@vue/runtime-core 3.6.0-rc.5 → 3.6.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-core.cjs.js +454 -328
- package/dist/runtime-core.cjs.prod.js +331 -259
- package/dist/runtime-core.d.ts +599 -610
- package/dist/runtime-core.esm-bundler.js +455 -329
- 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.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -256,7 +256,7 @@ let currentFlushPromise = null;
|
|
|
256
256
|
let jobsLength = 0;
|
|
257
257
|
let flushIndex = 0;
|
|
258
258
|
let postFlushIndex = 0;
|
|
259
|
-
const resolvedPromise =
|
|
259
|
+
const resolvedPromise = /*@__PURE__*/ Promise.resolve();
|
|
260
260
|
const RECURSION_LIMIT = 100;
|
|
261
261
|
function nextTick(fn) {
|
|
262
262
|
const p = currentFlushPromise || resolvedPromise;
|
|
@@ -295,6 +295,7 @@ const doFlushJobs = () => {
|
|
|
295
295
|
flushJobs();
|
|
296
296
|
} catch (e) {
|
|
297
297
|
currentFlushPromise = null;
|
|
298
|
+
if (jobsLength || postJobs.length) queueFlush();
|
|
298
299
|
throw e;
|
|
299
300
|
}
|
|
300
301
|
};
|
|
@@ -302,9 +303,10 @@ function queueFlush() {
|
|
|
302
303
|
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
303
304
|
}
|
|
304
305
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
305
|
-
if (!(0, _vue_shared.isArray)(jobs))
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
if (!(0, _vue_shared.isArray)(jobs)) {
|
|
307
|
+
if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
308
|
+
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
309
|
+
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
308
310
|
queueFlush();
|
|
309
311
|
}
|
|
310
312
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -318,8 +320,11 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
318
320
|
i--;
|
|
319
321
|
jobsLength--;
|
|
320
322
|
if (cb.flags & 2) cb.flags &= -2;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
+
try {
|
|
324
|
+
cb();
|
|
325
|
+
} finally {
|
|
326
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
327
|
+
}
|
|
323
328
|
}
|
|
324
329
|
}
|
|
325
330
|
function flushPostFlushCbs(seen) {
|
|
@@ -332,18 +337,22 @@ function flushPostFlushCbs(seen) {
|
|
|
332
337
|
activePostJobs = postJobs;
|
|
333
338
|
postJobs = [];
|
|
334
339
|
seen = seen || /* @__PURE__ */ new Map();
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
cb
|
|
341
|
-
|
|
342
|
-
|
|
340
|
+
try {
|
|
341
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
342
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
343
|
+
if (checkRecursiveUpdates(seen, cb)) continue;
|
|
344
|
+
if (cb.flags & 2) cb.flags &= -2;
|
|
345
|
+
if (!(cb.flags & 4)) try {
|
|
346
|
+
cb();
|
|
347
|
+
} finally {
|
|
348
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
349
|
+
}
|
|
343
350
|
}
|
|
351
|
+
} finally {
|
|
352
|
+
while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
|
|
353
|
+
activePostJobs = null;
|
|
354
|
+
postFlushIndex = 0;
|
|
344
355
|
}
|
|
345
|
-
activePostJobs = null;
|
|
346
|
-
postFlushIndex = 0;
|
|
347
356
|
}
|
|
348
357
|
}
|
|
349
358
|
let isFlushing = false;
|
|
@@ -353,9 +362,12 @@ let isFlushing = false;
|
|
|
353
362
|
function flushOnAppMount(instance) {
|
|
354
363
|
if (!isFlushing) {
|
|
355
364
|
isFlushing = true;
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
365
|
+
try {
|
|
366
|
+
flushPreFlushCbs(instance);
|
|
367
|
+
flushPostFlushCbs();
|
|
368
|
+
} finally {
|
|
369
|
+
isFlushing = false;
|
|
370
|
+
}
|
|
359
371
|
}
|
|
360
372
|
}
|
|
361
373
|
function flushJobs(seen) {
|
|
@@ -385,8 +397,8 @@ function flushJobs(seen) {
|
|
|
385
397
|
jobsLength = 0;
|
|
386
398
|
jobs.length = 0;
|
|
387
399
|
flushPostFlushCbs(seen);
|
|
388
|
-
currentFlushPromise = null;
|
|
389
400
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
401
|
+
else currentFlushPromise = null;
|
|
390
402
|
}
|
|
391
403
|
}
|
|
392
404
|
function checkRecursiveUpdates(seen, fn) {
|
|
@@ -417,6 +429,19 @@ const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
|
|
|
417
429
|
rerender: tryWrap(rerender),
|
|
418
430
|
reload: tryWrap(reload)
|
|
419
431
|
};
|
|
432
|
+
function runWithHmrUpdating(fn) {
|
|
433
|
+
isHmrUpdating = true;
|
|
434
|
+
let done = false;
|
|
435
|
+
try {
|
|
436
|
+
fn();
|
|
437
|
+
done = true;
|
|
438
|
+
} finally {
|
|
439
|
+
if (done) nextTick(() => {
|
|
440
|
+
isHmrUpdating = false;
|
|
441
|
+
});
|
|
442
|
+
else isHmrUpdating = false;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
420
445
|
const map = /* @__PURE__ */ new Map();
|
|
421
446
|
function registerHMR(instance) {
|
|
422
447
|
const id = instance.type.__hmrId;
|
|
@@ -458,18 +483,16 @@ function rerender(id, newRender) {
|
|
|
458
483
|
instance.render = newRender;
|
|
459
484
|
normalizeClassComponent(instance.type).render = newRender;
|
|
460
485
|
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
486
|
+
runWithHmrUpdating(() => {
|
|
487
|
+
if (instance.vapor) {
|
|
488
|
+
if (!instance.isUnmounted) instance.hmrRerender();
|
|
489
|
+
} else {
|
|
490
|
+
const i = instance;
|
|
491
|
+
if (!(i.effect.flags & 1024)) {
|
|
492
|
+
i.renderCache = [];
|
|
493
|
+
i.effect.run();
|
|
494
|
+
}
|
|
469
495
|
}
|
|
470
|
-
}
|
|
471
|
-
nextTick(() => {
|
|
472
|
-
isHmrUpdating = false;
|
|
473
496
|
});
|
|
474
497
|
});
|
|
475
498
|
}
|
|
@@ -484,15 +507,17 @@ function reload(id, newComp) {
|
|
|
484
507
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
485
508
|
const dirtyInstances = new Set(instances);
|
|
486
509
|
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
487
|
-
|
|
488
|
-
const
|
|
489
|
-
|
|
490
|
-
if (
|
|
491
|
-
rerenderedParents.
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
510
|
+
runWithHmrUpdating(() => {
|
|
511
|
+
for (const instance of instances) {
|
|
512
|
+
const parent = instance.parent;
|
|
513
|
+
if (parent) {
|
|
514
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
515
|
+
rerenderedParents.add(parent);
|
|
516
|
+
parent.hmrRerender();
|
|
517
|
+
}
|
|
518
|
+
} else instance.hmrReload(newComp);
|
|
519
|
+
}
|
|
520
|
+
});
|
|
496
521
|
} else {
|
|
497
522
|
const parentUpdates = /* @__PURE__ */ new Map();
|
|
498
523
|
const dirtyInstanceSet = new Set(instances);
|
|
@@ -526,21 +551,22 @@ function reload(id, newComp) {
|
|
|
526
551
|
}
|
|
527
552
|
parentUpdates.forEach((updates, parent) => {
|
|
528
553
|
queueJob(() => {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
554
|
+
try {
|
|
555
|
+
runWithHmrUpdating(() => {
|
|
556
|
+
if (parent.vapor) parent.hmrRerender();
|
|
557
|
+
else {
|
|
558
|
+
const i = parent;
|
|
559
|
+
if (!(i.effect.flags & 1024)) {
|
|
560
|
+
i.renderCache = [];
|
|
561
|
+
i.effect.run();
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
} finally {
|
|
566
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
567
|
+
dirtyInstances.delete(instance);
|
|
568
|
+
});
|
|
537
569
|
}
|
|
538
|
-
nextTick(() => {
|
|
539
|
-
isHmrUpdating = false;
|
|
540
|
-
});
|
|
541
|
-
updates.forEach(([instance, dirtyInstances]) => {
|
|
542
|
-
dirtyInstances.delete(instance);
|
|
543
|
-
});
|
|
544
570
|
});
|
|
545
571
|
});
|
|
546
572
|
}
|
|
@@ -609,20 +635,20 @@ function devtoolsInitApp(app, version) {
|
|
|
609
635
|
function devtoolsUnmountApp(app) {
|
|
610
636
|
emit$1("app:unmount", app);
|
|
611
637
|
}
|
|
612
|
-
const devtoolsComponentAdded =
|
|
613
|
-
const devtoolsComponentUpdated =
|
|
614
|
-
const _devtoolsComponentRemoved =
|
|
638
|
+
const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
|
|
639
|
+
const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
|
|
640
|
+
const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
|
|
615
641
|
const devtoolsComponentRemoved = (component) => {
|
|
616
642
|
if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && !devtools$1.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
|
|
617
643
|
};
|
|
618
|
-
|
|
644
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
619
645
|
function createDevtoolsComponentHook(hook) {
|
|
620
646
|
return (component) => {
|
|
621
647
|
emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
|
|
622
648
|
};
|
|
623
649
|
}
|
|
624
|
-
const devtoolsPerfStart =
|
|
625
|
-
const devtoolsPerfEnd =
|
|
650
|
+
const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
|
|
651
|
+
const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
|
|
626
652
|
function createDevtoolsPerformanceHook(hook) {
|
|
627
653
|
return (component, type, time) => {
|
|
628
654
|
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
@@ -905,15 +931,16 @@ const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target inst
|
|
|
905
931
|
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
906
932
|
const resolveTarget = (props, select) => {
|
|
907
933
|
const targetSelector = props && props.to;
|
|
908
|
-
if ((0, _vue_shared.isString)(targetSelector))
|
|
909
|
-
|
|
910
|
-
|
|
934
|
+
if ((0, _vue_shared.isString)(targetSelector)) {
|
|
935
|
+
if (!select) {
|
|
936
|
+
warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
|
|
937
|
+
return null;
|
|
938
|
+
} else {
|
|
939
|
+
const target = select(targetSelector);
|
|
940
|
+
if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
|
|
941
|
+
return target;
|
|
942
|
+
}
|
|
911
943
|
} else {
|
|
912
|
-
const target = select(targetSelector);
|
|
913
|
-
if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
|
|
914
|
-
return target;
|
|
915
|
-
}
|
|
916
|
-
else {
|
|
917
944
|
if (!targetSelector && !isTeleportDisabled(props)) warn$1(`Invalid Teleport target: ${targetSelector}`);
|
|
918
945
|
return targetSelector;
|
|
919
946
|
}
|
|
@@ -951,7 +978,8 @@ const TeleportImpl = {
|
|
|
951
978
|
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
952
979
|
pendingMounts.delete(vnode);
|
|
953
980
|
if (isTeleportDisabled(vnode.props)) {
|
|
954
|
-
|
|
981
|
+
const mountContainer = parentNode(vnode.el) || container;
|
|
982
|
+
mount(vnode, mountContainer, vnode.anchor);
|
|
955
983
|
updateCssVars(vnode, true);
|
|
956
984
|
}
|
|
957
985
|
mountToTarget(vnode);
|
|
@@ -1060,15 +1088,17 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1060
1088
|
const disabled = isTeleportDisabled(vnode.props);
|
|
1061
1089
|
if (target) {
|
|
1062
1090
|
const targetNode = target._lpa || target.firstChild;
|
|
1063
|
-
if (vnode.shapeFlag & 16)
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1091
|
+
if (vnode.shapeFlag & 16) {
|
|
1092
|
+
if (disabled) {
|
|
1093
|
+
hydrateDisabledTeleport(node, vnode);
|
|
1094
|
+
hydrateAnchor(target, targetNode);
|
|
1095
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
|
|
1096
|
+
} else {
|
|
1097
|
+
vnode.anchor = nextSibling(node);
|
|
1098
|
+
hydrateAnchor(target, targetNode);
|
|
1099
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
|
|
1100
|
+
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1101
|
+
}
|
|
1072
1102
|
}
|
|
1073
1103
|
updateCssVars(vnode, disabled);
|
|
1074
1104
|
} else if (disabled) {
|
|
@@ -1234,8 +1264,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1234
1264
|
persisted,
|
|
1235
1265
|
beforeEnter(el) {
|
|
1236
1266
|
let hook = onBeforeEnter;
|
|
1237
|
-
if (!state.isMounted)
|
|
1238
|
-
|
|
1267
|
+
if (!state.isMounted) {
|
|
1268
|
+
if (appear) hook = onBeforeAppear || onBeforeEnter;
|
|
1269
|
+
else return;
|
|
1270
|
+
}
|
|
1239
1271
|
if (el[leaveCbKey]) el[leaveCbKey](true);
|
|
1240
1272
|
earlyRemove();
|
|
1241
1273
|
callHook(hook, [el]);
|
|
@@ -1245,11 +1277,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1245
1277
|
let hook = onEnter;
|
|
1246
1278
|
let afterHook = onAfterEnter;
|
|
1247
1279
|
let cancelHook = onEnterCancelled;
|
|
1248
|
-
if (!state.isMounted)
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1280
|
+
if (!state.isMounted) {
|
|
1281
|
+
if (appear) {
|
|
1282
|
+
hook = onAppear || onEnter;
|
|
1283
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
1284
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
1285
|
+
} else return;
|
|
1286
|
+
}
|
|
1253
1287
|
let called = false;
|
|
1254
1288
|
el[enterCbKey] = (cancelled) => {
|
|
1255
1289
|
if (called) return;
|
|
@@ -1283,7 +1317,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1283
1317
|
else done();
|
|
1284
1318
|
},
|
|
1285
1319
|
clone(node) {
|
|
1286
|
-
return cloneHooks(node);
|
|
1320
|
+
return cloneHooks ? cloneHooks(node) : hooks;
|
|
1287
1321
|
}
|
|
1288
1322
|
};
|
|
1289
1323
|
return hooks;
|
|
@@ -1415,9 +1449,9 @@ function checkTransitionMode(mode) {
|
|
|
1415
1449
|
}
|
|
1416
1450
|
//#endregion
|
|
1417
1451
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1418
|
-
|
|
1452
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1419
1453
|
function defineComponent(options, extraOptions) {
|
|
1420
|
-
return (0, _vue_shared.isFunction)(options) ? (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
1454
|
+
return (0, _vue_shared.isFunction)(options) ? /*@__PURE__*/ (() => (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }))() : options;
|
|
1421
1455
|
}
|
|
1422
1456
|
//#endregion
|
|
1423
1457
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -1514,15 +1548,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1514
1548
|
if (rawRef.f) {
|
|
1515
1549
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
1516
1550
|
if (isUnmount) (0, _vue_shared.isArray)(existing) && (0, _vue_shared.remove)(existing, refValue);
|
|
1517
|
-
else if (!(0, _vue_shared.isArray)(existing))
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1551
|
+
else if (!(0, _vue_shared.isArray)(existing)) {
|
|
1552
|
+
if (_isString) {
|
|
1553
|
+
refs[ref] = [refValue];
|
|
1554
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
1555
|
+
} else {
|
|
1556
|
+
const newVal = [refValue];
|
|
1557
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
1558
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
1559
|
+
}
|
|
1560
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
1526
1561
|
} else if (_isString) {
|
|
1527
1562
|
refs[ref] = value;
|
|
1528
1563
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -1623,11 +1658,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1623
1658
|
let nextNode = null;
|
|
1624
1659
|
switch (type) {
|
|
1625
1660
|
case Text:
|
|
1626
|
-
if (domType !== 3)
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1661
|
+
if (domType !== 3) {
|
|
1662
|
+
if (vnode.children === "") {
|
|
1663
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
1664
|
+
nextNode = node;
|
|
1665
|
+
} else nextNode = onMismatch();
|
|
1666
|
+
} else {
|
|
1631
1667
|
if (node.data !== vnode.children) {
|
|
1632
1668
|
warn$1(`Hydration text mismatch in`, node.parentNode, `\n - rendered on server: ${JSON.stringify(node.data)}\n - expected on client: ${JSON.stringify(vnode.children)}`);
|
|
1633
1669
|
logMismatchError();
|
|
@@ -1666,9 +1702,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1666
1702
|
case VaporSlot:
|
|
1667
1703
|
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
1668
1704
|
break;
|
|
1669
|
-
default: if (shapeFlag & 1)
|
|
1670
|
-
|
|
1671
|
-
|
|
1705
|
+
default: if (shapeFlag & 1) {
|
|
1706
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
1707
|
+
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1708
|
+
} else if (shapeFlag & 6) {
|
|
1672
1709
|
vnode.slotScopeIds = slotScopeIds;
|
|
1673
1710
|
const container = parentNode(node);
|
|
1674
1711
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
@@ -1690,19 +1727,20 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1690
1727
|
} else {
|
|
1691
1728
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1692
1729
|
const component = vnode.component;
|
|
1693
|
-
if (isAsyncWrapper(vnode)
|
|
1730
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep && !component.asyncResolved)) {
|
|
1694
1731
|
let subTree;
|
|
1695
1732
|
if (isFragmentStart) {
|
|
1696
|
-
subTree = createVNode(
|
|
1733
|
+
subTree = createVNode(Static);
|
|
1697
1734
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1698
1735
|
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1699
1736
|
subTree.el = node;
|
|
1700
1737
|
component.subTree = subTree;
|
|
1701
1738
|
}
|
|
1702
1739
|
}
|
|
1703
|
-
} else if (shapeFlag & 64)
|
|
1704
|
-
|
|
1705
|
-
|
|
1740
|
+
} else if (shapeFlag & 64) {
|
|
1741
|
+
if (domType !== 8) nextNode = onMismatch();
|
|
1742
|
+
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
1743
|
+
} else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
1706
1744
|
else warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
1707
1745
|
}
|
|
1708
1746
|
if (ref != null) setRef(ref, null, parentSuspense, vnode);
|
|
@@ -1843,8 +1881,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1843
1881
|
node = nextSibling(node);
|
|
1844
1882
|
if (node && isComment(node)) {
|
|
1845
1883
|
if (node.data === open) match++;
|
|
1846
|
-
if (node.data === close)
|
|
1847
|
-
|
|
1884
|
+
if (node.data === close) {
|
|
1885
|
+
if (match === 0) return nextSibling(node);
|
|
1886
|
+
else match--;
|
|
1887
|
+
}
|
|
1848
1888
|
}
|
|
1849
1889
|
}
|
|
1850
1890
|
return node;
|
|
@@ -1866,7 +1906,7 @@ const isTemplateNode = (node) => {
|
|
|
1866
1906
|
/**
|
|
1867
1907
|
* Dev only
|
|
1868
1908
|
*/
|
|
1869
|
-
const resourceProps =
|
|
1909
|
+
const resourceProps = /*@__PURE__*/ new Set([
|
|
1870
1910
|
"src",
|
|
1871
1911
|
"srcset",
|
|
1872
1912
|
"href",
|
|
@@ -2108,14 +2148,14 @@ function forEachElement(node, cb) {
|
|
|
2108
2148
|
//#endregion
|
|
2109
2149
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
2110
2150
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
2111
|
-
|
|
2151
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2112
2152
|
function defineAsyncComponent(source) {
|
|
2113
2153
|
const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
|
|
2114
2154
|
return /* @__PURE__ */ defineComponent({
|
|
2115
2155
|
name: "AsyncComponentWrapper",
|
|
2116
2156
|
__asyncLoader: load,
|
|
2117
2157
|
__asyncHydrate(el, instance, hydrate) {
|
|
2118
|
-
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
|
|
2158
|
+
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
|
|
2119
2159
|
},
|
|
2120
2160
|
get __asyncResolved() {
|
|
2121
2161
|
return getResolvedComp();
|
|
@@ -2234,10 +2274,10 @@ const useAsyncComponentState = (delay, timeout, onError, instance = currentInsta
|
|
|
2234
2274
|
* shared between core and vapor
|
|
2235
2275
|
* @internal
|
|
2236
2276
|
*/
|
|
2237
|
-
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
2277
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
|
|
2238
2278
|
const wasConnected = el.isConnected;
|
|
2239
2279
|
let patched = false;
|
|
2240
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2280
|
+
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2241
2281
|
const performHydrate = () => {
|
|
2242
2282
|
if (patched) {
|
|
2243
2283
|
{
|
|
@@ -2327,10 +2367,13 @@ const KeepAlive = {
|
|
|
2327
2367
|
});
|
|
2328
2368
|
let pendingCacheKey = null;
|
|
2329
2369
|
const cacheSubtree = () => {
|
|
2330
|
-
if (pendingCacheKey != null)
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2370
|
+
if (pendingCacheKey != null) {
|
|
2371
|
+
if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
|
|
2372
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
2373
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
2374
|
+
}, void 0, keepAliveInstance.subTree.suspense);
|
|
2375
|
+
else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
2376
|
+
}
|
|
2334
2377
|
};
|
|
2335
2378
|
onMounted(cacheSubtree);
|
|
2336
2379
|
onUpdated(cacheSubtree);
|
|
@@ -2572,23 +2615,25 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2572
2615
|
}
|
|
2573
2616
|
ret = new Array(source.length);
|
|
2574
2617
|
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]);
|
|
2575
|
-
} else if (typeof source === "number")
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
else if ((0, _vue_shared.isObject)(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2583
|
-
else {
|
|
2584
|
-
const keys = Object.keys(source);
|
|
2585
|
-
ret = new Array(keys.length);
|
|
2586
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2587
|
-
const key = keys[i];
|
|
2588
|
-
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2618
|
+
} else if (typeof source === "number") {
|
|
2619
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
2620
|
+
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
2621
|
+
ret = [];
|
|
2622
|
+
} else {
|
|
2623
|
+
ret = new Array(source);
|
|
2624
|
+
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2589
2625
|
}
|
|
2590
|
-
}
|
|
2591
|
-
|
|
2626
|
+
} else if ((0, _vue_shared.isObject)(source)) {
|
|
2627
|
+
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2628
|
+
else {
|
|
2629
|
+
const keys = Object.keys(source);
|
|
2630
|
+
ret = new Array(keys.length);
|
|
2631
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2632
|
+
const key = keys[i];
|
|
2633
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
} else ret = [];
|
|
2592
2637
|
if (cache) cache[index] = ret;
|
|
2593
2638
|
return ret;
|
|
2594
2639
|
}
|
|
@@ -2613,14 +2658,27 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2613
2658
|
//#endregion
|
|
2614
2659
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
2615
2660
|
/**
|
|
2661
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
2662
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
2663
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
2664
|
+
* "which one". Internal to vapor interop.
|
|
2665
|
+
*/
|
|
2666
|
+
const rawVaporSlotKey = Symbol(`rawVaporSlot`);
|
|
2667
|
+
/**
|
|
2668
|
+
* Marks a compiler-generated slot fallback as VDOM-rendered so the vapor
|
|
2669
|
+
* interop fallback chain renders it through the VDOM renderer. Internal to
|
|
2670
|
+
* vapor interop.
|
|
2671
|
+
*/
|
|
2672
|
+
const vdomSlotFallbackKey = Symbol(`vdomSlotFallback`);
|
|
2673
|
+
/**
|
|
2616
2674
|
* Compiler runtime helper for rendering `<slot/>`
|
|
2617
2675
|
* @private
|
|
2618
2676
|
*/
|
|
2619
2677
|
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2620
2678
|
if (props == null) props = {};
|
|
2621
2679
|
let slot = slots[name];
|
|
2622
|
-
if (fallback) fallback
|
|
2623
|
-
const vaporSlot = slot &&
|
|
2680
|
+
if (fallback) fallback[vdomSlotFallbackKey] = true;
|
|
2681
|
+
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
2624
2682
|
if (vaporSlot) {
|
|
2625
2683
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
2626
2684
|
ret.vs = {
|
|
@@ -2697,11 +2755,38 @@ const getPublicInstance = (i) => {
|
|
|
2697
2755
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
2698
2756
|
return getPublicInstance(i.parent);
|
|
2699
2757
|
};
|
|
2758
|
+
const resolveDevRootEl = (vnode) => {
|
|
2759
|
+
let found = false;
|
|
2760
|
+
while (true) {
|
|
2761
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
2762
|
+
const root = filterSingleRoot(vnode.children);
|
|
2763
|
+
if (!root) return;
|
|
2764
|
+
vnode = root;
|
|
2765
|
+
found = true;
|
|
2766
|
+
continue;
|
|
2767
|
+
}
|
|
2768
|
+
const component = vnode.component;
|
|
2769
|
+
if (component && component.subTree) {
|
|
2770
|
+
vnode = component.subTree;
|
|
2771
|
+
continue;
|
|
2772
|
+
}
|
|
2773
|
+
const suspense = vnode.suspense;
|
|
2774
|
+
if (suspense && suspense.activeBranch) {
|
|
2775
|
+
vnode = suspense.activeBranch;
|
|
2776
|
+
continue;
|
|
2777
|
+
}
|
|
2778
|
+
return found ? vnode.el : void 0;
|
|
2779
|
+
}
|
|
2780
|
+
};
|
|
2781
|
+
const getDevRootFragmentEl = (i) => {
|
|
2782
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
2783
|
+
return el === void 0 ? i.vnode.el : el;
|
|
2784
|
+
};
|
|
2700
2785
|
let publicPropertiesMap;
|
|
2701
2786
|
const getPublicPropertiesMap = () => {
|
|
2702
2787
|
if (!publicPropertiesMap) publicPropertiesMap = (0, _vue_shared.extend)(Object.create(null), {
|
|
2703
2788
|
$: (i) => i,
|
|
2704
|
-
$el: (i) => i
|
|
2789
|
+
$el: (i) => getDevRootFragmentEl(i),
|
|
2705
2790
|
$data: (i) => i.data,
|
|
2706
2791
|
$props: (i) => (0, _vue_reactivity.shallowReadonly)(i.props),
|
|
2707
2792
|
$attrs: (i) => (0, _vue_reactivity.shallowReadonly)(i.attrs),
|
|
@@ -2807,7 +2892,7 @@ PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
|
2807
2892
|
warn$1("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.");
|
|
2808
2893
|
return Reflect.ownKeys(target);
|
|
2809
2894
|
};
|
|
2810
|
-
const RuntimeCompiledPublicInstanceProxyHandlers =
|
|
2895
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ (0, _vue_shared.extend)({}, PublicInstanceProxyHandlers, {
|
|
2811
2896
|
get(target, key) {
|
|
2812
2897
|
if (key === Symbol.unscopables) return;
|
|
2813
2898
|
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
@@ -2979,12 +3064,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
2979
3064
|
for (const key in defaults) {
|
|
2980
3065
|
if (key.startsWith("__skip")) continue;
|
|
2981
3066
|
let opt = props[key];
|
|
2982
|
-
if (opt)
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
3067
|
+
if (opt) {
|
|
3068
|
+
if ((0, _vue_shared.isArray)(opt) || (0, _vue_shared.isFunction)(opt)) opt = props[key] = {
|
|
3069
|
+
type: opt,
|
|
3070
|
+
default: defaults[key]
|
|
3071
|
+
};
|
|
3072
|
+
else opt.default = defaults[key];
|
|
3073
|
+
} else if (opt === null) opt = props[key] = { default: defaults[key] };
|
|
2988
3074
|
else warn$1(`props default key "${key}" has no corresponding declaration.`);
|
|
2989
3075
|
if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
|
|
2990
3076
|
}
|
|
@@ -3127,11 +3213,12 @@ function applyOptions(instance) {
|
|
|
3127
3213
|
const opt = computedOptions[key];
|
|
3128
3214
|
const get = (0, _vue_shared.isFunction)(opt) ? opt.bind(publicThis, publicThis) : (0, _vue_shared.isFunction)(opt.get) ? opt.get.bind(publicThis, publicThis) : _vue_shared.NOOP;
|
|
3129
3215
|
if (get === _vue_shared.NOOP) warn$1(`Computed property "${key}" has no getter.`);
|
|
3216
|
+
const set = !(0, _vue_shared.isFunction)(opt) && (0, _vue_shared.isFunction)(opt.set) ? opt.set.bind(publicThis) : () => {
|
|
3217
|
+
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3218
|
+
};
|
|
3130
3219
|
const c = computed({
|
|
3131
3220
|
get,
|
|
3132
|
-
set
|
|
3133
|
-
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3134
|
-
}
|
|
3221
|
+
set
|
|
3135
3222
|
});
|
|
3136
3223
|
Object.defineProperty(ctx, key, {
|
|
3137
3224
|
enumerable: true,
|
|
@@ -3188,9 +3275,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = _vue_s
|
|
|
3188
3275
|
for (const key in injectOptions) {
|
|
3189
3276
|
const opt = injectOptions[key];
|
|
3190
3277
|
let injected;
|
|
3191
|
-
if ((0, _vue_shared.isObject)(opt))
|
|
3192
|
-
|
|
3193
|
-
|
|
3278
|
+
if ((0, _vue_shared.isObject)(opt)) {
|
|
3279
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
3280
|
+
else injected = inject(opt.from || key);
|
|
3281
|
+
} else injected = inject(opt);
|
|
3194
3282
|
if ((0, _vue_reactivity.isRef)(injected)) Object.defineProperty(ctx, key, {
|
|
3195
3283
|
enumerable: true,
|
|
3196
3284
|
configurable: true,
|
|
@@ -3211,13 +3299,14 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3211
3299
|
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler);
|
|
3212
3300
|
else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
3213
3301
|
} else if ((0, _vue_shared.isFunction)(raw)) watch(getter, raw.bind(publicThis));
|
|
3214
|
-
else if ((0, _vue_shared.isObject)(raw))
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3302
|
+
else if ((0, _vue_shared.isObject)(raw)) {
|
|
3303
|
+
if ((0, _vue_shared.isArray)(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
3304
|
+
else {
|
|
3305
|
+
const handler = (0, _vue_shared.isFunction)(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
3306
|
+
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler, raw);
|
|
3307
|
+
else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
3308
|
+
}
|
|
3309
|
+
} else warn$1(`Invalid watch option: "${key}"`, raw);
|
|
3221
3310
|
}
|
|
3222
3311
|
/**
|
|
3223
3312
|
* Resolve merged options and cache it on the component.
|
|
@@ -3303,7 +3392,7 @@ function mergeObjectOptions(to, from) {
|
|
|
3303
3392
|
}
|
|
3304
3393
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
3305
3394
|
if (to) {
|
|
3306
|
-
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [
|
|
3395
|
+
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
3307
3396
|
return (0, _vue_shared.extend)(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
3308
3397
|
} else return from;
|
|
3309
3398
|
}
|
|
@@ -3422,8 +3511,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
3422
3511
|
} else warn$1(`Cannot unmount an app that is not mounted.`);
|
|
3423
3512
|
},
|
|
3424
3513
|
provide(key, value) {
|
|
3425
|
-
if (key in context.provides)
|
|
3426
|
-
|
|
3514
|
+
if (key in context.provides) {
|
|
3515
|
+
if ((0, _vue_shared.hasOwn)(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
|
|
3516
|
+
else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
|
|
3517
|
+
}
|
|
3427
3518
|
context.provides[key] = value;
|
|
3428
3519
|
return app;
|
|
3429
3520
|
},
|
|
@@ -3530,12 +3621,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3530
3621
|
if (instance.isUnmounted) return;
|
|
3531
3622
|
{
|
|
3532
3623
|
const { emitsOptions, propsOptions } = instance;
|
|
3533
|
-
if (emitsOptions)
|
|
3534
|
-
if (!
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
if (
|
|
3624
|
+
if (emitsOptions) {
|
|
3625
|
+
if (!(event in emitsOptions) && true) {
|
|
3626
|
+
if (!propsOptions || !propsOptions[0] || !((0, _vue_shared.toHandlerKey)((0, _vue_shared.camelize)(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${(0, _vue_shared.toHandlerKey)((0, _vue_shared.camelize)(event))}" prop.`);
|
|
3627
|
+
} else {
|
|
3628
|
+
const validator = emitsOptions[event];
|
|
3629
|
+
if ((0, _vue_shared.isFunction)(validator)) {
|
|
3630
|
+
if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
3631
|
+
}
|
|
3539
3632
|
}
|
|
3540
3633
|
}
|
|
3541
3634
|
}
|
|
@@ -3544,7 +3637,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3544
3637
|
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
3545
3638
|
if (modifiers) {
|
|
3546
3639
|
if (modifiers.trim) args = rawArgs.map((a) => (0, _vue_shared.isString)(a) ? a.trim() : a);
|
|
3547
|
-
if (modifiers.number) args =
|
|
3640
|
+
if (modifiers.number) args = args.map(_vue_shared.looseToNumber);
|
|
3548
3641
|
}
|
|
3549
3642
|
devtoolsComponentEmit(instance, event, args);
|
|
3550
3643
|
{
|
|
@@ -3724,10 +3817,12 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
3724
3817
|
for (let i = 0; i < children.length; i++) {
|
|
3725
3818
|
const child = children[i];
|
|
3726
3819
|
if (isVNode(child)) {
|
|
3727
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3820
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
3821
|
+
if (singleRoot) return;
|
|
3822
|
+
else {
|
|
3823
|
+
singleRoot = child;
|
|
3824
|
+
if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
3825
|
+
}
|
|
3731
3826
|
}
|
|
3732
3827
|
} else return;
|
|
3733
3828
|
}
|
|
@@ -3848,16 +3943,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3848
3943
|
let key = propsToUpdate[i];
|
|
3849
3944
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
3850
3945
|
const value = rawProps[key];
|
|
3851
|
-
if (options)
|
|
3852
|
-
if (
|
|
3853
|
-
attrs[key]
|
|
3854
|
-
|
|
3946
|
+
if (options) {
|
|
3947
|
+
if ((0, _vue_shared.hasOwn)(attrs, key)) {
|
|
3948
|
+
if (value !== attrs[key]) {
|
|
3949
|
+
attrs[key] = value;
|
|
3950
|
+
hasAttrsChanged = true;
|
|
3951
|
+
}
|
|
3952
|
+
} else {
|
|
3953
|
+
const camelizedKey = (0, _vue_shared.camelize)(key);
|
|
3954
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3855
3955
|
}
|
|
3856
|
-
} else {
|
|
3857
|
-
const camelizedKey = (0, _vue_shared.camelize)(key);
|
|
3858
|
-
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3859
|
-
}
|
|
3860
|
-
else if (value !== attrs[key]) {
|
|
3956
|
+
} else if (value !== attrs[key]) {
|
|
3861
3957
|
attrs[key] = value;
|
|
3862
3958
|
hasAttrsChanged = true;
|
|
3863
3959
|
}
|
|
@@ -3866,9 +3962,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3866
3962
|
} else {
|
|
3867
3963
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
3868
3964
|
let kebabKey;
|
|
3869
|
-
for (const key in rawCurrentProps) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && ((kebabKey = (0, _vue_shared.hyphenate)(key)) === key || !(0, _vue_shared.hasOwn)(rawProps, kebabKey)))
|
|
3870
|
-
if (
|
|
3871
|
-
|
|
3965
|
+
for (const key in rawCurrentProps) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && ((kebabKey = (0, _vue_shared.hyphenate)(key)) === key || !(0, _vue_shared.hasOwn)(rawProps, kebabKey))) {
|
|
3966
|
+
if (options) {
|
|
3967
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
3968
|
+
} else delete props[key];
|
|
3969
|
+
}
|
|
3872
3970
|
if (attrs !== rawCurrentProps) {
|
|
3873
3971
|
for (const key in attrs) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && true) {
|
|
3874
3972
|
delete attrs[key];
|
|
@@ -3887,9 +3985,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3887
3985
|
if ((0, _vue_shared.isReservedProp)(key)) continue;
|
|
3888
3986
|
const value = rawProps[key];
|
|
3889
3987
|
let camelKey;
|
|
3890
|
-
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key)))
|
|
3891
|
-
|
|
3892
|
-
|
|
3988
|
+
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key))) {
|
|
3989
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
3990
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
3991
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3893
3992
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
3894
3993
|
attrs[key] = value;
|
|
3895
3994
|
hasAttrsChanged = true;
|
|
@@ -4052,7 +4151,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
|
|
|
4052
4151
|
}
|
|
4053
4152
|
if (validator && !validator(value, (0, _vue_reactivity.shallowReadonly)(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
|
|
4054
4153
|
}
|
|
4055
|
-
const isSimpleType =
|
|
4154
|
+
const isSimpleType = /*@__PURE__*/ (0, _vue_shared.makeMap)("String,Number,Boolean,Function,Symbol,BigInt");
|
|
4056
4155
|
/**
|
|
4057
4156
|
* dev only
|
|
4058
4157
|
*/
|
|
@@ -4165,12 +4264,13 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4165
4264
|
let deletionComparisonTarget = _vue_shared.EMPTY_OBJ;
|
|
4166
4265
|
if (vnode.shapeFlag & 32) {
|
|
4167
4266
|
const type = children._;
|
|
4168
|
-
if (type)
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4267
|
+
if (type) {
|
|
4268
|
+
if (isHmrUpdating) {
|
|
4269
|
+
assignSlots(slots, children, optimized);
|
|
4270
|
+
(0, _vue_reactivity.trigger)(instance, "set", "$slots");
|
|
4271
|
+
} else if (optimized && type === 1) needDeletionCheck = false;
|
|
4272
|
+
else assignSlots(slots, children, optimized);
|
|
4273
|
+
} else {
|
|
4174
4274
|
needDeletionCheck = !children.$stable;
|
|
4175
4275
|
normalizeObjectSlots(children, slots, instance);
|
|
4176
4276
|
}
|
|
@@ -4188,7 +4288,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4188
4288
|
let supported;
|
|
4189
4289
|
let perf;
|
|
4190
4290
|
let cachedNow = 0;
|
|
4191
|
-
const p =
|
|
4291
|
+
const p = /*@__PURE__*/ Promise.resolve();
|
|
4192
4292
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = isSupported() ? perf.now() : Date.now());
|
|
4193
4293
|
/**
|
|
4194
4294
|
* @internal
|
|
@@ -4404,7 +4504,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4404
4504
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
4405
4505
|
};
|
|
4406
4506
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
4407
|
-
for (let i = start; i < children.length; i++)
|
|
4507
|
+
for (let i = start; i < children.length; i++) {
|
|
4508
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
4509
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4510
|
+
}
|
|
4408
4511
|
};
|
|
4409
4512
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4410
4513
|
const el = n2.el = n1.el;
|
|
@@ -4416,6 +4519,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4416
4519
|
let vnodeHook;
|
|
4417
4520
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
4418
4521
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4522
|
+
if (n2.ibu) n2.ibu();
|
|
4419
4523
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4420
4524
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
4421
4525
|
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -4449,8 +4553,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4449
4553
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
4450
4554
|
}
|
|
4451
4555
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
4452
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
4556
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
4453
4557
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4558
|
+
n2.iu && n2.iu();
|
|
4454
4559
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4455
4560
|
}, void 0, parentSuspense);
|
|
4456
4561
|
};
|
|
@@ -4458,7 +4563,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4458
4563
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4459
4564
|
const oldVNode = oldChildren[i];
|
|
4460
4565
|
const newVNode = newChildren[i];
|
|
4461
|
-
|
|
4566
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
4567
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4462
4568
|
}
|
|
4463
4569
|
};
|
|
4464
4570
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -4496,41 +4602,46 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4496
4602
|
};
|
|
4497
4603
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4498
4604
|
n2.slotScopeIds = slotScopeIds;
|
|
4499
|
-
if (n2.type.__vapor)
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4605
|
+
if (n2.type.__vapor) {
|
|
4606
|
+
if (n1 == null) {
|
|
4607
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
4608
|
+
else {
|
|
4609
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
4610
|
+
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
4611
|
+
if (n2.dirs) {
|
|
4612
|
+
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
4613
|
+
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
4614
|
+
}
|
|
4615
|
+
}, () => {
|
|
4616
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
4617
|
+
});
|
|
4618
|
+
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
4619
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
4620
|
+
if (vnodeMountedHook) {
|
|
4621
|
+
const scopedVNode = n2;
|
|
4622
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
4623
|
+
}
|
|
4506
4624
|
}
|
|
4507
|
-
}
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4625
|
+
} else {
|
|
4626
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
4627
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
4628
|
+
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4629
|
+
}, () => {
|
|
4630
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
4631
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
4632
|
+
if (n2.ibu) n2.ibu();
|
|
4633
|
+
});
|
|
4634
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
4635
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs || n2.iu)) queuePostRenderEffect(() => {
|
|
4636
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4637
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
4638
|
+
n2.iu && n2.iu();
|
|
4639
|
+
}, void 0, parentSuspense);
|
|
4515
4640
|
}
|
|
4516
|
-
}
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4521
|
-
}, () => {
|
|
4522
|
-
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
4523
|
-
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
4524
|
-
});
|
|
4525
|
-
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
4526
|
-
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
4527
|
-
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4528
|
-
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
4529
|
-
}, void 0, parentSuspense);
|
|
4530
|
-
}
|
|
4531
|
-
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
4532
|
-
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
4533
|
-
else updateComponent(n1, n2, optimized);
|
|
4641
|
+
} else if (n1 == null) {
|
|
4642
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
4643
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
4644
|
+
} else updateComponent(n1, n2, optimized);
|
|
4534
4645
|
};
|
|
4535
4646
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
4536
4647
|
const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
|
|
@@ -4571,16 +4682,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4571
4682
|
};
|
|
4572
4683
|
const updateComponent = (n1, n2, optimized) => {
|
|
4573
4684
|
const instance = n2.component = n1.component;
|
|
4574
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4685
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
4686
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4687
|
+
pushWarningContext(n2);
|
|
4688
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
4689
|
+
popWarningContext();
|
|
4690
|
+
return;
|
|
4691
|
+
} else {
|
|
4692
|
+
instance.next = n2;
|
|
4693
|
+
instance.effect.run();
|
|
4694
|
+
}
|
|
4579
4695
|
} else {
|
|
4580
|
-
instance.next = n2;
|
|
4581
|
-
instance.effect.run();
|
|
4582
|
-
}
|
|
4583
|
-
else {
|
|
4584
4696
|
n2.el = n1.el;
|
|
4585
4697
|
instance.vnode = n2;
|
|
4586
4698
|
}
|
|
@@ -4678,6 +4790,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4678
4790
|
} else next = vnode;
|
|
4679
4791
|
if (bu) (0, _vue_shared.invokeArrayFns)(bu);
|
|
4680
4792
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4793
|
+
if (next.ibu) next.ibu();
|
|
4681
4794
|
toggleRecurse(instance, true);
|
|
4682
4795
|
startMeasure(instance, `render`);
|
|
4683
4796
|
const nextTree = renderComponentRoot(instance);
|
|
@@ -4690,7 +4803,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4690
4803
|
next.el = nextTree.el;
|
|
4691
4804
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
4692
4805
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
4693
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
4806
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
4807
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4808
|
+
next.iu && next.iu();
|
|
4809
|
+
}, void 0, parentSuspense);
|
|
4694
4810
|
devtoolsComponentUpdated(instance);
|
|
4695
4811
|
popWarningContext();
|
|
4696
4812
|
}
|
|
@@ -4730,9 +4846,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4730
4846
|
if (shapeFlag & 8) {
|
|
4731
4847
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
4732
4848
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
4733
|
-
} else if (prevShapeFlag & 16)
|
|
4734
|
-
|
|
4735
|
-
|
|
4849
|
+
} else if (prevShapeFlag & 16) {
|
|
4850
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4851
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
4852
|
+
} else {
|
|
4736
4853
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
4737
4854
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4738
4855
|
}
|
|
@@ -4831,8 +4948,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4831
4948
|
const anchorVNode = c2[nextIndex + 1];
|
|
4832
4949
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
4833
4950
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4834
|
-
else if (moved)
|
|
4835
|
-
|
|
4951
|
+
else if (moved) {
|
|
4952
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
4953
|
+
else j--;
|
|
4954
|
+
}
|
|
4836
4955
|
}
|
|
4837
4956
|
}
|
|
4838
4957
|
};
|
|
@@ -4864,26 +4983,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4864
4983
|
moveStaticNode(vnode, container, anchor);
|
|
4865
4984
|
return;
|
|
4866
4985
|
}
|
|
4867
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
const remove = () => {
|
|
4986
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
4987
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
4988
|
+
else performTransitionLeave(el, transition, () => {
|
|
4871
4989
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
4872
4990
|
else hostInsert(el, container, anchor);
|
|
4873
|
-
};
|
|
4874
|
-
|
|
4875
|
-
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
4876
|
-
if (el._isLeaving) el[leaveCbKey](true);
|
|
4877
|
-
if (transition.persisted && !wasLeaving) remove();
|
|
4878
|
-
else leave(el, () => {
|
|
4879
|
-
remove();
|
|
4880
|
-
afterLeave && afterLeave();
|
|
4881
|
-
});
|
|
4882
|
-
};
|
|
4883
|
-
if (delayLeave) delayLeave(el, remove, performLeave);
|
|
4884
|
-
else performLeave();
|
|
4885
|
-
}
|
|
4886
|
-
else hostInsert(el, container, anchor);
|
|
4991
|
+
}, true, true);
|
|
4992
|
+
} else hostInsert(el, container, anchor);
|
|
4887
4993
|
};
|
|
4888
4994
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
4889
4995
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
@@ -4903,16 +5009,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4903
5009
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
4904
5010
|
let vnodeHook;
|
|
4905
5011
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
4906
|
-
if (shapeFlag & 6)
|
|
4907
|
-
if (
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
5012
|
+
if (shapeFlag & 6) {
|
|
5013
|
+
if (isVaporComponent(type)) {
|
|
5014
|
+
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
5015
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
5016
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
5017
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
5018
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5019
|
+
}, void 0, parentSuspense);
|
|
5020
|
+
return;
|
|
5021
|
+
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
5022
|
+
} else {
|
|
4916
5023
|
if (shapeFlag & 128) {
|
|
4917
5024
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
4918
5025
|
return;
|
|
@@ -5044,12 +5151,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
5044
5151
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
5045
5152
|
}
|
|
5046
5153
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
5047
|
-
if (!vapor)
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5154
|
+
if (!vapor) {
|
|
5155
|
+
if (allowed) {
|
|
5156
|
+
effect.flags |= 128;
|
|
5157
|
+
job.flags |= 2;
|
|
5158
|
+
} else {
|
|
5159
|
+
effect.flags &= -129;
|
|
5160
|
+
job.flags &= -3;
|
|
5161
|
+
}
|
|
5053
5162
|
}
|
|
5054
5163
|
}
|
|
5055
5164
|
function needTransition(parentSuspense, transition) {
|
|
@@ -5089,8 +5198,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
5089
5198
|
}
|
|
5090
5199
|
function locateNonHydratedAsyncRoot(instance) {
|
|
5091
5200
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
5092
|
-
if (subComponent)
|
|
5093
|
-
|
|
5201
|
+
if (subComponent) {
|
|
5202
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
5203
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
5204
|
+
}
|
|
5094
5205
|
}
|
|
5095
5206
|
function invalidateMount(hooks) {
|
|
5096
5207
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
@@ -5109,13 +5220,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
5109
5220
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
5110
5221
|
const performRemove = () => {
|
|
5111
5222
|
remove();
|
|
5112
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5223
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
5113
5224
|
};
|
|
5114
5225
|
if (force || isElement && transition && !transition.persisted) {
|
|
5115
5226
|
const { leave, delayLeave } = transition;
|
|
5116
5227
|
const performLeave = () => {
|
|
5228
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
5117
5229
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
5118
|
-
|
|
5230
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
5231
|
+
else leave(el, performRemove);
|
|
5119
5232
|
};
|
|
5120
5233
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
5121
5234
|
else performLeave();
|
|
@@ -5211,7 +5324,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5211
5324
|
patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
5212
5325
|
if (suspense.deps <= 0) suspense.resolve();
|
|
5213
5326
|
else if (isInFallback) {
|
|
5214
|
-
if (!isHydrating) {
|
|
5327
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
5215
5328
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5216
5329
|
setActiveBranch(suspense, newFallback);
|
|
5217
5330
|
}
|
|
@@ -5232,7 +5345,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5232
5345
|
if (isInFallback) {
|
|
5233
5346
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
5234
5347
|
if (suspense.deps <= 0) suspense.resolve();
|
|
5235
|
-
else {
|
|
5348
|
+
else if (!suspense.isFallbackMountPending) {
|
|
5236
5349
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5237
5350
|
setActiveBranch(suspense, newFallback);
|
|
5238
5351
|
}
|
|
@@ -5358,8 +5471,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5358
5471
|
const mountFallback = () => {
|
|
5359
5472
|
suspense.isFallbackMountPending = false;
|
|
5360
5473
|
if (!suspense.isInFallback) return;
|
|
5361
|
-
|
|
5362
|
-
|
|
5474
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
5475
|
+
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5476
|
+
setActiveBranch(suspense, latestFallback);
|
|
5363
5477
|
};
|
|
5364
5478
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
5365
5479
|
if (delayEnter) {
|
|
@@ -5435,9 +5549,10 @@ function normalizeSuspenseSlot(s) {
|
|
|
5435
5549
|
return s;
|
|
5436
5550
|
}
|
|
5437
5551
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
5438
|
-
if (suspense && suspense.pendingBranch)
|
|
5439
|
-
|
|
5440
|
-
|
|
5552
|
+
if (suspense && suspense.pendingBranch) {
|
|
5553
|
+
if ((0, _vue_shared.isArray)(fn)) suspense.effects.push(...fn);
|
|
5554
|
+
else suspense.effects.push(fn);
|
|
5555
|
+
} else queuePostFlushCb(fn, id);
|
|
5441
5556
|
}
|
|
5442
5557
|
function setActiveBranch(suspense, branch) {
|
|
5443
5558
|
suspense.activeBranch = branch;
|
|
@@ -5631,8 +5746,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
5631
5746
|
if (isVNode(type)) {
|
|
5632
5747
|
const cloned = cloneVNode(type, props, true);
|
|
5633
5748
|
if (children) normalizeChildren(cloned, children);
|
|
5634
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
5635
|
-
|
|
5749
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
5750
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
5751
|
+
else currentBlock.push(cloned);
|
|
5752
|
+
}
|
|
5636
5753
|
cloned.patchFlag = -2;
|
|
5637
5754
|
return cloned;
|
|
5638
5755
|
}
|
|
@@ -5692,7 +5809,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5692
5809
|
ce: vnode.ce,
|
|
5693
5810
|
vi: vnode.vi,
|
|
5694
5811
|
vs: cloneVaporSlotMeta(vnode),
|
|
5695
|
-
vb: vnode.vb
|
|
5812
|
+
vb: vnode.vb,
|
|
5813
|
+
ibu: vnode.ibu,
|
|
5814
|
+
iu: vnode.iu
|
|
5696
5815
|
};
|
|
5697
5816
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5698
5817
|
return cloned;
|
|
@@ -5755,25 +5874,28 @@ function normalizeChildren(vnode, children) {
|
|
|
5755
5874
|
const { shapeFlag } = vnode;
|
|
5756
5875
|
if (children == null) children = null;
|
|
5757
5876
|
else if ((0, _vue_shared.isArray)(children)) type = 16;
|
|
5758
|
-
else if (typeof children === "object")
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5877
|
+
else if (typeof children === "object") {
|
|
5878
|
+
if (shapeFlag & 65) {
|
|
5879
|
+
const slot = children.default;
|
|
5880
|
+
if (slot) {
|
|
5881
|
+
slot._c && (slot._d = false);
|
|
5882
|
+
normalizeChildren(vnode, slot());
|
|
5883
|
+
slot._c && (slot._d = true);
|
|
5884
|
+
}
|
|
5885
|
+
return;
|
|
5886
|
+
} else {
|
|
5887
|
+
type = 32;
|
|
5888
|
+
const slotFlag = children._;
|
|
5889
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
5890
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
5891
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
5892
|
+
else {
|
|
5893
|
+
children._ = 2;
|
|
5894
|
+
vnode.patchFlag |= 1024;
|
|
5895
|
+
}
|
|
5896
|
+
}
|
|
5774
5897
|
}
|
|
5775
|
-
}
|
|
5776
|
-
else if ((0, _vue_shared.isFunction)(children)) {
|
|
5898
|
+
} else if ((0, _vue_shared.isFunction)(children)) {
|
|
5777
5899
|
if (shapeFlag & 65) {
|
|
5778
5900
|
normalizeChildren(vnode, { default: children });
|
|
5779
5901
|
return;
|
|
@@ -5891,7 +6013,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
5891
6013
|
};
|
|
5892
6014
|
//#endregion
|
|
5893
6015
|
//#region packages/runtime-core/src/component.ts
|
|
5894
|
-
const emptyAppContext =
|
|
6016
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
5895
6017
|
let uid = 0;
|
|
5896
6018
|
function createComponentInstance(vnode, parent, suspense) {
|
|
5897
6019
|
const type = vnode.type;
|
|
@@ -6036,9 +6158,10 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6036
6158
|
} else finishComponentSetup(instance, isSSR);
|
|
6037
6159
|
}
|
|
6038
6160
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
6039
|
-
if ((0, _vue_shared.isFunction)(setupResult))
|
|
6040
|
-
|
|
6041
|
-
|
|
6161
|
+
if ((0, _vue_shared.isFunction)(setupResult)) {
|
|
6162
|
+
if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
|
|
6163
|
+
else instance.render = setupResult;
|
|
6164
|
+
} else if ((0, _vue_shared.isObject)(setupResult)) {
|
|
6042
6165
|
if (isVNode(setupResult)) warn$1("setup() should not return VNodes directly - return a render function instead.");
|
|
6043
6166
|
instance.devtoolsRawSetupState = setupResult;
|
|
6044
6167
|
instance.setupState = (0, _vue_reactivity.proxyRefs)(setupResult);
|
|
@@ -6089,10 +6212,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
6089
6212
|
restoreCurrentInstance(prevInstance);
|
|
6090
6213
|
}
|
|
6091
6214
|
}
|
|
6092
|
-
if (!Component.render && instance.render === _vue_shared.NOOP && !isSSR)
|
|
6215
|
+
if (!Component.render && instance.render === _vue_shared.NOOP && !isSSR) {
|
|
6216
|
+
if (!compile && Component.template)
|
|
6093
6217
|
/* v8 ignore start */
|
|
6094
|
-
|
|
6095
|
-
|
|
6218
|
+
warn$1("Component provided template option but runtime compilation is not supported in this build of Vue.");
|
|
6219
|
+
else warn$1(`Component is missing template or render function: `, Component);
|
|
6220
|
+
}
|
|
6096
6221
|
}
|
|
6097
6222
|
const attrsProxyHandlers = {
|
|
6098
6223
|
get(target, key) {
|
|
@@ -6200,11 +6325,12 @@ function h(type, propsOrChildren, children) {
|
|
|
6200
6325
|
try {
|
|
6201
6326
|
setBlockTracking(-1);
|
|
6202
6327
|
const l = arguments.length;
|
|
6203
|
-
if (l === 2)
|
|
6204
|
-
if (
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6328
|
+
if (l === 2) {
|
|
6329
|
+
if ((0, _vue_shared.isObject)(propsOrChildren) && !(0, _vue_shared.isArray)(propsOrChildren)) {
|
|
6330
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
6331
|
+
return createVNode(type, propsOrChildren);
|
|
6332
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
6333
|
+
} else {
|
|
6208
6334
|
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
6209
6335
|
else if (l === 3 && isVNode(children)) children = [children];
|
|
6210
6336
|
return createVNode(type, propsOrChildren, children);
|
|
@@ -6396,7 +6522,7 @@ function isMemoSame(cached, memo) {
|
|
|
6396
6522
|
}
|
|
6397
6523
|
//#endregion
|
|
6398
6524
|
//#region packages/runtime-core/src/index.ts
|
|
6399
|
-
const version = "3.6.0-rc.
|
|
6525
|
+
const version = "3.6.0-rc.7";
|
|
6400
6526
|
const warn = warn$1;
|
|
6401
6527
|
/**
|
|
6402
6528
|
* Runtime error messages. Only exposed in dev or esm builds.
|