@vue/runtime-core 3.6.0-rc.1 → 3.6.0-rc.11
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 +686 -462
- package/dist/runtime-core.cjs.prod.js +540 -383
- package/dist/runtime-core.d.ts +608 -608
- package/dist/runtime-core.esm-bundler.js +701 -464
- 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.11
|
|
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) {
|
|
@@ -1146,59 +1165,27 @@ const BaseTransitionPropsValidators = {
|
|
|
1146
1165
|
onAfterAppear: TransitionHookValidator,
|
|
1147
1166
|
onAppearCancelled: TransitionHookValidator
|
|
1148
1167
|
};
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1168
|
+
function isEmptyTransitionChild(vnode, instance) {
|
|
1169
|
+
if (vnode.type === Comment) return true;
|
|
1170
|
+
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
1171
|
+
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
1172
|
+
}
|
|
1153
1173
|
const BaseTransitionImpl = {
|
|
1154
1174
|
name: `BaseTransition`,
|
|
1155
1175
|
props: BaseTransitionPropsValidators,
|
|
1156
1176
|
setup(props, { slots }) {
|
|
1157
1177
|
const instance = getCurrentInstance();
|
|
1158
1178
|
const state = useTransitionState();
|
|
1179
|
+
let resumeAfterLeave;
|
|
1159
1180
|
return () => {
|
|
1160
|
-
const
|
|
1161
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
1181
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
1162
1182
|
if (!child) return;
|
|
1163
1183
|
const rawProps = (0, _vue_reactivity.toRaw)(props);
|
|
1164
1184
|
const { mode } = rawProps;
|
|
1165
1185
|
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;
|
|
1186
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
1187
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
1188
|
+
}) : _vue_shared.NOOP);
|
|
1202
1189
|
};
|
|
1203
1190
|
}
|
|
1204
1191
|
};
|
|
@@ -1230,7 +1217,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
1230
1217
|
function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
1231
1218
|
const key = String(vnode.key);
|
|
1232
1219
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1233
|
-
|
|
1220
|
+
const hooks = baseResolveTransitionHooks({
|
|
1234
1221
|
isLeaving: () => leavingVNodesCache[key] === vnode,
|
|
1235
1222
|
setLeavingNodeCache: () => {
|
|
1236
1223
|
leavingVNodesCache[key] = vnode;
|
|
@@ -1248,6 +1235,13 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1248
1235
|
return hooks;
|
|
1249
1236
|
}
|
|
1250
1237
|
}, props, state, instance);
|
|
1238
|
+
if (vnode.type === VaporSlot) (0, _vue_shared.extend)(hooks, {
|
|
1239
|
+
__vapor: true,
|
|
1240
|
+
props,
|
|
1241
|
+
state,
|
|
1242
|
+
instance
|
|
1243
|
+
});
|
|
1244
|
+
return hooks;
|
|
1251
1245
|
}
|
|
1252
1246
|
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
1253
1247
|
const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
|
|
@@ -1267,8 +1261,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1267
1261
|
persisted,
|
|
1268
1262
|
beforeEnter(el) {
|
|
1269
1263
|
let hook = onBeforeEnter;
|
|
1270
|
-
if (!state.isMounted)
|
|
1271
|
-
|
|
1264
|
+
if (!state.isMounted) {
|
|
1265
|
+
if (appear) hook = onBeforeAppear || onBeforeEnter;
|
|
1266
|
+
else return;
|
|
1267
|
+
}
|
|
1272
1268
|
if (el[leaveCbKey]) el[leaveCbKey](true);
|
|
1273
1269
|
earlyRemove();
|
|
1274
1270
|
callHook(hook, [el]);
|
|
@@ -1278,11 +1274,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1278
1274
|
let hook = onEnter;
|
|
1279
1275
|
let afterHook = onAfterEnter;
|
|
1280
1276
|
let cancelHook = onEnterCancelled;
|
|
1281
|
-
if (!state.isMounted)
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1277
|
+
if (!state.isMounted) {
|
|
1278
|
+
if (appear) {
|
|
1279
|
+
hook = onAppear || onEnter;
|
|
1280
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
1281
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
1282
|
+
} else return;
|
|
1283
|
+
}
|
|
1286
1284
|
let called = false;
|
|
1287
1285
|
el[enterCbKey] = (cancelled) => {
|
|
1288
1286
|
if (called) return;
|
|
@@ -1316,7 +1314,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1316
1314
|
else done();
|
|
1317
1315
|
},
|
|
1318
1316
|
clone(node) {
|
|
1319
|
-
return cloneHooks(node);
|
|
1317
|
+
return cloneHooks ? cloneHooks(node) : hooks;
|
|
1320
1318
|
}
|
|
1321
1319
|
};
|
|
1322
1320
|
return hooks;
|
|
@@ -1340,16 +1338,91 @@ function getInnerChild$1(vnode) {
|
|
|
1340
1338
|
if (shapeFlag & 32 && (0, _vue_shared.isFunction)(children.default)) return children.default();
|
|
1341
1339
|
}
|
|
1342
1340
|
}
|
|
1341
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
1342
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
1343
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* @internal
|
|
1347
|
+
*/
|
|
1348
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
1349
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
1350
|
+
const nextInner = getInnerChild$1(next);
|
|
1351
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
1352
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
1353
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
1354
|
+
enterHooks = hooks;
|
|
1355
|
+
});
|
|
1356
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
1357
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
1358
|
+
const mode = props.mode;
|
|
1359
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
1360
|
+
if (previous && previousInner && !isSameVNodeType(previousInner, nextInner) && !isEmptyTransitionChild(previousInner, instance)) {
|
|
1361
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
1362
|
+
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);
|
|
1363
|
+
}
|
|
1364
|
+
return next;
|
|
1365
|
+
}
|
|
1366
|
+
function forwardDelayedLeave(hooks, source) {
|
|
1367
|
+
const delayedLeave = source && source.delayedLeave;
|
|
1368
|
+
if (!delayedLeave) return;
|
|
1369
|
+
hooks.delayedLeave = () => {
|
|
1370
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
1371
|
+
delete hooks.delayedLeave;
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
1375
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
1376
|
+
}
|
|
1377
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
1378
|
+
if (props.mode === "out-in") {
|
|
1379
|
+
state.isLeaving = true;
|
|
1380
|
+
leavingHooks.afterLeave = () => {
|
|
1381
|
+
state.isLeaving = false;
|
|
1382
|
+
resumeAfterLeave();
|
|
1383
|
+
delete leavingHooks.afterLeave;
|
|
1384
|
+
};
|
|
1385
|
+
return true;
|
|
1386
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
1387
|
+
let delayedLeavingVNode = leavingVNode;
|
|
1388
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1389
|
+
const enterHooks = getEnterHooks();
|
|
1390
|
+
if (!enterHooks) {
|
|
1391
|
+
delayedLeave();
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1394
|
+
const vnode = delayedLeavingVNode;
|
|
1395
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1396
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
1397
|
+
el[leaveCbKey] = () => {
|
|
1398
|
+
earlyRemove();
|
|
1399
|
+
el[leaveCbKey] = void 0;
|
|
1400
|
+
delete enterHooks.delayedLeave;
|
|
1401
|
+
delayedLeavingVNode = void 0;
|
|
1402
|
+
};
|
|
1403
|
+
enterHooks.delayedLeave = () => {
|
|
1404
|
+
delayedLeave();
|
|
1405
|
+
delete enterHooks.delayedLeave;
|
|
1406
|
+
delayedLeavingVNode = void 0;
|
|
1407
|
+
};
|
|
1408
|
+
};
|
|
1409
|
+
}
|
|
1410
|
+
return false;
|
|
1411
|
+
}
|
|
1343
1412
|
function setTransitionHooks(vnode, hooks) {
|
|
1344
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
1345
|
-
else {
|
|
1413
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
1346
1414
|
vnode.transition = hooks;
|
|
1347
|
-
setTransitionHooks(vnode.component
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1415
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
1416
|
+
else {
|
|
1417
|
+
const subTree = vnode.component.subTree;
|
|
1418
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
1419
|
+
}
|
|
1420
|
+
} else if (vnode.shapeFlag & 128) {
|
|
1421
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1422
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1423
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1352
1424
|
} else vnode.transition = hooks;
|
|
1425
|
+
return hooks;
|
|
1353
1426
|
}
|
|
1354
1427
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
1355
1428
|
let ret = [];
|
|
@@ -1373,9 +1446,9 @@ function checkTransitionMode(mode) {
|
|
|
1373
1446
|
}
|
|
1374
1447
|
//#endregion
|
|
1375
1448
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1376
|
-
|
|
1449
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1377
1450
|
function defineComponent(options, extraOptions) {
|
|
1378
|
-
return (0, _vue_shared.isFunction)(options) ? (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
1451
|
+
return (0, _vue_shared.isFunction)(options) ? /*@__PURE__*/ (() => (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }))() : options;
|
|
1379
1452
|
}
|
|
1380
1453
|
//#endregion
|
|
1381
1454
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -1472,15 +1545,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1472
1545
|
if (rawRef.f) {
|
|
1473
1546
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
1474
1547
|
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
|
-
|
|
1548
|
+
else if (!(0, _vue_shared.isArray)(existing)) {
|
|
1549
|
+
if (_isString) {
|
|
1550
|
+
refs[ref] = [refValue];
|
|
1551
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
1552
|
+
} else {
|
|
1553
|
+
const newVal = [refValue];
|
|
1554
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
1555
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
1556
|
+
}
|
|
1557
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
1484
1558
|
} else if (_isString) {
|
|
1485
1559
|
refs[ref] = value;
|
|
1486
1560
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -1532,7 +1606,18 @@ const logMismatchError = () => {
|
|
|
1532
1606
|
hasLoggedMismatchError = true;
|
|
1533
1607
|
};
|
|
1534
1608
|
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
1535
|
-
const isMathMLContainer = (container) =>
|
|
1609
|
+
const isMathMLContainer = (container) => {
|
|
1610
|
+
if (!container.namespaceURI.includes("MathML")) return false;
|
|
1611
|
+
if (container.tagName !== "annotation-xml") return true;
|
|
1612
|
+
const encoding = container.getAttribute("encoding");
|
|
1613
|
+
return !encoding || !encoding.includes("html");
|
|
1614
|
+
};
|
|
1615
|
+
/**
|
|
1616
|
+
* Resolve the element namespace a container's children should be created in.
|
|
1617
|
+
* The live DOM is the source of truth, so this also covers containers that are
|
|
1618
|
+
* only known at runtime (interop boundaries, teleport targets).
|
|
1619
|
+
* @internal
|
|
1620
|
+
*/
|
|
1536
1621
|
const getContainerType = (container) => {
|
|
1537
1622
|
if (container.nodeType !== 1) return void 0;
|
|
1538
1623
|
if (isSVGContainer(container)) return "svg";
|
|
@@ -1556,7 +1641,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1556
1641
|
};
|
|
1557
1642
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
1558
1643
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
1559
|
-
const isFragmentStart = isComment(node) && node.data === "[";
|
|
1644
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
|
|
1560
1645
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
1561
1646
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
1562
1647
|
let domType = node.nodeType;
|
|
@@ -1570,11 +1655,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1570
1655
|
let nextNode = null;
|
|
1571
1656
|
switch (type) {
|
|
1572
1657
|
case Text:
|
|
1573
|
-
if (domType !== 3)
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1658
|
+
if (domType !== 3) {
|
|
1659
|
+
if (vnode.children === "") {
|
|
1660
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
1661
|
+
nextNode = node;
|
|
1662
|
+
} else nextNode = onMismatch();
|
|
1663
|
+
} else {
|
|
1578
1664
|
if (node.data !== vnode.children) {
|
|
1579
1665
|
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
1666
|
logMismatchError();
|
|
@@ -1611,45 +1697,35 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1611
1697
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1612
1698
|
break;
|
|
1613
1699
|
case VaporSlot:
|
|
1614
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
1700
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
1615
1701
|
break;
|
|
1616
|
-
default: if (shapeFlag & 1)
|
|
1617
|
-
|
|
1618
|
-
|
|
1702
|
+
default: if (shapeFlag & 1) {
|
|
1703
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
1704
|
+
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1705
|
+
} else if (shapeFlag & 6) {
|
|
1619
1706
|
vnode.slotScopeIds = slotScopeIds;
|
|
1620
1707
|
const container = parentNode(node);
|
|
1621
1708
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
1622
1709
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
1623
1710
|
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 {
|
|
1711
|
+
if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
|
|
1712
|
+
else {
|
|
1638
1713
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1639
1714
|
const component = vnode.component;
|
|
1640
|
-
if (isAsyncWrapper(vnode)
|
|
1715
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
1641
1716
|
let subTree;
|
|
1642
1717
|
if (isFragmentStart) {
|
|
1643
|
-
subTree = createVNode(
|
|
1718
|
+
subTree = createVNode(Static);
|
|
1644
1719
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1645
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1720
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
1646
1721
|
subTree.el = node;
|
|
1647
1722
|
component.subTree = subTree;
|
|
1648
1723
|
}
|
|
1649
1724
|
}
|
|
1650
|
-
} else if (shapeFlag & 64)
|
|
1651
|
-
|
|
1652
|
-
|
|
1725
|
+
} else if (shapeFlag & 64) {
|
|
1726
|
+
if (domType !== 8) nextNode = onMismatch();
|
|
1727
|
+
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
1728
|
+
} else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
1653
1729
|
else warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
1654
1730
|
}
|
|
1655
1731
|
if (ref != null) setRef(ref, null, parentSuspense, vnode);
|
|
@@ -1701,7 +1777,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1701
1777
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
1702
1778
|
for (const key in props) {
|
|
1703
1779
|
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))
|
|
1780
|
+
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)) {
|
|
1781
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
1782
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
1783
|
+
}
|
|
1705
1784
|
}
|
|
1706
1785
|
}
|
|
1707
1786
|
let vnodeHooks;
|
|
@@ -1749,8 +1828,9 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1749
1828
|
const { slotScopeIds: fragmentSlotScopeIds } = vnode;
|
|
1750
1829
|
if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
1751
1830
|
const container = parentNode(node);
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1831
|
+
const first = nextSibling(node);
|
|
1832
|
+
const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1833
|
+
if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
|
|
1754
1834
|
else {
|
|
1755
1835
|
logMismatchError();
|
|
1756
1836
|
insert(vnode.anchor = createComment(`]`), container, next);
|
|
@@ -1759,7 +1839,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1759
1839
|
};
|
|
1760
1840
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
1761
1841
|
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);
|
|
1842
|
+
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
1843
|
logMismatchError();
|
|
1764
1844
|
}
|
|
1765
1845
|
vnode.el = null;
|
|
@@ -1775,20 +1855,22 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1775
1855
|
const container = parentNode(node);
|
|
1776
1856
|
remove(node);
|
|
1777
1857
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
1778
|
-
if (parentComponent) {
|
|
1858
|
+
if (parentComponent && parentComponent.vnode) {
|
|
1779
1859
|
parentComponent.vnode.el = vnode.el;
|
|
1780
1860
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
1781
1861
|
}
|
|
1782
1862
|
return next;
|
|
1783
1863
|
};
|
|
1784
|
-
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
1864
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
|
|
1785
1865
|
let match = 0;
|
|
1786
1866
|
while (node) {
|
|
1787
1867
|
node = nextSibling(node);
|
|
1788
1868
|
if (node && isComment(node)) {
|
|
1789
1869
|
if (node.data === open) match++;
|
|
1790
|
-
if (node.data === close)
|
|
1791
|
-
|
|
1870
|
+
if (node.data === close) {
|
|
1871
|
+
if (match === 0) return nextSibling(node);
|
|
1872
|
+
else match--;
|
|
1873
|
+
}
|
|
1792
1874
|
}
|
|
1793
1875
|
}
|
|
1794
1876
|
return node;
|
|
@@ -1798,7 +1880,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1798
1880
|
if (parentNode) parentNode.replaceChild(newNode, oldNode);
|
|
1799
1881
|
let parent = parentComponent;
|
|
1800
1882
|
while (parent) {
|
|
1801
|
-
if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
1883
|
+
if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
1802
1884
|
parent = parent.parent;
|
|
1803
1885
|
}
|
|
1804
1886
|
};
|
|
@@ -1807,6 +1889,16 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1807
1889
|
const isTemplateNode = (node) => {
|
|
1808
1890
|
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
1809
1891
|
};
|
|
1892
|
+
const resourceProps = /*@__PURE__*/ new Set([
|
|
1893
|
+
"src",
|
|
1894
|
+
"srcset",
|
|
1895
|
+
"href",
|
|
1896
|
+
"poster"
|
|
1897
|
+
]);
|
|
1898
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
1899
|
+
if (!resourceProps.has(key)) return false;
|
|
1900
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
1901
|
+
}
|
|
1810
1902
|
/**
|
|
1811
1903
|
* Dev only
|
|
1812
1904
|
*/
|
|
@@ -1850,7 +1942,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
1850
1942
|
function getAttributeMismatch(el, key, clientValue) {
|
|
1851
1943
|
let actual;
|
|
1852
1944
|
let expected;
|
|
1853
|
-
if (
|
|
1945
|
+
if (key === "hidden") {
|
|
1946
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
1947
|
+
expected = normalizeHiddenValue(clientValue);
|
|
1948
|
+
} else if ((0, _vue_shared.isBooleanAttr)(key)) {
|
|
1854
1949
|
actual = el.hasAttribute(key);
|
|
1855
1950
|
expected = (0, _vue_shared.includeBooleanAttr)(clientValue);
|
|
1856
1951
|
} else if (clientValue == null) {
|
|
@@ -1878,6 +1973,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
|
|
|
1878
1973
|
}
|
|
1879
1974
|
return false;
|
|
1880
1975
|
}
|
|
1976
|
+
function normalizeHiddenValue(value) {
|
|
1977
|
+
if (!(0, _vue_shared.isRenderableAttrValue)(value)) return false;
|
|
1978
|
+
if ((0, _vue_shared.isString)(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
1979
|
+
return (0, _vue_shared.includeBooleanAttr)(value) ? "" : false;
|
|
1980
|
+
}
|
|
1881
1981
|
function toClassSet(str) {
|
|
1882
1982
|
return new Set(str.trim().split(/\s+/));
|
|
1883
1983
|
}
|
|
@@ -2016,16 +2116,18 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
2016
2116
|
return teardown;
|
|
2017
2117
|
};
|
|
2018
2118
|
function forEachElement(node, cb) {
|
|
2019
|
-
if (isComment(node) && node.data === "[") {
|
|
2119
|
+
if (isComment(node) && (node.data === "[" || node.data === "(")) {
|
|
2120
|
+
const open = node.data;
|
|
2121
|
+
const close = open === "[" ? "]" : ")";
|
|
2020
2122
|
let depth = 1;
|
|
2021
2123
|
let next = node.nextSibling;
|
|
2022
2124
|
while (next) {
|
|
2023
2125
|
if (next.nodeType === 1) {
|
|
2024
2126
|
if (cb(next) === false) break;
|
|
2025
2127
|
} else if (isComment(next)) {
|
|
2026
|
-
if (next.data ===
|
|
2128
|
+
if (next.data === close) {
|
|
2027
2129
|
if (--depth === 0) break;
|
|
2028
|
-
} else if (next.data ===
|
|
2130
|
+
} else if (next.data === open) depth++;
|
|
2029
2131
|
}
|
|
2030
2132
|
next = next.nextSibling;
|
|
2031
2133
|
}
|
|
@@ -2034,14 +2136,14 @@ function forEachElement(node, cb) {
|
|
|
2034
2136
|
//#endregion
|
|
2035
2137
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
2036
2138
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
2037
|
-
|
|
2139
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2038
2140
|
function defineAsyncComponent(source) {
|
|
2039
2141
|
const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
|
|
2040
2142
|
return /* @__PURE__ */ defineComponent({
|
|
2041
2143
|
name: "AsyncComponentWrapper",
|
|
2042
2144
|
__asyncLoader: load,
|
|
2043
2145
|
__asyncHydrate(el, instance, hydrate) {
|
|
2044
|
-
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
|
|
2146
|
+
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
|
|
2045
2147
|
},
|
|
2046
2148
|
get __asyncResolved() {
|
|
2047
2149
|
return getResolvedComp();
|
|
@@ -2160,10 +2262,10 @@ const useAsyncComponentState = (delay, timeout, onError, instance = currentInsta
|
|
|
2160
2262
|
* shared between core and vapor
|
|
2161
2263
|
* @internal
|
|
2162
2264
|
*/
|
|
2163
|
-
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
2265
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
|
|
2164
2266
|
const wasConnected = el.isConnected;
|
|
2165
2267
|
let patched = false;
|
|
2166
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2268
|
+
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2167
2269
|
const performHydrate = () => {
|
|
2168
2270
|
if (patched) {
|
|
2169
2271
|
{
|
|
@@ -2253,10 +2355,13 @@ const KeepAlive = {
|
|
|
2253
2355
|
});
|
|
2254
2356
|
let pendingCacheKey = null;
|
|
2255
2357
|
const cacheSubtree = () => {
|
|
2256
|
-
if (pendingCacheKey != null)
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2358
|
+
if (pendingCacheKey != null) {
|
|
2359
|
+
if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
|
|
2360
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
2361
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
2362
|
+
}, void 0, keepAliveInstance.subTree.suspense);
|
|
2363
|
+
else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
2364
|
+
}
|
|
2260
2365
|
};
|
|
2261
2366
|
onMounted(cacheSubtree);
|
|
2262
2367
|
onUpdated(cacheSubtree);
|
|
@@ -2413,7 +2518,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
2413
2518
|
try {
|
|
2414
2519
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
2415
2520
|
} finally {
|
|
2416
|
-
|
|
2521
|
+
restoreCurrentInstance(prev);
|
|
2417
2522
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
2418
2523
|
}
|
|
2419
2524
|
});
|
|
@@ -2498,23 +2603,25 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2498
2603
|
}
|
|
2499
2604
|
ret = new Array(source.length);
|
|
2500
2605
|
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]);
|
|
2606
|
+
} else if (typeof source === "number") {
|
|
2607
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
2608
|
+
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
2609
|
+
ret = [];
|
|
2610
|
+
} else {
|
|
2611
|
+
ret = new Array(source);
|
|
2612
|
+
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2515
2613
|
}
|
|
2516
|
-
}
|
|
2517
|
-
|
|
2614
|
+
} else if ((0, _vue_shared.isObject)(source)) {
|
|
2615
|
+
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2616
|
+
else {
|
|
2617
|
+
const keys = Object.keys(source);
|
|
2618
|
+
ret = new Array(keys.length);
|
|
2619
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2620
|
+
const key = keys[i];
|
|
2621
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
} else ret = [];
|
|
2518
2625
|
if (cache) cache[index] = ret;
|
|
2519
2626
|
return ret;
|
|
2520
2627
|
}
|
|
@@ -2539,18 +2646,45 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2539
2646
|
//#endregion
|
|
2540
2647
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
2541
2648
|
/**
|
|
2649
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
2650
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
2651
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
2652
|
+
* "which one". Internal to vapor interop.
|
|
2653
|
+
*/
|
|
2654
|
+
const rawVaporSlotKey = Symbol(`rawVaporSlot`);
|
|
2655
|
+
/**
|
|
2656
|
+
* Invokes a VDOM slot fallback under the outlet owner that produced it, the
|
|
2657
|
+
* way `renderSlot` would have rendered it inline. Vapor interop invokes
|
|
2658
|
+
* fallbacks late, outside any render, so it passes the owner recorded on the
|
|
2659
|
+
* vapor slot vnode. Internal to vapor interop.
|
|
2660
|
+
*/
|
|
2661
|
+
function invokeSlotFallback(fallback, owner) {
|
|
2662
|
+
if (!owner) return fallback();
|
|
2663
|
+
const prev = setCurrentRenderingInstance(owner);
|
|
2664
|
+
const prevStackSize = blockStack.length;
|
|
2665
|
+
try {
|
|
2666
|
+
return fallback();
|
|
2667
|
+
} finally {
|
|
2668
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2669
|
+
setCurrentRenderingInstance(prev);
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
/**
|
|
2542
2673
|
* Compiler runtime helper for rendering `<slot/>`
|
|
2543
2674
|
* @private
|
|
2544
2675
|
*/
|
|
2545
|
-
function renderSlot(slots, name, props
|
|
2676
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2677
|
+
if (props == null) props = {};
|
|
2546
2678
|
let slot = slots[name];
|
|
2547
|
-
|
|
2548
|
-
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
2679
|
+
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
2549
2680
|
if (vaporSlot) {
|
|
2550
2681
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
2551
2682
|
ret.vs = {
|
|
2552
2683
|
slot: vaporSlot,
|
|
2553
|
-
fallback
|
|
2684
|
+
outlets: fallback ? [{
|
|
2685
|
+
fallback,
|
|
2686
|
+
owner: currentRenderingInstance
|
|
2687
|
+
}] : void 0
|
|
2554
2688
|
};
|
|
2555
2689
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2556
2690
|
return ret;
|
|
@@ -2571,9 +2705,15 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
|
2571
2705
|
let rendered;
|
|
2572
2706
|
try {
|
|
2573
2707
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2574
|
-
|
|
2708
|
+
let attached = false;
|
|
2709
|
+
if (fallback && validSlotContent && currentRenderingInstance) {
|
|
2710
|
+
const interop = currentRenderingInstance.appContext.vapor;
|
|
2711
|
+
if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
|
|
2712
|
+
}
|
|
2575
2713
|
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
2576
2714
|
rendered = createBlock(Fragment, { key: (slotKey && !(0, _vue_shared.isSymbol)(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
2715
|
+
if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
|
|
2716
|
+
if (attached) rendered.vo = true;
|
|
2577
2717
|
} catch (err) {
|
|
2578
2718
|
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2579
2719
|
throw err;
|
|
@@ -2591,10 +2731,6 @@ function ensureValidVNode(vnodes) {
|
|
|
2591
2731
|
return true;
|
|
2592
2732
|
}) ? vnodes : null;
|
|
2593
2733
|
}
|
|
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
2734
|
//#endregion
|
|
2599
2735
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
2600
2736
|
/**
|
|
@@ -2622,11 +2758,38 @@ const getPublicInstance = (i) => {
|
|
|
2622
2758
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
2623
2759
|
return getPublicInstance(i.parent);
|
|
2624
2760
|
};
|
|
2761
|
+
const resolveDevRootEl = (vnode) => {
|
|
2762
|
+
let found = false;
|
|
2763
|
+
while (true) {
|
|
2764
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
2765
|
+
const root = filterSingleRoot(vnode.children);
|
|
2766
|
+
if (!root) return;
|
|
2767
|
+
vnode = root;
|
|
2768
|
+
found = true;
|
|
2769
|
+
continue;
|
|
2770
|
+
}
|
|
2771
|
+
const component = vnode.component;
|
|
2772
|
+
if (component && component.subTree) {
|
|
2773
|
+
vnode = component.subTree;
|
|
2774
|
+
continue;
|
|
2775
|
+
}
|
|
2776
|
+
const suspense = vnode.suspense;
|
|
2777
|
+
if (suspense && suspense.activeBranch) {
|
|
2778
|
+
vnode = suspense.activeBranch;
|
|
2779
|
+
continue;
|
|
2780
|
+
}
|
|
2781
|
+
return found ? vnode.el : void 0;
|
|
2782
|
+
}
|
|
2783
|
+
};
|
|
2784
|
+
const getDevRootFragmentEl = (i) => {
|
|
2785
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
2786
|
+
return el === void 0 ? i.vnode.el : el;
|
|
2787
|
+
};
|
|
2625
2788
|
let publicPropertiesMap;
|
|
2626
2789
|
const getPublicPropertiesMap = () => {
|
|
2627
2790
|
if (!publicPropertiesMap) publicPropertiesMap = (0, _vue_shared.extend)(Object.create(null), {
|
|
2628
2791
|
$: (i) => i,
|
|
2629
|
-
$el: (i) => i
|
|
2792
|
+
$el: (i) => getDevRootFragmentEl(i),
|
|
2630
2793
|
$data: (i) => i.data,
|
|
2631
2794
|
$props: (i) => (0, _vue_reactivity.shallowReadonly)(i.props),
|
|
2632
2795
|
$attrs: (i) => (0, _vue_reactivity.shallowReadonly)(i.attrs),
|
|
@@ -2732,7 +2895,7 @@ PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
|
2732
2895
|
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
2896
|
return Reflect.ownKeys(target);
|
|
2734
2897
|
};
|
|
2735
|
-
const RuntimeCompiledPublicInstanceProxyHandlers =
|
|
2898
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ (0, _vue_shared.extend)({}, PublicInstanceProxyHandlers, {
|
|
2736
2899
|
get(target, key) {
|
|
2737
2900
|
if (key === Symbol.unscopables) return;
|
|
2738
2901
|
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
@@ -2904,12 +3067,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
2904
3067
|
for (const key in defaults) {
|
|
2905
3068
|
if (key.startsWith("__skip")) continue;
|
|
2906
3069
|
let opt = props[key];
|
|
2907
|
-
if (opt)
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
3070
|
+
if (opt) {
|
|
3071
|
+
if ((0, _vue_shared.isArray)(opt) || (0, _vue_shared.isFunction)(opt)) opt = props[key] = {
|
|
3072
|
+
type: opt,
|
|
3073
|
+
default: defaults[key]
|
|
3074
|
+
};
|
|
3075
|
+
else opt.default = defaults[key];
|
|
3076
|
+
} else if (opt === null) opt = props[key] = { default: defaults[key] };
|
|
2913
3077
|
else warn$1(`props default key "${key}" has no corresponding declaration.`);
|
|
2914
3078
|
if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
|
|
2915
3079
|
}
|
|
@@ -2959,37 +3123,32 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
2959
3123
|
function withAsyncContext(getAwaitable) {
|
|
2960
3124
|
const ctx = getCurrentGenericInstance();
|
|
2961
3125
|
const inSSRSetup = isInSSRComponentSetup;
|
|
2962
|
-
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
2963
3126
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
2964
3127
|
let awaitable = getAwaitable();
|
|
2965
3128
|
setCurrentInstance(null, void 0);
|
|
2966
3129
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2967
3130
|
const restore = () => {
|
|
2968
|
-
const
|
|
3131
|
+
const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
2969
3132
|
setCurrentInstance(ctx);
|
|
2970
3133
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
2971
|
-
|
|
2972
|
-
return () => {
|
|
2973
|
-
if (reset) reset();
|
|
2974
|
-
if (resetStoppedScope) resetStoppedScope.reset();
|
|
2975
|
-
};
|
|
3134
|
+
return stoppedScope;
|
|
2976
3135
|
};
|
|
2977
3136
|
const cleanup = () => {
|
|
2978
3137
|
setCurrentInstance(null, void 0);
|
|
2979
3138
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2980
3139
|
};
|
|
2981
3140
|
if ((0, _vue_shared.isPromise)(awaitable)) awaitable = awaitable.catch((e) => {
|
|
2982
|
-
const
|
|
3141
|
+
const stoppedScope = restore();
|
|
2983
3142
|
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
2984
|
-
if (
|
|
3143
|
+
if (stoppedScope) stoppedScope.reset();
|
|
2985
3144
|
cleanup();
|
|
2986
3145
|
}));
|
|
2987
3146
|
throw e;
|
|
2988
3147
|
});
|
|
2989
3148
|
return [awaitable, () => {
|
|
2990
|
-
const
|
|
3149
|
+
const stoppedScope = restore();
|
|
2991
3150
|
Promise.resolve().then(() => {
|
|
2992
|
-
if (
|
|
3151
|
+
if (stoppedScope) stoppedScope.reset();
|
|
2993
3152
|
cleanup();
|
|
2994
3153
|
});
|
|
2995
3154
|
}];
|
|
@@ -3052,11 +3211,12 @@ function applyOptions(instance) {
|
|
|
3052
3211
|
const opt = computedOptions[key];
|
|
3053
3212
|
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
3213
|
if (get === _vue_shared.NOOP) warn$1(`Computed property "${key}" has no getter.`);
|
|
3214
|
+
const set = !(0, _vue_shared.isFunction)(opt) && (0, _vue_shared.isFunction)(opt.set) ? opt.set.bind(publicThis) : () => {
|
|
3215
|
+
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3216
|
+
};
|
|
3055
3217
|
const c = computed({
|
|
3056
3218
|
get,
|
|
3057
|
-
set
|
|
3058
|
-
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3059
|
-
}
|
|
3219
|
+
set
|
|
3060
3220
|
});
|
|
3061
3221
|
Object.defineProperty(ctx, key, {
|
|
3062
3222
|
enumerable: true,
|
|
@@ -3113,9 +3273,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = _vue_s
|
|
|
3113
3273
|
for (const key in injectOptions) {
|
|
3114
3274
|
const opt = injectOptions[key];
|
|
3115
3275
|
let injected;
|
|
3116
|
-
if ((0, _vue_shared.isObject)(opt))
|
|
3117
|
-
|
|
3118
|
-
|
|
3276
|
+
if ((0, _vue_shared.isObject)(opt)) {
|
|
3277
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
3278
|
+
else injected = inject(opt.from || key);
|
|
3279
|
+
} else injected = inject(opt);
|
|
3119
3280
|
if ((0, _vue_reactivity.isRef)(injected)) Object.defineProperty(ctx, key, {
|
|
3120
3281
|
enumerable: true,
|
|
3121
3282
|
configurable: true,
|
|
@@ -3136,13 +3297,14 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3136
3297
|
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler);
|
|
3137
3298
|
else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
3138
3299
|
} 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
|
-
|
|
3300
|
+
else if ((0, _vue_shared.isObject)(raw)) {
|
|
3301
|
+
if ((0, _vue_shared.isArray)(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
3302
|
+
else {
|
|
3303
|
+
const handler = (0, _vue_shared.isFunction)(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
3304
|
+
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler, raw);
|
|
3305
|
+
else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
3306
|
+
}
|
|
3307
|
+
} else warn$1(`Invalid watch option: "${key}"`, raw);
|
|
3146
3308
|
}
|
|
3147
3309
|
/**
|
|
3148
3310
|
* Resolve merged options and cache it on the component.
|
|
@@ -3228,7 +3390,7 @@ function mergeObjectOptions(to, from) {
|
|
|
3228
3390
|
}
|
|
3229
3391
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
3230
3392
|
if (to) {
|
|
3231
|
-
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [
|
|
3393
|
+
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
3232
3394
|
return (0, _vue_shared.extend)(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
3233
3395
|
} else return from;
|
|
3234
3396
|
}
|
|
@@ -3347,8 +3509,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
3347
3509
|
} else warn$1(`Cannot unmount an app that is not mounted.`);
|
|
3348
3510
|
},
|
|
3349
3511
|
provide(key, value) {
|
|
3350
|
-
if (key in context.provides)
|
|
3351
|
-
|
|
3512
|
+
if (key in context.provides) {
|
|
3513
|
+
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.`);
|
|
3514
|
+
else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
|
|
3515
|
+
}
|
|
3352
3516
|
context.provides[key] = value;
|
|
3353
3517
|
return app;
|
|
3354
3518
|
},
|
|
@@ -3387,13 +3551,17 @@ function useModel(props, name, options = _vue_shared.EMPTY_OBJ) {
|
|
|
3387
3551
|
const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
|
|
3388
3552
|
const res = (0, _vue_reactivity.customRef)((track, trigger) => {
|
|
3389
3553
|
let localValue;
|
|
3554
|
+
let prevPropValue = _vue_shared.EMPTY_OBJ;
|
|
3390
3555
|
let prevSetValue = _vue_shared.EMPTY_OBJ;
|
|
3391
3556
|
let prevEmittedValue;
|
|
3392
3557
|
watchSyncEffect(() => {
|
|
3393
3558
|
const propValue = props[camelizedName];
|
|
3394
|
-
if ((0, _vue_shared.hasChanged)(
|
|
3395
|
-
|
|
3396
|
-
|
|
3559
|
+
if ((0, _vue_shared.hasChanged)(prevPropValue, propValue)) {
|
|
3560
|
+
prevPropValue = propValue;
|
|
3561
|
+
if ((0, _vue_shared.hasChanged)(localValue, propValue)) {
|
|
3562
|
+
localValue = propValue;
|
|
3563
|
+
trigger();
|
|
3564
|
+
}
|
|
3397
3565
|
}
|
|
3398
3566
|
});
|
|
3399
3567
|
return {
|
|
@@ -3455,12 +3623,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3455
3623
|
if (instance.isUnmounted) return;
|
|
3456
3624
|
{
|
|
3457
3625
|
const { emitsOptions, propsOptions } = instance;
|
|
3458
|
-
if (emitsOptions)
|
|
3459
|
-
if (!
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
if (
|
|
3626
|
+
if (emitsOptions) {
|
|
3627
|
+
if (!(event in emitsOptions) && true) {
|
|
3628
|
+
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.`);
|
|
3629
|
+
} else {
|
|
3630
|
+
const validator = emitsOptions[event];
|
|
3631
|
+
if ((0, _vue_shared.isFunction)(validator)) {
|
|
3632
|
+
if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
3633
|
+
}
|
|
3464
3634
|
}
|
|
3465
3635
|
}
|
|
3466
3636
|
}
|
|
@@ -3469,7 +3639,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3469
3639
|
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
3470
3640
|
if (modifiers) {
|
|
3471
3641
|
if (modifiers.trim) args = rawArgs.map((a) => (0, _vue_shared.isString)(a) ? a.trim() : a);
|
|
3472
|
-
if (modifiers.number) args =
|
|
3642
|
+
if (modifiers.number) args = args.map(_vue_shared.looseToNumber);
|
|
3473
3643
|
}
|
|
3474
3644
|
devtoolsComponentEmit(instance, event, args);
|
|
3475
3645
|
{
|
|
@@ -3596,8 +3766,9 @@ function renderComponentRoot(instance) {
|
|
|
3596
3766
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
3597
3767
|
}
|
|
3598
3768
|
if (vnode.transition) {
|
|
3599
|
-
|
|
3600
|
-
|
|
3769
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
3770
|
+
if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
3771
|
+
setTransitionHooks(child, vnode.transition);
|
|
3601
3772
|
}
|
|
3602
3773
|
if (setRoot) setRoot(root);
|
|
3603
3774
|
else result = root;
|
|
@@ -3648,18 +3819,21 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
3648
3819
|
for (let i = 0; i < children.length; i++) {
|
|
3649
3820
|
const child = children[i];
|
|
3650
3821
|
if (isVNode(child)) {
|
|
3651
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3822
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
3823
|
+
if (singleRoot) return;
|
|
3824
|
+
else {
|
|
3825
|
+
singleRoot = child;
|
|
3826
|
+
if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
3827
|
+
}
|
|
3655
3828
|
}
|
|
3656
3829
|
} else return;
|
|
3657
3830
|
}
|
|
3658
3831
|
return singleRoot;
|
|
3659
3832
|
}
|
|
3833
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || (0, _vue_shared.isOn)(key);
|
|
3660
3834
|
const getFunctionalFallthrough = (attrs) => {
|
|
3661
3835
|
let res;
|
|
3662
|
-
for (const key in attrs) if (
|
|
3836
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
3663
3837
|
return res;
|
|
3664
3838
|
};
|
|
3665
3839
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -3771,16 +3945,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3771
3945
|
let key = propsToUpdate[i];
|
|
3772
3946
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
3773
3947
|
const value = rawProps[key];
|
|
3774
|
-
if (options)
|
|
3775
|
-
if (
|
|
3776
|
-
attrs[key]
|
|
3777
|
-
|
|
3948
|
+
if (options) {
|
|
3949
|
+
if ((0, _vue_shared.hasOwn)(attrs, key)) {
|
|
3950
|
+
if (value !== attrs[key]) {
|
|
3951
|
+
attrs[key] = value;
|
|
3952
|
+
hasAttrsChanged = true;
|
|
3953
|
+
}
|
|
3954
|
+
} else {
|
|
3955
|
+
const camelizedKey = (0, _vue_shared.camelize)(key);
|
|
3956
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3778
3957
|
}
|
|
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]) {
|
|
3958
|
+
} else if (value !== attrs[key]) {
|
|
3784
3959
|
attrs[key] = value;
|
|
3785
3960
|
hasAttrsChanged = true;
|
|
3786
3961
|
}
|
|
@@ -3789,9 +3964,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3789
3964
|
} else {
|
|
3790
3965
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
3791
3966
|
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
|
-
|
|
3967
|
+
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))) {
|
|
3968
|
+
if (options) {
|
|
3969
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
3970
|
+
} else delete props[key];
|
|
3971
|
+
}
|
|
3795
3972
|
if (attrs !== rawCurrentProps) {
|
|
3796
3973
|
for (const key in attrs) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && true) {
|
|
3797
3974
|
delete attrs[key];
|
|
@@ -3810,9 +3987,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3810
3987
|
if ((0, _vue_shared.isReservedProp)(key)) continue;
|
|
3811
3988
|
const value = rawProps[key];
|
|
3812
3989
|
let camelKey;
|
|
3813
|
-
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key)))
|
|
3814
|
-
|
|
3815
|
-
|
|
3990
|
+
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key))) {
|
|
3991
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
3992
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
3993
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3816
3994
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
3817
3995
|
attrs[key] = value;
|
|
3818
3996
|
hasAttrsChanged = true;
|
|
@@ -3859,7 +4037,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
3859
4037
|
const prev = setCurrentInstance(instance);
|
|
3860
4038
|
const props = (0, _vue_reactivity.toRaw)(instance.props);
|
|
3861
4039
|
value = factory.call(null, props);
|
|
3862
|
-
|
|
4040
|
+
restoreCurrentInstance(prev);
|
|
3863
4041
|
return value;
|
|
3864
4042
|
}
|
|
3865
4043
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -3975,7 +4153,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
|
|
|
3975
4153
|
}
|
|
3976
4154
|
if (validator && !validator(value, (0, _vue_reactivity.shallowReadonly)(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
|
|
3977
4155
|
}
|
|
3978
|
-
const isSimpleType =
|
|
4156
|
+
const isSimpleType = /*@__PURE__*/ (0, _vue_shared.makeMap)("String,Number,Boolean,Function,Symbol,BigInt");
|
|
3979
4157
|
/**
|
|
3980
4158
|
* dev only
|
|
3981
4159
|
*/
|
|
@@ -4088,12 +4266,13 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4088
4266
|
let deletionComparisonTarget = _vue_shared.EMPTY_OBJ;
|
|
4089
4267
|
if (vnode.shapeFlag & 32) {
|
|
4090
4268
|
const type = children._;
|
|
4091
|
-
if (type)
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4269
|
+
if (type) {
|
|
4270
|
+
if (isHmrUpdating) {
|
|
4271
|
+
assignSlots(slots, children, optimized);
|
|
4272
|
+
(0, _vue_reactivity.trigger)(instance, "set", "$slots");
|
|
4273
|
+
} else if (optimized && type === 1) needDeletionCheck = false;
|
|
4274
|
+
else assignSlots(slots, children, optimized);
|
|
4275
|
+
} else {
|
|
4097
4276
|
needDeletionCheck = !children.$stable;
|
|
4098
4277
|
normalizeObjectSlots(children, slots, instance);
|
|
4099
4278
|
}
|
|
@@ -4111,7 +4290,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4111
4290
|
let supported;
|
|
4112
4291
|
let perf;
|
|
4113
4292
|
let cachedNow = 0;
|
|
4114
|
-
const p =
|
|
4293
|
+
const p = /*@__PURE__*/ Promise.resolve();
|
|
4115
4294
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = isSupported() ? perf.now() : Date.now());
|
|
4116
4295
|
/**
|
|
4117
4296
|
* @internal
|
|
@@ -4192,6 +4371,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4192
4371
|
optimized = false;
|
|
4193
4372
|
n2.dynamicChildren = null;
|
|
4194
4373
|
}
|
|
4374
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
4375
|
+
if (n2.dynamicChildren === _vue_shared.EMPTY_ARR) n2.dynamicChildren = [];
|
|
4376
|
+
n2.dynamicChildren.hasOnce = true;
|
|
4377
|
+
}
|
|
4195
4378
|
const { type, ref, shapeFlag } = n2;
|
|
4196
4379
|
switch (type) {
|
|
4197
4380
|
case Text:
|
|
@@ -4208,7 +4391,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4208
4391
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4209
4392
|
break;
|
|
4210
4393
|
case VaporSlot:
|
|
4211
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
4394
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
4212
4395
|
break;
|
|
4213
4396
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4214
4397
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -4327,7 +4510,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4327
4510
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
4328
4511
|
};
|
|
4329
4512
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
4330
|
-
for (let i = start; i < children.length; i++)
|
|
4513
|
+
for (let i = start; i < children.length; i++) {
|
|
4514
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
4515
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4516
|
+
}
|
|
4331
4517
|
};
|
|
4332
4518
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4333
4519
|
const el = n2.el = n1.el;
|
|
@@ -4339,6 +4525,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4339
4525
|
let vnodeHook;
|
|
4340
4526
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
4341
4527
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4528
|
+
if (n2.ibu) n2.ibu();
|
|
4342
4529
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4343
4530
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
4344
4531
|
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -4372,8 +4559,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4372
4559
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
4373
4560
|
}
|
|
4374
4561
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
4375
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
4562
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
4376
4563
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4564
|
+
n2.iu && n2.iu();
|
|
4377
4565
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4378
4566
|
}, void 0, parentSuspense);
|
|
4379
4567
|
};
|
|
@@ -4381,7 +4569,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4381
4569
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4382
4570
|
const oldVNode = oldChildren[i];
|
|
4383
4571
|
const newVNode = newChildren[i];
|
|
4384
|
-
|
|
4572
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
4573
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4385
4574
|
}
|
|
4386
4575
|
};
|
|
4387
4576
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -4419,41 +4608,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4419
4608
|
};
|
|
4420
4609
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4421
4610
|
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);
|
|
4611
|
+
if (n2.type.__vapor) {
|
|
4612
|
+
if (n1 == null) {
|
|
4613
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
4614
|
+
else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
|
|
4615
|
+
} else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
|
|
4616
|
+
} else if (n1 == null) {
|
|
4617
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
4618
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
4619
|
+
} else updateComponent(n1, n2, optimized);
|
|
4457
4620
|
};
|
|
4458
4621
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
4459
4622
|
const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
|
|
@@ -4494,16 +4657,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4494
4657
|
};
|
|
4495
4658
|
const updateComponent = (n1, n2, optimized) => {
|
|
4496
4659
|
const instance = n2.component = n1.component;
|
|
4497
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4660
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
4661
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4662
|
+
pushWarningContext(n2);
|
|
4663
|
+
n2.el = n1.el;
|
|
4664
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
4665
|
+
popWarningContext();
|
|
4666
|
+
return;
|
|
4667
|
+
} else {
|
|
4668
|
+
instance.next = n2;
|
|
4669
|
+
instance.effect.run();
|
|
4670
|
+
}
|
|
4502
4671
|
} else {
|
|
4503
|
-
instance.next = n2;
|
|
4504
|
-
instance.effect.run();
|
|
4505
|
-
}
|
|
4506
|
-
else {
|
|
4507
4672
|
n2.el = n1.el;
|
|
4508
4673
|
instance.vnode = n2;
|
|
4509
4674
|
}
|
|
@@ -4601,6 +4766,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4601
4766
|
} else next = vnode;
|
|
4602
4767
|
if (bu) (0, _vue_shared.invokeArrayFns)(bu);
|
|
4603
4768
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4769
|
+
if (next.ibu) next.ibu();
|
|
4604
4770
|
toggleRecurse(instance, true);
|
|
4605
4771
|
startMeasure(instance, `render`);
|
|
4606
4772
|
const nextTree = renderComponentRoot(instance);
|
|
@@ -4613,7 +4779,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4613
4779
|
next.el = nextTree.el;
|
|
4614
4780
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
4615
4781
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
4616
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
4782
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
4783
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4784
|
+
next.iu && next.iu();
|
|
4785
|
+
}, void 0, parentSuspense);
|
|
4617
4786
|
devtoolsComponentUpdated(instance);
|
|
4618
4787
|
popWarningContext();
|
|
4619
4788
|
}
|
|
@@ -4653,9 +4822,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4653
4822
|
if (shapeFlag & 8) {
|
|
4654
4823
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
4655
4824
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
4656
|
-
} else if (prevShapeFlag & 16)
|
|
4657
|
-
|
|
4658
|
-
|
|
4825
|
+
} else if (prevShapeFlag & 16) {
|
|
4826
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4827
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
4828
|
+
} else {
|
|
4659
4829
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
4660
4830
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4661
4831
|
}
|
|
@@ -4754,15 +4924,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4754
4924
|
const anchorVNode = c2[nextIndex + 1];
|
|
4755
4925
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
4756
4926
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4757
|
-
else if (moved)
|
|
4758
|
-
|
|
4927
|
+
else if (moved) {
|
|
4928
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
4929
|
+
else j--;
|
|
4930
|
+
}
|
|
4759
4931
|
}
|
|
4760
4932
|
}
|
|
4761
4933
|
};
|
|
4762
4934
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
4763
4935
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
4764
4936
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
4765
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
4937
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
4766
4938
|
return;
|
|
4767
4939
|
}
|
|
4768
4940
|
if (shapeFlag & 6) {
|
|
@@ -4787,54 +4959,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4787
4959
|
moveStaticNode(vnode, container, anchor);
|
|
4788
4960
|
return;
|
|
4789
4961
|
}
|
|
4790
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
const remove = () => {
|
|
4962
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
4963
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
4964
|
+
else performTransitionLeave(el, transition, () => {
|
|
4794
4965
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
4795
4966
|
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);
|
|
4967
|
+
}, true, true);
|
|
4968
|
+
} else hostInsert(el, container, anchor);
|
|
4810
4969
|
};
|
|
4811
4970
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
4812
4971
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
4813
|
-
if (patchFlag === -2) optimized = false;
|
|
4972
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
4814
4973
|
if (ref != null) {
|
|
4815
4974
|
const prevSub = (0, _vue_reactivity.setActiveSub)();
|
|
4816
4975
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
4817
4976
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
4818
4977
|
}
|
|
4819
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
4978
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
4820
4979
|
if (shapeFlag & 256) {
|
|
4821
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
4980
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
4822
4981
|
else parentComponent.ctx.deactivate(vnode);
|
|
4823
4982
|
return;
|
|
4824
4983
|
}
|
|
4984
|
+
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
4985
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
4986
|
+
return;
|
|
4987
|
+
}
|
|
4825
4988
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
4826
4989
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
4827
4990
|
let vnodeHook;
|
|
4828
4991
|
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);
|
|
4992
|
+
if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
4838
4993
|
else {
|
|
4839
4994
|
if (shapeFlag & 128) {
|
|
4840
4995
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -4845,7 +5000,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4845
5000
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
4846
5001
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
4847
5002
|
if (type === VaporSlot) {
|
|
4848
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
5003
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
4849
5004
|
return;
|
|
4850
5005
|
}
|
|
4851
5006
|
if (doRemove) remove(vnode);
|
|
@@ -4869,6 +5024,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4869
5024
|
}
|
|
4870
5025
|
if (type === Static) {
|
|
4871
5026
|
removeStaticNode(vnode);
|
|
5027
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
4872
5028
|
return;
|
|
4873
5029
|
}
|
|
4874
5030
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -4893,7 +5049,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4893
5049
|
if (effect) {
|
|
4894
5050
|
effect.stop();
|
|
4895
5051
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
4896
|
-
} else if (
|
|
5052
|
+
} else if (instance.vnode.el && subTree) {
|
|
5053
|
+
subTree.transition = instance.vnode.transition;
|
|
5054
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5055
|
+
}
|
|
4897
5056
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
4898
5057
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
4899
5058
|
devtoolsComponentRemoved(instance);
|
|
@@ -4967,12 +5126,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
4967
5126
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
4968
5127
|
}
|
|
4969
5128
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
4970
|
-
if (!vapor)
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
5129
|
+
if (!vapor) {
|
|
5130
|
+
if (allowed) {
|
|
5131
|
+
effect.flags |= 128;
|
|
5132
|
+
job.flags |= 2;
|
|
5133
|
+
} else {
|
|
5134
|
+
effect.flags &= -129;
|
|
5135
|
+
job.flags &= -3;
|
|
5136
|
+
}
|
|
4976
5137
|
}
|
|
4977
5138
|
}
|
|
4978
5139
|
function needTransition(parentSuspense, transition) {
|
|
@@ -5012,8 +5173,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
5012
5173
|
}
|
|
5013
5174
|
function locateNonHydratedAsyncRoot(instance) {
|
|
5014
5175
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
5015
|
-
if (subComponent)
|
|
5016
|
-
|
|
5176
|
+
if (subComponent) {
|
|
5177
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
5178
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
5179
|
+
}
|
|
5017
5180
|
}
|
|
5018
5181
|
function invalidateMount(hooks) {
|
|
5019
5182
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
@@ -5032,13 +5195,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
5032
5195
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
5033
5196
|
const performRemove = () => {
|
|
5034
5197
|
remove();
|
|
5035
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5198
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
5036
5199
|
};
|
|
5037
5200
|
if (force || isElement && transition && !transition.persisted) {
|
|
5038
5201
|
const { leave, delayLeave } = transition;
|
|
5039
5202
|
const performLeave = () => {
|
|
5203
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
5040
5204
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
5041
|
-
|
|
5205
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
5206
|
+
else leave(el, performRemove);
|
|
5042
5207
|
};
|
|
5043
5208
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
5044
5209
|
else performLeave();
|
|
@@ -5057,7 +5222,7 @@ function isVaporComponent(type) {
|
|
|
5057
5222
|
/**
|
|
5058
5223
|
* shared between vdom and vapor
|
|
5059
5224
|
*/
|
|
5060
|
-
function getInheritedScopeIds(vnode, parentComponent) {
|
|
5225
|
+
function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
|
|
5061
5226
|
const inheritedScopeIds = [];
|
|
5062
5227
|
let currentParent = parentComponent;
|
|
5063
5228
|
let currentVNode = vnode;
|
|
@@ -5073,6 +5238,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
5073
5238
|
currentParent = currentParent.parent;
|
|
5074
5239
|
} else break;
|
|
5075
5240
|
}
|
|
5241
|
+
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
5242
|
+
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
5076
5243
|
return inheritedScopeIds;
|
|
5077
5244
|
}
|
|
5078
5245
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
@@ -5091,7 +5258,7 @@ const Suspense = {
|
|
|
5091
5258
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
5092
5259
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
5093
5260
|
else {
|
|
5094
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
5261
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
5095
5262
|
n2.suspense = n1.suspense;
|
|
5096
5263
|
n2.suspense.vnode = n2;
|
|
5097
5264
|
n2.el = n1.el;
|
|
@@ -5129,10 +5296,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5129
5296
|
if (pendingBranch) {
|
|
5130
5297
|
suspense.pendingBranch = newBranch;
|
|
5131
5298
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
5132
|
-
|
|
5299
|
+
suspense.deps++;
|
|
5300
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
5301
|
+
suspense.deps--;
|
|
5133
5302
|
if (suspense.deps <= 0) suspense.resolve();
|
|
5134
5303
|
else if (isInFallback) {
|
|
5135
|
-
if (!isHydrating) {
|
|
5304
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
5136
5305
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5137
5306
|
setActiveBranch(suspense, newFallback);
|
|
5138
5307
|
}
|
|
@@ -5144,12 +5313,16 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5144
5313
|
suspense.activeBranch = pendingBranch;
|
|
5145
5314
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
5146
5315
|
suspense.deps = 0;
|
|
5316
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
5317
|
+
const effect = suspense.effects[i];
|
|
5318
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
5319
|
+
}
|
|
5147
5320
|
suspense.effects.length = 0;
|
|
5148
5321
|
suspense.hiddenContainer = createElement("div");
|
|
5149
5322
|
if (isInFallback) {
|
|
5150
5323
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
5151
5324
|
if (suspense.deps <= 0) suspense.resolve();
|
|
5152
|
-
else {
|
|
5325
|
+
else if (!suspense.isFallbackMountPending) {
|
|
5153
5326
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5154
5327
|
setActiveBranch(suspense, newFallback);
|
|
5155
5328
|
}
|
|
@@ -5251,7 +5424,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5251
5424
|
let hasUnresolvedAncestor = false;
|
|
5252
5425
|
while (parent) {
|
|
5253
5426
|
if (parent.pendingBranch) {
|
|
5254
|
-
parent.effects.push(
|
|
5427
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
5255
5428
|
hasUnresolvedAncestor = true;
|
|
5256
5429
|
break;
|
|
5257
5430
|
}
|
|
@@ -5261,6 +5434,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5261
5434
|
suspense.effects = [];
|
|
5262
5435
|
if (isSuspensible) {
|
|
5263
5436
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
5437
|
+
parentSuspenseId = void 0;
|
|
5264
5438
|
parentSuspense.deps--;
|
|
5265
5439
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
5266
5440
|
}
|
|
@@ -5275,8 +5449,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5275
5449
|
const mountFallback = () => {
|
|
5276
5450
|
suspense.isFallbackMountPending = false;
|
|
5277
5451
|
if (!suspense.isInFallback) return;
|
|
5278
|
-
|
|
5279
|
-
|
|
5452
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
5453
|
+
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5454
|
+
setActiveBranch(suspense, latestFallback);
|
|
5280
5455
|
};
|
|
5281
5456
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
5282
5457
|
if (delayEnter) {
|
|
@@ -5297,11 +5472,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5297
5472
|
registerDep(instance, onResolve) {
|
|
5298
5473
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5299
5474
|
if (isInPendingSuspense) suspense.deps++;
|
|
5475
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
5300
5476
|
instance.asyncDep.catch((err) => {
|
|
5301
5477
|
handleError(err, instance, 0);
|
|
5302
5478
|
}).then((asyncSetupResult) => {
|
|
5303
5479
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
5304
5480
|
setCurrentInstance(null, void 0);
|
|
5481
|
+
if (hydratedEl && !instance.scope.active) {
|
|
5482
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
5483
|
+
return;
|
|
5484
|
+
}
|
|
5305
5485
|
instance.asyncResolved = true;
|
|
5306
5486
|
onResolve(asyncSetupResult);
|
|
5307
5487
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -5352,9 +5532,10 @@ function normalizeSuspenseSlot(s) {
|
|
|
5352
5532
|
return s;
|
|
5353
5533
|
}
|
|
5354
5534
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
5355
|
-
if (suspense && suspense.pendingBranch)
|
|
5356
|
-
|
|
5357
|
-
|
|
5535
|
+
if (suspense && suspense.pendingBranch) {
|
|
5536
|
+
if ((0, _vue_shared.isArray)(fn)) suspense.effects.push(...fn);
|
|
5537
|
+
else suspense.effects.push(fn);
|
|
5538
|
+
} else queuePostFlushCb(fn, id);
|
|
5358
5539
|
}
|
|
5359
5540
|
function setActiveBranch(suspense, branch) {
|
|
5360
5541
|
suspense.activeBranch = branch;
|
|
@@ -5521,9 +5702,24 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
5521
5702
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
5522
5703
|
} else if (children) vnode.shapeFlag |= (0, _vue_shared.isString)(children) ? 8 : 16;
|
|
5523
5704
|
if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
5705
|
+
if (props && vnode.shapeFlag & 1) {
|
|
5706
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
5707
|
+
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.`);
|
|
5708
|
+
}
|
|
5524
5709
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
5525
5710
|
return vnode;
|
|
5526
5711
|
}
|
|
5712
|
+
/**
|
|
5713
|
+
* dev only
|
|
5714
|
+
* Whether children would actually render something. Empty text and empty
|
|
5715
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
5716
|
+
* for `v-html` / `v-text`.
|
|
5717
|
+
*/
|
|
5718
|
+
function hasContentChildren(children) {
|
|
5719
|
+
if ((0, _vue_shared.isString)(children)) return children !== "";
|
|
5720
|
+
if ((0, _vue_shared.isArray)(children)) return children.length > 0;
|
|
5721
|
+
return false;
|
|
5722
|
+
}
|
|
5527
5723
|
const createVNode = createVNodeWithArgsTransform;
|
|
5528
5724
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
5529
5725
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -5533,8 +5729,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
5533
5729
|
if (isVNode(type)) {
|
|
5534
5730
|
const cloned = cloneVNode(type, props, true);
|
|
5535
5731
|
if (children) normalizeChildren(cloned, children);
|
|
5536
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
5537
|
-
|
|
5732
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
5733
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
5734
|
+
else currentBlock.push(cloned);
|
|
5735
|
+
}
|
|
5538
5736
|
cloned.patchFlag = -2;
|
|
5539
5737
|
return cloned;
|
|
5540
5738
|
}
|
|
@@ -5594,7 +5792,10 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5594
5792
|
ce: vnode.ce,
|
|
5595
5793
|
vi: vnode.vi,
|
|
5596
5794
|
vs: cloneVaporSlotMeta(vnode),
|
|
5597
|
-
vb: vnode.vb
|
|
5795
|
+
vb: vnode.vb,
|
|
5796
|
+
ibu: vnode.ibu,
|
|
5797
|
+
iu: vnode.iu,
|
|
5798
|
+
cacheIndex: vnode.cacheIndex
|
|
5598
5799
|
};
|
|
5599
5800
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5600
5801
|
return cloned;
|
|
@@ -5604,8 +5805,7 @@ function cloneVaporSlotMeta(vnode) {
|
|
|
5604
5805
|
if (!vaporSlot) return vaporSlot;
|
|
5605
5806
|
const cloned = {
|
|
5606
5807
|
slot: vaporSlot.slot,
|
|
5607
|
-
|
|
5608
|
-
outletFallback: vaporSlot.outletFallback
|
|
5808
|
+
outlets: vaporSlot.outlets
|
|
5609
5809
|
};
|
|
5610
5810
|
if (vnode.el) {
|
|
5611
5811
|
cloned.state = vaporSlot.state;
|
|
@@ -5657,25 +5857,28 @@ function normalizeChildren(vnode, children) {
|
|
|
5657
5857
|
const { shapeFlag } = vnode;
|
|
5658
5858
|
if (children == null) children = null;
|
|
5659
5859
|
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
|
-
|
|
5860
|
+
else if (typeof children === "object") {
|
|
5861
|
+
if (shapeFlag & 65) {
|
|
5862
|
+
const slot = children.default;
|
|
5863
|
+
if (slot) {
|
|
5864
|
+
slot._c && (slot._d = false);
|
|
5865
|
+
normalizeChildren(vnode, slot());
|
|
5866
|
+
slot._c && (slot._d = true);
|
|
5867
|
+
}
|
|
5868
|
+
return;
|
|
5869
|
+
} else {
|
|
5870
|
+
type = 32;
|
|
5871
|
+
const slotFlag = children._;
|
|
5872
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
5873
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
5874
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
5875
|
+
else {
|
|
5876
|
+
children._ = 2;
|
|
5877
|
+
vnode.patchFlag |= 1024;
|
|
5878
|
+
}
|
|
5879
|
+
}
|
|
5676
5880
|
}
|
|
5677
|
-
}
|
|
5678
|
-
else if ((0, _vue_shared.isFunction)(children)) {
|
|
5881
|
+
} else if ((0, _vue_shared.isFunction)(children)) {
|
|
5679
5882
|
if (shapeFlag & 65) {
|
|
5680
5883
|
normalizeChildren(vnode, { default: children });
|
|
5681
5884
|
return;
|
|
@@ -5752,6 +5955,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
5752
5955
|
simpleSetCurrentInstance(instance);
|
|
5753
5956
|
}
|
|
5754
5957
|
};
|
|
5958
|
+
/**
|
|
5959
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
5960
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
5961
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
5962
|
+
* @internal
|
|
5963
|
+
*/
|
|
5964
|
+
const restoreCurrentInstance = (prev) => {
|
|
5965
|
+
(0, _vue_reactivity.setCurrentScope)(prev[1]);
|
|
5966
|
+
simpleSetCurrentInstance(prev[0]);
|
|
5967
|
+
};
|
|
5755
5968
|
const internalOptions = [
|
|
5756
5969
|
"ce",
|
|
5757
5970
|
"type",
|
|
@@ -5783,7 +5996,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
5783
5996
|
};
|
|
5784
5997
|
//#endregion
|
|
5785
5998
|
//#region packages/runtime-core/src/component.ts
|
|
5786
|
-
const emptyAppContext =
|
|
5999
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
5787
6000
|
let uid = 0;
|
|
5788
6001
|
function createComponentInstance(vnode, parent, suspense) {
|
|
5789
6002
|
const type = vnode.type;
|
|
@@ -5903,7 +6116,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5903
6116
|
const setupResult = callWithErrorHandling(setup, instance, 0, [(0, _vue_reactivity.shallowReadonly)(instance.props), setupContext]);
|
|
5904
6117
|
const isAsyncSetup = (0, _vue_shared.isPromise)(setupResult);
|
|
5905
6118
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
5906
|
-
|
|
6119
|
+
restoreCurrentInstance(prev);
|
|
5907
6120
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
5908
6121
|
if (isAsyncSetup) {
|
|
5909
6122
|
const unsetCurrentInstance = () => {
|
|
@@ -5911,7 +6124,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5911
6124
|
};
|
|
5912
6125
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
5913
6126
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
5914
|
-
|
|
6127
|
+
setInSSRSetupState(true);
|
|
6128
|
+
try {
|
|
6129
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
6130
|
+
} finally {
|
|
6131
|
+
setInSSRSetupState(false);
|
|
6132
|
+
}
|
|
5915
6133
|
}).catch((e) => {
|
|
5916
6134
|
handleError(e, instance, 0);
|
|
5917
6135
|
});
|
|
@@ -5923,9 +6141,10 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5923
6141
|
} else finishComponentSetup(instance, isSSR);
|
|
5924
6142
|
}
|
|
5925
6143
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
5926
|
-
if ((0, _vue_shared.isFunction)(setupResult))
|
|
5927
|
-
|
|
5928
|
-
|
|
6144
|
+
if ((0, _vue_shared.isFunction)(setupResult)) {
|
|
6145
|
+
if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
|
|
6146
|
+
else instance.render = setupResult;
|
|
6147
|
+
} else if ((0, _vue_shared.isObject)(setupResult)) {
|
|
5929
6148
|
if (isVNode(setupResult)) warn$1("setup() should not return VNodes directly - return a render function instead.");
|
|
5930
6149
|
instance.devtoolsRawSetupState = setupResult;
|
|
5931
6150
|
instance.setupState = (0, _vue_reactivity.proxyRefs)(setupResult);
|
|
@@ -5973,13 +6192,15 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
5973
6192
|
applyOptions(instance);
|
|
5974
6193
|
} finally {
|
|
5975
6194
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
5976
|
-
|
|
6195
|
+
restoreCurrentInstance(prevInstance);
|
|
5977
6196
|
}
|
|
5978
6197
|
}
|
|
5979
|
-
if (!Component.render && instance.render === _vue_shared.NOOP && !isSSR)
|
|
6198
|
+
if (!Component.render && instance.render === _vue_shared.NOOP && !isSSR) {
|
|
6199
|
+
if (!compile && Component.template)
|
|
5980
6200
|
/* v8 ignore start */
|
|
5981
|
-
|
|
5982
|
-
|
|
6201
|
+
warn$1("Component provided template option but runtime compilation is not supported in this build of Vue.");
|
|
6202
|
+
else warn$1(`Component is missing template or render function: `, Component);
|
|
6203
|
+
}
|
|
5983
6204
|
}
|
|
5984
6205
|
const attrsProxyHandlers = {
|
|
5985
6206
|
get(target, key) {
|
|
@@ -6042,14 +6263,13 @@ function getComponentPublicInstance(instance) {
|
|
|
6042
6263
|
if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy((0, _vue_reactivity.proxyRefs)((0, _vue_reactivity.markRaw)(instance.exposed)), {
|
|
6043
6264
|
get(target, key) {
|
|
6044
6265
|
if (key in target) return target[key];
|
|
6045
|
-
else {
|
|
6266
|
+
else if (!instance.vapor) {
|
|
6046
6267
|
const publicPropertiesMap = getPublicPropertiesMap();
|
|
6047
6268
|
if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
|
|
6048
6269
|
}
|
|
6049
6270
|
},
|
|
6050
6271
|
has(target, key) {
|
|
6051
|
-
|
|
6052
|
-
return key in target || key in publicPropertiesMap;
|
|
6272
|
+
return key in target || !instance.vapor && key in getPublicPropertiesMap();
|
|
6053
6273
|
}
|
|
6054
6274
|
}));
|
|
6055
6275
|
else return instance.proxy;
|
|
@@ -6087,11 +6307,12 @@ function h(type, propsOrChildren, children) {
|
|
|
6087
6307
|
try {
|
|
6088
6308
|
setBlockTracking(-1);
|
|
6089
6309
|
const l = arguments.length;
|
|
6090
|
-
if (l === 2)
|
|
6091
|
-
if (
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6310
|
+
if (l === 2) {
|
|
6311
|
+
if ((0, _vue_shared.isObject)(propsOrChildren) && !(0, _vue_shared.isArray)(propsOrChildren)) {
|
|
6312
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
6313
|
+
return createVNode(type, propsOrChildren);
|
|
6314
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
6315
|
+
} else {
|
|
6095
6316
|
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
6096
6317
|
else if (l === 3 && isVNode(children)) children = [children];
|
|
6097
6318
|
return createVNode(type, propsOrChildren, children);
|
|
@@ -6283,7 +6504,7 @@ function isMemoSame(cached, memo) {
|
|
|
6283
6504
|
}
|
|
6284
6505
|
//#endregion
|
|
6285
6506
|
//#region packages/runtime-core/src/index.ts
|
|
6286
|
-
const version = "3.6.0-rc.
|
|
6507
|
+
const version = "3.6.0-rc.11";
|
|
6287
6508
|
const warn = warn$1;
|
|
6288
6509
|
/**
|
|
6289
6510
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -6306,7 +6527,10 @@ const ssrUtils = {
|
|
|
6306
6527
|
getComponentPublicInstance,
|
|
6307
6528
|
ensureValidVNode,
|
|
6308
6529
|
pushWarningContext,
|
|
6309
|
-
popWarningContext
|
|
6530
|
+
popWarningContext,
|
|
6531
|
+
VaporSlot,
|
|
6532
|
+
rawVaporSlotKey,
|
|
6533
|
+
invokeSlotFallback
|
|
6310
6534
|
};
|
|
6311
6535
|
/**
|
|
6312
6536
|
* @internal only exposed in compat builds
|