@vue/runtime-core 3.6.0-rc.10 → 3.6.0-rc.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 +148 -56
- package/dist/runtime-core.cjs.prod.js +152 -53
- package/dist/runtime-core.d.ts +2 -1
- package/dist/runtime-core.esm-bundler.js +161 -62
- 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.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -309,15 +309,15 @@ function queuePostFlushCb(jobs, id = Infinity) {
|
|
|
309
309
|
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
310
310
|
queueFlush();
|
|
311
311
|
}
|
|
312
|
-
function flushPreFlushCbs(instance, seen) {
|
|
312
|
+
function flushPreFlushCbs(instance, minUid, seen) {
|
|
313
313
|
seen = seen || /* @__PURE__ */ new Map();
|
|
314
314
|
for (let i = flushIndex; i < jobsLength; i++) {
|
|
315
315
|
const cb = jobs[i];
|
|
316
316
|
if (cb.order & 1 || cb.order === Infinity) continue;
|
|
317
|
-
if (instance && cb.order !== instance.uid * 2) continue;
|
|
317
|
+
if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
|
|
318
318
|
if (checkRecursiveUpdates(seen, cb)) continue;
|
|
319
319
|
jobs.splice(i, 1);
|
|
320
|
-
i
|
|
320
|
+
i = instance ? i - 1 : flushIndex - 1;
|
|
321
321
|
jobsLength--;
|
|
322
322
|
if (cb.flags & 2) cb.flags &= -2;
|
|
323
323
|
try {
|
|
@@ -327,15 +327,24 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
function flushPostFlushCbs(seen) {
|
|
330
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
331
331
|
if (postJobs.length) {
|
|
332
|
+
let cbs = postJobs;
|
|
333
|
+
if (skip) {
|
|
334
|
+
cbs = [];
|
|
335
|
+
let kept = 0;
|
|
336
|
+
for (let i = 0; i < postJobs.length; i++) {
|
|
337
|
+
const cb = postJobs[i];
|
|
338
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
|
|
339
|
+
else cbs.push(cb);
|
|
340
|
+
}
|
|
341
|
+
postJobs.length = kept;
|
|
342
|
+
} else postJobs = [];
|
|
332
343
|
if (activePostJobs) {
|
|
333
|
-
for (let i = 0; i <
|
|
334
|
-
postJobs.length = 0;
|
|
344
|
+
for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
|
|
335
345
|
return;
|
|
336
346
|
}
|
|
337
|
-
activePostJobs =
|
|
338
|
-
postJobs = [];
|
|
347
|
+
activePostJobs = cbs;
|
|
339
348
|
seen = seen || /* @__PURE__ */ new Map();
|
|
340
349
|
try {
|
|
341
350
|
while (postFlushIndex < activePostJobs.length) {
|
|
@@ -357,17 +366,28 @@ function flushPostFlushCbs(seen) {
|
|
|
357
366
|
}
|
|
358
367
|
let isFlushing = false;
|
|
359
368
|
/**
|
|
369
|
+
* Run a root render, then flush the jobs it is responsible for. A mount or
|
|
370
|
+
* unmount (`minUid` given) only flushes the jobs of the components it created
|
|
371
|
+
* and the post cbs it queued, so pre watchers triggered in setup run before
|
|
372
|
+
* mounted (#5721) while the jobs of other components stay in the queue and
|
|
373
|
+
* keep their order (#6728). A root update keeps flushing all pending pre jobs
|
|
374
|
+
* and post cbs, as the jobs of the components it re-renders may predate it.
|
|
375
|
+
*
|
|
360
376
|
* @internal
|
|
361
377
|
*/
|
|
362
|
-
function flushOnAppMount(
|
|
363
|
-
if (
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
378
|
+
function flushOnAppMount(fn, minUid) {
|
|
379
|
+
if (isFlushing) {
|
|
380
|
+
fn();
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
const queued = minUid === void 0 ? void 0 : new Set(postJobs);
|
|
384
|
+
fn();
|
|
385
|
+
isFlushing = true;
|
|
386
|
+
try {
|
|
387
|
+
flushPreFlushCbs(void 0, minUid);
|
|
388
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
389
|
+
} finally {
|
|
390
|
+
isFlushing = false;
|
|
371
391
|
}
|
|
372
392
|
}
|
|
373
393
|
function flushJobs(seen) {
|
|
@@ -835,7 +855,7 @@ var RenderWatcherEffect = class extends _vue_reactivity.WatcherEffect {
|
|
|
835
855
|
this.flags |= 128;
|
|
836
856
|
job.flags |= 2;
|
|
837
857
|
}
|
|
838
|
-
|
|
858
|
+
job.i = instance;
|
|
839
859
|
this.job = job;
|
|
840
860
|
}
|
|
841
861
|
notify() {
|
|
@@ -1046,7 +1066,11 @@ const TeleportImpl = {
|
|
|
1046
1066
|
hydrate: hydrateTeleport
|
|
1047
1067
|
};
|
|
1048
1068
|
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
|
|
1049
|
-
if (moveType === 0)
|
|
1069
|
+
if (moveType === 0) {
|
|
1070
|
+
if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
|
|
1071
|
+
insert(vnode.targetAnchor, container, parentAnchor);
|
|
1072
|
+
parentAnchor = vnode.targetAnchor;
|
|
1073
|
+
}
|
|
1050
1074
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
1051
1075
|
const isReorder = moveType === 2;
|
|
1052
1076
|
if (isReorder) insert(el, container, parentAnchor);
|
|
@@ -1165,10 +1189,15 @@ const BaseTransitionPropsValidators = {
|
|
|
1165
1189
|
onAfterAppear: TransitionHookValidator,
|
|
1166
1190
|
onAppearCancelled: TransitionHookValidator
|
|
1167
1191
|
};
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1192
|
+
function isEmptyTransitionChild(vnode, instance) {
|
|
1193
|
+
if (vnode.type === Comment) return true;
|
|
1194
|
+
if (vnode.type === Fragment) {
|
|
1195
|
+
const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1196
|
+
return !child || isEmptyTransitionChild(child, instance);
|
|
1197
|
+
}
|
|
1198
|
+
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
1199
|
+
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
1200
|
+
}
|
|
1172
1201
|
const BaseTransitionImpl = {
|
|
1173
1202
|
name: `BaseTransition`,
|
|
1174
1203
|
props: BaseTransitionPropsValidators,
|
|
@@ -1216,7 +1245,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
1216
1245
|
function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
1217
1246
|
const key = String(vnode.key);
|
|
1218
1247
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1219
|
-
|
|
1248
|
+
const hooks = baseResolveTransitionHooks({
|
|
1220
1249
|
isLeaving: () => leavingVNodesCache[key] === vnode,
|
|
1221
1250
|
setLeavingNodeCache: () => {
|
|
1222
1251
|
leavingVNodesCache[key] = vnode;
|
|
@@ -1226,7 +1255,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1226
1255
|
},
|
|
1227
1256
|
earlyRemove: () => {
|
|
1228
1257
|
const leavingVNode = leavingVNodesCache[key];
|
|
1229
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)
|
|
1258
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
|
|
1259
|
+
let leavingCb = leavingVNode.el[leaveCbKey];
|
|
1260
|
+
if (!leavingCb) {
|
|
1261
|
+
const leavingRoot = getTransitionRoot(leavingVNode);
|
|
1262
|
+
leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
|
|
1263
|
+
}
|
|
1264
|
+
if (leavingCb) leavingCb();
|
|
1265
|
+
}
|
|
1230
1266
|
},
|
|
1231
1267
|
cloneHooks: (vnode) => {
|
|
1232
1268
|
const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
|
|
@@ -1234,6 +1270,13 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1234
1270
|
return hooks;
|
|
1235
1271
|
}
|
|
1236
1272
|
}, props, state, instance);
|
|
1273
|
+
if (vnode.type === VaporSlot) (0, _vue_shared.extend)(hooks, {
|
|
1274
|
+
__vapor: true,
|
|
1275
|
+
props,
|
|
1276
|
+
state,
|
|
1277
|
+
instance
|
|
1278
|
+
});
|
|
1279
|
+
return hooks;
|
|
1237
1280
|
}
|
|
1238
1281
|
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
1239
1282
|
const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
|
|
@@ -1349,7 +1392,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
|
|
|
1349
1392
|
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
1350
1393
|
const mode = props.mode;
|
|
1351
1394
|
const previousInner = previous && getInnerChild$1(previous);
|
|
1352
|
-
if (previous && previousInner &&
|
|
1395
|
+
if (previous && previousInner && !isSameVNodeType(previousInner, nextInner) && !isEmptyTransitionChild(previousInner, instance)) {
|
|
1353
1396
|
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
1354
1397
|
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);
|
|
1355
1398
|
}
|
|
@@ -1413,7 +1456,13 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
1413
1456
|
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1414
1457
|
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1415
1458
|
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1416
|
-
} else
|
|
1459
|
+
} else {
|
|
1460
|
+
vnode.transition = hooks;
|
|
1461
|
+
if (vnode.type === Fragment && (0, _vue_shared.isArray)(vnode.children)) {
|
|
1462
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
1463
|
+
if (child) setTransitionHooks(child, hooks);
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1417
1466
|
return hooks;
|
|
1418
1467
|
}
|
|
1419
1468
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
@@ -1436,6 +1485,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1436
1485
|
function checkTransitionMode(mode) {
|
|
1437
1486
|
if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
|
|
1438
1487
|
}
|
|
1488
|
+
function getTransitionRoot(vnode) {
|
|
1489
|
+
if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
|
|
1490
|
+
if (vnode.type === Fragment) {
|
|
1491
|
+
const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1492
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
1493
|
+
}
|
|
1494
|
+
if (vnode.type !== Comment) return vnode;
|
|
1495
|
+
}
|
|
1439
1496
|
//#endregion
|
|
1440
1497
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1441
1498
|
/*@__NO_SIDE_EFFECTS__*/
|
|
@@ -2065,14 +2122,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
2065
2122
|
break;
|
|
2066
2123
|
}
|
|
2067
2124
|
}, opts);
|
|
2068
|
-
|
|
2069
|
-
if (!(el instanceof Element)) return;
|
|
2125
|
+
const observe = (el) => {
|
|
2070
2126
|
if (elementIsVisibleInViewport(el)) {
|
|
2071
2127
|
hydrate();
|
|
2072
2128
|
ob.disconnect();
|
|
2073
2129
|
return false;
|
|
2074
2130
|
}
|
|
2131
|
+
if (getComputedStyle(el).display === "contents") {
|
|
2132
|
+
for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
|
|
2133
|
+
}
|
|
2075
2134
|
ob.observe(el);
|
|
2135
|
+
};
|
|
2136
|
+
forEach((el) => {
|
|
2137
|
+
if (!(el instanceof Element)) return;
|
|
2138
|
+
return observe(el);
|
|
2076
2139
|
});
|
|
2077
2140
|
return () => ob.disconnect();
|
|
2078
2141
|
};
|
|
@@ -2334,7 +2397,10 @@ const KeepAlive = {
|
|
|
2334
2397
|
function pruneCacheEntry(key) {
|
|
2335
2398
|
const cached = cache.get(key);
|
|
2336
2399
|
if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
|
|
2337
|
-
else if (current)
|
|
2400
|
+
else if (current) {
|
|
2401
|
+
resetShapeFlag(current);
|
|
2402
|
+
if (cached) resetShapeFlag(cached);
|
|
2403
|
+
}
|
|
2338
2404
|
cache.delete(key);
|
|
2339
2405
|
keys.delete(key);
|
|
2340
2406
|
}
|
|
@@ -2678,6 +2744,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
2678
2744
|
owner: currentRenderingInstance
|
|
2679
2745
|
}] : void 0
|
|
2680
2746
|
};
|
|
2747
|
+
if (branchKey != null && props.key == null) {
|
|
2748
|
+
ret.vs.props = ret.props;
|
|
2749
|
+
ret.props = (0, _vue_shared.extend)({}, ret.props, { key: branchKey });
|
|
2750
|
+
ret.key = branchKey;
|
|
2751
|
+
}
|
|
2681
2752
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2682
2753
|
return ret;
|
|
2683
2754
|
}
|
|
@@ -3870,7 +3941,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3870
3941
|
if (nextKeys.length !== Object.keys(prevProps).length) return true;
|
|
3871
3942
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
3872
3943
|
const key = nextKeys[i];
|
|
3873
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3944
|
+
if (!(0, _vue_shared.hasOwn)(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3874
3945
|
}
|
|
3875
3946
|
return false;
|
|
3876
3947
|
}
|
|
@@ -4561,7 +4632,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4561
4632
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4562
4633
|
const oldVNode = oldChildren[i];
|
|
4563
4634
|
const newVNode = newChildren[i];
|
|
4564
|
-
const
|
|
4635
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
4636
|
+
const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
|
|
4565
4637
|
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4566
4638
|
}
|
|
4567
4639
|
};
|
|
@@ -4653,6 +4725,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4653
4725
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4654
4726
|
pushWarningContext(n2);
|
|
4655
4727
|
n2.el = n1.el;
|
|
4728
|
+
n2.placeholder = n1.placeholder;
|
|
4656
4729
|
updateComponentPreRender(instance, n2, optimized);
|
|
4657
4730
|
popWarningContext();
|
|
4658
4731
|
return;
|
|
@@ -4662,6 +4735,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4662
4735
|
}
|
|
4663
4736
|
} else {
|
|
4664
4737
|
n2.el = n1.el;
|
|
4738
|
+
n2.placeholder = n1.placeholder;
|
|
4665
4739
|
instance.vnode = n2;
|
|
4666
4740
|
}
|
|
4667
4741
|
};
|
|
@@ -5006,12 +5080,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5006
5080
|
};
|
|
5007
5081
|
const remove = (vnode) => {
|
|
5008
5082
|
const { type, el, anchor, transition } = vnode;
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
else remove(child);
|
|
5013
|
-
});
|
|
5014
|
-
else removeFragment(el, anchor);
|
|
5083
|
+
const isFragment = type === Fragment;
|
|
5084
|
+
if (isFragment && !transition) {
|
|
5085
|
+
removeFragment(el, anchor);
|
|
5015
5086
|
return;
|
|
5016
5087
|
}
|
|
5017
5088
|
if (type === Static) {
|
|
@@ -5019,8 +5090,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5019
5090
|
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5020
5091
|
return;
|
|
5021
5092
|
}
|
|
5022
|
-
|
|
5023
|
-
|
|
5093
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
5094
|
+
const performRemove = () => {
|
|
5095
|
+
if (isFragment) {
|
|
5096
|
+
if (hostParentNode(el)) removeFragment(el, anchor);
|
|
5097
|
+
} else hostRemove(el);
|
|
5098
|
+
};
|
|
5099
|
+
if (transition) {
|
|
5100
|
+
let leavingEl = leavingNode && leavingNode.el;
|
|
5101
|
+
let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
|
|
5102
|
+
if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
|
|
5103
|
+
leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
|
|
5104
|
+
isElement = !!leavingEl;
|
|
5105
|
+
}
|
|
5106
|
+
performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
|
|
5107
|
+
} else performRemove();
|
|
5024
5108
|
};
|
|
5025
5109
|
const removeFragment = (cur, end) => {
|
|
5026
5110
|
let next;
|
|
@@ -5063,15 +5147,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5063
5147
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
5064
5148
|
};
|
|
5065
5149
|
const render = (vnode, container, namespace) => {
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5073
|
-
container._vnode = vnode;
|
|
5074
|
-
flushOnAppMount(instance);
|
|
5150
|
+
flushOnAppMount(() => {
|
|
5151
|
+
if (vnode == null) {
|
|
5152
|
+
if (container._vnode) unmount(container._vnode, null, null, true);
|
|
5153
|
+
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5154
|
+
container._vnode = vnode;
|
|
5155
|
+
}, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
|
|
5075
5156
|
};
|
|
5076
5157
|
const internals = {
|
|
5077
5158
|
p: patch,
|
|
@@ -5464,13 +5545,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5464
5545
|
registerDep(instance, onResolve) {
|
|
5465
5546
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5466
5547
|
if (isInPendingSuspense) suspense.deps++;
|
|
5467
|
-
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
5468
5548
|
instance.asyncDep.catch((err) => {
|
|
5469
5549
|
handleError(err, instance, 0);
|
|
5470
5550
|
}).then((asyncSetupResult) => {
|
|
5471
5551
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
5472
5552
|
setCurrentInstance(null, void 0);
|
|
5473
|
-
if (
|
|
5553
|
+
if (!instance.scope.active) {
|
|
5474
5554
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
5475
5555
|
return;
|
|
5476
5556
|
}
|
|
@@ -5783,7 +5863,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5783
5863
|
ctx: vnode.ctx,
|
|
5784
5864
|
ce: vnode.ce,
|
|
5785
5865
|
vi: vnode.vi,
|
|
5786
|
-
vs: cloneVaporSlotMeta(vnode),
|
|
5866
|
+
vs: cloneVaporSlotMeta(vnode, extraProps),
|
|
5787
5867
|
vb: vnode.vb,
|
|
5788
5868
|
ibu: vnode.ibu,
|
|
5789
5869
|
iu: vnode.iu,
|
|
@@ -5792,13 +5872,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5792
5872
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5793
5873
|
return cloned;
|
|
5794
5874
|
}
|
|
5795
|
-
function cloneVaporSlotMeta(vnode) {
|
|
5875
|
+
function cloneVaporSlotMeta(vnode, extraProps) {
|
|
5796
5876
|
const vaporSlot = vnode.vs;
|
|
5797
5877
|
if (!vaporSlot) return vaporSlot;
|
|
5798
5878
|
const cloned = {
|
|
5799
5879
|
slot: vaporSlot.slot,
|
|
5800
|
-
outlets: vaporSlot.outlets
|
|
5880
|
+
outlets: vaporSlot.outlets,
|
|
5881
|
+
props: vaporSlot.props
|
|
5801
5882
|
};
|
|
5883
|
+
if (vaporSlot.props && extraProps) {
|
|
5884
|
+
let extraSlotProps;
|
|
5885
|
+
for (const key in extraProps) if (key !== "key") {
|
|
5886
|
+
if (!extraSlotProps) extraSlotProps = {};
|
|
5887
|
+
extraSlotProps[key] = extraProps[key];
|
|
5888
|
+
}
|
|
5889
|
+
if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
|
|
5890
|
+
}
|
|
5802
5891
|
if (vnode.el) {
|
|
5803
5892
|
cloned.state = vaporSlot.state;
|
|
5804
5893
|
cloned.ref = vaporSlot.ref;
|
|
@@ -5990,6 +6079,9 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
5990
6079
|
//#region packages/runtime-core/src/component.ts
|
|
5991
6080
|
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
5992
6081
|
let uid = 0;
|
|
6082
|
+
function getNextUid() {
|
|
6083
|
+
return uid;
|
|
6084
|
+
}
|
|
5993
6085
|
function createComponentInstance(vnode, parent, suspense) {
|
|
5994
6086
|
const type = vnode.type;
|
|
5995
6087
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
@@ -6496,7 +6588,7 @@ function isMemoSame(cached, memo) {
|
|
|
6496
6588
|
}
|
|
6497
6589
|
//#endregion
|
|
6498
6590
|
//#region packages/runtime-core/src/index.ts
|
|
6499
|
-
const version = "3.6.0-rc.
|
|
6591
|
+
const version = "3.6.0-rc.12";
|
|
6500
6592
|
const warn = warn$1;
|
|
6501
6593
|
/**
|
|
6502
6594
|
* 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.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -205,13 +205,13 @@ function queuePostFlushCb(jobs, id = Infinity) {
|
|
|
205
205
|
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
206
206
|
queueFlush();
|
|
207
207
|
}
|
|
208
|
-
function flushPreFlushCbs(instance, seen) {
|
|
208
|
+
function flushPreFlushCbs(instance, minUid, seen) {
|
|
209
209
|
for (let i = flushIndex; i < jobsLength; i++) {
|
|
210
210
|
const cb = jobs[i];
|
|
211
211
|
if (cb.order & 1 || cb.order === Infinity) continue;
|
|
212
|
-
if (instance && cb.order !== instance.uid * 2) continue;
|
|
212
|
+
if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
|
|
213
213
|
jobs.splice(i, 1);
|
|
214
|
-
i
|
|
214
|
+
i = instance ? i - 1 : flushIndex - 1;
|
|
215
215
|
jobsLength--;
|
|
216
216
|
if (cb.flags & 2) cb.flags &= -2;
|
|
217
217
|
try {
|
|
@@ -221,15 +221,24 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
function flushPostFlushCbs(seen) {
|
|
224
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
225
225
|
if (postJobs.length) {
|
|
226
|
+
let cbs = postJobs;
|
|
227
|
+
if (skip) {
|
|
228
|
+
cbs = [];
|
|
229
|
+
let kept = 0;
|
|
230
|
+
for (let i = 0; i < postJobs.length; i++) {
|
|
231
|
+
const cb = postJobs[i];
|
|
232
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
|
|
233
|
+
else cbs.push(cb);
|
|
234
|
+
}
|
|
235
|
+
postJobs.length = kept;
|
|
236
|
+
} else postJobs = [];
|
|
226
237
|
if (activePostJobs) {
|
|
227
|
-
for (let i = 0; i <
|
|
228
|
-
postJobs.length = 0;
|
|
238
|
+
for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
|
|
229
239
|
return;
|
|
230
240
|
}
|
|
231
|
-
activePostJobs =
|
|
232
|
-
postJobs = [];
|
|
241
|
+
activePostJobs = cbs;
|
|
233
242
|
try {
|
|
234
243
|
while (postFlushIndex < activePostJobs.length) {
|
|
235
244
|
const cb = activePostJobs[postFlushIndex++];
|
|
@@ -249,17 +258,28 @@ function flushPostFlushCbs(seen) {
|
|
|
249
258
|
}
|
|
250
259
|
let isFlushing = false;
|
|
251
260
|
/**
|
|
261
|
+
* Run a root render, then flush the jobs it is responsible for. A mount or
|
|
262
|
+
* unmount (`minUid` given) only flushes the jobs of the components it created
|
|
263
|
+
* and the post cbs it queued, so pre watchers triggered in setup run before
|
|
264
|
+
* mounted (#5721) while the jobs of other components stay in the queue and
|
|
265
|
+
* keep their order (#6728). A root update keeps flushing all pending pre jobs
|
|
266
|
+
* and post cbs, as the jobs of the components it re-renders may predate it.
|
|
267
|
+
*
|
|
252
268
|
* @internal
|
|
253
269
|
*/
|
|
254
|
-
function flushOnAppMount(
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
270
|
+
function flushOnAppMount(fn, minUid) {
|
|
271
|
+
if (isFlushing) {
|
|
272
|
+
fn();
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const queued = minUid === void 0 ? void 0 : new Set(postJobs);
|
|
276
|
+
fn();
|
|
277
|
+
isFlushing = true;
|
|
278
|
+
try {
|
|
279
|
+
flushPreFlushCbs(void 0, minUid);
|
|
280
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
281
|
+
} finally {
|
|
282
|
+
isFlushing = false;
|
|
263
283
|
}
|
|
264
284
|
}
|
|
265
285
|
function flushJobs(seen) {
|
|
@@ -470,7 +490,7 @@ var RenderWatcherEffect = class extends _vue_reactivity.WatcherEffect {
|
|
|
470
490
|
this.flags |= 128;
|
|
471
491
|
job.flags |= 2;
|
|
472
492
|
}
|
|
473
|
-
|
|
493
|
+
job.i = instance;
|
|
474
494
|
this.job = job;
|
|
475
495
|
}
|
|
476
496
|
notify() {
|
|
@@ -662,7 +682,11 @@ const TeleportImpl = {
|
|
|
662
682
|
hydrate: hydrateTeleport
|
|
663
683
|
};
|
|
664
684
|
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
|
|
665
|
-
if (moveType === 0)
|
|
685
|
+
if (moveType === 0) {
|
|
686
|
+
if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
|
|
687
|
+
insert(vnode.targetAnchor, container, parentAnchor);
|
|
688
|
+
parentAnchor = vnode.targetAnchor;
|
|
689
|
+
}
|
|
666
690
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
667
691
|
const isReorder = moveType === 2;
|
|
668
692
|
if (isReorder) insert(el, container, parentAnchor);
|
|
@@ -781,10 +805,15 @@ const BaseTransitionPropsValidators = {
|
|
|
781
805
|
onAfterAppear: TransitionHookValidator,
|
|
782
806
|
onAppearCancelled: TransitionHookValidator
|
|
783
807
|
};
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
808
|
+
function isEmptyTransitionChild(vnode, instance) {
|
|
809
|
+
if (vnode.type === Comment) return true;
|
|
810
|
+
if (vnode.type === Fragment) {
|
|
811
|
+
const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
812
|
+
return !child || isEmptyTransitionChild(child, instance);
|
|
813
|
+
}
|
|
814
|
+
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
815
|
+
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
816
|
+
}
|
|
788
817
|
const BaseTransitionImpl = {
|
|
789
818
|
name: `BaseTransition`,
|
|
790
819
|
props: BaseTransitionPropsValidators,
|
|
@@ -826,7 +855,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
826
855
|
function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
827
856
|
const key = String(vnode.key);
|
|
828
857
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
829
|
-
|
|
858
|
+
const hooks = baseResolveTransitionHooks({
|
|
830
859
|
isLeaving: () => leavingVNodesCache[key] === vnode,
|
|
831
860
|
setLeavingNodeCache: () => {
|
|
832
861
|
leavingVNodesCache[key] = vnode;
|
|
@@ -836,7 +865,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
836
865
|
},
|
|
837
866
|
earlyRemove: () => {
|
|
838
867
|
const leavingVNode = leavingVNodesCache[key];
|
|
839
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)
|
|
868
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
|
|
869
|
+
let leavingCb = leavingVNode.el[leaveCbKey];
|
|
870
|
+
if (!leavingCb) {
|
|
871
|
+
const leavingRoot = getTransitionRoot(leavingVNode);
|
|
872
|
+
leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
|
|
873
|
+
}
|
|
874
|
+
if (leavingCb) leavingCb();
|
|
875
|
+
}
|
|
840
876
|
},
|
|
841
877
|
cloneHooks: (vnode) => {
|
|
842
878
|
const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
|
|
@@ -844,6 +880,13 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
844
880
|
return hooks;
|
|
845
881
|
}
|
|
846
882
|
}, props, state, instance);
|
|
883
|
+
if (vnode.type === VaporSlot) (0, _vue_shared.extend)(hooks, {
|
|
884
|
+
__vapor: true,
|
|
885
|
+
props,
|
|
886
|
+
state,
|
|
887
|
+
instance
|
|
888
|
+
});
|
|
889
|
+
return hooks;
|
|
847
890
|
}
|
|
848
891
|
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
849
892
|
const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
|
|
@@ -959,7 +1002,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
|
|
|
959
1002
|
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
960
1003
|
const mode = props.mode;
|
|
961
1004
|
const previousInner = previous && getInnerChild$1(previous);
|
|
962
|
-
if (previous && previousInner &&
|
|
1005
|
+
if (previous && previousInner && !isSameVNodeType(previousInner, nextInner) && !isEmptyTransitionChild(previousInner, instance)) {
|
|
963
1006
|
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
964
1007
|
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);
|
|
965
1008
|
}
|
|
@@ -1023,7 +1066,13 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
1023
1066
|
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1024
1067
|
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1025
1068
|
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1026
|
-
} else
|
|
1069
|
+
} else {
|
|
1070
|
+
vnode.transition = hooks;
|
|
1071
|
+
if (vnode.type === Fragment && (0, _vue_shared.isArray)(vnode.children)) {
|
|
1072
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
1073
|
+
if (child) setTransitionHooks(child, hooks);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1027
1076
|
return hooks;
|
|
1028
1077
|
}
|
|
1029
1078
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
@@ -1040,6 +1089,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1040
1089
|
if (keyedFragmentCount > 1) for (let i = 0; i < ret.length; i++) ret[i].patchFlag = -2;
|
|
1041
1090
|
return ret;
|
|
1042
1091
|
}
|
|
1092
|
+
function getTransitionRoot(vnode) {
|
|
1093
|
+
if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
|
|
1094
|
+
if (vnode.type === Fragment) {
|
|
1095
|
+
const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1096
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
1097
|
+
}
|
|
1098
|
+
if (vnode.type !== Comment) return vnode;
|
|
1099
|
+
}
|
|
1043
1100
|
//#endregion
|
|
1044
1101
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1045
1102
|
/*@__NO_SIDE_EFFECTS__*/
|
|
@@ -1528,14 +1585,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
1528
1585
|
break;
|
|
1529
1586
|
}
|
|
1530
1587
|
}, opts);
|
|
1531
|
-
|
|
1532
|
-
if (!(el instanceof Element)) return;
|
|
1588
|
+
const observe = (el) => {
|
|
1533
1589
|
if (elementIsVisibleInViewport(el)) {
|
|
1534
1590
|
hydrate();
|
|
1535
1591
|
ob.disconnect();
|
|
1536
1592
|
return false;
|
|
1537
1593
|
}
|
|
1594
|
+
if (getComputedStyle(el).display === "contents") {
|
|
1595
|
+
for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
|
|
1596
|
+
}
|
|
1538
1597
|
ob.observe(el);
|
|
1598
|
+
};
|
|
1599
|
+
forEach((el) => {
|
|
1600
|
+
if (!(el instanceof Element)) return;
|
|
1601
|
+
return observe(el);
|
|
1539
1602
|
});
|
|
1540
1603
|
return () => ob.disconnect();
|
|
1541
1604
|
};
|
|
@@ -1788,7 +1851,10 @@ const KeepAlive = {
|
|
|
1788
1851
|
function pruneCacheEntry(key) {
|
|
1789
1852
|
const cached = cache.get(key);
|
|
1790
1853
|
if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
|
|
1791
|
-
else if (current)
|
|
1854
|
+
else if (current) {
|
|
1855
|
+
resetShapeFlag(current);
|
|
1856
|
+
if (cached) resetShapeFlag(cached);
|
|
1857
|
+
}
|
|
1792
1858
|
cache.delete(key);
|
|
1793
1859
|
keys.delete(key);
|
|
1794
1860
|
}
|
|
@@ -2043,8 +2109,11 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2043
2109
|
ret = new Array(source.length);
|
|
2044
2110
|
for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? (0, _vue_reactivity.toReadonly)((0, _vue_reactivity.toReactive)(source[i])) : (0, _vue_reactivity.toReactive)(source[i]) : source[i], i, void 0, cached && cached[i]);
|
|
2045
2111
|
} else if (typeof source === "number") {
|
|
2046
|
-
|
|
2047
|
-
|
|
2112
|
+
if (!Number.isInteger(source) || source < 0) ret = [];
|
|
2113
|
+
else {
|
|
2114
|
+
ret = new Array(source);
|
|
2115
|
+
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2116
|
+
}
|
|
2048
2117
|
} else if ((0, _vue_shared.isObject)(source)) {
|
|
2049
2118
|
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2050
2119
|
else {
|
|
@@ -2120,6 +2189,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
2120
2189
|
owner: currentRenderingInstance
|
|
2121
2190
|
}] : void 0
|
|
2122
2191
|
};
|
|
2192
|
+
if (branchKey != null && props.key == null) {
|
|
2193
|
+
ret.vs.props = ret.props;
|
|
2194
|
+
ret.props = (0, _vue_shared.extend)({}, ret.props, { key: branchKey });
|
|
2195
|
+
ret.key = branchKey;
|
|
2196
|
+
}
|
|
2123
2197
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2124
2198
|
return ret;
|
|
2125
2199
|
}
|
|
@@ -3031,7 +3105,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3031
3105
|
if (nextKeys.length !== Object.keys(prevProps).length) return true;
|
|
3032
3106
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
3033
3107
|
const key = nextKeys[i];
|
|
3034
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3108
|
+
if (!(0, _vue_shared.hasOwn)(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3035
3109
|
}
|
|
3036
3110
|
return false;
|
|
3037
3111
|
}
|
|
@@ -3530,7 +3604,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3530
3604
|
for (let i = 0; i < newChildren.length; i++) {
|
|
3531
3605
|
const oldVNode = oldChildren[i];
|
|
3532
3606
|
const newVNode = newChildren[i];
|
|
3533
|
-
const
|
|
3607
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
3608
|
+
const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
|
|
3534
3609
|
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
3535
3610
|
}
|
|
3536
3611
|
};
|
|
@@ -3606,6 +3681,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3606
3681
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
3607
3682
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
3608
3683
|
n2.el = n1.el;
|
|
3684
|
+
n2.placeholder = n1.placeholder;
|
|
3609
3685
|
updateComponentPreRender(instance, n2, optimized);
|
|
3610
3686
|
return;
|
|
3611
3687
|
} else {
|
|
@@ -3614,6 +3690,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3614
3690
|
}
|
|
3615
3691
|
} else {
|
|
3616
3692
|
n2.el = n1.el;
|
|
3693
|
+
n2.placeholder = n1.placeholder;
|
|
3617
3694
|
instance.vnode = n2;
|
|
3618
3695
|
}
|
|
3619
3696
|
};
|
|
@@ -3937,7 +4014,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3937
4014
|
};
|
|
3938
4015
|
const remove = (vnode) => {
|
|
3939
4016
|
const { type, el, anchor, transition } = vnode;
|
|
3940
|
-
|
|
4017
|
+
const isFragment = type === Fragment;
|
|
4018
|
+
if (isFragment && !transition) {
|
|
3941
4019
|
removeFragment(el, anchor);
|
|
3942
4020
|
return;
|
|
3943
4021
|
}
|
|
@@ -3946,8 +4024,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3946
4024
|
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
3947
4025
|
return;
|
|
3948
4026
|
}
|
|
3949
|
-
|
|
3950
|
-
|
|
4027
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
4028
|
+
const performRemove = () => {
|
|
4029
|
+
if (isFragment) {
|
|
4030
|
+
if (hostParentNode(el)) removeFragment(el, anchor);
|
|
4031
|
+
} else hostRemove(el);
|
|
4032
|
+
};
|
|
4033
|
+
if (transition) {
|
|
4034
|
+
let leavingEl = leavingNode && leavingNode.el;
|
|
4035
|
+
let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
|
|
4036
|
+
if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
|
|
4037
|
+
leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
|
|
4038
|
+
isElement = !!leavingEl;
|
|
4039
|
+
}
|
|
4040
|
+
performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
|
|
4041
|
+
} else performRemove();
|
|
3951
4042
|
};
|
|
3952
4043
|
const removeFragment = (cur, end) => {
|
|
3953
4044
|
let next;
|
|
@@ -3988,15 +4079,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3988
4079
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
3989
4080
|
};
|
|
3990
4081
|
const render = (vnode, container, namespace) => {
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
3998
|
-
container._vnode = vnode;
|
|
3999
|
-
flushOnAppMount(instance);
|
|
4082
|
+
flushOnAppMount(() => {
|
|
4083
|
+
if (vnode == null) {
|
|
4084
|
+
if (container._vnode) unmount(container._vnode, null, null, true);
|
|
4085
|
+
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
4086
|
+
container._vnode = vnode;
|
|
4087
|
+
}, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
|
|
4000
4088
|
};
|
|
4001
4089
|
const internals = {
|
|
4002
4090
|
p: patch,
|
|
@@ -4370,13 +4458,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4370
4458
|
registerDep(instance, onResolve) {
|
|
4371
4459
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
4372
4460
|
if (isInPendingSuspense) suspense.deps++;
|
|
4373
|
-
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
4374
4461
|
instance.asyncDep.catch((err) => {
|
|
4375
4462
|
handleError(err, instance, 0);
|
|
4376
4463
|
}).then((asyncSetupResult) => {
|
|
4377
4464
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
4378
4465
|
setCurrentInstance(null, void 0);
|
|
4379
|
-
if (
|
|
4466
|
+
if (!instance.scope.active) {
|
|
4380
4467
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
4381
4468
|
return;
|
|
4382
4469
|
}
|
|
@@ -4648,7 +4735,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
4648
4735
|
ctx: vnode.ctx,
|
|
4649
4736
|
ce: vnode.ce,
|
|
4650
4737
|
vi: vnode.vi,
|
|
4651
|
-
vs: cloneVaporSlotMeta(vnode),
|
|
4738
|
+
vs: cloneVaporSlotMeta(vnode, extraProps),
|
|
4652
4739
|
vb: vnode.vb,
|
|
4653
4740
|
ibu: vnode.ibu,
|
|
4654
4741
|
iu: vnode.iu,
|
|
@@ -4657,13 +4744,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
4657
4744
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
4658
4745
|
return cloned;
|
|
4659
4746
|
}
|
|
4660
|
-
function cloneVaporSlotMeta(vnode) {
|
|
4747
|
+
function cloneVaporSlotMeta(vnode, extraProps) {
|
|
4661
4748
|
const vaporSlot = vnode.vs;
|
|
4662
4749
|
if (!vaporSlot) return vaporSlot;
|
|
4663
4750
|
const cloned = {
|
|
4664
4751
|
slot: vaporSlot.slot,
|
|
4665
|
-
outlets: vaporSlot.outlets
|
|
4752
|
+
outlets: vaporSlot.outlets,
|
|
4753
|
+
props: vaporSlot.props
|
|
4666
4754
|
};
|
|
4755
|
+
if (vaporSlot.props && extraProps) {
|
|
4756
|
+
let extraSlotProps;
|
|
4757
|
+
for (const key in extraProps) if (key !== "key") {
|
|
4758
|
+
if (!extraSlotProps) extraSlotProps = {};
|
|
4759
|
+
extraSlotProps[key] = extraProps[key];
|
|
4760
|
+
}
|
|
4761
|
+
if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
|
|
4762
|
+
}
|
|
4667
4763
|
if (vnode.el) {
|
|
4668
4764
|
cloned.state = vaporSlot.state;
|
|
4669
4765
|
cloned.ref = vaporSlot.ref;
|
|
@@ -4840,6 +4936,9 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
4840
4936
|
//#region packages/runtime-core/src/component.ts
|
|
4841
4937
|
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
4842
4938
|
let uid = 0;
|
|
4939
|
+
function getNextUid() {
|
|
4940
|
+
return uid;
|
|
4941
|
+
}
|
|
4843
4942
|
function createComponentInstance(vnode, parent, suspense) {
|
|
4844
4943
|
const type = vnode.type;
|
|
4845
4944
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
@@ -5097,7 +5196,7 @@ function isMemoSame(cached, memo) {
|
|
|
5097
5196
|
}
|
|
5098
5197
|
//#endregion
|
|
5099
5198
|
//#region packages/runtime-core/src/index.ts
|
|
5100
|
-
const version = "3.6.0-rc.
|
|
5199
|
+
const version = "3.6.0-rc.12";
|
|
5101
5200
|
const warn = _vue_shared.NOOP;
|
|
5102
5201
|
/**
|
|
5103
5202
|
* Runtime error messages. Only exposed in dev or esm builds.
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -56,8 +56,9 @@ export interface SchedulerJob extends Function {
|
|
|
56
56
|
/**
|
|
57
57
|
* Attached by renderer.ts when setting up a component's render effect
|
|
58
58
|
* Used to obtain component information when reporting max recursive updates.
|
|
59
|
+
* Also set on watcher jobs: null marks a watcher without an owner component.
|
|
59
60
|
*/
|
|
60
|
-
i?: GenericComponentInstance;
|
|
61
|
+
i?: GenericComponentInstance | null;
|
|
61
62
|
}
|
|
62
63
|
type SchedulerJobs = SchedulerJob | SchedulerJob[];
|
|
63
64
|
export declare function nextTick(): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -317,15 +317,15 @@ function queuePostFlushCb(jobs, id = Infinity) {
|
|
|
317
317
|
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
318
318
|
queueFlush();
|
|
319
319
|
}
|
|
320
|
-
function flushPreFlushCbs(instance, seen) {
|
|
320
|
+
function flushPreFlushCbs(instance, minUid, seen) {
|
|
321
321
|
if (!!(process.env.NODE_ENV !== "production")) seen = seen || /* @__PURE__ */ new Map();
|
|
322
322
|
for (let i = flushIndex; i < jobsLength; i++) {
|
|
323
323
|
const cb = jobs[i];
|
|
324
324
|
if (cb.order & 1 || cb.order === Infinity) continue;
|
|
325
|
-
if (instance && cb.order !== instance.uid * 2) continue;
|
|
325
|
+
if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
|
|
326
326
|
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) continue;
|
|
327
327
|
jobs.splice(i, 1);
|
|
328
|
-
i
|
|
328
|
+
i = instance ? i - 1 : flushIndex - 1;
|
|
329
329
|
jobsLength--;
|
|
330
330
|
if (cb.flags & 2) cb.flags &= -2;
|
|
331
331
|
try {
|
|
@@ -335,15 +335,24 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
function flushPostFlushCbs(seen) {
|
|
338
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
339
339
|
if (postJobs.length) {
|
|
340
|
+
let cbs = postJobs;
|
|
341
|
+
if (skip) {
|
|
342
|
+
cbs = [];
|
|
343
|
+
let kept = 0;
|
|
344
|
+
for (let i = 0; i < postJobs.length; i++) {
|
|
345
|
+
const cb = postJobs[i];
|
|
346
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
|
|
347
|
+
else cbs.push(cb);
|
|
348
|
+
}
|
|
349
|
+
postJobs.length = kept;
|
|
350
|
+
} else postJobs = [];
|
|
340
351
|
if (activePostJobs) {
|
|
341
|
-
for (let i = 0; i <
|
|
342
|
-
postJobs.length = 0;
|
|
352
|
+
for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
|
|
343
353
|
return;
|
|
344
354
|
}
|
|
345
|
-
activePostJobs =
|
|
346
|
-
postJobs = [];
|
|
355
|
+
activePostJobs = cbs;
|
|
347
356
|
if (!!(process.env.NODE_ENV !== "production")) seen = seen || /* @__PURE__ */ new Map();
|
|
348
357
|
try {
|
|
349
358
|
while (postFlushIndex < activePostJobs.length) {
|
|
@@ -365,17 +374,28 @@ function flushPostFlushCbs(seen) {
|
|
|
365
374
|
}
|
|
366
375
|
let isFlushing = false;
|
|
367
376
|
/**
|
|
377
|
+
* Run a root render, then flush the jobs it is responsible for. A mount or
|
|
378
|
+
* unmount (`minUid` given) only flushes the jobs of the components it created
|
|
379
|
+
* and the post cbs it queued, so pre watchers triggered in setup run before
|
|
380
|
+
* mounted (#5721) while the jobs of other components stay in the queue and
|
|
381
|
+
* keep their order (#6728). A root update keeps flushing all pending pre jobs
|
|
382
|
+
* and post cbs, as the jobs of the components it re-renders may predate it.
|
|
383
|
+
*
|
|
368
384
|
* @internal
|
|
369
385
|
*/
|
|
370
|
-
function flushOnAppMount(
|
|
371
|
-
if (
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
386
|
+
function flushOnAppMount(fn, minUid) {
|
|
387
|
+
if (isFlushing) {
|
|
388
|
+
fn();
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
const queued = minUid === void 0 ? void 0 : new Set(postJobs);
|
|
392
|
+
fn();
|
|
393
|
+
isFlushing = true;
|
|
394
|
+
try {
|
|
395
|
+
flushPreFlushCbs(void 0, minUid);
|
|
396
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
397
|
+
} finally {
|
|
398
|
+
isFlushing = false;
|
|
379
399
|
}
|
|
380
400
|
}
|
|
381
401
|
function flushJobs(seen) {
|
|
@@ -845,7 +865,7 @@ var RenderWatcherEffect = class extends WatcherEffect {
|
|
|
845
865
|
this.flags |= 128;
|
|
846
866
|
job.flags |= 2;
|
|
847
867
|
}
|
|
848
|
-
|
|
868
|
+
job.i = instance;
|
|
849
869
|
this.job = job;
|
|
850
870
|
}
|
|
851
871
|
notify() {
|
|
@@ -1056,7 +1076,11 @@ const TeleportImpl = {
|
|
|
1056
1076
|
hydrate: hydrateTeleport
|
|
1057
1077
|
};
|
|
1058
1078
|
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
|
|
1059
|
-
if (moveType === 0)
|
|
1079
|
+
if (moveType === 0) {
|
|
1080
|
+
if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
|
|
1081
|
+
insert(vnode.targetAnchor, container, parentAnchor);
|
|
1082
|
+
parentAnchor = vnode.targetAnchor;
|
|
1083
|
+
}
|
|
1060
1084
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
1061
1085
|
const isReorder = moveType === 2;
|
|
1062
1086
|
if (isReorder) insert(el, container, parentAnchor);
|
|
@@ -1175,10 +1199,15 @@ const BaseTransitionPropsValidators = {
|
|
|
1175
1199
|
onAfterAppear: TransitionHookValidator,
|
|
1176
1200
|
onAppearCancelled: TransitionHookValidator
|
|
1177
1201
|
};
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1202
|
+
function isEmptyTransitionChild(vnode, instance) {
|
|
1203
|
+
if (vnode.type === Comment) return true;
|
|
1204
|
+
if (vnode.type === Fragment) {
|
|
1205
|
+
const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1206
|
+
return !child || isEmptyTransitionChild(child, instance);
|
|
1207
|
+
}
|
|
1208
|
+
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
1209
|
+
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
1210
|
+
}
|
|
1182
1211
|
const BaseTransitionImpl = {
|
|
1183
1212
|
name: `BaseTransition`,
|
|
1184
1213
|
props: BaseTransitionPropsValidators,
|
|
@@ -1227,7 +1256,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
1227
1256
|
function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
1228
1257
|
const key = String(vnode.key);
|
|
1229
1258
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1230
|
-
|
|
1259
|
+
const hooks = baseResolveTransitionHooks({
|
|
1231
1260
|
isLeaving: () => leavingVNodesCache[key] === vnode,
|
|
1232
1261
|
setLeavingNodeCache: () => {
|
|
1233
1262
|
leavingVNodesCache[key] = vnode;
|
|
@@ -1237,7 +1266,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1237
1266
|
},
|
|
1238
1267
|
earlyRemove: () => {
|
|
1239
1268
|
const leavingVNode = leavingVNodesCache[key];
|
|
1240
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)
|
|
1269
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
|
|
1270
|
+
let leavingCb = leavingVNode.el[leaveCbKey];
|
|
1271
|
+
if (!leavingCb) {
|
|
1272
|
+
const leavingRoot = getTransitionRoot(leavingVNode);
|
|
1273
|
+
leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
|
|
1274
|
+
}
|
|
1275
|
+
if (leavingCb) leavingCb();
|
|
1276
|
+
}
|
|
1241
1277
|
},
|
|
1242
1278
|
cloneHooks: (vnode) => {
|
|
1243
1279
|
const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
|
|
@@ -1245,6 +1281,13 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1245
1281
|
return hooks;
|
|
1246
1282
|
}
|
|
1247
1283
|
}, props, state, instance);
|
|
1284
|
+
if (vnode.type === VaporSlot) extend(hooks, {
|
|
1285
|
+
__vapor: true,
|
|
1286
|
+
props,
|
|
1287
|
+
state,
|
|
1288
|
+
instance
|
|
1289
|
+
});
|
|
1290
|
+
return hooks;
|
|
1248
1291
|
}
|
|
1249
1292
|
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
1250
1293
|
const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
|
|
@@ -1360,7 +1403,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
|
|
|
1360
1403
|
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
1361
1404
|
const mode = props.mode;
|
|
1362
1405
|
const previousInner = previous && getInnerChild$1(previous);
|
|
1363
|
-
if (previous && previousInner &&
|
|
1406
|
+
if (previous && previousInner && !isSameVNodeType(previousInner, nextInner) && !isEmptyTransitionChild(previousInner, instance)) {
|
|
1364
1407
|
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
1365
1408
|
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);
|
|
1366
1409
|
}
|
|
@@ -1376,14 +1419,21 @@ function forwardDelayedLeave(hooks, source) {
|
|
|
1376
1419
|
}
|
|
1377
1420
|
/**
|
|
1378
1421
|
* Prepares an outgoing VNode when the incoming branch belongs to another
|
|
1379
|
-
* renderer. Returns true
|
|
1422
|
+
* renderer. Returns true under out-in, where that branch is a comment
|
|
1423
|
+
* child's: no mode holds for it, the leave runs on its own and
|
|
1424
|
+
* `resumeAfterLeave` follows it.
|
|
1380
1425
|
*
|
|
1381
1426
|
* @internal
|
|
1382
1427
|
*/
|
|
1383
1428
|
function prepareTransitionLeave(previous, enterHooks, props, state, instance, resumeAfterLeave) {
|
|
1384
1429
|
const previousInner = getInnerChild$1(previous);
|
|
1385
|
-
if (!previousInner || previousInner
|
|
1386
|
-
|
|
1430
|
+
if (!previousInner || isEmptyTransitionChild(previousInner, instance)) return false;
|
|
1431
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
1432
|
+
if (props.mode === "out-in") {
|
|
1433
|
+
leavingHooks.afterLeave = resumeAfterLeave;
|
|
1434
|
+
return true;
|
|
1435
|
+
}
|
|
1436
|
+
return applyTransitionModeSwitch(previousInner, leavingHooks, enterHooks ? () => enterHooks : void 0, props, state, resumeAfterLeave);
|
|
1387
1437
|
}
|
|
1388
1438
|
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
1389
1439
|
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
@@ -1435,7 +1485,13 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
1435
1485
|
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1436
1486
|
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1437
1487
|
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1438
|
-
} else
|
|
1488
|
+
} else {
|
|
1489
|
+
vnode.transition = hooks;
|
|
1490
|
+
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
1491
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
1492
|
+
if (child) setTransitionHooks(child, hooks);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1439
1495
|
return hooks;
|
|
1440
1496
|
}
|
|
1441
1497
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
@@ -1458,6 +1514,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1458
1514
|
function checkTransitionMode(mode) {
|
|
1459
1515
|
if (!!(process.env.NODE_ENV !== "production") && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
|
|
1460
1516
|
}
|
|
1517
|
+
function getTransitionRoot(vnode) {
|
|
1518
|
+
if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
|
|
1519
|
+
if (vnode.type === Fragment) {
|
|
1520
|
+
const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1521
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
1522
|
+
}
|
|
1523
|
+
if (vnode.type !== Comment) return vnode;
|
|
1524
|
+
}
|
|
1461
1525
|
//#endregion
|
|
1462
1526
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1463
1527
|
/*@__NO_SIDE_EFFECTS__*/
|
|
@@ -2116,14 +2180,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
2116
2180
|
break;
|
|
2117
2181
|
}
|
|
2118
2182
|
}, opts);
|
|
2119
|
-
|
|
2120
|
-
if (!(el instanceof Element)) return;
|
|
2183
|
+
const observe = (el) => {
|
|
2121
2184
|
if (elementIsVisibleInViewport(el)) {
|
|
2122
2185
|
hydrate();
|
|
2123
2186
|
ob.disconnect();
|
|
2124
2187
|
return false;
|
|
2125
2188
|
}
|
|
2189
|
+
if (getComputedStyle(el).display === "contents") {
|
|
2190
|
+
for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
|
|
2191
|
+
}
|
|
2126
2192
|
ob.observe(el);
|
|
2193
|
+
};
|
|
2194
|
+
forEach((el) => {
|
|
2195
|
+
if (!(el instanceof Element)) return;
|
|
2196
|
+
return observe(el);
|
|
2127
2197
|
});
|
|
2128
2198
|
return () => ob.disconnect();
|
|
2129
2199
|
};
|
|
@@ -2385,7 +2455,10 @@ const KeepAlive = {
|
|
|
2385
2455
|
function pruneCacheEntry(key) {
|
|
2386
2456
|
const cached = cache.get(key);
|
|
2387
2457
|
if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
|
|
2388
|
-
else if (current)
|
|
2458
|
+
else if (current) {
|
|
2459
|
+
resetShapeFlag(current);
|
|
2460
|
+
if (cached) resetShapeFlag(cached);
|
|
2461
|
+
}
|
|
2389
2462
|
cache.delete(key);
|
|
2390
2463
|
keys.delete(key);
|
|
2391
2464
|
}
|
|
@@ -2647,8 +2720,8 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2647
2720
|
ret = new Array(source.length);
|
|
2648
2721
|
for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
|
|
2649
2722
|
} else if (typeof source === "number") {
|
|
2650
|
-
if (
|
|
2651
|
-
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
2723
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
2724
|
+
if (!!(process.env.NODE_ENV !== "production")) warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
2652
2725
|
ret = [];
|
|
2653
2726
|
} else {
|
|
2654
2727
|
ret = new Array(source);
|
|
@@ -2729,6 +2802,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
2729
2802
|
owner: currentRenderingInstance
|
|
2730
2803
|
}] : void 0
|
|
2731
2804
|
};
|
|
2805
|
+
if (branchKey != null && props.key == null) {
|
|
2806
|
+
ret.vs.props = ret.props;
|
|
2807
|
+
ret.props = extend({}, ret.props, { key: branchKey });
|
|
2808
|
+
ret.key = branchKey;
|
|
2809
|
+
}
|
|
2732
2810
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2733
2811
|
return ret;
|
|
2734
2812
|
}
|
|
@@ -3932,7 +4010,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3932
4010
|
if (nextKeys.length !== Object.keys(prevProps).length) return true;
|
|
3933
4011
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
3934
4012
|
const key = nextKeys[i];
|
|
3935
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
4013
|
+
if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3936
4014
|
}
|
|
3937
4015
|
return false;
|
|
3938
4016
|
}
|
|
@@ -4655,7 +4733,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4655
4733
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4656
4734
|
const oldVNode = oldChildren[i];
|
|
4657
4735
|
const newVNode = newChildren[i];
|
|
4658
|
-
const
|
|
4736
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
4737
|
+
const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
|
|
4659
4738
|
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4660
4739
|
}
|
|
4661
4740
|
};
|
|
@@ -4752,6 +4831,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4752
4831
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4753
4832
|
if (!!(process.env.NODE_ENV !== "production")) pushWarningContext(n2);
|
|
4754
4833
|
n2.el = n1.el;
|
|
4834
|
+
n2.placeholder = n1.placeholder;
|
|
4755
4835
|
updateComponentPreRender(instance, n2, optimized);
|
|
4756
4836
|
if (!!(process.env.NODE_ENV !== "production")) popWarningContext();
|
|
4757
4837
|
return;
|
|
@@ -4761,6 +4841,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4761
4841
|
}
|
|
4762
4842
|
} else {
|
|
4763
4843
|
n2.el = n1.el;
|
|
4844
|
+
n2.placeholder = n1.placeholder;
|
|
4764
4845
|
instance.vnode = n2;
|
|
4765
4846
|
}
|
|
4766
4847
|
};
|
|
@@ -5107,12 +5188,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5107
5188
|
};
|
|
5108
5189
|
const remove = (vnode) => {
|
|
5109
5190
|
const { type, el, anchor, transition } = vnode;
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
else remove(child);
|
|
5114
|
-
});
|
|
5115
|
-
else removeFragment(el, anchor);
|
|
5191
|
+
const isFragment = type === Fragment;
|
|
5192
|
+
if (isFragment && !transition) {
|
|
5193
|
+
removeFragment(el, anchor);
|
|
5116
5194
|
return;
|
|
5117
5195
|
}
|
|
5118
5196
|
if (type === Static) {
|
|
@@ -5120,8 +5198,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5120
5198
|
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5121
5199
|
return;
|
|
5122
5200
|
}
|
|
5123
|
-
|
|
5124
|
-
|
|
5201
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
5202
|
+
const performRemove = () => {
|
|
5203
|
+
if (isFragment) {
|
|
5204
|
+
if (hostParentNode(el)) removeFragment(el, anchor);
|
|
5205
|
+
} else hostRemove(el);
|
|
5206
|
+
};
|
|
5207
|
+
if (transition) {
|
|
5208
|
+
let leavingEl = leavingNode && leavingNode.el;
|
|
5209
|
+
let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
|
|
5210
|
+
if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
|
|
5211
|
+
leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
|
|
5212
|
+
isElement = !!leavingEl;
|
|
5213
|
+
}
|
|
5214
|
+
performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
|
|
5215
|
+
} else performRemove();
|
|
5125
5216
|
};
|
|
5126
5217
|
const removeFragment = (cur, end) => {
|
|
5127
5218
|
let next;
|
|
@@ -5164,15 +5255,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5164
5255
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
5165
5256
|
};
|
|
5166
5257
|
const render = (vnode, container, namespace) => {
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5174
|
-
container._vnode = vnode;
|
|
5175
|
-
flushOnAppMount(instance);
|
|
5258
|
+
flushOnAppMount(() => {
|
|
5259
|
+
if (vnode == null) {
|
|
5260
|
+
if (container._vnode) unmount(container._vnode, null, null, true);
|
|
5261
|
+
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5262
|
+
container._vnode = vnode;
|
|
5263
|
+
}, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
|
|
5176
5264
|
};
|
|
5177
5265
|
const internals = {
|
|
5178
5266
|
p: patch,
|
|
@@ -5567,13 +5655,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5567
5655
|
registerDep(instance, onResolve) {
|
|
5568
5656
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5569
5657
|
if (isInPendingSuspense) suspense.deps++;
|
|
5570
|
-
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
5571
5658
|
instance.asyncDep.catch((err) => {
|
|
5572
5659
|
handleError(err, instance, 0);
|
|
5573
5660
|
}).then((asyncSetupResult) => {
|
|
5574
5661
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
5575
5662
|
setCurrentInstance(null, void 0);
|
|
5576
|
-
if (
|
|
5663
|
+
if (!instance.scope.active) {
|
|
5577
5664
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
5578
5665
|
return;
|
|
5579
5666
|
}
|
|
@@ -5886,7 +5973,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5886
5973
|
ctx: vnode.ctx,
|
|
5887
5974
|
ce: vnode.ce,
|
|
5888
5975
|
vi: vnode.vi,
|
|
5889
|
-
vs: cloneVaporSlotMeta(vnode),
|
|
5976
|
+
vs: cloneVaporSlotMeta(vnode, extraProps),
|
|
5890
5977
|
vb: vnode.vb,
|
|
5891
5978
|
ibu: vnode.ibu,
|
|
5892
5979
|
iu: vnode.iu,
|
|
@@ -5895,13 +5982,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5895
5982
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5896
5983
|
return cloned;
|
|
5897
5984
|
}
|
|
5898
|
-
function cloneVaporSlotMeta(vnode) {
|
|
5985
|
+
function cloneVaporSlotMeta(vnode, extraProps) {
|
|
5899
5986
|
const vaporSlot = vnode.vs;
|
|
5900
5987
|
if (!vaporSlot) return vaporSlot;
|
|
5901
5988
|
const cloned = {
|
|
5902
5989
|
slot: vaporSlot.slot,
|
|
5903
|
-
outlets: vaporSlot.outlets
|
|
5990
|
+
outlets: vaporSlot.outlets,
|
|
5991
|
+
props: vaporSlot.props
|
|
5904
5992
|
};
|
|
5993
|
+
if (vaporSlot.props && extraProps) {
|
|
5994
|
+
let extraSlotProps;
|
|
5995
|
+
for (const key in extraProps) if (key !== "key") {
|
|
5996
|
+
if (!extraSlotProps) extraSlotProps = {};
|
|
5997
|
+
extraSlotProps[key] = extraProps[key];
|
|
5998
|
+
}
|
|
5999
|
+
if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
|
|
6000
|
+
}
|
|
5905
6001
|
if (vnode.el) {
|
|
5906
6002
|
cloned.state = vaporSlot.state;
|
|
5907
6003
|
cloned.ref = vaporSlot.ref;
|
|
@@ -6093,6 +6189,9 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
6093
6189
|
//#region packages/runtime-core/src/component.ts
|
|
6094
6190
|
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
6095
6191
|
let uid = 0;
|
|
6192
|
+
function getNextUid() {
|
|
6193
|
+
return uid;
|
|
6194
|
+
}
|
|
6096
6195
|
/**
|
|
6097
6196
|
* @internal for vapor
|
|
6098
6197
|
*/
|
|
@@ -6618,7 +6717,7 @@ function isMemoSame(cached, memo) {
|
|
|
6618
6717
|
}
|
|
6619
6718
|
//#endregion
|
|
6620
6719
|
//#region packages/runtime-core/src/index.ts
|
|
6621
|
-
const version = "3.6.0-rc.
|
|
6720
|
+
const version = "3.6.0-rc.12";
|
|
6622
6721
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
6623
6722
|
/**
|
|
6624
6723
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -6656,4 +6755,4 @@ const resolveFilter = null;
|
|
|
6656
6755
|
const compatUtils = null;
|
|
6657
6756
|
const DeprecationTypes = null;
|
|
6658
6757
|
//#endregion
|
|
6659
|
-
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, defaultPropGetter, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, expose, filterModelListeners, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, invokeSlotFallback, invokeVNodeHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isUnchangedResourceProp, 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, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveCssVars, 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 };
|
|
6758
|
+
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, defaultPropGetter, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, expose, filterModelListeners, filterSingleRoot, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getNextUid, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, invokeSlotFallback, invokeVNodeHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isUnchangedResourceProp, 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, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveCssVars, 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.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-rc.
|
|
50
|
-
"@vue/reactivity": "3.6.0-rc.
|
|
49
|
+
"@vue/shared": "3.6.0-rc.12",
|
|
50
|
+
"@vue/reactivity": "3.6.0-rc.12"
|
|
51
51
|
}
|
|
52
52
|
}
|