@vue/runtime-core 3.6.0-rc.2 → 3.6.0-rc.4
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 +144 -53
- package/dist/runtime-core.cjs.prod.js +121 -51
- package/dist/runtime-core.d.ts +29 -8
- package/dist/runtime-core.esm-bundler.js +159 -55
- 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-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.4
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -304,7 +304,7 @@ function queueFlush() {
|
|
|
304
304
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
305
305
|
if (!(0, _vue_shared.isArray)(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
306
306
|
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
307
|
-
else for (
|
|
307
|
+
else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
308
308
|
queueFlush();
|
|
309
309
|
}
|
|
310
310
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -325,7 +325,7 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
325
325
|
function flushPostFlushCbs(seen) {
|
|
326
326
|
if (postJobs.length) {
|
|
327
327
|
if (activePostJobs) {
|
|
328
|
-
activePostJobs.push(
|
|
328
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
329
329
|
postJobs.length = 0;
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
@@ -1156,49 +1156,16 @@ const BaseTransitionImpl = {
|
|
|
1156
1156
|
setup(props, { slots }) {
|
|
1157
1157
|
const instance = getCurrentInstance();
|
|
1158
1158
|
const state = useTransitionState();
|
|
1159
|
+
let resumeAfterLeave;
|
|
1159
1160
|
return () => {
|
|
1160
|
-
const
|
|
1161
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
1161
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
1162
1162
|
if (!child) return;
|
|
1163
1163
|
const rawProps = (0, _vue_reactivity.toRaw)(props);
|
|
1164
1164
|
const { mode } = rawProps;
|
|
1165
1165
|
checkTransitionMode(mode);
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
1170
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
1171
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
1172
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
1173
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
1174
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
1175
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
1176
|
-
state.isLeaving = true;
|
|
1177
|
-
leavingHooks.afterLeave = () => {
|
|
1178
|
-
state.isLeaving = false;
|
|
1179
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
1180
|
-
delete leavingHooks.afterLeave;
|
|
1181
|
-
oldInnerChild = void 0;
|
|
1182
|
-
};
|
|
1183
|
-
return emptyPlaceholder(child);
|
|
1184
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1185
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
1186
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
1187
|
-
el[leaveCbKey] = () => {
|
|
1188
|
-
earlyRemove();
|
|
1189
|
-
el[leaveCbKey] = void 0;
|
|
1190
|
-
delete enterHooks.delayedLeave;
|
|
1191
|
-
oldInnerChild = void 0;
|
|
1192
|
-
};
|
|
1193
|
-
enterHooks.delayedLeave = () => {
|
|
1194
|
-
delayedLeave();
|
|
1195
|
-
delete enterHooks.delayedLeave;
|
|
1196
|
-
oldInnerChild = void 0;
|
|
1197
|
-
};
|
|
1198
|
-
};
|
|
1199
|
-
else oldInnerChild = void 0;
|
|
1200
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
1201
|
-
return child;
|
|
1166
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
1167
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
1168
|
+
}) : _vue_shared.NOOP);
|
|
1202
1169
|
};
|
|
1203
1170
|
}
|
|
1204
1171
|
};
|
|
@@ -1340,15 +1307,91 @@ function getInnerChild$1(vnode) {
|
|
|
1340
1307
|
if (shapeFlag & 32 && (0, _vue_shared.isFunction)(children.default)) return children.default();
|
|
1341
1308
|
}
|
|
1342
1309
|
}
|
|
1310
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
1311
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
1312
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* @internal
|
|
1316
|
+
*/
|
|
1317
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
1318
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
1319
|
+
const nextInner = getInnerChild$1(next);
|
|
1320
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
1321
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
1322
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
1323
|
+
enterHooks = hooks;
|
|
1324
|
+
});
|
|
1325
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
1326
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
1327
|
+
const mode = props.mode;
|
|
1328
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
1329
|
+
if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
|
|
1330
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
1331
|
+
if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
|
|
1332
|
+
}
|
|
1333
|
+
return next;
|
|
1334
|
+
}
|
|
1335
|
+
function forwardDelayedLeave(hooks, source) {
|
|
1336
|
+
const delayedLeave = source && source.delayedLeave;
|
|
1337
|
+
if (!delayedLeave) return;
|
|
1338
|
+
hooks.delayedLeave = () => {
|
|
1339
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
1340
|
+
delete hooks.delayedLeave;
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
1344
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
1345
|
+
}
|
|
1346
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
1347
|
+
if (props.mode === "out-in") {
|
|
1348
|
+
state.isLeaving = true;
|
|
1349
|
+
leavingHooks.afterLeave = () => {
|
|
1350
|
+
state.isLeaving = false;
|
|
1351
|
+
resumeAfterLeave();
|
|
1352
|
+
delete leavingHooks.afterLeave;
|
|
1353
|
+
};
|
|
1354
|
+
return true;
|
|
1355
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
1356
|
+
let delayedLeavingVNode = leavingVNode;
|
|
1357
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1358
|
+
const enterHooks = getEnterHooks();
|
|
1359
|
+
if (!enterHooks) {
|
|
1360
|
+
delayedLeave();
|
|
1361
|
+
return;
|
|
1362
|
+
}
|
|
1363
|
+
const vnode = delayedLeavingVNode;
|
|
1364
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1365
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
1366
|
+
el[leaveCbKey] = () => {
|
|
1367
|
+
earlyRemove();
|
|
1368
|
+
el[leaveCbKey] = void 0;
|
|
1369
|
+
delete enterHooks.delayedLeave;
|
|
1370
|
+
delayedLeavingVNode = void 0;
|
|
1371
|
+
};
|
|
1372
|
+
enterHooks.delayedLeave = () => {
|
|
1373
|
+
delayedLeave();
|
|
1374
|
+
delete enterHooks.delayedLeave;
|
|
1375
|
+
delayedLeavingVNode = void 0;
|
|
1376
|
+
};
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
return false;
|
|
1380
|
+
}
|
|
1343
1381
|
function setTransitionHooks(vnode, hooks) {
|
|
1344
1382
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
1345
1383
|
vnode.transition = hooks;
|
|
1346
1384
|
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
1347
|
-
else
|
|
1385
|
+
else {
|
|
1386
|
+
const subTree = vnode.component.subTree;
|
|
1387
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
1388
|
+
}
|
|
1348
1389
|
} else if (vnode.shapeFlag & 128) {
|
|
1349
|
-
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1350
|
-
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1390
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1391
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1392
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1351
1393
|
} else vnode.transition = hooks;
|
|
1394
|
+
return hooks;
|
|
1352
1395
|
}
|
|
1353
1396
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
1354
1397
|
let ret = [];
|
|
@@ -1700,7 +1743,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1700
1743
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
1701
1744
|
for (const key in props) {
|
|
1702
1745
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
1703
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key))
|
|
1746
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
1747
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
1748
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
1749
|
+
}
|
|
1704
1750
|
}
|
|
1705
1751
|
}
|
|
1706
1752
|
let vnodeHooks;
|
|
@@ -1809,6 +1855,16 @@ const isTemplateNode = (node) => {
|
|
|
1809
1855
|
/**
|
|
1810
1856
|
* Dev only
|
|
1811
1857
|
*/
|
|
1858
|
+
const resourceProps = /* @__PURE__ */ new Set([
|
|
1859
|
+
"src",
|
|
1860
|
+
"srcset",
|
|
1861
|
+
"href",
|
|
1862
|
+
"poster"
|
|
1863
|
+
]);
|
|
1864
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
1865
|
+
if (!resourceProps.has(key)) return false;
|
|
1866
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
1867
|
+
}
|
|
1812
1868
|
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
1813
1869
|
let mismatchType;
|
|
1814
1870
|
let mismatchKey;
|
|
@@ -1849,7 +1905,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
1849
1905
|
function getAttributeMismatch(el, key, clientValue) {
|
|
1850
1906
|
let actual;
|
|
1851
1907
|
let expected;
|
|
1852
|
-
if (
|
|
1908
|
+
if (key === "hidden") {
|
|
1909
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
1910
|
+
expected = normalizeHiddenValue(clientValue);
|
|
1911
|
+
} else if ((0, _vue_shared.isBooleanAttr)(key)) {
|
|
1853
1912
|
actual = el.hasAttribute(key);
|
|
1854
1913
|
expected = (0, _vue_shared.includeBooleanAttr)(clientValue);
|
|
1855
1914
|
} else if (clientValue == null) {
|
|
@@ -1877,6 +1936,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
|
|
|
1877
1936
|
}
|
|
1878
1937
|
return false;
|
|
1879
1938
|
}
|
|
1939
|
+
function normalizeHiddenValue(value) {
|
|
1940
|
+
if (!(0, _vue_shared.isRenderableAttrValue)(value)) return false;
|
|
1941
|
+
if ((0, _vue_shared.isString)(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
1942
|
+
return (0, _vue_shared.includeBooleanAttr)(value) ? "" : false;
|
|
1943
|
+
}
|
|
1880
1944
|
function toClassSet(str) {
|
|
1881
1945
|
return new Set(str.trim().split(/\s+/));
|
|
1882
1946
|
}
|
|
@@ -2541,7 +2605,8 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2541
2605
|
* Compiler runtime helper for rendering `<slot/>`
|
|
2542
2606
|
* @private
|
|
2543
2607
|
*/
|
|
2544
|
-
function renderSlot(slots, name, props
|
|
2608
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2609
|
+
if (props == null) props = {};
|
|
2545
2610
|
let slot = slots[name];
|
|
2546
2611
|
if (fallback) fallback.__vdom = true;
|
|
2547
2612
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
@@ -3595,8 +3660,9 @@ function renderComponentRoot(instance) {
|
|
|
3595
3660
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
3596
3661
|
}
|
|
3597
3662
|
if (vnode.transition) {
|
|
3598
|
-
|
|
3599
|
-
|
|
3663
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
3664
|
+
if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
3665
|
+
setTransitionHooks(child, vnode.transition);
|
|
3600
3666
|
}
|
|
3601
3667
|
if (setRoot) setRoot(root);
|
|
3602
3668
|
else result = root;
|
|
@@ -3656,9 +3722,10 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
3656
3722
|
}
|
|
3657
3723
|
return singleRoot;
|
|
3658
3724
|
}
|
|
3725
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || (0, _vue_shared.isOn)(key);
|
|
3659
3726
|
const getFunctionalFallthrough = (attrs) => {
|
|
3660
3727
|
let res;
|
|
3661
|
-
for (const key in attrs) if (
|
|
3728
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
3662
3729
|
return res;
|
|
3663
3730
|
};
|
|
3664
3731
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -5143,6 +5210,10 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5143
5210
|
suspense.activeBranch = pendingBranch;
|
|
5144
5211
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
5145
5212
|
suspense.deps = 0;
|
|
5213
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
5214
|
+
const effect = suspense.effects[i];
|
|
5215
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
5216
|
+
}
|
|
5146
5217
|
suspense.effects.length = 0;
|
|
5147
5218
|
suspense.hiddenContainer = createElement("div");
|
|
5148
5219
|
if (isInFallback) {
|
|
@@ -5250,7 +5321,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5250
5321
|
let hasUnresolvedAncestor = false;
|
|
5251
5322
|
while (parent) {
|
|
5252
5323
|
if (parent.pendingBranch) {
|
|
5253
|
-
parent.effects.push(
|
|
5324
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
5254
5325
|
hasUnresolvedAncestor = true;
|
|
5255
5326
|
break;
|
|
5256
5327
|
}
|
|
@@ -5520,9 +5591,24 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
5520
5591
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
5521
5592
|
} else if (children) vnode.shapeFlag |= (0, _vue_shared.isString)(children) ? 8 : 16;
|
|
5522
5593
|
if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
5594
|
+
if (props && vnode.shapeFlag & 1) {
|
|
5595
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
5596
|
+
if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
|
|
5597
|
+
}
|
|
5523
5598
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
5524
5599
|
return vnode;
|
|
5525
5600
|
}
|
|
5601
|
+
/**
|
|
5602
|
+
* dev only
|
|
5603
|
+
* Whether children would actually render something. Empty text and empty
|
|
5604
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
5605
|
+
* for `v-html` / `v-text`.
|
|
5606
|
+
*/
|
|
5607
|
+
function hasContentChildren(children) {
|
|
5608
|
+
if ((0, _vue_shared.isString)(children)) return children !== "";
|
|
5609
|
+
if ((0, _vue_shared.isArray)(children)) return children.length > 0;
|
|
5610
|
+
return false;
|
|
5611
|
+
}
|
|
5526
5612
|
const createVNode = createVNodeWithArgsTransform;
|
|
5527
5613
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
5528
5614
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -5920,7 +6006,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5920
6006
|
};
|
|
5921
6007
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
5922
6008
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
5923
|
-
|
|
6009
|
+
setInSSRSetupState(true);
|
|
6010
|
+
try {
|
|
6011
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
6012
|
+
} finally {
|
|
6013
|
+
setInSSRSetupState(false);
|
|
6014
|
+
}
|
|
5924
6015
|
}).catch((e) => {
|
|
5925
6016
|
handleError(e, instance, 0);
|
|
5926
6017
|
});
|
|
@@ -6292,7 +6383,7 @@ function isMemoSame(cached, memo) {
|
|
|
6292
6383
|
}
|
|
6293
6384
|
//#endregion
|
|
6294
6385
|
//#region packages/runtime-core/src/index.ts
|
|
6295
|
-
const version = "3.6.0-rc.
|
|
6386
|
+
const version = "3.6.0-rc.4";
|
|
6296
6387
|
const warn = warn$1;
|
|
6297
6388
|
/**
|
|
6298
6389
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.4
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -200,7 +200,7 @@ function queueFlush() {
|
|
|
200
200
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
201
201
|
if (!(0, _vue_shared.isArray)(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
202
202
|
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
203
|
-
else for (
|
|
203
|
+
else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
204
204
|
queueFlush();
|
|
205
205
|
}
|
|
206
206
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -219,7 +219,7 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
219
219
|
function flushPostFlushCbs(seen) {
|
|
220
220
|
if (postJobs.length) {
|
|
221
221
|
if (activePostJobs) {
|
|
222
|
-
activePostJobs.push(
|
|
222
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
223
223
|
postJobs.length = 0;
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
@@ -775,48 +775,15 @@ const BaseTransitionImpl = {
|
|
|
775
775
|
setup(props, { slots }) {
|
|
776
776
|
const instance = getCurrentInstance();
|
|
777
777
|
const state = useTransitionState();
|
|
778
|
+
let resumeAfterLeave;
|
|
778
779
|
return () => {
|
|
779
|
-
const
|
|
780
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
780
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
781
781
|
if (!child) return;
|
|
782
782
|
const rawProps = (0, _vue_reactivity.toRaw)(props);
|
|
783
783
|
const { mode } = rawProps;
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
788
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
789
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
790
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
791
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
792
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
793
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
794
|
-
state.isLeaving = true;
|
|
795
|
-
leavingHooks.afterLeave = () => {
|
|
796
|
-
state.isLeaving = false;
|
|
797
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
798
|
-
delete leavingHooks.afterLeave;
|
|
799
|
-
oldInnerChild = void 0;
|
|
800
|
-
};
|
|
801
|
-
return emptyPlaceholder(child);
|
|
802
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
803
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
804
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
805
|
-
el[leaveCbKey] = () => {
|
|
806
|
-
earlyRemove();
|
|
807
|
-
el[leaveCbKey] = void 0;
|
|
808
|
-
delete enterHooks.delayedLeave;
|
|
809
|
-
oldInnerChild = void 0;
|
|
810
|
-
};
|
|
811
|
-
enterHooks.delayedLeave = () => {
|
|
812
|
-
delayedLeave();
|
|
813
|
-
delete enterHooks.delayedLeave;
|
|
814
|
-
oldInnerChild = void 0;
|
|
815
|
-
};
|
|
816
|
-
};
|
|
817
|
-
else oldInnerChild = void 0;
|
|
818
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
819
|
-
return child;
|
|
784
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
785
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
786
|
+
}) : _vue_shared.NOOP);
|
|
820
787
|
};
|
|
821
788
|
}
|
|
822
789
|
};
|
|
@@ -953,15 +920,91 @@ function getInnerChild$1(vnode) {
|
|
|
953
920
|
if (shapeFlag & 32 && (0, _vue_shared.isFunction)(children.default)) return children.default();
|
|
954
921
|
}
|
|
955
922
|
}
|
|
923
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
924
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
925
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* @internal
|
|
929
|
+
*/
|
|
930
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
931
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
932
|
+
const nextInner = getInnerChild$1(next);
|
|
933
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
934
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
935
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
936
|
+
enterHooks = hooks;
|
|
937
|
+
});
|
|
938
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
939
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
940
|
+
const mode = props.mode;
|
|
941
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
942
|
+
if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
|
|
943
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
944
|
+
if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
|
|
945
|
+
}
|
|
946
|
+
return next;
|
|
947
|
+
}
|
|
948
|
+
function forwardDelayedLeave(hooks, source) {
|
|
949
|
+
const delayedLeave = source && source.delayedLeave;
|
|
950
|
+
if (!delayedLeave) return;
|
|
951
|
+
hooks.delayedLeave = () => {
|
|
952
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
953
|
+
delete hooks.delayedLeave;
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
957
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
958
|
+
}
|
|
959
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
960
|
+
if (props.mode === "out-in") {
|
|
961
|
+
state.isLeaving = true;
|
|
962
|
+
leavingHooks.afterLeave = () => {
|
|
963
|
+
state.isLeaving = false;
|
|
964
|
+
resumeAfterLeave();
|
|
965
|
+
delete leavingHooks.afterLeave;
|
|
966
|
+
};
|
|
967
|
+
return true;
|
|
968
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
969
|
+
let delayedLeavingVNode = leavingVNode;
|
|
970
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
971
|
+
const enterHooks = getEnterHooks();
|
|
972
|
+
if (!enterHooks) {
|
|
973
|
+
delayedLeave();
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
const vnode = delayedLeavingVNode;
|
|
977
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
978
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
979
|
+
el[leaveCbKey] = () => {
|
|
980
|
+
earlyRemove();
|
|
981
|
+
el[leaveCbKey] = void 0;
|
|
982
|
+
delete enterHooks.delayedLeave;
|
|
983
|
+
delayedLeavingVNode = void 0;
|
|
984
|
+
};
|
|
985
|
+
enterHooks.delayedLeave = () => {
|
|
986
|
+
delayedLeave();
|
|
987
|
+
delete enterHooks.delayedLeave;
|
|
988
|
+
delayedLeavingVNode = void 0;
|
|
989
|
+
};
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
return false;
|
|
993
|
+
}
|
|
956
994
|
function setTransitionHooks(vnode, hooks) {
|
|
957
995
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
958
996
|
vnode.transition = hooks;
|
|
959
997
|
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
960
|
-
else
|
|
998
|
+
else {
|
|
999
|
+
const subTree = vnode.component.subTree;
|
|
1000
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
1001
|
+
}
|
|
961
1002
|
} else if (vnode.shapeFlag & 128) {
|
|
962
|
-
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
963
|
-
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1003
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1004
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1005
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
964
1006
|
} else vnode.transition = hooks;
|
|
1007
|
+
return hooks;
|
|
965
1008
|
}
|
|
966
1009
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
967
1010
|
let ret = [];
|
|
@@ -1284,7 +1327,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1284
1327
|
if (forcePatch || hasDynamicProps || !optimized || patchFlag & 48) {
|
|
1285
1328
|
const isCustomElement = el.tagName.includes("-");
|
|
1286
1329
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
1287
|
-
for (const key in props) if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key))
|
|
1330
|
+
for (const key in props) if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
1331
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
1332
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
1333
|
+
}
|
|
1288
1334
|
} else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
|
|
1289
1335
|
else if (patchFlag & 4 && (0, _vue_reactivity.isReactive)(props.style)) for (const key in props.style) props.style[key];
|
|
1290
1336
|
}
|
|
@@ -1385,6 +1431,19 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1385
1431
|
const isTemplateNode = (node) => {
|
|
1386
1432
|
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
1387
1433
|
};
|
|
1434
|
+
/**
|
|
1435
|
+
* Dev only
|
|
1436
|
+
*/
|
|
1437
|
+
const resourceProps = /* @__PURE__ */ new Set([
|
|
1438
|
+
"src",
|
|
1439
|
+
"srcset",
|
|
1440
|
+
"href",
|
|
1441
|
+
"poster"
|
|
1442
|
+
]);
|
|
1443
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
1444
|
+
if (!resourceProps.has(key)) return false;
|
|
1445
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
1446
|
+
}
|
|
1388
1447
|
const allowMismatchAttr = "data-allow-mismatch";
|
|
1389
1448
|
const MismatchTypeString = {
|
|
1390
1449
|
[0]: "text",
|
|
@@ -1995,7 +2054,8 @@ function createSlots(slots, dynamicSlots) {
|
|
|
1995
2054
|
* Compiler runtime helper for rendering `<slot/>`
|
|
1996
2055
|
* @private
|
|
1997
2056
|
*/
|
|
1998
|
-
function renderSlot(slots, name, props
|
|
2057
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2058
|
+
if (props == null) props = {};
|
|
1999
2059
|
let slot = slots[name];
|
|
2000
2060
|
if (fallback) fallback.__vdom = true;
|
|
2001
2061
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
@@ -2847,7 +2907,7 @@ function renderComponentRoot(instance) {
|
|
|
2847
2907
|
root = cloneVNode(root, null, false, true);
|
|
2848
2908
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
2849
2909
|
}
|
|
2850
|
-
if (vnode.transition) setTransitionHooks(root, vnode.transition);
|
|
2910
|
+
if (vnode.transition) setTransitionHooks(isTeleport(root.type) ? getInnerChild$1(root) || root : root, vnode.transition);
|
|
2851
2911
|
result = root;
|
|
2852
2912
|
setCurrentRenderingInstance(prev);
|
|
2853
2913
|
return result;
|
|
@@ -2863,9 +2923,10 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
2863
2923
|
}
|
|
2864
2924
|
return singleRoot;
|
|
2865
2925
|
}
|
|
2926
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || (0, _vue_shared.isOn)(key);
|
|
2866
2927
|
const getFunctionalFallthrough = (attrs) => {
|
|
2867
2928
|
let res;
|
|
2868
|
-
for (const key in attrs) if (
|
|
2929
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
2869
2930
|
return res;
|
|
2870
2931
|
};
|
|
2871
2932
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -4100,6 +4161,10 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
4100
4161
|
suspense.activeBranch = pendingBranch;
|
|
4101
4162
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
4102
4163
|
suspense.deps = 0;
|
|
4164
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
4165
|
+
const effect = suspense.effects[i];
|
|
4166
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
4167
|
+
}
|
|
4103
4168
|
suspense.effects.length = 0;
|
|
4104
4169
|
suspense.hiddenContainer = createElement("div");
|
|
4105
4170
|
if (isInFallback) {
|
|
@@ -4198,7 +4263,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4198
4263
|
let hasUnresolvedAncestor = false;
|
|
4199
4264
|
while (parent) {
|
|
4200
4265
|
if (parent.pendingBranch) {
|
|
4201
|
-
parent.effects.push(
|
|
4266
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
4202
4267
|
hasUnresolvedAncestor = true;
|
|
4203
4268
|
break;
|
|
4204
4269
|
}
|
|
@@ -4810,7 +4875,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4810
4875
|
};
|
|
4811
4876
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
4812
4877
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
4813
|
-
|
|
4878
|
+
setInSSRSetupState(true);
|
|
4879
|
+
try {
|
|
4880
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
4881
|
+
} finally {
|
|
4882
|
+
setInSSRSetupState(false);
|
|
4883
|
+
}
|
|
4814
4884
|
}).catch((e) => {
|
|
4815
4885
|
handleError(e, instance, 0);
|
|
4816
4886
|
});
|
|
@@ -4960,7 +5030,7 @@ function isMemoSame(cached, memo) {
|
|
|
4960
5030
|
}
|
|
4961
5031
|
//#endregion
|
|
4962
5032
|
//#region packages/runtime-core/src/index.ts
|
|
4963
|
-
const version = "3.6.0-rc.
|
|
5033
|
+
const version = "3.6.0-rc.4";
|
|
4964
5034
|
const warn = _vue_shared.NOOP;
|
|
4965
5035
|
/**
|
|
4966
5036
|
* Runtime error messages. Only exposed in dev or esm builds.
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -40,7 +40,12 @@ declare enum SchedulerJobFlags {
|
|
|
40
40
|
* stabilizes (#1727).
|
|
41
41
|
*/
|
|
42
42
|
ALLOW_RECURSE = 2,
|
|
43
|
-
DISPOSED = 4
|
|
43
|
+
DISPOSED = 4,
|
|
44
|
+
/**
|
|
45
|
+
* Requeue a Suspense effect if its pending branch is discarded.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
REQUEUE_ON_SUSPENSE_DISCARD = 8
|
|
44
49
|
}
|
|
45
50
|
export interface SchedulerJob extends Function {
|
|
46
51
|
order?: number;
|
|
@@ -316,17 +321,17 @@ type DefineModelDefault<T> = InferDefault<Data, T>;
|
|
|
316
321
|
* const count = defineModel<number>('count', { default: 0 })
|
|
317
322
|
* ```
|
|
318
323
|
*/
|
|
319
|
-
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options: ({
|
|
324
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options: DefineModelRuntimeOptions<T, G, S> & ({
|
|
320
325
|
default: DefineModelDefault<T>;
|
|
321
326
|
} | {
|
|
322
327
|
required: true;
|
|
323
|
-
})
|
|
328
|
+
})): ModelRef<T, M, G, S>;
|
|
324
329
|
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options?: DefineModelRuntimeOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
|
325
|
-
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options: ({
|
|
330
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options: DefineModelRuntimeOptions<T, G, S> & ({
|
|
326
331
|
default: DefineModelDefault<T>;
|
|
327
332
|
} | {
|
|
328
333
|
required: true;
|
|
329
|
-
})
|
|
334
|
+
})): ModelRef<T, M, G, S>;
|
|
330
335
|
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options?: DefineModelRuntimeOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
|
331
336
|
type NotUndefined<T> = T extends undefined ? never : T;
|
|
332
337
|
type MappedOmit<T, K extends keyof any> = { [P in keyof T as P extends K ? never : P]: T[P] };
|
|
@@ -623,7 +628,7 @@ export interface TransitionHooksContext {
|
|
|
623
628
|
cloneHooks: (node: any) => TransitionHooks;
|
|
624
629
|
}
|
|
625
630
|
export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: GenericComponentInstance, postClone?: (hooks: TransitionHooks) => void): TransitionHooks;
|
|
626
|
-
export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks):
|
|
631
|
+
export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): TransitionHooks;
|
|
627
632
|
export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode["key"]): VNode[];
|
|
628
633
|
//#endregion
|
|
629
634
|
//#region temp/packages/runtime-core/src/renderer.d.ts
|
|
@@ -815,7 +820,23 @@ declare function configureCompat(config: CompatConfig): void;
|
|
|
815
820
|
* ```
|
|
816
821
|
*/
|
|
817
822
|
export interface ComponentCustomOptions {}
|
|
818
|
-
|
|
823
|
+
/**
|
|
824
|
+
* Registry for additional render result types.
|
|
825
|
+
*
|
|
826
|
+
* @example
|
|
827
|
+
* ```ts
|
|
828
|
+
* import type { VaporRenderResult } from 'vue'
|
|
829
|
+
*
|
|
830
|
+
* declare module 'vue' {
|
|
831
|
+
* interface RenderResultExtensions {
|
|
832
|
+
* vapor: VaporRenderResult
|
|
833
|
+
* }
|
|
834
|
+
* }
|
|
835
|
+
* ```
|
|
836
|
+
*/
|
|
837
|
+
export interface RenderResultExtensions {}
|
|
838
|
+
type RenderResult = VNodeChild | RenderResultExtensions[keyof RenderResultExtensions] | RenderResult[];
|
|
839
|
+
export type RenderFunction = () => RenderResult;
|
|
819
840
|
export interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II, Provide>, ComponentInternalOptions, AsyncComponentInternalOptions, ComponentCustomOptions {
|
|
820
841
|
setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "P">>>, ctx: SetupContext<E, S>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
|
|
821
842
|
name?: string;
|
|
@@ -1774,7 +1795,7 @@ type SlotFallback = {
|
|
|
1774
1795
|
* Compiler runtime helper for rendering `<slot/>`
|
|
1775
1796
|
* @private
|
|
1776
1797
|
*/
|
|
1777
|
-
export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: SlotFallback, noSlotted?: boolean, branchKey?: PropertyKey): VNode;
|
|
1798
|
+
export declare function renderSlot(slots: Slots, name: string, props?: Data | null, fallback?: SlotFallback, noSlotted?: boolean, branchKey?: PropertyKey): VNode;
|
|
1778
1799
|
//#endregion
|
|
1779
1800
|
//#region temp/packages/runtime-core/src/helpers/createSlots.d.ts
|
|
1780
1801
|
type SSRSlot = (...args: any[]) => VNode[] | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.4
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -253,7 +253,9 @@ const SchedulerJobFlags = {
|
|
|
253
253
|
"ALLOW_RECURSE": 2,
|
|
254
254
|
"2": "ALLOW_RECURSE",
|
|
255
255
|
"DISPOSED": 4,
|
|
256
|
-
"4": "DISPOSED"
|
|
256
|
+
"4": "DISPOSED",
|
|
257
|
+
"REQUEUE_ON_SUSPENSE_DISCARD": 8,
|
|
258
|
+
"8": "REQUEUE_ON_SUSPENSE_DISCARD"
|
|
257
259
|
};
|
|
258
260
|
const jobs = [];
|
|
259
261
|
let postJobs = [];
|
|
@@ -310,7 +312,7 @@ function queueFlush() {
|
|
|
310
312
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
311
313
|
if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
312
314
|
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
313
|
-
else for (
|
|
315
|
+
else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
314
316
|
queueFlush();
|
|
315
317
|
}
|
|
316
318
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -331,7 +333,7 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
331
333
|
function flushPostFlushCbs(seen) {
|
|
332
334
|
if (postJobs.length) {
|
|
333
335
|
if (activePostJobs) {
|
|
334
|
-
activePostJobs.push(
|
|
336
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
335
337
|
postJobs.length = 0;
|
|
336
338
|
return;
|
|
337
339
|
}
|
|
@@ -1164,49 +1166,16 @@ const BaseTransitionImpl = {
|
|
|
1164
1166
|
setup(props, { slots }) {
|
|
1165
1167
|
const instance = getCurrentInstance();
|
|
1166
1168
|
const state = useTransitionState();
|
|
1169
|
+
let resumeAfterLeave;
|
|
1167
1170
|
return () => {
|
|
1168
|
-
const
|
|
1169
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
1171
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
1170
1172
|
if (!child) return;
|
|
1171
1173
|
const rawProps = toRaw$1(props);
|
|
1172
1174
|
const { mode } = rawProps;
|
|
1173
1175
|
checkTransitionMode(mode);
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
1178
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
1179
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
1180
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
1181
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
1182
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
1183
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
1184
|
-
state.isLeaving = true;
|
|
1185
|
-
leavingHooks.afterLeave = () => {
|
|
1186
|
-
state.isLeaving = false;
|
|
1187
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
1188
|
-
delete leavingHooks.afterLeave;
|
|
1189
|
-
oldInnerChild = void 0;
|
|
1190
|
-
};
|
|
1191
|
-
return emptyPlaceholder(child);
|
|
1192
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1193
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
1194
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
1195
|
-
el[leaveCbKey] = () => {
|
|
1196
|
-
earlyRemove();
|
|
1197
|
-
el[leaveCbKey] = void 0;
|
|
1198
|
-
delete enterHooks.delayedLeave;
|
|
1199
|
-
oldInnerChild = void 0;
|
|
1200
|
-
};
|
|
1201
|
-
enterHooks.delayedLeave = () => {
|
|
1202
|
-
delayedLeave();
|
|
1203
|
-
delete enterHooks.delayedLeave;
|
|
1204
|
-
oldInnerChild = void 0;
|
|
1205
|
-
};
|
|
1206
|
-
};
|
|
1207
|
-
else oldInnerChild = void 0;
|
|
1208
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
1209
|
-
return child;
|
|
1176
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
1177
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
1178
|
+
}) : NOOP);
|
|
1210
1179
|
};
|
|
1211
1180
|
}
|
|
1212
1181
|
};
|
|
@@ -1349,15 +1318,102 @@ function getInnerChild$1(vnode) {
|
|
|
1349
1318
|
if (shapeFlag & 32 && isFunction(children.default)) return children.default();
|
|
1350
1319
|
}
|
|
1351
1320
|
}
|
|
1321
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
1322
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
1323
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* @internal
|
|
1327
|
+
*/
|
|
1328
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
1329
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
1330
|
+
const nextInner = getInnerChild$1(next);
|
|
1331
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
1332
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
1333
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
1334
|
+
enterHooks = hooks;
|
|
1335
|
+
});
|
|
1336
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
1337
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
1338
|
+
const mode = props.mode;
|
|
1339
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
1340
|
+
if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
|
|
1341
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
1342
|
+
if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
|
|
1343
|
+
}
|
|
1344
|
+
return next;
|
|
1345
|
+
}
|
|
1346
|
+
function forwardDelayedLeave(hooks, source) {
|
|
1347
|
+
const delayedLeave = source && source.delayedLeave;
|
|
1348
|
+
if (!delayedLeave) return;
|
|
1349
|
+
hooks.delayedLeave = () => {
|
|
1350
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
1351
|
+
delete hooks.delayedLeave;
|
|
1352
|
+
};
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Prepares an outgoing VNode when the incoming branch belongs to another
|
|
1356
|
+
* renderer. Returns true when out-in must defer the incoming branch.
|
|
1357
|
+
*
|
|
1358
|
+
* @internal
|
|
1359
|
+
*/
|
|
1360
|
+
function prepareTransitionLeave(previous, enterHooks, props, state, instance, resumeAfterLeave) {
|
|
1361
|
+
const previousInner = getInnerChild$1(previous);
|
|
1362
|
+
if (!previousInner || previousInner.type === Comment || previous.component && recursiveGetSubtree(previous.component).type === Comment) return false;
|
|
1363
|
+
return applyTransitionModeSwitch(previousInner, prepareLeavingTransitionHooks(previousInner, props, state, instance), enterHooks ? () => enterHooks : void 0, props, state, resumeAfterLeave);
|
|
1364
|
+
}
|
|
1365
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
1366
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
1367
|
+
}
|
|
1368
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
1369
|
+
if (props.mode === "out-in") {
|
|
1370
|
+
state.isLeaving = true;
|
|
1371
|
+
leavingHooks.afterLeave = () => {
|
|
1372
|
+
state.isLeaving = false;
|
|
1373
|
+
resumeAfterLeave();
|
|
1374
|
+
delete leavingHooks.afterLeave;
|
|
1375
|
+
};
|
|
1376
|
+
return true;
|
|
1377
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
1378
|
+
let delayedLeavingVNode = leavingVNode;
|
|
1379
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1380
|
+
const enterHooks = getEnterHooks();
|
|
1381
|
+
if (!enterHooks) {
|
|
1382
|
+
delayedLeave();
|
|
1383
|
+
return;
|
|
1384
|
+
}
|
|
1385
|
+
const vnode = delayedLeavingVNode;
|
|
1386
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1387
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
1388
|
+
el[leaveCbKey] = () => {
|
|
1389
|
+
earlyRemove();
|
|
1390
|
+
el[leaveCbKey] = void 0;
|
|
1391
|
+
delete enterHooks.delayedLeave;
|
|
1392
|
+
delayedLeavingVNode = void 0;
|
|
1393
|
+
};
|
|
1394
|
+
enterHooks.delayedLeave = () => {
|
|
1395
|
+
delayedLeave();
|
|
1396
|
+
delete enterHooks.delayedLeave;
|
|
1397
|
+
delayedLeavingVNode = void 0;
|
|
1398
|
+
};
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
return false;
|
|
1402
|
+
}
|
|
1352
1403
|
function setTransitionHooks(vnode, hooks) {
|
|
1353
1404
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
1354
1405
|
vnode.transition = hooks;
|
|
1355
1406
|
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
1356
|
-
else
|
|
1407
|
+
else {
|
|
1408
|
+
const subTree = vnode.component.subTree;
|
|
1409
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
1410
|
+
}
|
|
1357
1411
|
} else if (vnode.shapeFlag & 128) {
|
|
1358
|
-
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1359
|
-
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1412
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1413
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1414
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1360
1415
|
} else vnode.transition = hooks;
|
|
1416
|
+
return hooks;
|
|
1361
1417
|
}
|
|
1362
1418
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
1363
1419
|
let ret = [];
|
|
@@ -1724,7 +1780,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1724
1780
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
1725
1781
|
for (const key in props) {
|
|
1726
1782
|
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
1727
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key))
|
|
1783
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
1784
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
1785
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
1786
|
+
}
|
|
1728
1787
|
}
|
|
1729
1788
|
} else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
|
|
1730
1789
|
else if (patchFlag & 4 && isReactive$1(props.style)) for (const key in props.style) props.style[key];
|
|
@@ -1835,6 +1894,16 @@ const isTemplateNode = (node) => {
|
|
|
1835
1894
|
/**
|
|
1836
1895
|
* Dev only
|
|
1837
1896
|
*/
|
|
1897
|
+
const resourceProps = /* @__PURE__ */ new Set([
|
|
1898
|
+
"src",
|
|
1899
|
+
"srcset",
|
|
1900
|
+
"href",
|
|
1901
|
+
"poster"
|
|
1902
|
+
]);
|
|
1903
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
1904
|
+
if (!resourceProps.has(key)) return false;
|
|
1905
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
1906
|
+
}
|
|
1838
1907
|
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
1839
1908
|
let mismatchType;
|
|
1840
1909
|
let mismatchKey;
|
|
@@ -1875,7 +1944,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
1875
1944
|
function getAttributeMismatch(el, key, clientValue) {
|
|
1876
1945
|
let actual;
|
|
1877
1946
|
let expected;
|
|
1878
|
-
if (
|
|
1947
|
+
if (key === "hidden") {
|
|
1948
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
1949
|
+
expected = normalizeHiddenValue(clientValue);
|
|
1950
|
+
} else if (isBooleanAttr(key)) {
|
|
1879
1951
|
actual = el.hasAttribute(key);
|
|
1880
1952
|
expected = includeBooleanAttr(clientValue);
|
|
1881
1953
|
} else if (clientValue == null) {
|
|
@@ -1903,6 +1975,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
|
|
|
1903
1975
|
}
|
|
1904
1976
|
return false;
|
|
1905
1977
|
}
|
|
1978
|
+
function normalizeHiddenValue(value) {
|
|
1979
|
+
if (!isRenderableAttrValue(value)) return false;
|
|
1980
|
+
if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
1981
|
+
return includeBooleanAttr(value) ? "" : false;
|
|
1982
|
+
}
|
|
1906
1983
|
function toClassSet(str) {
|
|
1907
1984
|
return new Set(str.trim().split(/\s+/));
|
|
1908
1985
|
}
|
|
@@ -2579,7 +2656,8 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2579
2656
|
* Compiler runtime helper for rendering `<slot/>`
|
|
2580
2657
|
* @private
|
|
2581
2658
|
*/
|
|
2582
|
-
function renderSlot(slots, name, props
|
|
2659
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2660
|
+
if (props == null) props = {};
|
|
2583
2661
|
let slot = slots[name];
|
|
2584
2662
|
if (fallback) fallback.__vdom = true;
|
|
2585
2663
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
@@ -3644,8 +3722,9 @@ function renderComponentRoot(instance) {
|
|
|
3644
3722
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
3645
3723
|
}
|
|
3646
3724
|
if (vnode.transition) {
|
|
3647
|
-
|
|
3648
|
-
|
|
3725
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
3726
|
+
if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
3727
|
+
setTransitionHooks(child, vnode.transition);
|
|
3649
3728
|
}
|
|
3650
3729
|
if (!!(process.env.NODE_ENV !== "production") && setRoot) setRoot(root);
|
|
3651
3730
|
else result = root;
|
|
@@ -3705,9 +3784,10 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
3705
3784
|
}
|
|
3706
3785
|
return singleRoot;
|
|
3707
3786
|
}
|
|
3787
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
|
|
3708
3788
|
const getFunctionalFallthrough = (attrs) => {
|
|
3709
3789
|
let res;
|
|
3710
|
-
for (const key in attrs) if (
|
|
3790
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
3711
3791
|
return res;
|
|
3712
3792
|
};
|
|
3713
3793
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -5231,6 +5311,10 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5231
5311
|
suspense.activeBranch = pendingBranch;
|
|
5232
5312
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
5233
5313
|
suspense.deps = 0;
|
|
5314
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
5315
|
+
const effect = suspense.effects[i];
|
|
5316
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
5317
|
+
}
|
|
5234
5318
|
suspense.effects.length = 0;
|
|
5235
5319
|
suspense.hiddenContainer = createElement("div");
|
|
5236
5320
|
if (isInFallback) {
|
|
@@ -5340,7 +5424,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5340
5424
|
let hasUnresolvedAncestor = false;
|
|
5341
5425
|
while (parent) {
|
|
5342
5426
|
if (parent.pendingBranch) {
|
|
5343
|
-
parent.effects.push(
|
|
5427
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
5344
5428
|
hasUnresolvedAncestor = true;
|
|
5345
5429
|
break;
|
|
5346
5430
|
}
|
|
@@ -5610,9 +5694,24 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
5610
5694
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
5611
5695
|
} else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
5612
5696
|
if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
5697
|
+
if (!!(process.env.NODE_ENV !== "production") && props && vnode.shapeFlag & 1) {
|
|
5698
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
5699
|
+
if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
|
|
5700
|
+
}
|
|
5613
5701
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
5614
5702
|
return vnode;
|
|
5615
5703
|
}
|
|
5704
|
+
/**
|
|
5705
|
+
* dev only
|
|
5706
|
+
* Whether children would actually render something. Empty text and empty
|
|
5707
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
5708
|
+
* for `v-html` / `v-text`.
|
|
5709
|
+
*/
|
|
5710
|
+
function hasContentChildren(children) {
|
|
5711
|
+
if (isString(children)) return children !== "";
|
|
5712
|
+
if (isArray(children)) return children.length > 0;
|
|
5713
|
+
return false;
|
|
5714
|
+
}
|
|
5616
5715
|
const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode;
|
|
5617
5716
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
5618
5717
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -6019,7 +6118,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6019
6118
|
};
|
|
6020
6119
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
6021
6120
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
6022
|
-
|
|
6121
|
+
setInSSRSetupState(true);
|
|
6122
|
+
try {
|
|
6123
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
6124
|
+
} finally {
|
|
6125
|
+
setInSSRSetupState(false);
|
|
6126
|
+
}
|
|
6023
6127
|
}).catch((e) => {
|
|
6024
6128
|
handleError(e, instance, 0);
|
|
6025
6129
|
});
|
|
@@ -6401,7 +6505,7 @@ function isMemoSame(cached, memo) {
|
|
|
6401
6505
|
}
|
|
6402
6506
|
//#endregion
|
|
6403
6507
|
//#region packages/runtime-core/src/index.ts
|
|
6404
|
-
const version = "3.6.0-rc.
|
|
6508
|
+
const version = "3.6.0-rc.4";
|
|
6405
6509
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
6406
6510
|
/**
|
|
6407
6511
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -6436,4 +6540,4 @@ const resolveFilter = null;
|
|
|
6436
6540
|
const compatUtils = null;
|
|
6437
6541
|
const DeprecationTypes = null;
|
|
6438
6542
|
//#endregion
|
|
6439
|
-
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, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, 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, queuePostRenderEffect, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, restoreCurrentInstance, 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 };
|
|
6543
|
+
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, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, 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, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, 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-rc.
|
|
3
|
+
"version": "3.6.0-rc.4",
|
|
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-rc.
|
|
50
|
-
"@vue/reactivity": "3.6.0-rc.
|
|
49
|
+
"@vue/shared": "3.6.0-rc.4",
|
|
50
|
+
"@vue/reactivity": "3.6.0-rc.4"
|
|
51
51
|
}
|
|
52
52
|
}
|