@vue/runtime-core 3.6.0-rc.1 → 3.6.0-rc.10
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 +673 -457
- package/dist/runtime-core.cjs.prod.js +527 -378
- package/dist/runtime-core.d.ts +608 -608
- package/dist/runtime-core.esm-bundler.js +688 -459
- 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.10
|
|
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,32 +320,39 @@ 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) {
|
|
326
331
|
if (postJobs.length) {
|
|
327
332
|
if (activePostJobs) {
|
|
328
|
-
activePostJobs.push(
|
|
333
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
329
334
|
postJobs.length = 0;
|
|
330
335
|
return;
|
|
331
336
|
}
|
|
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,17 +507,19 @@ 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
|
-
const
|
|
522
|
+
const parents = /* @__PURE__ */ new Set();
|
|
498
523
|
const dirtyInstanceSet = new Set(instances);
|
|
499
524
|
for (const instance of instances) {
|
|
500
525
|
const oldComp = normalizeClassComponent(instance.type);
|
|
@@ -513,33 +538,23 @@ function reload(id, newComp) {
|
|
|
513
538
|
instance.ceReload(newComp.styles);
|
|
514
539
|
dirtyInstances.delete(instance);
|
|
515
540
|
} else if (instance.parent) {
|
|
516
|
-
|
|
517
|
-
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
518
|
-
let updates = parentUpdates.get(parent);
|
|
519
|
-
if (!updates) parentUpdates.set(parent, updates = []);
|
|
520
|
-
updates.push([instance, dirtyInstances]);
|
|
521
|
-
}
|
|
541
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
|
|
522
542
|
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
523
543
|
else if (typeof window !== "undefined") window.location.reload();
|
|
524
544
|
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
525
545
|
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
526
546
|
}
|
|
527
|
-
|
|
547
|
+
parents.forEach((parent) => {
|
|
528
548
|
queueJob(() => {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
549
|
+
runWithHmrUpdating(() => {
|
|
550
|
+
if (parent.vapor) parent.hmrRerender();
|
|
551
|
+
else {
|
|
552
|
+
const i = parent;
|
|
553
|
+
if (!(i.effect.flags & 1024)) {
|
|
554
|
+
i.renderCache = [];
|
|
555
|
+
i.effect.run();
|
|
556
|
+
}
|
|
536
557
|
}
|
|
537
|
-
}
|
|
538
|
-
nextTick(() => {
|
|
539
|
-
isHmrUpdating = false;
|
|
540
|
-
});
|
|
541
|
-
updates.forEach(([instance, dirtyInstances]) => {
|
|
542
|
-
dirtyInstances.delete(instance);
|
|
543
558
|
});
|
|
544
559
|
});
|
|
545
560
|
});
|
|
@@ -609,20 +624,20 @@ function devtoolsInitApp(app, version) {
|
|
|
609
624
|
function devtoolsUnmountApp(app) {
|
|
610
625
|
emit$1("app:unmount", app);
|
|
611
626
|
}
|
|
612
|
-
const devtoolsComponentAdded =
|
|
613
|
-
const devtoolsComponentUpdated =
|
|
614
|
-
const _devtoolsComponentRemoved =
|
|
627
|
+
const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
|
|
628
|
+
const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
|
|
629
|
+
const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
|
|
615
630
|
const devtoolsComponentRemoved = (component) => {
|
|
616
631
|
if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && !devtools$1.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
|
|
617
632
|
};
|
|
618
|
-
|
|
633
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
619
634
|
function createDevtoolsComponentHook(hook) {
|
|
620
635
|
return (component) => {
|
|
621
636
|
emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
|
|
622
637
|
};
|
|
623
638
|
}
|
|
624
|
-
const devtoolsPerfStart =
|
|
625
|
-
const devtoolsPerfEnd =
|
|
639
|
+
const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
|
|
640
|
+
const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
|
|
626
641
|
function createDevtoolsPerformanceHook(hook) {
|
|
627
642
|
return (component, type, time) => {
|
|
628
643
|
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
@@ -883,7 +898,7 @@ function instanceWatch(source, value, options) {
|
|
|
883
898
|
}
|
|
884
899
|
const prev = setCurrentInstance(this);
|
|
885
900
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
886
|
-
|
|
901
|
+
restoreCurrentInstance(prev);
|
|
887
902
|
return res;
|
|
888
903
|
}
|
|
889
904
|
function createPathGetter(ctx, path) {
|
|
@@ -905,15 +920,16 @@ const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target inst
|
|
|
905
920
|
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
906
921
|
const resolveTarget = (props, select) => {
|
|
907
922
|
const targetSelector = props && props.to;
|
|
908
|
-
if ((0, _vue_shared.isString)(targetSelector))
|
|
909
|
-
|
|
910
|
-
|
|
923
|
+
if ((0, _vue_shared.isString)(targetSelector)) {
|
|
924
|
+
if (!select) {
|
|
925
|
+
warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
|
|
926
|
+
return null;
|
|
927
|
+
} else {
|
|
928
|
+
const target = select(targetSelector);
|
|
929
|
+
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.`);
|
|
930
|
+
return target;
|
|
931
|
+
}
|
|
911
932
|
} 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
933
|
if (!targetSelector && !isTeleportDisabled(props)) warn$1(`Invalid Teleport target: ${targetSelector}`);
|
|
918
934
|
return targetSelector;
|
|
919
935
|
}
|
|
@@ -951,7 +967,8 @@ const TeleportImpl = {
|
|
|
951
967
|
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
952
968
|
pendingMounts.delete(vnode);
|
|
953
969
|
if (isTeleportDisabled(vnode.props)) {
|
|
954
|
-
|
|
970
|
+
const mountContainer = parentNode(vnode.el) || container;
|
|
971
|
+
mount(vnode, mountContainer, vnode.anchor);
|
|
955
972
|
updateCssVars(vnode, true);
|
|
956
973
|
}
|
|
957
974
|
mountToTarget(vnode);
|
|
@@ -1060,15 +1077,17 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1060
1077
|
const disabled = isTeleportDisabled(vnode.props);
|
|
1061
1078
|
if (target) {
|
|
1062
1079
|
const targetNode = target._lpa || target.firstChild;
|
|
1063
|
-
if (vnode.shapeFlag & 16)
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1080
|
+
if (vnode.shapeFlag & 16) {
|
|
1081
|
+
if (disabled) {
|
|
1082
|
+
hydrateDisabledTeleport(node, vnode);
|
|
1083
|
+
hydrateAnchor(target, targetNode);
|
|
1084
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
|
|
1085
|
+
} else {
|
|
1086
|
+
vnode.anchor = nextSibling(node);
|
|
1087
|
+
hydrateAnchor(target, targetNode);
|
|
1088
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
|
|
1089
|
+
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1090
|
+
}
|
|
1072
1091
|
}
|
|
1073
1092
|
updateCssVars(vnode, disabled);
|
|
1074
1093
|
} else if (disabled) {
|
|
@@ -1156,49 +1175,16 @@ const BaseTransitionImpl = {
|
|
|
1156
1175
|
setup(props, { slots }) {
|
|
1157
1176
|
const instance = getCurrentInstance();
|
|
1158
1177
|
const state = useTransitionState();
|
|
1178
|
+
let resumeAfterLeave;
|
|
1159
1179
|
return () => {
|
|
1160
|
-
const
|
|
1161
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
1180
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
1162
1181
|
if (!child) return;
|
|
1163
1182
|
const rawProps = (0, _vue_reactivity.toRaw)(props);
|
|
1164
1183
|
const { mode } = rawProps;
|
|
1165
1184
|
checkTransitionMode(mode);
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
1170
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
1171
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
1172
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
1173
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
1174
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
1175
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
1176
|
-
state.isLeaving = true;
|
|
1177
|
-
leavingHooks.afterLeave = () => {
|
|
1178
|
-
state.isLeaving = false;
|
|
1179
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
1180
|
-
delete leavingHooks.afterLeave;
|
|
1181
|
-
oldInnerChild = void 0;
|
|
1182
|
-
};
|
|
1183
|
-
return emptyPlaceholder(child);
|
|
1184
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1185
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
1186
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
1187
|
-
el[leaveCbKey] = () => {
|
|
1188
|
-
earlyRemove();
|
|
1189
|
-
el[leaveCbKey] = void 0;
|
|
1190
|
-
delete enterHooks.delayedLeave;
|
|
1191
|
-
oldInnerChild = void 0;
|
|
1192
|
-
};
|
|
1193
|
-
enterHooks.delayedLeave = () => {
|
|
1194
|
-
delayedLeave();
|
|
1195
|
-
delete enterHooks.delayedLeave;
|
|
1196
|
-
oldInnerChild = void 0;
|
|
1197
|
-
};
|
|
1198
|
-
};
|
|
1199
|
-
else oldInnerChild = void 0;
|
|
1200
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
1201
|
-
return child;
|
|
1185
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
1186
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
1187
|
+
}) : _vue_shared.NOOP);
|
|
1202
1188
|
};
|
|
1203
1189
|
}
|
|
1204
1190
|
};
|
|
@@ -1267,8 +1253,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1267
1253
|
persisted,
|
|
1268
1254
|
beforeEnter(el) {
|
|
1269
1255
|
let hook = onBeforeEnter;
|
|
1270
|
-
if (!state.isMounted)
|
|
1271
|
-
|
|
1256
|
+
if (!state.isMounted) {
|
|
1257
|
+
if (appear) hook = onBeforeAppear || onBeforeEnter;
|
|
1258
|
+
else return;
|
|
1259
|
+
}
|
|
1272
1260
|
if (el[leaveCbKey]) el[leaveCbKey](true);
|
|
1273
1261
|
earlyRemove();
|
|
1274
1262
|
callHook(hook, [el]);
|
|
@@ -1278,11 +1266,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1278
1266
|
let hook = onEnter;
|
|
1279
1267
|
let afterHook = onAfterEnter;
|
|
1280
1268
|
let cancelHook = onEnterCancelled;
|
|
1281
|
-
if (!state.isMounted)
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1269
|
+
if (!state.isMounted) {
|
|
1270
|
+
if (appear) {
|
|
1271
|
+
hook = onAppear || onEnter;
|
|
1272
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
1273
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
1274
|
+
} else return;
|
|
1275
|
+
}
|
|
1286
1276
|
let called = false;
|
|
1287
1277
|
el[enterCbKey] = (cancelled) => {
|
|
1288
1278
|
if (called) return;
|
|
@@ -1316,7 +1306,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1316
1306
|
else done();
|
|
1317
1307
|
},
|
|
1318
1308
|
clone(node) {
|
|
1319
|
-
return cloneHooks(node);
|
|
1309
|
+
return cloneHooks ? cloneHooks(node) : hooks;
|
|
1320
1310
|
}
|
|
1321
1311
|
};
|
|
1322
1312
|
return hooks;
|
|
@@ -1340,16 +1330,91 @@ function getInnerChild$1(vnode) {
|
|
|
1340
1330
|
if (shapeFlag & 32 && (0, _vue_shared.isFunction)(children.default)) return children.default();
|
|
1341
1331
|
}
|
|
1342
1332
|
}
|
|
1333
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
1334
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
1335
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
1336
|
+
}
|
|
1337
|
+
/**
|
|
1338
|
+
* @internal
|
|
1339
|
+
*/
|
|
1340
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
1341
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
1342
|
+
const nextInner = getInnerChild$1(next);
|
|
1343
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
1344
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
1345
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
1346
|
+
enterHooks = hooks;
|
|
1347
|
+
});
|
|
1348
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
1349
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
1350
|
+
const mode = props.mode;
|
|
1351
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
1352
|
+
if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
|
|
1353
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
1354
|
+
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
|
+
}
|
|
1356
|
+
return next;
|
|
1357
|
+
}
|
|
1358
|
+
function forwardDelayedLeave(hooks, source) {
|
|
1359
|
+
const delayedLeave = source && source.delayedLeave;
|
|
1360
|
+
if (!delayedLeave) return;
|
|
1361
|
+
hooks.delayedLeave = () => {
|
|
1362
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
1363
|
+
delete hooks.delayedLeave;
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
1367
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
1368
|
+
}
|
|
1369
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
1370
|
+
if (props.mode === "out-in") {
|
|
1371
|
+
state.isLeaving = true;
|
|
1372
|
+
leavingHooks.afterLeave = () => {
|
|
1373
|
+
state.isLeaving = false;
|
|
1374
|
+
resumeAfterLeave();
|
|
1375
|
+
delete leavingHooks.afterLeave;
|
|
1376
|
+
};
|
|
1377
|
+
return true;
|
|
1378
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
1379
|
+
let delayedLeavingVNode = leavingVNode;
|
|
1380
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1381
|
+
const enterHooks = getEnterHooks();
|
|
1382
|
+
if (!enterHooks) {
|
|
1383
|
+
delayedLeave();
|
|
1384
|
+
return;
|
|
1385
|
+
}
|
|
1386
|
+
const vnode = delayedLeavingVNode;
|
|
1387
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1388
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
1389
|
+
el[leaveCbKey] = () => {
|
|
1390
|
+
earlyRemove();
|
|
1391
|
+
el[leaveCbKey] = void 0;
|
|
1392
|
+
delete enterHooks.delayedLeave;
|
|
1393
|
+
delayedLeavingVNode = void 0;
|
|
1394
|
+
};
|
|
1395
|
+
enterHooks.delayedLeave = () => {
|
|
1396
|
+
delayedLeave();
|
|
1397
|
+
delete enterHooks.delayedLeave;
|
|
1398
|
+
delayedLeavingVNode = void 0;
|
|
1399
|
+
};
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
return false;
|
|
1403
|
+
}
|
|
1343
1404
|
function setTransitionHooks(vnode, hooks) {
|
|
1344
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
1345
|
-
else {
|
|
1405
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
1346
1406
|
vnode.transition = hooks;
|
|
1347
|
-
setTransitionHooks(vnode.component
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1407
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
1408
|
+
else {
|
|
1409
|
+
const subTree = vnode.component.subTree;
|
|
1410
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
1411
|
+
}
|
|
1412
|
+
} else if (vnode.shapeFlag & 128) {
|
|
1413
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1414
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1415
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1352
1416
|
} else vnode.transition = hooks;
|
|
1417
|
+
return hooks;
|
|
1353
1418
|
}
|
|
1354
1419
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
1355
1420
|
let ret = [];
|
|
@@ -1373,9 +1438,9 @@ function checkTransitionMode(mode) {
|
|
|
1373
1438
|
}
|
|
1374
1439
|
//#endregion
|
|
1375
1440
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1376
|
-
|
|
1441
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1377
1442
|
function defineComponent(options, extraOptions) {
|
|
1378
|
-
return (0, _vue_shared.isFunction)(options) ? (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
1443
|
+
return (0, _vue_shared.isFunction)(options) ? /*@__PURE__*/ (() => (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }))() : options;
|
|
1379
1444
|
}
|
|
1380
1445
|
//#endregion
|
|
1381
1446
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -1472,15 +1537,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1472
1537
|
if (rawRef.f) {
|
|
1473
1538
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
1474
1539
|
if (isUnmount) (0, _vue_shared.isArray)(existing) && (0, _vue_shared.remove)(existing, refValue);
|
|
1475
|
-
else if (!(0, _vue_shared.isArray)(existing))
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1540
|
+
else if (!(0, _vue_shared.isArray)(existing)) {
|
|
1541
|
+
if (_isString) {
|
|
1542
|
+
refs[ref] = [refValue];
|
|
1543
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
1544
|
+
} else {
|
|
1545
|
+
const newVal = [refValue];
|
|
1546
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
1547
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
1548
|
+
}
|
|
1549
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
1484
1550
|
} else if (_isString) {
|
|
1485
1551
|
refs[ref] = value;
|
|
1486
1552
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -1532,7 +1598,18 @@ const logMismatchError = () => {
|
|
|
1532
1598
|
hasLoggedMismatchError = true;
|
|
1533
1599
|
};
|
|
1534
1600
|
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
1535
|
-
const isMathMLContainer = (container) =>
|
|
1601
|
+
const isMathMLContainer = (container) => {
|
|
1602
|
+
if (!container.namespaceURI.includes("MathML")) return false;
|
|
1603
|
+
if (container.tagName !== "annotation-xml") return true;
|
|
1604
|
+
const encoding = container.getAttribute("encoding");
|
|
1605
|
+
return !encoding || !encoding.includes("html");
|
|
1606
|
+
};
|
|
1607
|
+
/**
|
|
1608
|
+
* Resolve the element namespace a container's children should be created in.
|
|
1609
|
+
* The live DOM is the source of truth, so this also covers containers that are
|
|
1610
|
+
* only known at runtime (interop boundaries, teleport targets).
|
|
1611
|
+
* @internal
|
|
1612
|
+
*/
|
|
1536
1613
|
const getContainerType = (container) => {
|
|
1537
1614
|
if (container.nodeType !== 1) return void 0;
|
|
1538
1615
|
if (isSVGContainer(container)) return "svg";
|
|
@@ -1556,7 +1633,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1556
1633
|
};
|
|
1557
1634
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
1558
1635
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
1559
|
-
const isFragmentStart = isComment(node) && node.data === "[";
|
|
1636
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
|
|
1560
1637
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
1561
1638
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
1562
1639
|
let domType = node.nodeType;
|
|
@@ -1570,11 +1647,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1570
1647
|
let nextNode = null;
|
|
1571
1648
|
switch (type) {
|
|
1572
1649
|
case Text:
|
|
1573
|
-
if (domType !== 3)
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1650
|
+
if (domType !== 3) {
|
|
1651
|
+
if (vnode.children === "") {
|
|
1652
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
1653
|
+
nextNode = node;
|
|
1654
|
+
} else nextNode = onMismatch();
|
|
1655
|
+
} else {
|
|
1578
1656
|
if (node.data !== vnode.children) {
|
|
1579
1657
|
warn$1(`Hydration text mismatch in`, node.parentNode, `\n - rendered on server: ${JSON.stringify(node.data)}\n - expected on client: ${JSON.stringify(vnode.children)}`);
|
|
1580
1658
|
logMismatchError();
|
|
@@ -1611,45 +1689,35 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1611
1689
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1612
1690
|
break;
|
|
1613
1691
|
case VaporSlot:
|
|
1614
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
1692
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
1615
1693
|
break;
|
|
1616
|
-
default: if (shapeFlag & 1)
|
|
1617
|
-
|
|
1618
|
-
|
|
1694
|
+
default: if (shapeFlag & 1) {
|
|
1695
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
1696
|
+
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1697
|
+
} else if (shapeFlag & 6) {
|
|
1619
1698
|
vnode.slotScopeIds = slotScopeIds;
|
|
1620
1699
|
const container = parentNode(node);
|
|
1621
1700
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
1622
1701
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
1623
1702
|
else nextNode = nextSibling(node);
|
|
1624
|
-
if (vnode.type.__vapor)
|
|
1625
|
-
|
|
1626
|
-
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
1627
|
-
if (vnode.dirs) {
|
|
1628
|
-
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
1629
|
-
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
1630
|
-
}
|
|
1631
|
-
}, () => {
|
|
1632
|
-
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
1633
|
-
});
|
|
1634
|
-
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
1635
|
-
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
1636
|
-
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
1637
|
-
} else {
|
|
1703
|
+
if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
|
|
1704
|
+
else {
|
|
1638
1705
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1639
1706
|
const component = vnode.component;
|
|
1640
|
-
if (isAsyncWrapper(vnode)
|
|
1707
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
1641
1708
|
let subTree;
|
|
1642
1709
|
if (isFragmentStart) {
|
|
1643
|
-
subTree = createVNode(
|
|
1710
|
+
subTree = createVNode(Static);
|
|
1644
1711
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1645
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1712
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
1646
1713
|
subTree.el = node;
|
|
1647
1714
|
component.subTree = subTree;
|
|
1648
1715
|
}
|
|
1649
1716
|
}
|
|
1650
|
-
} else if (shapeFlag & 64)
|
|
1651
|
-
|
|
1652
|
-
|
|
1717
|
+
} else if (shapeFlag & 64) {
|
|
1718
|
+
if (domType !== 8) nextNode = onMismatch();
|
|
1719
|
+
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
1720
|
+
} else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
1653
1721
|
else warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
1654
1722
|
}
|
|
1655
1723
|
if (ref != null) setRef(ref, null, parentSuspense, vnode);
|
|
@@ -1701,7 +1769,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1701
1769
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
1702
1770
|
for (const key in props) {
|
|
1703
1771
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
1704
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key))
|
|
1772
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
1773
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
1774
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
1775
|
+
}
|
|
1705
1776
|
}
|
|
1706
1777
|
}
|
|
1707
1778
|
let vnodeHooks;
|
|
@@ -1749,8 +1820,9 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1749
1820
|
const { slotScopeIds: fragmentSlotScopeIds } = vnode;
|
|
1750
1821
|
if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
1751
1822
|
const container = parentNode(node);
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1823
|
+
const first = nextSibling(node);
|
|
1824
|
+
const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1825
|
+
if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
|
|
1754
1826
|
else {
|
|
1755
1827
|
logMismatchError();
|
|
1756
1828
|
insert(vnode.anchor = createComment(`]`), container, next);
|
|
@@ -1759,7 +1831,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1759
1831
|
};
|
|
1760
1832
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
1761
1833
|
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
1762
|
-
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
1834
|
+
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data === "[" || node.data === "(") ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
1763
1835
|
logMismatchError();
|
|
1764
1836
|
}
|
|
1765
1837
|
vnode.el = null;
|
|
@@ -1775,20 +1847,22 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1775
1847
|
const container = parentNode(node);
|
|
1776
1848
|
remove(node);
|
|
1777
1849
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
1778
|
-
if (parentComponent) {
|
|
1850
|
+
if (parentComponent && parentComponent.vnode) {
|
|
1779
1851
|
parentComponent.vnode.el = vnode.el;
|
|
1780
1852
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
1781
1853
|
}
|
|
1782
1854
|
return next;
|
|
1783
1855
|
};
|
|
1784
|
-
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
1856
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
|
|
1785
1857
|
let match = 0;
|
|
1786
1858
|
while (node) {
|
|
1787
1859
|
node = nextSibling(node);
|
|
1788
1860
|
if (node && isComment(node)) {
|
|
1789
1861
|
if (node.data === open) match++;
|
|
1790
|
-
if (node.data === close)
|
|
1791
|
-
|
|
1862
|
+
if (node.data === close) {
|
|
1863
|
+
if (match === 0) return nextSibling(node);
|
|
1864
|
+
else match--;
|
|
1865
|
+
}
|
|
1792
1866
|
}
|
|
1793
1867
|
}
|
|
1794
1868
|
return node;
|
|
@@ -1798,7 +1872,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1798
1872
|
if (parentNode) parentNode.replaceChild(newNode, oldNode);
|
|
1799
1873
|
let parent = parentComponent;
|
|
1800
1874
|
while (parent) {
|
|
1801
|
-
if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
1875
|
+
if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
1802
1876
|
parent = parent.parent;
|
|
1803
1877
|
}
|
|
1804
1878
|
};
|
|
@@ -1807,6 +1881,16 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1807
1881
|
const isTemplateNode = (node) => {
|
|
1808
1882
|
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
1809
1883
|
};
|
|
1884
|
+
const resourceProps = /*@__PURE__*/ new Set([
|
|
1885
|
+
"src",
|
|
1886
|
+
"srcset",
|
|
1887
|
+
"href",
|
|
1888
|
+
"poster"
|
|
1889
|
+
]);
|
|
1890
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
1891
|
+
if (!resourceProps.has(key)) return false;
|
|
1892
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
1893
|
+
}
|
|
1810
1894
|
/**
|
|
1811
1895
|
* Dev only
|
|
1812
1896
|
*/
|
|
@@ -1850,7 +1934,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
1850
1934
|
function getAttributeMismatch(el, key, clientValue) {
|
|
1851
1935
|
let actual;
|
|
1852
1936
|
let expected;
|
|
1853
|
-
if (
|
|
1937
|
+
if (key === "hidden") {
|
|
1938
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
1939
|
+
expected = normalizeHiddenValue(clientValue);
|
|
1940
|
+
} else if ((0, _vue_shared.isBooleanAttr)(key)) {
|
|
1854
1941
|
actual = el.hasAttribute(key);
|
|
1855
1942
|
expected = (0, _vue_shared.includeBooleanAttr)(clientValue);
|
|
1856
1943
|
} else if (clientValue == null) {
|
|
@@ -1878,6 +1965,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
|
|
|
1878
1965
|
}
|
|
1879
1966
|
return false;
|
|
1880
1967
|
}
|
|
1968
|
+
function normalizeHiddenValue(value) {
|
|
1969
|
+
if (!(0, _vue_shared.isRenderableAttrValue)(value)) return false;
|
|
1970
|
+
if ((0, _vue_shared.isString)(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
1971
|
+
return (0, _vue_shared.includeBooleanAttr)(value) ? "" : false;
|
|
1972
|
+
}
|
|
1881
1973
|
function toClassSet(str) {
|
|
1882
1974
|
return new Set(str.trim().split(/\s+/));
|
|
1883
1975
|
}
|
|
@@ -2016,16 +2108,18 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
2016
2108
|
return teardown;
|
|
2017
2109
|
};
|
|
2018
2110
|
function forEachElement(node, cb) {
|
|
2019
|
-
if (isComment(node) && node.data === "[") {
|
|
2111
|
+
if (isComment(node) && (node.data === "[" || node.data === "(")) {
|
|
2112
|
+
const open = node.data;
|
|
2113
|
+
const close = open === "[" ? "]" : ")";
|
|
2020
2114
|
let depth = 1;
|
|
2021
2115
|
let next = node.nextSibling;
|
|
2022
2116
|
while (next) {
|
|
2023
2117
|
if (next.nodeType === 1) {
|
|
2024
2118
|
if (cb(next) === false) break;
|
|
2025
2119
|
} else if (isComment(next)) {
|
|
2026
|
-
if (next.data ===
|
|
2120
|
+
if (next.data === close) {
|
|
2027
2121
|
if (--depth === 0) break;
|
|
2028
|
-
} else if (next.data ===
|
|
2122
|
+
} else if (next.data === open) depth++;
|
|
2029
2123
|
}
|
|
2030
2124
|
next = next.nextSibling;
|
|
2031
2125
|
}
|
|
@@ -2034,14 +2128,14 @@ function forEachElement(node, cb) {
|
|
|
2034
2128
|
//#endregion
|
|
2035
2129
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
2036
2130
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
2037
|
-
|
|
2131
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2038
2132
|
function defineAsyncComponent(source) {
|
|
2039
2133
|
const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
|
|
2040
2134
|
return /* @__PURE__ */ defineComponent({
|
|
2041
2135
|
name: "AsyncComponentWrapper",
|
|
2042
2136
|
__asyncLoader: load,
|
|
2043
2137
|
__asyncHydrate(el, instance, hydrate) {
|
|
2044
|
-
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
|
|
2138
|
+
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
|
|
2045
2139
|
},
|
|
2046
2140
|
get __asyncResolved() {
|
|
2047
2141
|
return getResolvedComp();
|
|
@@ -2160,10 +2254,10 @@ const useAsyncComponentState = (delay, timeout, onError, instance = currentInsta
|
|
|
2160
2254
|
* shared between core and vapor
|
|
2161
2255
|
* @internal
|
|
2162
2256
|
*/
|
|
2163
|
-
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
2257
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
|
|
2164
2258
|
const wasConnected = el.isConnected;
|
|
2165
2259
|
let patched = false;
|
|
2166
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2260
|
+
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2167
2261
|
const performHydrate = () => {
|
|
2168
2262
|
if (patched) {
|
|
2169
2263
|
{
|
|
@@ -2253,10 +2347,13 @@ const KeepAlive = {
|
|
|
2253
2347
|
});
|
|
2254
2348
|
let pendingCacheKey = null;
|
|
2255
2349
|
const cacheSubtree = () => {
|
|
2256
|
-
if (pendingCacheKey != null)
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2350
|
+
if (pendingCacheKey != null) {
|
|
2351
|
+
if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
|
|
2352
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
2353
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
2354
|
+
}, void 0, keepAliveInstance.subTree.suspense);
|
|
2355
|
+
else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
2356
|
+
}
|
|
2260
2357
|
};
|
|
2261
2358
|
onMounted(cacheSubtree);
|
|
2262
2359
|
onUpdated(cacheSubtree);
|
|
@@ -2413,7 +2510,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
2413
2510
|
try {
|
|
2414
2511
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
2415
2512
|
} finally {
|
|
2416
|
-
|
|
2513
|
+
restoreCurrentInstance(prev);
|
|
2417
2514
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
2418
2515
|
}
|
|
2419
2516
|
});
|
|
@@ -2498,23 +2595,25 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2498
2595
|
}
|
|
2499
2596
|
ret = new Array(source.length);
|
|
2500
2597
|
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]);
|
|
2501
|
-
} else if (typeof source === "number")
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
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]));
|
|
2509
|
-
else {
|
|
2510
|
-
const keys = Object.keys(source);
|
|
2511
|
-
ret = new Array(keys.length);
|
|
2512
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2513
|
-
const key = keys[i];
|
|
2514
|
-
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2598
|
+
} else if (typeof source === "number") {
|
|
2599
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
2600
|
+
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
2601
|
+
ret = [];
|
|
2602
|
+
} else {
|
|
2603
|
+
ret = new Array(source);
|
|
2604
|
+
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2515
2605
|
}
|
|
2516
|
-
}
|
|
2517
|
-
|
|
2606
|
+
} else if ((0, _vue_shared.isObject)(source)) {
|
|
2607
|
+
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2608
|
+
else {
|
|
2609
|
+
const keys = Object.keys(source);
|
|
2610
|
+
ret = new Array(keys.length);
|
|
2611
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2612
|
+
const key = keys[i];
|
|
2613
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
} else ret = [];
|
|
2518
2617
|
if (cache) cache[index] = ret;
|
|
2519
2618
|
return ret;
|
|
2520
2619
|
}
|
|
@@ -2539,18 +2638,45 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2539
2638
|
//#endregion
|
|
2540
2639
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
2541
2640
|
/**
|
|
2641
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
2642
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
2643
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
2644
|
+
* "which one". Internal to vapor interop.
|
|
2645
|
+
*/
|
|
2646
|
+
const rawVaporSlotKey = Symbol(`rawVaporSlot`);
|
|
2647
|
+
/**
|
|
2648
|
+
* Invokes a VDOM slot fallback under the outlet owner that produced it, the
|
|
2649
|
+
* way `renderSlot` would have rendered it inline. Vapor interop invokes
|
|
2650
|
+
* fallbacks late, outside any render, so it passes the owner recorded on the
|
|
2651
|
+
* vapor slot vnode. Internal to vapor interop.
|
|
2652
|
+
*/
|
|
2653
|
+
function invokeSlotFallback(fallback, owner) {
|
|
2654
|
+
if (!owner) return fallback();
|
|
2655
|
+
const prev = setCurrentRenderingInstance(owner);
|
|
2656
|
+
const prevStackSize = blockStack.length;
|
|
2657
|
+
try {
|
|
2658
|
+
return fallback();
|
|
2659
|
+
} finally {
|
|
2660
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2661
|
+
setCurrentRenderingInstance(prev);
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
/**
|
|
2542
2665
|
* Compiler runtime helper for rendering `<slot/>`
|
|
2543
2666
|
* @private
|
|
2544
2667
|
*/
|
|
2545
|
-
function renderSlot(slots, name, props
|
|
2668
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2669
|
+
if (props == null) props = {};
|
|
2546
2670
|
let slot = slots[name];
|
|
2547
|
-
|
|
2548
|
-
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
2671
|
+
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
2549
2672
|
if (vaporSlot) {
|
|
2550
2673
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
2551
2674
|
ret.vs = {
|
|
2552
2675
|
slot: vaporSlot,
|
|
2553
|
-
fallback
|
|
2676
|
+
outlets: fallback ? [{
|
|
2677
|
+
fallback,
|
|
2678
|
+
owner: currentRenderingInstance
|
|
2679
|
+
}] : void 0
|
|
2554
2680
|
};
|
|
2555
2681
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2556
2682
|
return ret;
|
|
@@ -2571,9 +2697,15 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
|
2571
2697
|
let rendered;
|
|
2572
2698
|
try {
|
|
2573
2699
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2574
|
-
|
|
2700
|
+
let attached = false;
|
|
2701
|
+
if (fallback && validSlotContent && currentRenderingInstance) {
|
|
2702
|
+
const interop = currentRenderingInstance.appContext.vapor;
|
|
2703
|
+
if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
|
|
2704
|
+
}
|
|
2575
2705
|
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
2576
2706
|
rendered = createBlock(Fragment, { key: (slotKey && !(0, _vue_shared.isSymbol)(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
2707
|
+
if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
|
|
2708
|
+
if (attached) rendered.vo = true;
|
|
2577
2709
|
} catch (err) {
|
|
2578
2710
|
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2579
2711
|
throw err;
|
|
@@ -2591,10 +2723,6 @@ function ensureValidVNode(vnodes) {
|
|
|
2591
2723
|
return true;
|
|
2592
2724
|
}) ? vnodes : null;
|
|
2593
2725
|
}
|
|
2594
|
-
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
2595
|
-
let vaporSlot;
|
|
2596
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
2597
|
-
}
|
|
2598
2726
|
//#endregion
|
|
2599
2727
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
2600
2728
|
/**
|
|
@@ -2622,11 +2750,38 @@ const getPublicInstance = (i) => {
|
|
|
2622
2750
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
2623
2751
|
return getPublicInstance(i.parent);
|
|
2624
2752
|
};
|
|
2753
|
+
const resolveDevRootEl = (vnode) => {
|
|
2754
|
+
let found = false;
|
|
2755
|
+
while (true) {
|
|
2756
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
2757
|
+
const root = filterSingleRoot(vnode.children);
|
|
2758
|
+
if (!root) return;
|
|
2759
|
+
vnode = root;
|
|
2760
|
+
found = true;
|
|
2761
|
+
continue;
|
|
2762
|
+
}
|
|
2763
|
+
const component = vnode.component;
|
|
2764
|
+
if (component && component.subTree) {
|
|
2765
|
+
vnode = component.subTree;
|
|
2766
|
+
continue;
|
|
2767
|
+
}
|
|
2768
|
+
const suspense = vnode.suspense;
|
|
2769
|
+
if (suspense && suspense.activeBranch) {
|
|
2770
|
+
vnode = suspense.activeBranch;
|
|
2771
|
+
continue;
|
|
2772
|
+
}
|
|
2773
|
+
return found ? vnode.el : void 0;
|
|
2774
|
+
}
|
|
2775
|
+
};
|
|
2776
|
+
const getDevRootFragmentEl = (i) => {
|
|
2777
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
2778
|
+
return el === void 0 ? i.vnode.el : el;
|
|
2779
|
+
};
|
|
2625
2780
|
let publicPropertiesMap;
|
|
2626
2781
|
const getPublicPropertiesMap = () => {
|
|
2627
2782
|
if (!publicPropertiesMap) publicPropertiesMap = (0, _vue_shared.extend)(Object.create(null), {
|
|
2628
2783
|
$: (i) => i,
|
|
2629
|
-
$el: (i) => i
|
|
2784
|
+
$el: (i) => getDevRootFragmentEl(i),
|
|
2630
2785
|
$data: (i) => i.data,
|
|
2631
2786
|
$props: (i) => (0, _vue_reactivity.shallowReadonly)(i.props),
|
|
2632
2787
|
$attrs: (i) => (0, _vue_reactivity.shallowReadonly)(i.attrs),
|
|
@@ -2732,7 +2887,7 @@ PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
|
2732
2887
|
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.");
|
|
2733
2888
|
return Reflect.ownKeys(target);
|
|
2734
2889
|
};
|
|
2735
|
-
const RuntimeCompiledPublicInstanceProxyHandlers =
|
|
2890
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ (0, _vue_shared.extend)({}, PublicInstanceProxyHandlers, {
|
|
2736
2891
|
get(target, key) {
|
|
2737
2892
|
if (key === Symbol.unscopables) return;
|
|
2738
2893
|
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
@@ -2904,12 +3059,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
2904
3059
|
for (const key in defaults) {
|
|
2905
3060
|
if (key.startsWith("__skip")) continue;
|
|
2906
3061
|
let opt = props[key];
|
|
2907
|
-
if (opt)
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
3062
|
+
if (opt) {
|
|
3063
|
+
if ((0, _vue_shared.isArray)(opt) || (0, _vue_shared.isFunction)(opt)) opt = props[key] = {
|
|
3064
|
+
type: opt,
|
|
3065
|
+
default: defaults[key]
|
|
3066
|
+
};
|
|
3067
|
+
else opt.default = defaults[key];
|
|
3068
|
+
} else if (opt === null) opt = props[key] = { default: defaults[key] };
|
|
2913
3069
|
else warn$1(`props default key "${key}" has no corresponding declaration.`);
|
|
2914
3070
|
if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
|
|
2915
3071
|
}
|
|
@@ -2959,37 +3115,32 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
2959
3115
|
function withAsyncContext(getAwaitable) {
|
|
2960
3116
|
const ctx = getCurrentGenericInstance();
|
|
2961
3117
|
const inSSRSetup = isInSSRComponentSetup;
|
|
2962
|
-
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
2963
3118
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
2964
3119
|
let awaitable = getAwaitable();
|
|
2965
3120
|
setCurrentInstance(null, void 0);
|
|
2966
3121
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2967
3122
|
const restore = () => {
|
|
2968
|
-
const
|
|
3123
|
+
const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
2969
3124
|
setCurrentInstance(ctx);
|
|
2970
3125
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
2971
|
-
|
|
2972
|
-
return () => {
|
|
2973
|
-
if (reset) reset();
|
|
2974
|
-
if (resetStoppedScope) resetStoppedScope.reset();
|
|
2975
|
-
};
|
|
3126
|
+
return stoppedScope;
|
|
2976
3127
|
};
|
|
2977
3128
|
const cleanup = () => {
|
|
2978
3129
|
setCurrentInstance(null, void 0);
|
|
2979
3130
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2980
3131
|
};
|
|
2981
3132
|
if ((0, _vue_shared.isPromise)(awaitable)) awaitable = awaitable.catch((e) => {
|
|
2982
|
-
const
|
|
3133
|
+
const stoppedScope = restore();
|
|
2983
3134
|
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
2984
|
-
if (
|
|
3135
|
+
if (stoppedScope) stoppedScope.reset();
|
|
2985
3136
|
cleanup();
|
|
2986
3137
|
}));
|
|
2987
3138
|
throw e;
|
|
2988
3139
|
});
|
|
2989
3140
|
return [awaitable, () => {
|
|
2990
|
-
const
|
|
3141
|
+
const stoppedScope = restore();
|
|
2991
3142
|
Promise.resolve().then(() => {
|
|
2992
|
-
if (
|
|
3143
|
+
if (stoppedScope) stoppedScope.reset();
|
|
2993
3144
|
cleanup();
|
|
2994
3145
|
});
|
|
2995
3146
|
}];
|
|
@@ -3052,11 +3203,12 @@ function applyOptions(instance) {
|
|
|
3052
3203
|
const opt = computedOptions[key];
|
|
3053
3204
|
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;
|
|
3054
3205
|
if (get === _vue_shared.NOOP) warn$1(`Computed property "${key}" has no getter.`);
|
|
3206
|
+
const set = !(0, _vue_shared.isFunction)(opt) && (0, _vue_shared.isFunction)(opt.set) ? opt.set.bind(publicThis) : () => {
|
|
3207
|
+
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3208
|
+
};
|
|
3055
3209
|
const c = computed({
|
|
3056
3210
|
get,
|
|
3057
|
-
set
|
|
3058
|
-
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3059
|
-
}
|
|
3211
|
+
set
|
|
3060
3212
|
});
|
|
3061
3213
|
Object.defineProperty(ctx, key, {
|
|
3062
3214
|
enumerable: true,
|
|
@@ -3113,9 +3265,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = _vue_s
|
|
|
3113
3265
|
for (const key in injectOptions) {
|
|
3114
3266
|
const opt = injectOptions[key];
|
|
3115
3267
|
let injected;
|
|
3116
|
-
if ((0, _vue_shared.isObject)(opt))
|
|
3117
|
-
|
|
3118
|
-
|
|
3268
|
+
if ((0, _vue_shared.isObject)(opt)) {
|
|
3269
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
3270
|
+
else injected = inject(opt.from || key);
|
|
3271
|
+
} else injected = inject(opt);
|
|
3119
3272
|
if ((0, _vue_reactivity.isRef)(injected)) Object.defineProperty(ctx, key, {
|
|
3120
3273
|
enumerable: true,
|
|
3121
3274
|
configurable: true,
|
|
@@ -3136,13 +3289,14 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3136
3289
|
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler);
|
|
3137
3290
|
else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
3138
3291
|
} else if ((0, _vue_shared.isFunction)(raw)) watch(getter, raw.bind(publicThis));
|
|
3139
|
-
else if ((0, _vue_shared.isObject)(raw))
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3292
|
+
else if ((0, _vue_shared.isObject)(raw)) {
|
|
3293
|
+
if ((0, _vue_shared.isArray)(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
3294
|
+
else {
|
|
3295
|
+
const handler = (0, _vue_shared.isFunction)(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
3296
|
+
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler, raw);
|
|
3297
|
+
else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
3298
|
+
}
|
|
3299
|
+
} else warn$1(`Invalid watch option: "${key}"`, raw);
|
|
3146
3300
|
}
|
|
3147
3301
|
/**
|
|
3148
3302
|
* Resolve merged options and cache it on the component.
|
|
@@ -3228,7 +3382,7 @@ function mergeObjectOptions(to, from) {
|
|
|
3228
3382
|
}
|
|
3229
3383
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
3230
3384
|
if (to) {
|
|
3231
|
-
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [
|
|
3385
|
+
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
3232
3386
|
return (0, _vue_shared.extend)(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
3233
3387
|
} else return from;
|
|
3234
3388
|
}
|
|
@@ -3347,8 +3501,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
3347
3501
|
} else warn$1(`Cannot unmount an app that is not mounted.`);
|
|
3348
3502
|
},
|
|
3349
3503
|
provide(key, value) {
|
|
3350
|
-
if (key in context.provides)
|
|
3351
|
-
|
|
3504
|
+
if (key in context.provides) {
|
|
3505
|
+
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.`);
|
|
3506
|
+
else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
|
|
3507
|
+
}
|
|
3352
3508
|
context.provides[key] = value;
|
|
3353
3509
|
return app;
|
|
3354
3510
|
},
|
|
@@ -3387,13 +3543,17 @@ function useModel(props, name, options = _vue_shared.EMPTY_OBJ) {
|
|
|
3387
3543
|
const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
|
|
3388
3544
|
const res = (0, _vue_reactivity.customRef)((track, trigger) => {
|
|
3389
3545
|
let localValue;
|
|
3546
|
+
let prevPropValue = _vue_shared.EMPTY_OBJ;
|
|
3390
3547
|
let prevSetValue = _vue_shared.EMPTY_OBJ;
|
|
3391
3548
|
let prevEmittedValue;
|
|
3392
3549
|
watchSyncEffect(() => {
|
|
3393
3550
|
const propValue = props[camelizedName];
|
|
3394
|
-
if ((0, _vue_shared.hasChanged)(
|
|
3395
|
-
|
|
3396
|
-
|
|
3551
|
+
if ((0, _vue_shared.hasChanged)(prevPropValue, propValue)) {
|
|
3552
|
+
prevPropValue = propValue;
|
|
3553
|
+
if ((0, _vue_shared.hasChanged)(localValue, propValue)) {
|
|
3554
|
+
localValue = propValue;
|
|
3555
|
+
trigger();
|
|
3556
|
+
}
|
|
3397
3557
|
}
|
|
3398
3558
|
});
|
|
3399
3559
|
return {
|
|
@@ -3455,12 +3615,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3455
3615
|
if (instance.isUnmounted) return;
|
|
3456
3616
|
{
|
|
3457
3617
|
const { emitsOptions, propsOptions } = instance;
|
|
3458
|
-
if (emitsOptions)
|
|
3459
|
-
if (!
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
if (
|
|
3618
|
+
if (emitsOptions) {
|
|
3619
|
+
if (!(event in emitsOptions) && true) {
|
|
3620
|
+
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.`);
|
|
3621
|
+
} else {
|
|
3622
|
+
const validator = emitsOptions[event];
|
|
3623
|
+
if ((0, _vue_shared.isFunction)(validator)) {
|
|
3624
|
+
if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
3625
|
+
}
|
|
3464
3626
|
}
|
|
3465
3627
|
}
|
|
3466
3628
|
}
|
|
@@ -3469,7 +3631,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3469
3631
|
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
3470
3632
|
if (modifiers) {
|
|
3471
3633
|
if (modifiers.trim) args = rawArgs.map((a) => (0, _vue_shared.isString)(a) ? a.trim() : a);
|
|
3472
|
-
if (modifiers.number) args =
|
|
3634
|
+
if (modifiers.number) args = args.map(_vue_shared.looseToNumber);
|
|
3473
3635
|
}
|
|
3474
3636
|
devtoolsComponentEmit(instance, event, args);
|
|
3475
3637
|
{
|
|
@@ -3596,8 +3758,9 @@ function renderComponentRoot(instance) {
|
|
|
3596
3758
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
3597
3759
|
}
|
|
3598
3760
|
if (vnode.transition) {
|
|
3599
|
-
|
|
3600
|
-
|
|
3761
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
3762
|
+
if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
3763
|
+
setTransitionHooks(child, vnode.transition);
|
|
3601
3764
|
}
|
|
3602
3765
|
if (setRoot) setRoot(root);
|
|
3603
3766
|
else result = root;
|
|
@@ -3648,18 +3811,21 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
3648
3811
|
for (let i = 0; i < children.length; i++) {
|
|
3649
3812
|
const child = children[i];
|
|
3650
3813
|
if (isVNode(child)) {
|
|
3651
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3814
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
3815
|
+
if (singleRoot) return;
|
|
3816
|
+
else {
|
|
3817
|
+
singleRoot = child;
|
|
3818
|
+
if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
3819
|
+
}
|
|
3655
3820
|
}
|
|
3656
3821
|
} else return;
|
|
3657
3822
|
}
|
|
3658
3823
|
return singleRoot;
|
|
3659
3824
|
}
|
|
3825
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || (0, _vue_shared.isOn)(key);
|
|
3660
3826
|
const getFunctionalFallthrough = (attrs) => {
|
|
3661
3827
|
let res;
|
|
3662
|
-
for (const key in attrs) if (
|
|
3828
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
3663
3829
|
return res;
|
|
3664
3830
|
};
|
|
3665
3831
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -3771,16 +3937,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3771
3937
|
let key = propsToUpdate[i];
|
|
3772
3938
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
3773
3939
|
const value = rawProps[key];
|
|
3774
|
-
if (options)
|
|
3775
|
-
if (
|
|
3776
|
-
attrs[key]
|
|
3777
|
-
|
|
3940
|
+
if (options) {
|
|
3941
|
+
if ((0, _vue_shared.hasOwn)(attrs, key)) {
|
|
3942
|
+
if (value !== attrs[key]) {
|
|
3943
|
+
attrs[key] = value;
|
|
3944
|
+
hasAttrsChanged = true;
|
|
3945
|
+
}
|
|
3946
|
+
} else {
|
|
3947
|
+
const camelizedKey = (0, _vue_shared.camelize)(key);
|
|
3948
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3778
3949
|
}
|
|
3779
|
-
} else {
|
|
3780
|
-
const camelizedKey = (0, _vue_shared.camelize)(key);
|
|
3781
|
-
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3782
|
-
}
|
|
3783
|
-
else if (value !== attrs[key]) {
|
|
3950
|
+
} else if (value !== attrs[key]) {
|
|
3784
3951
|
attrs[key] = value;
|
|
3785
3952
|
hasAttrsChanged = true;
|
|
3786
3953
|
}
|
|
@@ -3789,9 +3956,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3789
3956
|
} else {
|
|
3790
3957
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
3791
3958
|
let kebabKey;
|
|
3792
|
-
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)))
|
|
3793
|
-
if (
|
|
3794
|
-
|
|
3959
|
+
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))) {
|
|
3960
|
+
if (options) {
|
|
3961
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
3962
|
+
} else delete props[key];
|
|
3963
|
+
}
|
|
3795
3964
|
if (attrs !== rawCurrentProps) {
|
|
3796
3965
|
for (const key in attrs) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && true) {
|
|
3797
3966
|
delete attrs[key];
|
|
@@ -3810,9 +3979,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3810
3979
|
if ((0, _vue_shared.isReservedProp)(key)) continue;
|
|
3811
3980
|
const value = rawProps[key];
|
|
3812
3981
|
let camelKey;
|
|
3813
|
-
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key)))
|
|
3814
|
-
|
|
3815
|
-
|
|
3982
|
+
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key))) {
|
|
3983
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
3984
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
3985
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3816
3986
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
3817
3987
|
attrs[key] = value;
|
|
3818
3988
|
hasAttrsChanged = true;
|
|
@@ -3859,7 +4029,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
3859
4029
|
const prev = setCurrentInstance(instance);
|
|
3860
4030
|
const props = (0, _vue_reactivity.toRaw)(instance.props);
|
|
3861
4031
|
value = factory.call(null, props);
|
|
3862
|
-
|
|
4032
|
+
restoreCurrentInstance(prev);
|
|
3863
4033
|
return value;
|
|
3864
4034
|
}
|
|
3865
4035
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -3975,7 +4145,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
|
|
|
3975
4145
|
}
|
|
3976
4146
|
if (validator && !validator(value, (0, _vue_reactivity.shallowReadonly)(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
|
|
3977
4147
|
}
|
|
3978
|
-
const isSimpleType =
|
|
4148
|
+
const isSimpleType = /*@__PURE__*/ (0, _vue_shared.makeMap)("String,Number,Boolean,Function,Symbol,BigInt");
|
|
3979
4149
|
/**
|
|
3980
4150
|
* dev only
|
|
3981
4151
|
*/
|
|
@@ -4088,12 +4258,13 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4088
4258
|
let deletionComparisonTarget = _vue_shared.EMPTY_OBJ;
|
|
4089
4259
|
if (vnode.shapeFlag & 32) {
|
|
4090
4260
|
const type = children._;
|
|
4091
|
-
if (type)
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4261
|
+
if (type) {
|
|
4262
|
+
if (isHmrUpdating) {
|
|
4263
|
+
assignSlots(slots, children, optimized);
|
|
4264
|
+
(0, _vue_reactivity.trigger)(instance, "set", "$slots");
|
|
4265
|
+
} else if (optimized && type === 1) needDeletionCheck = false;
|
|
4266
|
+
else assignSlots(slots, children, optimized);
|
|
4267
|
+
} else {
|
|
4097
4268
|
needDeletionCheck = !children.$stable;
|
|
4098
4269
|
normalizeObjectSlots(children, slots, instance);
|
|
4099
4270
|
}
|
|
@@ -4111,7 +4282,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4111
4282
|
let supported;
|
|
4112
4283
|
let perf;
|
|
4113
4284
|
let cachedNow = 0;
|
|
4114
|
-
const p =
|
|
4285
|
+
const p = /*@__PURE__*/ Promise.resolve();
|
|
4115
4286
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = isSupported() ? perf.now() : Date.now());
|
|
4116
4287
|
/**
|
|
4117
4288
|
* @internal
|
|
@@ -4192,6 +4363,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4192
4363
|
optimized = false;
|
|
4193
4364
|
n2.dynamicChildren = null;
|
|
4194
4365
|
}
|
|
4366
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
4367
|
+
if (n2.dynamicChildren === _vue_shared.EMPTY_ARR) n2.dynamicChildren = [];
|
|
4368
|
+
n2.dynamicChildren.hasOnce = true;
|
|
4369
|
+
}
|
|
4195
4370
|
const { type, ref, shapeFlag } = n2;
|
|
4196
4371
|
switch (type) {
|
|
4197
4372
|
case Text:
|
|
@@ -4208,7 +4383,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4208
4383
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4209
4384
|
break;
|
|
4210
4385
|
case VaporSlot:
|
|
4211
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
4386
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
4212
4387
|
break;
|
|
4213
4388
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4214
4389
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -4327,7 +4502,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4327
4502
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
4328
4503
|
};
|
|
4329
4504
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
4330
|
-
for (let i = start; i < children.length; i++)
|
|
4505
|
+
for (let i = start; i < children.length; i++) {
|
|
4506
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
4507
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4508
|
+
}
|
|
4331
4509
|
};
|
|
4332
4510
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4333
4511
|
const el = n2.el = n1.el;
|
|
@@ -4339,6 +4517,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4339
4517
|
let vnodeHook;
|
|
4340
4518
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
4341
4519
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4520
|
+
if (n2.ibu) n2.ibu();
|
|
4342
4521
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4343
4522
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
4344
4523
|
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -4372,8 +4551,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4372
4551
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
4373
4552
|
}
|
|
4374
4553
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
4375
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
4554
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
4376
4555
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4556
|
+
n2.iu && n2.iu();
|
|
4377
4557
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4378
4558
|
}, void 0, parentSuspense);
|
|
4379
4559
|
};
|
|
@@ -4381,7 +4561,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4381
4561
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4382
4562
|
const oldVNode = oldChildren[i];
|
|
4383
4563
|
const newVNode = newChildren[i];
|
|
4384
|
-
|
|
4564
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
4565
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4385
4566
|
}
|
|
4386
4567
|
};
|
|
4387
4568
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -4419,41 +4600,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4419
4600
|
};
|
|
4420
4601
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4421
4602
|
n2.slotScopeIds = slotScopeIds;
|
|
4422
|
-
if (n2.type.__vapor)
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
4432
|
-
});
|
|
4433
|
-
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
4434
|
-
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
4435
|
-
if (vnodeMountedHook) {
|
|
4436
|
-
const scopedVNode = n2;
|
|
4437
|
-
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
4438
|
-
}
|
|
4439
|
-
}
|
|
4440
|
-
else {
|
|
4441
|
-
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
4442
|
-
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
4443
|
-
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4444
|
-
}, () => {
|
|
4445
|
-
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
4446
|
-
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
4447
|
-
});
|
|
4448
|
-
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
4449
|
-
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
4450
|
-
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4451
|
-
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
4452
|
-
}, void 0, parentSuspense);
|
|
4453
|
-
}
|
|
4454
|
-
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
4455
|
-
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
4456
|
-
else updateComponent(n1, n2, optimized);
|
|
4603
|
+
if (n2.type.__vapor) {
|
|
4604
|
+
if (n1 == null) {
|
|
4605
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
4606
|
+
else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
|
|
4607
|
+
} else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
|
|
4608
|
+
} else if (n1 == null) {
|
|
4609
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
4610
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
4611
|
+
} else updateComponent(n1, n2, optimized);
|
|
4457
4612
|
};
|
|
4458
4613
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
4459
4614
|
const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
|
|
@@ -4494,16 +4649,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4494
4649
|
};
|
|
4495
4650
|
const updateComponent = (n1, n2, optimized) => {
|
|
4496
4651
|
const instance = n2.component = n1.component;
|
|
4497
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4652
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
4653
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4654
|
+
pushWarningContext(n2);
|
|
4655
|
+
n2.el = n1.el;
|
|
4656
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
4657
|
+
popWarningContext();
|
|
4658
|
+
return;
|
|
4659
|
+
} else {
|
|
4660
|
+
instance.next = n2;
|
|
4661
|
+
instance.effect.run();
|
|
4662
|
+
}
|
|
4502
4663
|
} else {
|
|
4503
|
-
instance.next = n2;
|
|
4504
|
-
instance.effect.run();
|
|
4505
|
-
}
|
|
4506
|
-
else {
|
|
4507
4664
|
n2.el = n1.el;
|
|
4508
4665
|
instance.vnode = n2;
|
|
4509
4666
|
}
|
|
@@ -4601,6 +4758,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4601
4758
|
} else next = vnode;
|
|
4602
4759
|
if (bu) (0, _vue_shared.invokeArrayFns)(bu);
|
|
4603
4760
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4761
|
+
if (next.ibu) next.ibu();
|
|
4604
4762
|
toggleRecurse(instance, true);
|
|
4605
4763
|
startMeasure(instance, `render`);
|
|
4606
4764
|
const nextTree = renderComponentRoot(instance);
|
|
@@ -4613,7 +4771,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4613
4771
|
next.el = nextTree.el;
|
|
4614
4772
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
4615
4773
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
4616
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
4774
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
4775
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4776
|
+
next.iu && next.iu();
|
|
4777
|
+
}, void 0, parentSuspense);
|
|
4617
4778
|
devtoolsComponentUpdated(instance);
|
|
4618
4779
|
popWarningContext();
|
|
4619
4780
|
}
|
|
@@ -4653,9 +4814,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4653
4814
|
if (shapeFlag & 8) {
|
|
4654
4815
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
4655
4816
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
4656
|
-
} else if (prevShapeFlag & 16)
|
|
4657
|
-
|
|
4658
|
-
|
|
4817
|
+
} else if (prevShapeFlag & 16) {
|
|
4818
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4819
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
4820
|
+
} else {
|
|
4659
4821
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
4660
4822
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4661
4823
|
}
|
|
@@ -4754,15 +4916,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4754
4916
|
const anchorVNode = c2[nextIndex + 1];
|
|
4755
4917
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
4756
4918
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4757
|
-
else if (moved)
|
|
4758
|
-
|
|
4919
|
+
else if (moved) {
|
|
4920
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
4921
|
+
else j--;
|
|
4922
|
+
}
|
|
4759
4923
|
}
|
|
4760
4924
|
}
|
|
4761
4925
|
};
|
|
4762
4926
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
4763
4927
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
4764
4928
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
4765
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
4929
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
4766
4930
|
return;
|
|
4767
4931
|
}
|
|
4768
4932
|
if (shapeFlag & 6) {
|
|
@@ -4787,54 +4951,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4787
4951
|
moveStaticNode(vnode, container, anchor);
|
|
4788
4952
|
return;
|
|
4789
4953
|
}
|
|
4790
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
const remove = () => {
|
|
4954
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
4955
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
4956
|
+
else performTransitionLeave(el, transition, () => {
|
|
4794
4957
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
4795
4958
|
else hostInsert(el, container, anchor);
|
|
4796
|
-
};
|
|
4797
|
-
|
|
4798
|
-
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
4799
|
-
if (el._isLeaving) el[leaveCbKey](true);
|
|
4800
|
-
if (transition.persisted && !wasLeaving) remove();
|
|
4801
|
-
else leave(el, () => {
|
|
4802
|
-
remove();
|
|
4803
|
-
afterLeave && afterLeave();
|
|
4804
|
-
});
|
|
4805
|
-
};
|
|
4806
|
-
if (delayLeave) delayLeave(el, remove, performLeave);
|
|
4807
|
-
else performLeave();
|
|
4808
|
-
}
|
|
4809
|
-
else hostInsert(el, container, anchor);
|
|
4959
|
+
}, true, true);
|
|
4960
|
+
} else hostInsert(el, container, anchor);
|
|
4810
4961
|
};
|
|
4811
4962
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
4812
4963
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
4813
|
-
if (patchFlag === -2) optimized = false;
|
|
4964
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
4814
4965
|
if (ref != null) {
|
|
4815
4966
|
const prevSub = (0, _vue_reactivity.setActiveSub)();
|
|
4816
4967
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
4817
4968
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
4818
4969
|
}
|
|
4819
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
4970
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
4820
4971
|
if (shapeFlag & 256) {
|
|
4821
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
4972
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
4822
4973
|
else parentComponent.ctx.deactivate(vnode);
|
|
4823
4974
|
return;
|
|
4824
4975
|
}
|
|
4976
|
+
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
4977
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
4978
|
+
return;
|
|
4979
|
+
}
|
|
4825
4980
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
4826
4981
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
4827
4982
|
let vnodeHook;
|
|
4828
4983
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
4829
|
-
if (shapeFlag & 6)
|
|
4830
|
-
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
4831
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
4832
|
-
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
4833
|
-
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
4834
|
-
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
4835
|
-
}, void 0, parentSuspense);
|
|
4836
|
-
return;
|
|
4837
|
-
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
4984
|
+
if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
4838
4985
|
else {
|
|
4839
4986
|
if (shapeFlag & 128) {
|
|
4840
4987
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -4845,7 +4992,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4845
4992
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
4846
4993
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
4847
4994
|
if (type === VaporSlot) {
|
|
4848
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
4995
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
4849
4996
|
return;
|
|
4850
4997
|
}
|
|
4851
4998
|
if (doRemove) remove(vnode);
|
|
@@ -4869,6 +5016,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4869
5016
|
}
|
|
4870
5017
|
if (type === Static) {
|
|
4871
5018
|
removeStaticNode(vnode);
|
|
5019
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
4872
5020
|
return;
|
|
4873
5021
|
}
|
|
4874
5022
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -4893,7 +5041,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4893
5041
|
if (effect) {
|
|
4894
5042
|
effect.stop();
|
|
4895
5043
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
4896
|
-
} else if (
|
|
5044
|
+
} else if (instance.vnode.el && subTree) {
|
|
5045
|
+
subTree.transition = instance.vnode.transition;
|
|
5046
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5047
|
+
}
|
|
4897
5048
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
4898
5049
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
4899
5050
|
devtoolsComponentRemoved(instance);
|
|
@@ -4967,12 +5118,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
4967
5118
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
4968
5119
|
}
|
|
4969
5120
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
4970
|
-
if (!vapor)
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
5121
|
+
if (!vapor) {
|
|
5122
|
+
if (allowed) {
|
|
5123
|
+
effect.flags |= 128;
|
|
5124
|
+
job.flags |= 2;
|
|
5125
|
+
} else {
|
|
5126
|
+
effect.flags &= -129;
|
|
5127
|
+
job.flags &= -3;
|
|
5128
|
+
}
|
|
4976
5129
|
}
|
|
4977
5130
|
}
|
|
4978
5131
|
function needTransition(parentSuspense, transition) {
|
|
@@ -5012,8 +5165,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
5012
5165
|
}
|
|
5013
5166
|
function locateNonHydratedAsyncRoot(instance) {
|
|
5014
5167
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
5015
|
-
if (subComponent)
|
|
5016
|
-
|
|
5168
|
+
if (subComponent) {
|
|
5169
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
5170
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
5171
|
+
}
|
|
5017
5172
|
}
|
|
5018
5173
|
function invalidateMount(hooks) {
|
|
5019
5174
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
@@ -5032,13 +5187,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
5032
5187
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
5033
5188
|
const performRemove = () => {
|
|
5034
5189
|
remove();
|
|
5035
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5190
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
5036
5191
|
};
|
|
5037
5192
|
if (force || isElement && transition && !transition.persisted) {
|
|
5038
5193
|
const { leave, delayLeave } = transition;
|
|
5039
5194
|
const performLeave = () => {
|
|
5195
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
5040
5196
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
5041
|
-
|
|
5197
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
5198
|
+
else leave(el, performRemove);
|
|
5042
5199
|
};
|
|
5043
5200
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
5044
5201
|
else performLeave();
|
|
@@ -5057,7 +5214,7 @@ function isVaporComponent(type) {
|
|
|
5057
5214
|
/**
|
|
5058
5215
|
* shared between vdom and vapor
|
|
5059
5216
|
*/
|
|
5060
|
-
function getInheritedScopeIds(vnode, parentComponent) {
|
|
5217
|
+
function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
|
|
5061
5218
|
const inheritedScopeIds = [];
|
|
5062
5219
|
let currentParent = parentComponent;
|
|
5063
5220
|
let currentVNode = vnode;
|
|
@@ -5073,6 +5230,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
5073
5230
|
currentParent = currentParent.parent;
|
|
5074
5231
|
} else break;
|
|
5075
5232
|
}
|
|
5233
|
+
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
5234
|
+
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
5076
5235
|
return inheritedScopeIds;
|
|
5077
5236
|
}
|
|
5078
5237
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
@@ -5091,7 +5250,7 @@ const Suspense = {
|
|
|
5091
5250
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
5092
5251
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
5093
5252
|
else {
|
|
5094
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
5253
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
5095
5254
|
n2.suspense = n1.suspense;
|
|
5096
5255
|
n2.suspense.vnode = n2;
|
|
5097
5256
|
n2.el = n1.el;
|
|
@@ -5129,10 +5288,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5129
5288
|
if (pendingBranch) {
|
|
5130
5289
|
suspense.pendingBranch = newBranch;
|
|
5131
5290
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
5132
|
-
|
|
5291
|
+
suspense.deps++;
|
|
5292
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
5293
|
+
suspense.deps--;
|
|
5133
5294
|
if (suspense.deps <= 0) suspense.resolve();
|
|
5134
5295
|
else if (isInFallback) {
|
|
5135
|
-
if (!isHydrating) {
|
|
5296
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
5136
5297
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5137
5298
|
setActiveBranch(suspense, newFallback);
|
|
5138
5299
|
}
|
|
@@ -5144,12 +5305,16 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5144
5305
|
suspense.activeBranch = pendingBranch;
|
|
5145
5306
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
5146
5307
|
suspense.deps = 0;
|
|
5308
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
5309
|
+
const effect = suspense.effects[i];
|
|
5310
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
5311
|
+
}
|
|
5147
5312
|
suspense.effects.length = 0;
|
|
5148
5313
|
suspense.hiddenContainer = createElement("div");
|
|
5149
5314
|
if (isInFallback) {
|
|
5150
5315
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
5151
5316
|
if (suspense.deps <= 0) suspense.resolve();
|
|
5152
|
-
else {
|
|
5317
|
+
else if (!suspense.isFallbackMountPending) {
|
|
5153
5318
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5154
5319
|
setActiveBranch(suspense, newFallback);
|
|
5155
5320
|
}
|
|
@@ -5251,7 +5416,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5251
5416
|
let hasUnresolvedAncestor = false;
|
|
5252
5417
|
while (parent) {
|
|
5253
5418
|
if (parent.pendingBranch) {
|
|
5254
|
-
parent.effects.push(
|
|
5419
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
5255
5420
|
hasUnresolvedAncestor = true;
|
|
5256
5421
|
break;
|
|
5257
5422
|
}
|
|
@@ -5261,6 +5426,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5261
5426
|
suspense.effects = [];
|
|
5262
5427
|
if (isSuspensible) {
|
|
5263
5428
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
5429
|
+
parentSuspenseId = void 0;
|
|
5264
5430
|
parentSuspense.deps--;
|
|
5265
5431
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
5266
5432
|
}
|
|
@@ -5275,8 +5441,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5275
5441
|
const mountFallback = () => {
|
|
5276
5442
|
suspense.isFallbackMountPending = false;
|
|
5277
5443
|
if (!suspense.isInFallback) return;
|
|
5278
|
-
|
|
5279
|
-
|
|
5444
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
5445
|
+
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5446
|
+
setActiveBranch(suspense, latestFallback);
|
|
5280
5447
|
};
|
|
5281
5448
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
5282
5449
|
if (delayEnter) {
|
|
@@ -5297,11 +5464,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5297
5464
|
registerDep(instance, onResolve) {
|
|
5298
5465
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5299
5466
|
if (isInPendingSuspense) suspense.deps++;
|
|
5467
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
5300
5468
|
instance.asyncDep.catch((err) => {
|
|
5301
5469
|
handleError(err, instance, 0);
|
|
5302
5470
|
}).then((asyncSetupResult) => {
|
|
5303
5471
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
5304
5472
|
setCurrentInstance(null, void 0);
|
|
5473
|
+
if (hydratedEl && !instance.scope.active) {
|
|
5474
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
5475
|
+
return;
|
|
5476
|
+
}
|
|
5305
5477
|
instance.asyncResolved = true;
|
|
5306
5478
|
onResolve(asyncSetupResult);
|
|
5307
5479
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -5352,9 +5524,10 @@ function normalizeSuspenseSlot(s) {
|
|
|
5352
5524
|
return s;
|
|
5353
5525
|
}
|
|
5354
5526
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
5355
|
-
if (suspense && suspense.pendingBranch)
|
|
5356
|
-
|
|
5357
|
-
|
|
5527
|
+
if (suspense && suspense.pendingBranch) {
|
|
5528
|
+
if ((0, _vue_shared.isArray)(fn)) suspense.effects.push(...fn);
|
|
5529
|
+
else suspense.effects.push(fn);
|
|
5530
|
+
} else queuePostFlushCb(fn, id);
|
|
5358
5531
|
}
|
|
5359
5532
|
function setActiveBranch(suspense, branch) {
|
|
5360
5533
|
suspense.activeBranch = branch;
|
|
@@ -5521,9 +5694,24 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
5521
5694
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
5522
5695
|
} else if (children) vnode.shapeFlag |= (0, _vue_shared.isString)(children) ? 8 : 16;
|
|
5523
5696
|
if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
5697
|
+
if (props && vnode.shapeFlag & 1) {
|
|
5698
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
5699
|
+
if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
|
|
5700
|
+
}
|
|
5524
5701
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
5525
5702
|
return vnode;
|
|
5526
5703
|
}
|
|
5704
|
+
/**
|
|
5705
|
+
* dev only
|
|
5706
|
+
* Whether children would actually render something. Empty text and empty
|
|
5707
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
5708
|
+
* for `v-html` / `v-text`.
|
|
5709
|
+
*/
|
|
5710
|
+
function hasContentChildren(children) {
|
|
5711
|
+
if ((0, _vue_shared.isString)(children)) return children !== "";
|
|
5712
|
+
if ((0, _vue_shared.isArray)(children)) return children.length > 0;
|
|
5713
|
+
return false;
|
|
5714
|
+
}
|
|
5527
5715
|
const createVNode = createVNodeWithArgsTransform;
|
|
5528
5716
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
5529
5717
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -5533,8 +5721,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
5533
5721
|
if (isVNode(type)) {
|
|
5534
5722
|
const cloned = cloneVNode(type, props, true);
|
|
5535
5723
|
if (children) normalizeChildren(cloned, children);
|
|
5536
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
5537
|
-
|
|
5724
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
5725
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
5726
|
+
else currentBlock.push(cloned);
|
|
5727
|
+
}
|
|
5538
5728
|
cloned.patchFlag = -2;
|
|
5539
5729
|
return cloned;
|
|
5540
5730
|
}
|
|
@@ -5594,7 +5784,10 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5594
5784
|
ce: vnode.ce,
|
|
5595
5785
|
vi: vnode.vi,
|
|
5596
5786
|
vs: cloneVaporSlotMeta(vnode),
|
|
5597
|
-
vb: vnode.vb
|
|
5787
|
+
vb: vnode.vb,
|
|
5788
|
+
ibu: vnode.ibu,
|
|
5789
|
+
iu: vnode.iu,
|
|
5790
|
+
cacheIndex: vnode.cacheIndex
|
|
5598
5791
|
};
|
|
5599
5792
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5600
5793
|
return cloned;
|
|
@@ -5604,8 +5797,7 @@ function cloneVaporSlotMeta(vnode) {
|
|
|
5604
5797
|
if (!vaporSlot) return vaporSlot;
|
|
5605
5798
|
const cloned = {
|
|
5606
5799
|
slot: vaporSlot.slot,
|
|
5607
|
-
|
|
5608
|
-
outletFallback: vaporSlot.outletFallback
|
|
5800
|
+
outlets: vaporSlot.outlets
|
|
5609
5801
|
};
|
|
5610
5802
|
if (vnode.el) {
|
|
5611
5803
|
cloned.state = vaporSlot.state;
|
|
@@ -5657,25 +5849,28 @@ function normalizeChildren(vnode, children) {
|
|
|
5657
5849
|
const { shapeFlag } = vnode;
|
|
5658
5850
|
if (children == null) children = null;
|
|
5659
5851
|
else if ((0, _vue_shared.isArray)(children)) type = 16;
|
|
5660
|
-
else if (typeof children === "object")
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5852
|
+
else if (typeof children === "object") {
|
|
5853
|
+
if (shapeFlag & 65) {
|
|
5854
|
+
const slot = children.default;
|
|
5855
|
+
if (slot) {
|
|
5856
|
+
slot._c && (slot._d = false);
|
|
5857
|
+
normalizeChildren(vnode, slot());
|
|
5858
|
+
slot._c && (slot._d = true);
|
|
5859
|
+
}
|
|
5860
|
+
return;
|
|
5861
|
+
} else {
|
|
5862
|
+
type = 32;
|
|
5863
|
+
const slotFlag = children._;
|
|
5864
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
5865
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
5866
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
5867
|
+
else {
|
|
5868
|
+
children._ = 2;
|
|
5869
|
+
vnode.patchFlag |= 1024;
|
|
5870
|
+
}
|
|
5871
|
+
}
|
|
5676
5872
|
}
|
|
5677
|
-
}
|
|
5678
|
-
else if ((0, _vue_shared.isFunction)(children)) {
|
|
5873
|
+
} else if ((0, _vue_shared.isFunction)(children)) {
|
|
5679
5874
|
if (shapeFlag & 65) {
|
|
5680
5875
|
normalizeChildren(vnode, { default: children });
|
|
5681
5876
|
return;
|
|
@@ -5752,6 +5947,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
5752
5947
|
simpleSetCurrentInstance(instance);
|
|
5753
5948
|
}
|
|
5754
5949
|
};
|
|
5950
|
+
/**
|
|
5951
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
5952
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
5953
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
5954
|
+
* @internal
|
|
5955
|
+
*/
|
|
5956
|
+
const restoreCurrentInstance = (prev) => {
|
|
5957
|
+
(0, _vue_reactivity.setCurrentScope)(prev[1]);
|
|
5958
|
+
simpleSetCurrentInstance(prev[0]);
|
|
5959
|
+
};
|
|
5755
5960
|
const internalOptions = [
|
|
5756
5961
|
"ce",
|
|
5757
5962
|
"type",
|
|
@@ -5783,7 +5988,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
5783
5988
|
};
|
|
5784
5989
|
//#endregion
|
|
5785
5990
|
//#region packages/runtime-core/src/component.ts
|
|
5786
|
-
const emptyAppContext =
|
|
5991
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
5787
5992
|
let uid = 0;
|
|
5788
5993
|
function createComponentInstance(vnode, parent, suspense) {
|
|
5789
5994
|
const type = vnode.type;
|
|
@@ -5903,7 +6108,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5903
6108
|
const setupResult = callWithErrorHandling(setup, instance, 0, [(0, _vue_reactivity.shallowReadonly)(instance.props), setupContext]);
|
|
5904
6109
|
const isAsyncSetup = (0, _vue_shared.isPromise)(setupResult);
|
|
5905
6110
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
5906
|
-
|
|
6111
|
+
restoreCurrentInstance(prev);
|
|
5907
6112
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
5908
6113
|
if (isAsyncSetup) {
|
|
5909
6114
|
const unsetCurrentInstance = () => {
|
|
@@ -5911,7 +6116,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5911
6116
|
};
|
|
5912
6117
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
5913
6118
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
5914
|
-
|
|
6119
|
+
setInSSRSetupState(true);
|
|
6120
|
+
try {
|
|
6121
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
6122
|
+
} finally {
|
|
6123
|
+
setInSSRSetupState(false);
|
|
6124
|
+
}
|
|
5915
6125
|
}).catch((e) => {
|
|
5916
6126
|
handleError(e, instance, 0);
|
|
5917
6127
|
});
|
|
@@ -5923,9 +6133,10 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5923
6133
|
} else finishComponentSetup(instance, isSSR);
|
|
5924
6134
|
}
|
|
5925
6135
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
5926
|
-
if ((0, _vue_shared.isFunction)(setupResult))
|
|
5927
|
-
|
|
5928
|
-
|
|
6136
|
+
if ((0, _vue_shared.isFunction)(setupResult)) {
|
|
6137
|
+
if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
|
|
6138
|
+
else instance.render = setupResult;
|
|
6139
|
+
} else if ((0, _vue_shared.isObject)(setupResult)) {
|
|
5929
6140
|
if (isVNode(setupResult)) warn$1("setup() should not return VNodes directly - return a render function instead.");
|
|
5930
6141
|
instance.devtoolsRawSetupState = setupResult;
|
|
5931
6142
|
instance.setupState = (0, _vue_reactivity.proxyRefs)(setupResult);
|
|
@@ -5973,13 +6184,15 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
5973
6184
|
applyOptions(instance);
|
|
5974
6185
|
} finally {
|
|
5975
6186
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
5976
|
-
|
|
6187
|
+
restoreCurrentInstance(prevInstance);
|
|
5977
6188
|
}
|
|
5978
6189
|
}
|
|
5979
|
-
if (!Component.render && instance.render === _vue_shared.NOOP && !isSSR)
|
|
6190
|
+
if (!Component.render && instance.render === _vue_shared.NOOP && !isSSR) {
|
|
6191
|
+
if (!compile && Component.template)
|
|
5980
6192
|
/* v8 ignore start */
|
|
5981
|
-
|
|
5982
|
-
|
|
6193
|
+
warn$1("Component provided template option but runtime compilation is not supported in this build of Vue.");
|
|
6194
|
+
else warn$1(`Component is missing template or render function: `, Component);
|
|
6195
|
+
}
|
|
5983
6196
|
}
|
|
5984
6197
|
const attrsProxyHandlers = {
|
|
5985
6198
|
get(target, key) {
|
|
@@ -6042,14 +6255,13 @@ function getComponentPublicInstance(instance) {
|
|
|
6042
6255
|
if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy((0, _vue_reactivity.proxyRefs)((0, _vue_reactivity.markRaw)(instance.exposed)), {
|
|
6043
6256
|
get(target, key) {
|
|
6044
6257
|
if (key in target) return target[key];
|
|
6045
|
-
else {
|
|
6258
|
+
else if (!instance.vapor) {
|
|
6046
6259
|
const publicPropertiesMap = getPublicPropertiesMap();
|
|
6047
6260
|
if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
|
|
6048
6261
|
}
|
|
6049
6262
|
},
|
|
6050
6263
|
has(target, key) {
|
|
6051
|
-
|
|
6052
|
-
return key in target || key in publicPropertiesMap;
|
|
6264
|
+
return key in target || !instance.vapor && key in getPublicPropertiesMap();
|
|
6053
6265
|
}
|
|
6054
6266
|
}));
|
|
6055
6267
|
else return instance.proxy;
|
|
@@ -6087,11 +6299,12 @@ function h(type, propsOrChildren, children) {
|
|
|
6087
6299
|
try {
|
|
6088
6300
|
setBlockTracking(-1);
|
|
6089
6301
|
const l = arguments.length;
|
|
6090
|
-
if (l === 2)
|
|
6091
|
-
if (
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6302
|
+
if (l === 2) {
|
|
6303
|
+
if ((0, _vue_shared.isObject)(propsOrChildren) && !(0, _vue_shared.isArray)(propsOrChildren)) {
|
|
6304
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
6305
|
+
return createVNode(type, propsOrChildren);
|
|
6306
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
6307
|
+
} else {
|
|
6095
6308
|
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
6096
6309
|
else if (l === 3 && isVNode(children)) children = [children];
|
|
6097
6310
|
return createVNode(type, propsOrChildren, children);
|
|
@@ -6283,7 +6496,7 @@ function isMemoSame(cached, memo) {
|
|
|
6283
6496
|
}
|
|
6284
6497
|
//#endregion
|
|
6285
6498
|
//#region packages/runtime-core/src/index.ts
|
|
6286
|
-
const version = "3.6.0-rc.
|
|
6499
|
+
const version = "3.6.0-rc.10";
|
|
6287
6500
|
const warn = warn$1;
|
|
6288
6501
|
/**
|
|
6289
6502
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -6306,7 +6519,10 @@ const ssrUtils = {
|
|
|
6306
6519
|
getComponentPublicInstance,
|
|
6307
6520
|
ensureValidVNode,
|
|
6308
6521
|
pushWarningContext,
|
|
6309
|
-
popWarningContext
|
|
6522
|
+
popWarningContext,
|
|
6523
|
+
VaporSlot,
|
|
6524
|
+
rawVaporSlotKey,
|
|
6525
|
+
invokeSlotFallback
|
|
6310
6526
|
};
|
|
6311
6527
|
/**
|
|
6312
6528
|
* @internal only exposed in compat builds
|