@vue/runtime-core 3.6.0-beta.9 → 3.6.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-core.cjs.js +897 -505
- package/dist/runtime-core.cjs.prod.js +710 -409
- package/dist/runtime-core.d.ts +618 -612
- package/dist/runtime-core.esm-bundler.js +916 -510
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.10
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -253,7 +253,9 @@ const SchedulerJobFlags = {
|
|
|
253
253
|
"ALLOW_RECURSE": 2,
|
|
254
254
|
"2": "ALLOW_RECURSE",
|
|
255
255
|
"DISPOSED": 4,
|
|
256
|
-
"4": "DISPOSED"
|
|
256
|
+
"4": "DISPOSED",
|
|
257
|
+
"REQUEUE_ON_SUSPENSE_DISCARD": 8,
|
|
258
|
+
"8": "REQUEUE_ON_SUSPENSE_DISCARD"
|
|
257
259
|
};
|
|
258
260
|
const jobs = [];
|
|
259
261
|
let postJobs = [];
|
|
@@ -262,7 +264,7 @@ let currentFlushPromise = null;
|
|
|
262
264
|
let jobsLength = 0;
|
|
263
265
|
let flushIndex = 0;
|
|
264
266
|
let postFlushIndex = 0;
|
|
265
|
-
const resolvedPromise =
|
|
267
|
+
const resolvedPromise = /*@__PURE__*/ Promise.resolve();
|
|
266
268
|
const RECURSION_LIMIT = 100;
|
|
267
269
|
function nextTick(fn) {
|
|
268
270
|
const p = currentFlushPromise || resolvedPromise;
|
|
@@ -279,8 +281,8 @@ function findInsertionIndex(order, queue, start, end) {
|
|
|
279
281
|
/**
|
|
280
282
|
* @internal for runtime-vapor only
|
|
281
283
|
*/
|
|
282
|
-
function queueJob(job, id, isPre = false) {
|
|
283
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
284
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
285
|
+
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
284
286
|
jobsLength++;
|
|
285
287
|
queueFlush();
|
|
286
288
|
}
|
|
@@ -301,6 +303,7 @@ const doFlushJobs = () => {
|
|
|
301
303
|
flushJobs();
|
|
302
304
|
} catch (e) {
|
|
303
305
|
currentFlushPromise = null;
|
|
306
|
+
if (jobsLength || postJobs.length) queueFlush();
|
|
304
307
|
throw e;
|
|
305
308
|
}
|
|
306
309
|
};
|
|
@@ -308,9 +311,10 @@ function queueFlush() {
|
|
|
308
311
|
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
309
312
|
}
|
|
310
313
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
311
|
-
if (!isArray(jobs))
|
|
312
|
-
|
|
313
|
-
|
|
314
|
+
if (!isArray(jobs)) {
|
|
315
|
+
if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
316
|
+
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
317
|
+
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
314
318
|
queueFlush();
|
|
315
319
|
}
|
|
316
320
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -324,32 +328,39 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
324
328
|
i--;
|
|
325
329
|
jobsLength--;
|
|
326
330
|
if (cb.flags & 2) cb.flags &= -2;
|
|
327
|
-
|
|
328
|
-
|
|
331
|
+
try {
|
|
332
|
+
cb();
|
|
333
|
+
} finally {
|
|
334
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
335
|
+
}
|
|
329
336
|
}
|
|
330
337
|
}
|
|
331
338
|
function flushPostFlushCbs(seen) {
|
|
332
339
|
if (postJobs.length) {
|
|
333
340
|
if (activePostJobs) {
|
|
334
|
-
activePostJobs.push(
|
|
341
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
335
342
|
postJobs.length = 0;
|
|
336
343
|
return;
|
|
337
344
|
}
|
|
338
345
|
activePostJobs = postJobs;
|
|
339
346
|
postJobs = [];
|
|
340
347
|
if (!!(process.env.NODE_ENV !== "production")) seen = seen || /* @__PURE__ */ new Map();
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
cb
|
|
347
|
-
|
|
348
|
-
|
|
348
|
+
try {
|
|
349
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
350
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
351
|
+
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) continue;
|
|
352
|
+
if (cb.flags & 2) cb.flags &= -2;
|
|
353
|
+
if (!(cb.flags & 4)) try {
|
|
354
|
+
cb();
|
|
355
|
+
} finally {
|
|
356
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
357
|
+
}
|
|
349
358
|
}
|
|
359
|
+
} finally {
|
|
360
|
+
while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
|
|
361
|
+
activePostJobs = null;
|
|
362
|
+
postFlushIndex = 0;
|
|
350
363
|
}
|
|
351
|
-
activePostJobs = null;
|
|
352
|
-
postFlushIndex = 0;
|
|
353
364
|
}
|
|
354
365
|
}
|
|
355
366
|
let isFlushing = false;
|
|
@@ -359,9 +370,12 @@ let isFlushing = false;
|
|
|
359
370
|
function flushOnAppMount(instance) {
|
|
360
371
|
if (!isFlushing) {
|
|
361
372
|
isFlushing = true;
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
373
|
+
try {
|
|
374
|
+
flushPreFlushCbs(instance);
|
|
375
|
+
flushPostFlushCbs();
|
|
376
|
+
} finally {
|
|
377
|
+
isFlushing = false;
|
|
378
|
+
}
|
|
365
379
|
}
|
|
366
380
|
}
|
|
367
381
|
function flushJobs(seen) {
|
|
@@ -389,9 +403,10 @@ function flushJobs(seen) {
|
|
|
389
403
|
}
|
|
390
404
|
flushIndex = 0;
|
|
391
405
|
jobsLength = 0;
|
|
406
|
+
jobs.length = 0;
|
|
392
407
|
flushPostFlushCbs(seen);
|
|
393
|
-
currentFlushPromise = null;
|
|
394
408
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
409
|
+
else currentFlushPromise = null;
|
|
395
410
|
}
|
|
396
411
|
}
|
|
397
412
|
function checkRecursiveUpdates(seen, fn) {
|
|
@@ -422,6 +437,19 @@ if (!!(process.env.NODE_ENV !== "production")) getGlobalThis().__VUE_HMR_RUNTIME
|
|
|
422
437
|
rerender: tryWrap(rerender),
|
|
423
438
|
reload: tryWrap(reload)
|
|
424
439
|
};
|
|
440
|
+
function runWithHmrUpdating(fn) {
|
|
441
|
+
isHmrUpdating = true;
|
|
442
|
+
let done = false;
|
|
443
|
+
try {
|
|
444
|
+
fn();
|
|
445
|
+
done = true;
|
|
446
|
+
} finally {
|
|
447
|
+
if (done) nextTick(() => {
|
|
448
|
+
isHmrUpdating = false;
|
|
449
|
+
});
|
|
450
|
+
else isHmrUpdating = false;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
425
453
|
const map = /* @__PURE__ */ new Map();
|
|
426
454
|
function registerHMR(instance) {
|
|
427
455
|
const id = instance.type.__hmrId;
|
|
@@ -446,6 +474,14 @@ function createRecord(id, initialDef) {
|
|
|
446
474
|
function normalizeClassComponent(component) {
|
|
447
475
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
448
476
|
}
|
|
477
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
478
|
+
let parent = instance.parent;
|
|
479
|
+
while (parent) {
|
|
480
|
+
if (dirtyInstances.has(parent)) return true;
|
|
481
|
+
parent = parent.parent;
|
|
482
|
+
}
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
449
485
|
function rerender(id, newRender) {
|
|
450
486
|
const record = map.get(id);
|
|
451
487
|
if (!record) return;
|
|
@@ -455,18 +491,16 @@ function rerender(id, newRender) {
|
|
|
455
491
|
instance.render = newRender;
|
|
456
492
|
normalizeClassComponent(instance.type).render = newRender;
|
|
457
493
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
494
|
+
runWithHmrUpdating(() => {
|
|
495
|
+
if (instance.vapor) {
|
|
496
|
+
if (!instance.isUnmounted) instance.hmrRerender();
|
|
497
|
+
} else {
|
|
498
|
+
const i = instance;
|
|
499
|
+
if (!(i.effect.flags & 1024)) {
|
|
500
|
+
i.renderCache = [];
|
|
501
|
+
i.effect.run();
|
|
502
|
+
}
|
|
466
503
|
}
|
|
467
|
-
}
|
|
468
|
-
nextTick(() => {
|
|
469
|
-
isHmrUpdating = false;
|
|
470
504
|
});
|
|
471
505
|
});
|
|
472
506
|
}
|
|
@@ -477,42 +511,61 @@ function reload(id, newComp) {
|
|
|
477
511
|
const isVapor = record.initialDef.__vapor;
|
|
478
512
|
updateComponentDef(record.initialDef, newComp);
|
|
479
513
|
const instances = [...record.instances];
|
|
480
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
514
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
481
515
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
494
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
495
|
-
if (instance.ceReload) {
|
|
496
|
-
dirtyInstances.add(instance);
|
|
497
|
-
instance.ceReload(newComp.styles);
|
|
498
|
-
dirtyInstances.delete(instance);
|
|
499
|
-
} else if (instance.parent) queueJob(() => {
|
|
500
|
-
isHmrUpdating = true;
|
|
501
|
-
const parent = instance.parent;
|
|
502
|
-
if (parent.vapor) parent.hmrRerender();
|
|
503
|
-
else if (!(parent.effect.flags & 1024)) {
|
|
504
|
-
parent.renderCache = [];
|
|
505
|
-
parent.effect.run();
|
|
516
|
+
const dirtyInstances = new Set(instances);
|
|
517
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
518
|
+
runWithHmrUpdating(() => {
|
|
519
|
+
for (const instance of instances) {
|
|
520
|
+
const parent = instance.parent;
|
|
521
|
+
if (parent) {
|
|
522
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
523
|
+
rerenderedParents.add(parent);
|
|
524
|
+
parent.hmrRerender();
|
|
525
|
+
}
|
|
526
|
+
} else instance.hmrReload(newComp);
|
|
506
527
|
}
|
|
507
|
-
|
|
508
|
-
|
|
528
|
+
});
|
|
529
|
+
} else {
|
|
530
|
+
const parents = /* @__PURE__ */ new Set();
|
|
531
|
+
const dirtyInstanceSet = new Set(instances);
|
|
532
|
+
for (const instance of instances) {
|
|
533
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
534
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
535
|
+
if (!dirtyInstances) {
|
|
536
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
537
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
538
|
+
}
|
|
539
|
+
dirtyInstances.add(instance);
|
|
540
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
541
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
542
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
543
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
544
|
+
if (instance.ceReload) {
|
|
545
|
+
dirtyInstances.add(instance);
|
|
546
|
+
instance.ceReload(newComp.styles);
|
|
547
|
+
dirtyInstances.delete(instance);
|
|
548
|
+
} else if (instance.parent) {
|
|
549
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
|
|
550
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
551
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
552
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
553
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
554
|
+
}
|
|
555
|
+
parents.forEach((parent) => {
|
|
556
|
+
queueJob(() => {
|
|
557
|
+
runWithHmrUpdating(() => {
|
|
558
|
+
if (parent.vapor) parent.hmrRerender();
|
|
559
|
+
else {
|
|
560
|
+
const i = parent;
|
|
561
|
+
if (!(i.effect.flags & 1024)) {
|
|
562
|
+
i.renderCache = [];
|
|
563
|
+
i.effect.run();
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
});
|
|
509
567
|
});
|
|
510
|
-
dirtyInstances.delete(instance);
|
|
511
568
|
});
|
|
512
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
513
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
514
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
515
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
516
569
|
}
|
|
517
570
|
queuePostFlushCb(() => {
|
|
518
571
|
hmrDirtyComponents.clear();
|
|
@@ -579,20 +632,20 @@ function devtoolsInitApp(app, version) {
|
|
|
579
632
|
function devtoolsUnmountApp(app) {
|
|
580
633
|
emit$1("app:unmount", app);
|
|
581
634
|
}
|
|
582
|
-
const devtoolsComponentAdded =
|
|
583
|
-
const devtoolsComponentUpdated =
|
|
584
|
-
const _devtoolsComponentRemoved =
|
|
635
|
+
const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
|
|
636
|
+
const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
|
|
637
|
+
const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
|
|
585
638
|
const devtoolsComponentRemoved = (component) => {
|
|
586
639
|
if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && !devtools$1.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
|
|
587
640
|
};
|
|
588
|
-
|
|
641
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
589
642
|
function createDevtoolsComponentHook(hook) {
|
|
590
643
|
return (component) => {
|
|
591
644
|
emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
|
|
592
645
|
};
|
|
593
646
|
}
|
|
594
|
-
const devtoolsPerfStart =
|
|
595
|
-
const devtoolsPerfEnd =
|
|
647
|
+
const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
|
|
648
|
+
const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
|
|
596
649
|
function createDevtoolsPerformanceHook(hook) {
|
|
597
650
|
return (component, type, time) => {
|
|
598
651
|
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
@@ -655,10 +708,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
655
708
|
const renderFnWithContext = (...args) => {
|
|
656
709
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
657
710
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
711
|
+
const prevStackSize = blockStack.length;
|
|
658
712
|
let res;
|
|
659
713
|
try {
|
|
660
714
|
res = fn(...args);
|
|
661
715
|
} finally {
|
|
716
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
662
717
|
setCurrentRenderingInstance(prevInstance);
|
|
663
718
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
664
719
|
}
|
|
@@ -853,7 +908,7 @@ function instanceWatch(source, value, options) {
|
|
|
853
908
|
}
|
|
854
909
|
const prev = setCurrentInstance(this);
|
|
855
910
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
856
|
-
|
|
911
|
+
restoreCurrentInstance(prev);
|
|
857
912
|
return res;
|
|
858
913
|
}
|
|
859
914
|
function createPathGetter(ctx, path) {
|
|
@@ -866,6 +921,7 @@ function createPathGetter(ctx, path) {
|
|
|
866
921
|
}
|
|
867
922
|
//#endregion
|
|
868
923
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
924
|
+
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
869
925
|
const TeleportEndKey = Symbol("_vte");
|
|
870
926
|
const isTeleport = (type) => type.__isTeleport;
|
|
871
927
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
@@ -874,15 +930,16 @@ const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target inst
|
|
|
874
930
|
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
875
931
|
const resolveTarget = (props, select) => {
|
|
876
932
|
const targetSelector = props && props.to;
|
|
877
|
-
if (isString(targetSelector))
|
|
878
|
-
|
|
879
|
-
|
|
933
|
+
if (isString(targetSelector)) {
|
|
934
|
+
if (!select) {
|
|
935
|
+
process.env.NODE_ENV !== "production" && warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
|
|
936
|
+
return null;
|
|
937
|
+
} else {
|
|
938
|
+
const target = select(targetSelector);
|
|
939
|
+
if (!!(process.env.NODE_ENV !== "production") && !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.`);
|
|
940
|
+
return target;
|
|
941
|
+
}
|
|
880
942
|
} else {
|
|
881
|
-
const target = select(targetSelector);
|
|
882
|
-
if (!!(process.env.NODE_ENV !== "production") && !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.`);
|
|
883
|
-
return target;
|
|
884
|
-
}
|
|
885
|
-
else {
|
|
886
943
|
if (!!(process.env.NODE_ENV !== "production") && !targetSelector && !isTeleportDisabled(props)) warn$1(`Invalid Teleport target: ${targetSelector}`);
|
|
887
944
|
return targetSelector;
|
|
888
945
|
}
|
|
@@ -891,58 +948,71 @@ const TeleportImpl = {
|
|
|
891
948
|
name: "Teleport",
|
|
892
949
|
__isTeleport: true,
|
|
893
950
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
894
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
951
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
895
952
|
const disabled = isTeleportDisabled(n2.props);
|
|
896
|
-
let {
|
|
953
|
+
let { dynamicChildren } = n2;
|
|
897
954
|
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
|
|
898
955
|
optimized = false;
|
|
899
956
|
dynamicChildren = null;
|
|
900
957
|
}
|
|
958
|
+
const mount = (vnode, container, anchor) => {
|
|
959
|
+
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
960
|
+
};
|
|
961
|
+
const mountToTarget = (vnode = n2) => {
|
|
962
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
963
|
+
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
964
|
+
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
|
|
965
|
+
if (target) {
|
|
966
|
+
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
967
|
+
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
968
|
+
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
969
|
+
if (!disabled) {
|
|
970
|
+
mount(vnode, target, targetAnchor);
|
|
971
|
+
updateCssVars(vnode, false);
|
|
972
|
+
}
|
|
973
|
+
} else if (!!(process.env.NODE_ENV !== "production") && !disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
974
|
+
};
|
|
975
|
+
const queuePendingMount = (vnode) => {
|
|
976
|
+
const mountJob = () => {
|
|
977
|
+
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
978
|
+
pendingMounts.delete(vnode);
|
|
979
|
+
if (isTeleportDisabled(vnode.props)) {
|
|
980
|
+
const mountContainer = parentNode(vnode.el) || container;
|
|
981
|
+
mount(vnode, mountContainer, vnode.anchor);
|
|
982
|
+
updateCssVars(vnode, true);
|
|
983
|
+
}
|
|
984
|
+
mountToTarget(vnode);
|
|
985
|
+
};
|
|
986
|
+
pendingMounts.set(vnode, mountJob);
|
|
987
|
+
queuePostRenderEffect(mountJob, void 0, parentSuspense);
|
|
988
|
+
};
|
|
901
989
|
if (n1 == null) {
|
|
902
990
|
const placeholder = n2.el = !!(process.env.NODE_ENV !== "production") ? createComment("teleport start") : createText("");
|
|
903
991
|
const mainAnchor = n2.anchor = !!(process.env.NODE_ENV !== "production") ? createComment("teleport end") : createText("");
|
|
904
992
|
insert(placeholder, container, anchor);
|
|
905
993
|
insert(mainAnchor, container, anchor);
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
911
|
-
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
912
|
-
if (target) {
|
|
913
|
-
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
914
|
-
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
915
|
-
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
916
|
-
if (!disabled) {
|
|
917
|
-
mount(target, targetAnchor);
|
|
918
|
-
updateCssVars(n2, false);
|
|
919
|
-
}
|
|
920
|
-
} else if (!!(process.env.NODE_ENV !== "production") && !disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
921
|
-
};
|
|
994
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
995
|
+
queuePendingMount(n2);
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
922
998
|
if (disabled) {
|
|
923
|
-
mount(container, mainAnchor);
|
|
999
|
+
mount(n2, container, mainAnchor);
|
|
924
1000
|
updateCssVars(n2, true);
|
|
925
1001
|
}
|
|
926
|
-
|
|
927
|
-
n2.el.__isMounted = false;
|
|
928
|
-
queuePostRenderEffect(() => {
|
|
929
|
-
if (n2.el.__isMounted !== false) return;
|
|
930
|
-
mountToTarget();
|
|
931
|
-
delete n2.el.__isMounted;
|
|
932
|
-
}, void 0, parentSuspense);
|
|
933
|
-
} else mountToTarget();
|
|
1002
|
+
mountToTarget();
|
|
934
1003
|
} else {
|
|
935
1004
|
n2.el = n1.el;
|
|
936
|
-
n2.targetStart = n1.targetStart;
|
|
937
1005
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
938
|
-
const
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
}, void 0, parentSuspense);
|
|
1006
|
+
const pendingMount = pendingMounts.get(n1);
|
|
1007
|
+
if (pendingMount) {
|
|
1008
|
+
pendingMount.flags |= 4;
|
|
1009
|
+
pendingMounts.delete(n1);
|
|
1010
|
+
queuePendingMount(n2);
|
|
944
1011
|
return;
|
|
945
1012
|
}
|
|
1013
|
+
n2.targetStart = n1.targetStart;
|
|
1014
|
+
const target = n2.target = n1.target;
|
|
1015
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
946
1016
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
947
1017
|
const currentContainer = wasDisabled ? container : target;
|
|
948
1018
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -956,24 +1026,30 @@ const TeleportImpl = {
|
|
|
956
1026
|
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
|
|
957
1027
|
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
|
|
958
1028
|
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
959
|
-
const nextTarget =
|
|
960
|
-
if (nextTarget)
|
|
961
|
-
|
|
1029
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
1030
|
+
if (nextTarget) {
|
|
1031
|
+
n2.target = nextTarget;
|
|
1032
|
+
moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
1033
|
+
} else if (!!(process.env.NODE_ENV !== "production")) warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
|
|
962
1034
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
963
1035
|
updateCssVars(n2, disabled);
|
|
964
1036
|
}
|
|
965
1037
|
},
|
|
966
1038
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
967
|
-
const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
|
|
1039
|
+
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
|
|
1040
|
+
const disabled = isTeleportDisabled(props);
|
|
1041
|
+
const shouldRemove = doRemove || !disabled;
|
|
1042
|
+
const pendingMount = pendingMounts.get(vnode);
|
|
1043
|
+
if (pendingMount) {
|
|
1044
|
+
pendingMount.flags |= 4;
|
|
1045
|
+
pendingMounts.delete(vnode);
|
|
1046
|
+
}
|
|
968
1047
|
if (targetStart) hostRemove(targetStart);
|
|
969
1048
|
if (targetAnchor) hostRemove(targetAnchor);
|
|
970
1049
|
doRemove && hostRemove(anchor);
|
|
971
|
-
if (shapeFlag & 16) {
|
|
972
|
-
const
|
|
973
|
-
|
|
974
|
-
const child = children[i];
|
|
975
|
-
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
976
|
-
}
|
|
1050
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
1051
|
+
const child = children[i];
|
|
1052
|
+
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
977
1053
|
}
|
|
978
1054
|
},
|
|
979
1055
|
move: moveTeleport,
|
|
@@ -984,7 +1060,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
984
1060
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
985
1061
|
const isReorder = moveType === 2;
|
|
986
1062
|
if (isReorder) insert(el, container, parentAnchor);
|
|
987
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
1063
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
988
1064
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
989
1065
|
}
|
|
990
1066
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -1011,15 +1087,17 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1011
1087
|
const disabled = isTeleportDisabled(vnode.props);
|
|
1012
1088
|
if (target) {
|
|
1013
1089
|
const targetNode = target._lpa || target.firstChild;
|
|
1014
|
-
if (vnode.shapeFlag & 16)
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1090
|
+
if (vnode.shapeFlag & 16) {
|
|
1091
|
+
if (disabled) {
|
|
1092
|
+
hydrateDisabledTeleport(node, vnode);
|
|
1093
|
+
hydrateAnchor(target, targetNode);
|
|
1094
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
|
|
1095
|
+
} else {
|
|
1096
|
+
vnode.anchor = nextSibling(node);
|
|
1097
|
+
hydrateAnchor(target, targetNode);
|
|
1098
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
|
|
1099
|
+
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1100
|
+
}
|
|
1023
1101
|
}
|
|
1024
1102
|
updateCssVars(vnode, disabled);
|
|
1025
1103
|
} else if (disabled) {
|
|
@@ -1107,49 +1185,16 @@ const BaseTransitionImpl = {
|
|
|
1107
1185
|
setup(props, { slots }) {
|
|
1108
1186
|
const instance = getCurrentInstance();
|
|
1109
1187
|
const state = useTransitionState();
|
|
1188
|
+
let resumeAfterLeave;
|
|
1110
1189
|
return () => {
|
|
1111
|
-
const
|
|
1112
|
-
if (!
|
|
1113
|
-
const child = findNonCommentChild(children);
|
|
1190
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
1191
|
+
if (!child) return;
|
|
1114
1192
|
const rawProps = toRaw$1(props);
|
|
1115
1193
|
const { mode } = rawProps;
|
|
1116
1194
|
checkTransitionMode(mode);
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
1121
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
1122
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
1123
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
1124
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
1125
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
1126
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
1127
|
-
state.isLeaving = true;
|
|
1128
|
-
leavingHooks.afterLeave = () => {
|
|
1129
|
-
state.isLeaving = false;
|
|
1130
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
1131
|
-
delete leavingHooks.afterLeave;
|
|
1132
|
-
oldInnerChild = void 0;
|
|
1133
|
-
};
|
|
1134
|
-
return emptyPlaceholder(child);
|
|
1135
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1136
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
1137
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
1138
|
-
el[leaveCbKey] = () => {
|
|
1139
|
-
earlyRemove();
|
|
1140
|
-
el[leaveCbKey] = void 0;
|
|
1141
|
-
delete enterHooks.delayedLeave;
|
|
1142
|
-
oldInnerChild = void 0;
|
|
1143
|
-
};
|
|
1144
|
-
enterHooks.delayedLeave = () => {
|
|
1145
|
-
delayedLeave();
|
|
1146
|
-
delete enterHooks.delayedLeave;
|
|
1147
|
-
oldInnerChild = void 0;
|
|
1148
|
-
};
|
|
1149
|
-
};
|
|
1150
|
-
else oldInnerChild = void 0;
|
|
1151
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
1152
|
-
return child;
|
|
1195
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
1196
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
1197
|
+
}) : NOOP);
|
|
1153
1198
|
};
|
|
1154
1199
|
}
|
|
1155
1200
|
};
|
|
@@ -1219,8 +1264,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1219
1264
|
persisted,
|
|
1220
1265
|
beforeEnter(el) {
|
|
1221
1266
|
let hook = onBeforeEnter;
|
|
1222
|
-
if (!state.isMounted)
|
|
1223
|
-
|
|
1267
|
+
if (!state.isMounted) {
|
|
1268
|
+
if (appear) hook = onBeforeAppear || onBeforeEnter;
|
|
1269
|
+
else return;
|
|
1270
|
+
}
|
|
1224
1271
|
if (el[leaveCbKey]) el[leaveCbKey](true);
|
|
1225
1272
|
earlyRemove();
|
|
1226
1273
|
callHook(hook, [el]);
|
|
@@ -1230,11 +1277,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1230
1277
|
let hook = onEnter;
|
|
1231
1278
|
let afterHook = onAfterEnter;
|
|
1232
1279
|
let cancelHook = onEnterCancelled;
|
|
1233
|
-
if (!state.isMounted)
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1280
|
+
if (!state.isMounted) {
|
|
1281
|
+
if (appear) {
|
|
1282
|
+
hook = onAppear || onEnter;
|
|
1283
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
1284
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
1285
|
+
} else return;
|
|
1286
|
+
}
|
|
1238
1287
|
let called = false;
|
|
1239
1288
|
el[enterCbKey] = (cancelled) => {
|
|
1240
1289
|
if (called) return;
|
|
@@ -1268,7 +1317,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1268
1317
|
else done();
|
|
1269
1318
|
},
|
|
1270
1319
|
clone(node) {
|
|
1271
|
-
return cloneHooks(node);
|
|
1320
|
+
return cloneHooks ? cloneHooks(node) : hooks;
|
|
1272
1321
|
}
|
|
1273
1322
|
};
|
|
1274
1323
|
return hooks;
|
|
@@ -1292,16 +1341,102 @@ function getInnerChild$1(vnode) {
|
|
|
1292
1341
|
if (shapeFlag & 32 && isFunction(children.default)) return children.default();
|
|
1293
1342
|
}
|
|
1294
1343
|
}
|
|
1344
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
1345
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
1346
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
1347
|
+
}
|
|
1348
|
+
/**
|
|
1349
|
+
* @internal
|
|
1350
|
+
*/
|
|
1351
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
1352
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
1353
|
+
const nextInner = getInnerChild$1(next);
|
|
1354
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
1355
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
1356
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
1357
|
+
enterHooks = hooks;
|
|
1358
|
+
});
|
|
1359
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
1360
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
1361
|
+
const mode = props.mode;
|
|
1362
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
1363
|
+
if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
|
|
1364
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
1365
|
+
if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
|
|
1366
|
+
}
|
|
1367
|
+
return next;
|
|
1368
|
+
}
|
|
1369
|
+
function forwardDelayedLeave(hooks, source) {
|
|
1370
|
+
const delayedLeave = source && source.delayedLeave;
|
|
1371
|
+
if (!delayedLeave) return;
|
|
1372
|
+
hooks.delayedLeave = () => {
|
|
1373
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
1374
|
+
delete hooks.delayedLeave;
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
/**
|
|
1378
|
+
* Prepares an outgoing VNode when the incoming branch belongs to another
|
|
1379
|
+
* renderer. Returns true when out-in must defer the incoming branch.
|
|
1380
|
+
*
|
|
1381
|
+
* @internal
|
|
1382
|
+
*/
|
|
1383
|
+
function prepareTransitionLeave(previous, enterHooks, props, state, instance, resumeAfterLeave) {
|
|
1384
|
+
const previousInner = getInnerChild$1(previous);
|
|
1385
|
+
if (!previousInner || previousInner.type === Comment || previous.component && recursiveGetSubtree(previous.component).type === Comment) return false;
|
|
1386
|
+
return applyTransitionModeSwitch(previousInner, prepareLeavingTransitionHooks(previousInner, props, state, instance), enterHooks ? () => enterHooks : void 0, props, state, resumeAfterLeave);
|
|
1387
|
+
}
|
|
1388
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
1389
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
1390
|
+
}
|
|
1391
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
1392
|
+
if (props.mode === "out-in") {
|
|
1393
|
+
state.isLeaving = true;
|
|
1394
|
+
leavingHooks.afterLeave = () => {
|
|
1395
|
+
state.isLeaving = false;
|
|
1396
|
+
resumeAfterLeave();
|
|
1397
|
+
delete leavingHooks.afterLeave;
|
|
1398
|
+
};
|
|
1399
|
+
return true;
|
|
1400
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
1401
|
+
let delayedLeavingVNode = leavingVNode;
|
|
1402
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1403
|
+
const enterHooks = getEnterHooks();
|
|
1404
|
+
if (!enterHooks) {
|
|
1405
|
+
delayedLeave();
|
|
1406
|
+
return;
|
|
1407
|
+
}
|
|
1408
|
+
const vnode = delayedLeavingVNode;
|
|
1409
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1410
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
1411
|
+
el[leaveCbKey] = () => {
|
|
1412
|
+
earlyRemove();
|
|
1413
|
+
el[leaveCbKey] = void 0;
|
|
1414
|
+
delete enterHooks.delayedLeave;
|
|
1415
|
+
delayedLeavingVNode = void 0;
|
|
1416
|
+
};
|
|
1417
|
+
enterHooks.delayedLeave = () => {
|
|
1418
|
+
delayedLeave();
|
|
1419
|
+
delete enterHooks.delayedLeave;
|
|
1420
|
+
delayedLeavingVNode = void 0;
|
|
1421
|
+
};
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
return false;
|
|
1425
|
+
}
|
|
1295
1426
|
function setTransitionHooks(vnode, hooks) {
|
|
1296
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
1297
|
-
else {
|
|
1427
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
1298
1428
|
vnode.transition = hooks;
|
|
1299
|
-
setTransitionHooks(vnode.component
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1429
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
1430
|
+
else {
|
|
1431
|
+
const subTree = vnode.component.subTree;
|
|
1432
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
1433
|
+
}
|
|
1434
|
+
} else if (vnode.shapeFlag & 128) {
|
|
1435
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1436
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1437
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1304
1438
|
} else vnode.transition = hooks;
|
|
1439
|
+
return hooks;
|
|
1305
1440
|
}
|
|
1306
1441
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
1307
1442
|
let ret = [];
|
|
@@ -1325,9 +1460,9 @@ function checkTransitionMode(mode) {
|
|
|
1325
1460
|
}
|
|
1326
1461
|
//#endregion
|
|
1327
1462
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1328
|
-
|
|
1463
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1329
1464
|
function defineComponent(options, extraOptions) {
|
|
1330
|
-
return isFunction(options) ? extend({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
1465
|
+
return isFunction(options) ? /*@__PURE__*/ (() => extend({ name: options.name }, extraOptions, { setup: options }))() : options;
|
|
1331
1466
|
}
|
|
1332
1467
|
//#endregion
|
|
1333
1468
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -1424,15 +1559,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1424
1559
|
if (rawRef.f) {
|
|
1425
1560
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
1426
1561
|
if (isUnmount) isArray(existing) && remove(existing, refValue);
|
|
1427
|
-
else if (!isArray(existing))
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1562
|
+
else if (!isArray(existing)) {
|
|
1563
|
+
if (_isString) {
|
|
1564
|
+
refs[ref] = [refValue];
|
|
1565
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
1566
|
+
} else {
|
|
1567
|
+
const newVal = [refValue];
|
|
1568
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
1569
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
1570
|
+
}
|
|
1571
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
1436
1572
|
} else if (_isString) {
|
|
1437
1573
|
refs[ref] = value;
|
|
1438
1574
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -1493,7 +1629,18 @@ const logMismatchError = () => {
|
|
|
1493
1629
|
hasLoggedMismatchError = true;
|
|
1494
1630
|
};
|
|
1495
1631
|
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
1496
|
-
const isMathMLContainer = (container) =>
|
|
1632
|
+
const isMathMLContainer = (container) => {
|
|
1633
|
+
if (!container.namespaceURI.includes("MathML")) return false;
|
|
1634
|
+
if (container.tagName !== "annotation-xml") return true;
|
|
1635
|
+
const encoding = container.getAttribute("encoding");
|
|
1636
|
+
return !encoding || !encoding.includes("html");
|
|
1637
|
+
};
|
|
1638
|
+
/**
|
|
1639
|
+
* Resolve the element namespace a container's children should be created in.
|
|
1640
|
+
* The live DOM is the source of truth, so this also covers containers that are
|
|
1641
|
+
* only known at runtime (interop boundaries, teleport targets).
|
|
1642
|
+
* @internal
|
|
1643
|
+
*/
|
|
1497
1644
|
const getContainerType = (container) => {
|
|
1498
1645
|
if (container.nodeType !== 1) return void 0;
|
|
1499
1646
|
if (isSVGContainer(container)) return "svg";
|
|
@@ -1519,7 +1666,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1519
1666
|
};
|
|
1520
1667
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
1521
1668
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
1522
|
-
const isFragmentStart = isComment(node) && node.data === "[";
|
|
1669
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
|
|
1523
1670
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
1524
1671
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
1525
1672
|
let domType = node.nodeType;
|
|
@@ -1535,11 +1682,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1535
1682
|
let nextNode = null;
|
|
1536
1683
|
switch (type) {
|
|
1537
1684
|
case Text:
|
|
1538
|
-
if (domType !== 3)
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1685
|
+
if (domType !== 3) {
|
|
1686
|
+
if (vnode.children === "") {
|
|
1687
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
1688
|
+
nextNode = node;
|
|
1689
|
+
} else nextNode = onMismatch();
|
|
1690
|
+
} else {
|
|
1543
1691
|
if (node.data !== vnode.children) {
|
|
1544
1692
|
(process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(`Hydration text mismatch in`, node.parentNode, `\n - rendered on server: ${JSON.stringify(node.data)}\n - expected on client: ${JSON.stringify(vnode.children)}`);
|
|
1545
1693
|
logMismatchError();
|
|
@@ -1576,30 +1724,35 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1576
1724
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1577
1725
|
break;
|
|
1578
1726
|
case VaporSlot:
|
|
1579
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
|
|
1727
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
1580
1728
|
break;
|
|
1581
|
-
default: if (shapeFlag & 1)
|
|
1582
|
-
|
|
1583
|
-
|
|
1729
|
+
default: if (shapeFlag & 1) {
|
|
1730
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
1731
|
+
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1732
|
+
} else if (shapeFlag & 6) {
|
|
1584
1733
|
vnode.slotScopeIds = slotScopeIds;
|
|
1585
1734
|
const container = parentNode(node);
|
|
1586
1735
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
1587
1736
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
1588
1737
|
else nextNode = nextSibling(node);
|
|
1589
|
-
if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container,
|
|
1590
|
-
else
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
if (
|
|
1594
|
-
subTree
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1738
|
+
if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
|
|
1739
|
+
else {
|
|
1740
|
+
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1741
|
+
const component = vnode.component;
|
|
1742
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
1743
|
+
let subTree;
|
|
1744
|
+
if (isFragmentStart) {
|
|
1745
|
+
subTree = createVNode(Static);
|
|
1746
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1747
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
1748
|
+
subTree.el = node;
|
|
1749
|
+
component.subTree = subTree;
|
|
1750
|
+
}
|
|
1599
1751
|
}
|
|
1600
|
-
} else if (shapeFlag & 64)
|
|
1601
|
-
|
|
1602
|
-
|
|
1752
|
+
} else if (shapeFlag & 64) {
|
|
1753
|
+
if (domType !== 8) nextNode = onMismatch();
|
|
1754
|
+
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
1755
|
+
} else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
1603
1756
|
else if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
1604
1757
|
}
|
|
1605
1758
|
if (ref != null) setRef(ref, null, parentSuspense, vnode);
|
|
@@ -1607,9 +1760,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1607
1760
|
};
|
|
1608
1761
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
1609
1762
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
1610
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
1763
|
+
const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
1611
1764
|
const forcePatch = type === "input" || type === "option";
|
|
1612
|
-
|
|
1765
|
+
const hasDynamicProps = !!dynamicProps;
|
|
1766
|
+
if (!!(process.env.NODE_ENV !== "production") || forcePatch || hasDynamicProps || patchFlag !== -1) {
|
|
1613
1767
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
1614
1768
|
let needCallTransitionHooks = false;
|
|
1615
1769
|
if (isTemplateNode(el)) {
|
|
@@ -1625,15 +1779,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1625
1779
|
}
|
|
1626
1780
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
1627
1781
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1628
|
-
|
|
1782
|
+
if (next && !isMismatchAllowed(el, 1)) {
|
|
1783
|
+
(process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
1784
|
+
logMismatchError();
|
|
1785
|
+
}
|
|
1629
1786
|
while (next) {
|
|
1630
|
-
if (!isMismatchAllowed(el, 1)) {
|
|
1631
|
-
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
|
|
1632
|
-
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
1633
|
-
hasWarned = true;
|
|
1634
|
-
}
|
|
1635
|
-
logMismatchError();
|
|
1636
|
-
}
|
|
1637
1787
|
const cur = next;
|
|
1638
1788
|
next = next.nextSibling;
|
|
1639
1789
|
remove(cur);
|
|
@@ -1651,11 +1801,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1651
1801
|
}
|
|
1652
1802
|
}
|
|
1653
1803
|
if (props) {
|
|
1654
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & 48) {
|
|
1804
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || hasDynamicProps || !optimized || patchFlag & 48) {
|
|
1655
1805
|
const isCustomElement = el.tagName.includes("-");
|
|
1806
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
1656
1807
|
for (const key in props) {
|
|
1657
1808
|
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
1658
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)
|
|
1809
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
1810
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
1811
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
1812
|
+
}
|
|
1659
1813
|
}
|
|
1660
1814
|
} else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
|
|
1661
1815
|
else if (patchFlag & 4 && isReactive$1(props.style)) for (const key in props.style) props.style[key];
|
|
@@ -1675,7 +1829,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1675
1829
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
1676
1830
|
const children = parentVNode.children;
|
|
1677
1831
|
const l = children.length;
|
|
1678
|
-
let
|
|
1832
|
+
let hasCheckedMismatch = false;
|
|
1679
1833
|
for (let i = 0; i < l; i++) {
|
|
1680
1834
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
1681
1835
|
const isText = vnode.type === Text;
|
|
@@ -1689,12 +1843,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1689
1843
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1690
1844
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
1691
1845
|
else {
|
|
1692
|
-
if (!
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1846
|
+
if (!hasCheckedMismatch) {
|
|
1847
|
+
hasCheckedMismatch = true;
|
|
1848
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
1849
|
+
(process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
|
|
1850
|
+
logMismatchError();
|
|
1696
1851
|
}
|
|
1697
|
-
logMismatchError();
|
|
1698
1852
|
}
|
|
1699
1853
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
1700
1854
|
}
|
|
@@ -1705,8 +1859,9 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1705
1859
|
const { slotScopeIds: fragmentSlotScopeIds } = vnode;
|
|
1706
1860
|
if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
1707
1861
|
const container = parentNode(node);
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1862
|
+
const first = nextSibling(node);
|
|
1863
|
+
const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1864
|
+
if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
|
|
1710
1865
|
else {
|
|
1711
1866
|
logMismatchError();
|
|
1712
1867
|
insert(vnode.anchor = createComment(`]`), container, next);
|
|
@@ -1714,8 +1869,8 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1714
1869
|
}
|
|
1715
1870
|
};
|
|
1716
1871
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
1717
|
-
if (!
|
|
1718
|
-
(process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && 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);
|
|
1872
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
1873
|
+
(process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && 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);
|
|
1719
1874
|
logMismatchError();
|
|
1720
1875
|
}
|
|
1721
1876
|
vnode.el = null;
|
|
@@ -1731,20 +1886,22 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1731
1886
|
const container = parentNode(node);
|
|
1732
1887
|
remove(node);
|
|
1733
1888
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
1734
|
-
if (parentComponent) {
|
|
1889
|
+
if (parentComponent && parentComponent.vnode) {
|
|
1735
1890
|
parentComponent.vnode.el = vnode.el;
|
|
1736
1891
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
1737
1892
|
}
|
|
1738
1893
|
return next;
|
|
1739
1894
|
};
|
|
1740
|
-
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
1895
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
|
|
1741
1896
|
let match = 0;
|
|
1742
1897
|
while (node) {
|
|
1743
1898
|
node = nextSibling(node);
|
|
1744
1899
|
if (node && isComment(node)) {
|
|
1745
1900
|
if (node.data === open) match++;
|
|
1746
|
-
if (node.data === close)
|
|
1747
|
-
|
|
1901
|
+
if (node.data === close) {
|
|
1902
|
+
if (match === 0) return nextSibling(node);
|
|
1903
|
+
else match--;
|
|
1904
|
+
}
|
|
1748
1905
|
}
|
|
1749
1906
|
}
|
|
1750
1907
|
return node;
|
|
@@ -1754,7 +1911,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1754
1911
|
if (parentNode) parentNode.replaceChild(newNode, oldNode);
|
|
1755
1912
|
let parent = parentComponent;
|
|
1756
1913
|
while (parent) {
|
|
1757
|
-
if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
1914
|
+
if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
1758
1915
|
parent = parent.parent;
|
|
1759
1916
|
}
|
|
1760
1917
|
};
|
|
@@ -1763,6 +1920,16 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1763
1920
|
const isTemplateNode = (node) => {
|
|
1764
1921
|
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
1765
1922
|
};
|
|
1923
|
+
const resourceProps = /*@__PURE__*/ new Set([
|
|
1924
|
+
"src",
|
|
1925
|
+
"srcset",
|
|
1926
|
+
"href",
|
|
1927
|
+
"poster"
|
|
1928
|
+
]);
|
|
1929
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
1930
|
+
if (!resourceProps.has(key)) return false;
|
|
1931
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
1932
|
+
}
|
|
1766
1933
|
/**
|
|
1767
1934
|
* Dev only
|
|
1768
1935
|
*/
|
|
@@ -1806,7 +1973,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
1806
1973
|
function getAttributeMismatch(el, key, clientValue) {
|
|
1807
1974
|
let actual;
|
|
1808
1975
|
let expected;
|
|
1809
|
-
if (
|
|
1976
|
+
if (key === "hidden") {
|
|
1977
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
1978
|
+
expected = normalizeHiddenValue(clientValue);
|
|
1979
|
+
} else if (isBooleanAttr(key)) {
|
|
1810
1980
|
actual = el.hasAttribute(key);
|
|
1811
1981
|
expected = includeBooleanAttr(clientValue);
|
|
1812
1982
|
} else if (clientValue == null) {
|
|
@@ -1834,6 +2004,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
|
|
|
1834
2004
|
}
|
|
1835
2005
|
return false;
|
|
1836
2006
|
}
|
|
2007
|
+
function normalizeHiddenValue(value) {
|
|
2008
|
+
if (!isRenderableAttrValue(value)) return false;
|
|
2009
|
+
if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
2010
|
+
return includeBooleanAttr(value) ? "" : false;
|
|
2011
|
+
}
|
|
1837
2012
|
function toClassSet(str) {
|
|
1838
2013
|
return new Set(str.trim().split(/\s+/));
|
|
1839
2014
|
}
|
|
@@ -1890,7 +2065,9 @@ const MismatchTypeString = {
|
|
|
1890
2065
|
};
|
|
1891
2066
|
function isMismatchAllowed(el, allowedType) {
|
|
1892
2067
|
if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
|
|
1893
|
-
|
|
2068
|
+
return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
|
|
2069
|
+
}
|
|
2070
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
1894
2071
|
if (allowedAttr == null) return false;
|
|
1895
2072
|
else if (allowedAttr === "") return true;
|
|
1896
2073
|
else {
|
|
@@ -1899,6 +2076,16 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
1899
2076
|
return list.includes(MismatchTypeString[allowedType]);
|
|
1900
2077
|
}
|
|
1901
2078
|
}
|
|
2079
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
2080
|
+
return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
2081
|
+
}
|
|
2082
|
+
function isMismatchAllowedByNode(node) {
|
|
2083
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
|
|
2084
|
+
}
|
|
2085
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
2086
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
2087
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
|
|
2088
|
+
}
|
|
1902
2089
|
//#endregion
|
|
1903
2090
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
1904
2091
|
let requestIdleCallback;
|
|
@@ -1972,16 +2159,18 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
1972
2159
|
return teardown;
|
|
1973
2160
|
};
|
|
1974
2161
|
function forEachElement(node, cb) {
|
|
1975
|
-
if (isComment(node) && node.data === "[") {
|
|
2162
|
+
if (isComment(node) && (node.data === "[" || node.data === "(")) {
|
|
2163
|
+
const open = node.data;
|
|
2164
|
+
const close = open === "[" ? "]" : ")";
|
|
1976
2165
|
let depth = 1;
|
|
1977
2166
|
let next = node.nextSibling;
|
|
1978
2167
|
while (next) {
|
|
1979
2168
|
if (next.nodeType === 1) {
|
|
1980
2169
|
if (cb(next) === false) break;
|
|
1981
2170
|
} else if (isComment(next)) {
|
|
1982
|
-
if (next.data ===
|
|
2171
|
+
if (next.data === close) {
|
|
1983
2172
|
if (--depth === 0) break;
|
|
1984
|
-
} else if (next.data ===
|
|
2173
|
+
} else if (next.data === open) depth++;
|
|
1985
2174
|
}
|
|
1986
2175
|
next = next.nextSibling;
|
|
1987
2176
|
}
|
|
@@ -1990,14 +2179,14 @@ function forEachElement(node, cb) {
|
|
|
1990
2179
|
//#endregion
|
|
1991
2180
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
1992
2181
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
1993
|
-
|
|
2182
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1994
2183
|
function defineAsyncComponent(source) {
|
|
1995
2184
|
const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
|
|
1996
2185
|
return /* @__PURE__ */ defineComponent({
|
|
1997
2186
|
name: "AsyncComponentWrapper",
|
|
1998
2187
|
__asyncLoader: load,
|
|
1999
2188
|
__asyncHydrate(el, instance, hydrate) {
|
|
2000
|
-
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
|
|
2189
|
+
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
|
|
2001
2190
|
},
|
|
2002
2191
|
get __asyncResolved() {
|
|
2003
2192
|
return getResolvedComp();
|
|
@@ -2017,11 +2206,16 @@ function defineAsyncComponent(source) {
|
|
|
2017
2206
|
onError(err);
|
|
2018
2207
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
2019
2208
|
});
|
|
2020
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
2209
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
2021
2210
|
load().then(() => {
|
|
2211
|
+
if (instance.isUnmounted) return;
|
|
2022
2212
|
loaded.value = true;
|
|
2023
2213
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
2024
2214
|
}).catch((err) => {
|
|
2215
|
+
if (instance.isUnmounted) {
|
|
2216
|
+
setPendingRequest(null);
|
|
2217
|
+
return;
|
|
2218
|
+
}
|
|
2025
2219
|
onError(err);
|
|
2026
2220
|
error.value = err;
|
|
2027
2221
|
});
|
|
@@ -2079,14 +2273,22 @@ function createAsyncComponentContext(source) {
|
|
|
2079
2273
|
setPendingRequest: (request) => pendingRequest = request
|
|
2080
2274
|
};
|
|
2081
2275
|
}
|
|
2082
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
2276
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
2083
2277
|
const loaded = ref$1(false);
|
|
2084
2278
|
const error = ref$1();
|
|
2085
2279
|
const delayed = ref$1(!!delay);
|
|
2086
|
-
|
|
2280
|
+
let timeoutTimer;
|
|
2281
|
+
let delayTimer;
|
|
2282
|
+
if (instance) onUnmounted(() => {
|
|
2283
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
2284
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
2285
|
+
}, instance);
|
|
2286
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
2287
|
+
if (instance && instance.isUnmounted) return;
|
|
2087
2288
|
delayed.value = false;
|
|
2088
2289
|
}, delay);
|
|
2089
|
-
if (timeout != null) setTimeout(() => {
|
|
2290
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
2291
|
+
if (instance && instance.isUnmounted) return;
|
|
2090
2292
|
if (!loaded.value && !error.value) {
|
|
2091
2293
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
2092
2294
|
onError(err);
|
|
@@ -2103,9 +2305,10 @@ const useAsyncComponentState = (delay, timeout, onError) => {
|
|
|
2103
2305
|
* shared between core and vapor
|
|
2104
2306
|
* @internal
|
|
2105
2307
|
*/
|
|
2106
|
-
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
2308
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
|
|
2309
|
+
const wasConnected = el.isConnected;
|
|
2107
2310
|
let patched = false;
|
|
2108
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2311
|
+
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2109
2312
|
const performHydrate = () => {
|
|
2110
2313
|
if (patched) {
|
|
2111
2314
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
@@ -2114,6 +2317,7 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
2114
2317
|
}
|
|
2115
2318
|
return;
|
|
2116
2319
|
}
|
|
2320
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
2117
2321
|
hydrate();
|
|
2118
2322
|
};
|
|
2119
2323
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -2194,10 +2398,13 @@ const KeepAlive = {
|
|
|
2194
2398
|
});
|
|
2195
2399
|
let pendingCacheKey = null;
|
|
2196
2400
|
const cacheSubtree = () => {
|
|
2197
|
-
if (pendingCacheKey != null)
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2401
|
+
if (pendingCacheKey != null) {
|
|
2402
|
+
if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
|
|
2403
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
2404
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
2405
|
+
}, void 0, keepAliveInstance.subTree.suspense);
|
|
2406
|
+
else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
2407
|
+
}
|
|
2201
2408
|
};
|
|
2202
2409
|
onMounted(cacheSubtree);
|
|
2203
2410
|
onUpdated(cacheSubtree);
|
|
@@ -2354,7 +2561,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
2354
2561
|
try {
|
|
2355
2562
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
2356
2563
|
} finally {
|
|
2357
|
-
|
|
2564
|
+
restoreCurrentInstance(prev);
|
|
2358
2565
|
setActiveSub(prevSub);
|
|
2359
2566
|
}
|
|
2360
2567
|
});
|
|
@@ -2439,23 +2646,25 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2439
2646
|
}
|
|
2440
2647
|
ret = new Array(source.length);
|
|
2441
2648
|
for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
|
|
2442
|
-
} else if (typeof source === "number")
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
else if (isObject(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2450
|
-
else {
|
|
2451
|
-
const keys = Object.keys(source);
|
|
2452
|
-
ret = new Array(keys.length);
|
|
2453
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2454
|
-
const key = keys[i];
|
|
2455
|
-
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2649
|
+
} else if (typeof source === "number") {
|
|
2650
|
+
if (!!(process.env.NODE_ENV !== "production") && (!Number.isInteger(source) || source < 0)) {
|
|
2651
|
+
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
2652
|
+
ret = [];
|
|
2653
|
+
} else {
|
|
2654
|
+
ret = new Array(source);
|
|
2655
|
+
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2456
2656
|
}
|
|
2457
|
-
}
|
|
2458
|
-
|
|
2657
|
+
} else if (isObject(source)) {
|
|
2658
|
+
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2659
|
+
else {
|
|
2660
|
+
const keys = Object.keys(source);
|
|
2661
|
+
ret = new Array(keys.length);
|
|
2662
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2663
|
+
const key = keys[i];
|
|
2664
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
} else ret = [];
|
|
2459
2668
|
if (cache) cache[index] = ret;
|
|
2460
2669
|
return ret;
|
|
2461
2670
|
}
|
|
@@ -2480,37 +2689,81 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2480
2689
|
//#endregion
|
|
2481
2690
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
2482
2691
|
/**
|
|
2692
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
2693
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
2694
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
2695
|
+
* "which one". Internal to vapor interop.
|
|
2696
|
+
*/
|
|
2697
|
+
const rawVaporSlotKey = Symbol(`rawVaporSlot`);
|
|
2698
|
+
/**
|
|
2699
|
+
* Invokes a VDOM slot fallback under the outlet owner that produced it, the
|
|
2700
|
+
* way `renderSlot` would have rendered it inline. Vapor interop invokes
|
|
2701
|
+
* fallbacks late, outside any render, so it passes the owner recorded on the
|
|
2702
|
+
* vapor slot vnode. Internal to vapor interop.
|
|
2703
|
+
*/
|
|
2704
|
+
function invokeSlotFallback(fallback, owner) {
|
|
2705
|
+
if (!owner) return fallback();
|
|
2706
|
+
const prev = setCurrentRenderingInstance(owner);
|
|
2707
|
+
const prevStackSize = blockStack.length;
|
|
2708
|
+
try {
|
|
2709
|
+
return fallback();
|
|
2710
|
+
} finally {
|
|
2711
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2712
|
+
setCurrentRenderingInstance(prev);
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
/**
|
|
2483
2716
|
* Compiler runtime helper for rendering `<slot/>`
|
|
2484
2717
|
* @private
|
|
2485
2718
|
*/
|
|
2486
|
-
function renderSlot(slots, name, props
|
|
2719
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2720
|
+
if (props == null) props = {};
|
|
2487
2721
|
let slot = slots[name];
|
|
2488
|
-
const vaporSlot = slot &&
|
|
2722
|
+
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
2489
2723
|
if (vaporSlot) {
|
|
2490
2724
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
2491
2725
|
ret.vs = {
|
|
2492
2726
|
slot: vaporSlot,
|
|
2493
|
-
fallback
|
|
2727
|
+
outlets: fallback ? [{
|
|
2728
|
+
fallback,
|
|
2729
|
+
owner: currentRenderingInstance
|
|
2730
|
+
}] : void 0
|
|
2494
2731
|
};
|
|
2732
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2495
2733
|
return ret;
|
|
2496
2734
|
}
|
|
2497
2735
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
2498
|
-
const
|
|
2499
|
-
|
|
2500
|
-
|
|
2736
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
2737
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
2738
|
+
if (name !== "default") slotProps.name = name;
|
|
2739
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
2501
2740
|
}
|
|
2502
2741
|
if (!!(process.env.NODE_ENV !== "production") && slot && slot.length > 1) {
|
|
2503
2742
|
warn$1("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.");
|
|
2504
2743
|
slot = () => [];
|
|
2505
2744
|
}
|
|
2506
2745
|
if (slot && slot._c) slot._d = false;
|
|
2746
|
+
const prevStackSize = blockStack.length;
|
|
2507
2747
|
openBlock();
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2748
|
+
let rendered;
|
|
2749
|
+
try {
|
|
2750
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2751
|
+
let attached = false;
|
|
2752
|
+
if (fallback && validSlotContent && currentRenderingInstance) {
|
|
2753
|
+
const interop = currentRenderingInstance.appContext.vapor;
|
|
2754
|
+
if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
|
|
2755
|
+
}
|
|
2756
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
2757
|
+
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
2758
|
+
if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
|
|
2759
|
+
if (attached) rendered.vo = true;
|
|
2760
|
+
} catch (err) {
|
|
2761
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2762
|
+
throw err;
|
|
2763
|
+
} finally {
|
|
2764
|
+
if (slot && slot._c) slot._d = true;
|
|
2765
|
+
}
|
|
2512
2766
|
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
2513
|
-
if (slot && slot._c) slot._d = true;
|
|
2514
2767
|
return rendered;
|
|
2515
2768
|
}
|
|
2516
2769
|
function ensureValidVNode(vnodes) {
|
|
@@ -2521,12 +2774,6 @@ function ensureValidVNode(vnodes) {
|
|
|
2521
2774
|
return true;
|
|
2522
2775
|
}) ? vnodes : null;
|
|
2523
2776
|
}
|
|
2524
|
-
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
2525
|
-
let vaporSlot;
|
|
2526
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
|
|
2527
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
2528
|
-
}
|
|
2529
|
-
}
|
|
2530
2777
|
//#endregion
|
|
2531
2778
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
2532
2779
|
/**
|
|
@@ -2554,11 +2801,38 @@ const getPublicInstance = (i) => {
|
|
|
2554
2801
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
2555
2802
|
return getPublicInstance(i.parent);
|
|
2556
2803
|
};
|
|
2804
|
+
const resolveDevRootEl = (vnode) => {
|
|
2805
|
+
let found = false;
|
|
2806
|
+
while (true) {
|
|
2807
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
2808
|
+
const root = filterSingleRoot(vnode.children);
|
|
2809
|
+
if (!root) return;
|
|
2810
|
+
vnode = root;
|
|
2811
|
+
found = true;
|
|
2812
|
+
continue;
|
|
2813
|
+
}
|
|
2814
|
+
const component = vnode.component;
|
|
2815
|
+
if (component && component.subTree) {
|
|
2816
|
+
vnode = component.subTree;
|
|
2817
|
+
continue;
|
|
2818
|
+
}
|
|
2819
|
+
const suspense = vnode.suspense;
|
|
2820
|
+
if (suspense && suspense.activeBranch) {
|
|
2821
|
+
vnode = suspense.activeBranch;
|
|
2822
|
+
continue;
|
|
2823
|
+
}
|
|
2824
|
+
return found ? vnode.el : void 0;
|
|
2825
|
+
}
|
|
2826
|
+
};
|
|
2827
|
+
const getDevRootFragmentEl = (i) => {
|
|
2828
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
2829
|
+
return el === void 0 ? i.vnode.el : el;
|
|
2830
|
+
};
|
|
2557
2831
|
let publicPropertiesMap;
|
|
2558
2832
|
const getPublicPropertiesMap = () => {
|
|
2559
2833
|
if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
|
|
2560
2834
|
$: (i) => i,
|
|
2561
|
-
$el: (i) => i.vnode.el,
|
|
2835
|
+
$el: (i) => !!(process.env.NODE_ENV !== "production") ? getDevRootFragmentEl(i) : i.vnode.el,
|
|
2562
2836
|
$data: (i) => i.data,
|
|
2563
2837
|
$props: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly$1(i.props) : i.props,
|
|
2564
2838
|
$attrs: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly$1(i.attrs) : i.attrs,
|
|
@@ -2664,7 +2938,7 @@ if (!!(process.env.NODE_ENV !== "production") && true) PublicInstanceProxyHandle
|
|
|
2664
2938
|
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.");
|
|
2665
2939
|
return Reflect.ownKeys(target);
|
|
2666
2940
|
};
|
|
2667
|
-
const RuntimeCompiledPublicInstanceProxyHandlers =
|
|
2941
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ extend({}, PublicInstanceProxyHandlers, {
|
|
2668
2942
|
get(target, key) {
|
|
2669
2943
|
if (key === Symbol.unscopables) return;
|
|
2670
2944
|
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
@@ -2836,12 +3110,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
2836
3110
|
for (const key in defaults) {
|
|
2837
3111
|
if (key.startsWith("__skip")) continue;
|
|
2838
3112
|
let opt = props[key];
|
|
2839
|
-
if (opt)
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
3113
|
+
if (opt) {
|
|
3114
|
+
if (isArray(opt) || isFunction(opt)) opt = props[key] = {
|
|
3115
|
+
type: opt,
|
|
3116
|
+
default: defaults[key]
|
|
3117
|
+
};
|
|
3118
|
+
else opt.default = defaults[key];
|
|
3119
|
+
} else if (opt === null) opt = props[key] = { default: defaults[key] };
|
|
2845
3120
|
else if (!!(process.env.NODE_ENV !== "production")) warn$1(`props default key "${key}" has no corresponding declaration.`);
|
|
2846
3121
|
if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
|
|
2847
3122
|
}
|
|
@@ -2896,21 +3171,29 @@ function withAsyncContext(getAwaitable) {
|
|
|
2896
3171
|
setCurrentInstance(null, void 0);
|
|
2897
3172
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2898
3173
|
const restore = () => {
|
|
3174
|
+
const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
2899
3175
|
setCurrentInstance(ctx);
|
|
2900
3176
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
3177
|
+
return stoppedScope;
|
|
2901
3178
|
};
|
|
2902
3179
|
const cleanup = () => {
|
|
2903
3180
|
setCurrentInstance(null, void 0);
|
|
2904
3181
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2905
3182
|
};
|
|
2906
3183
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
2907
|
-
restore();
|
|
2908
|
-
Promise.resolve().then(() => Promise.resolve().then(
|
|
3184
|
+
const stoppedScope = restore();
|
|
3185
|
+
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
3186
|
+
if (stoppedScope) stoppedScope.reset();
|
|
3187
|
+
cleanup();
|
|
3188
|
+
}));
|
|
2909
3189
|
throw e;
|
|
2910
3190
|
});
|
|
2911
3191
|
return [awaitable, () => {
|
|
2912
|
-
restore();
|
|
2913
|
-
Promise.resolve().then(
|
|
3192
|
+
const stoppedScope = restore();
|
|
3193
|
+
Promise.resolve().then(() => {
|
|
3194
|
+
if (stoppedScope) stoppedScope.reset();
|
|
3195
|
+
cleanup();
|
|
3196
|
+
});
|
|
2914
3197
|
}];
|
|
2915
3198
|
}
|
|
2916
3199
|
//#endregion
|
|
@@ -2972,11 +3255,12 @@ function applyOptions(instance) {
|
|
|
2972
3255
|
const opt = computedOptions[key];
|
|
2973
3256
|
const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
|
|
2974
3257
|
if (!!(process.env.NODE_ENV !== "production") && get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
|
|
3258
|
+
const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : !!(process.env.NODE_ENV !== "production") ? () => {
|
|
3259
|
+
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3260
|
+
} : NOOP;
|
|
2975
3261
|
const c = computed({
|
|
2976
3262
|
get,
|
|
2977
|
-
set
|
|
2978
|
-
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
2979
|
-
} : NOOP
|
|
3263
|
+
set
|
|
2980
3264
|
});
|
|
2981
3265
|
Object.defineProperty(ctx, key, {
|
|
2982
3266
|
enumerable: true,
|
|
@@ -3033,9 +3317,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
|
|
|
3033
3317
|
for (const key in injectOptions) {
|
|
3034
3318
|
const opt = injectOptions[key];
|
|
3035
3319
|
let injected;
|
|
3036
|
-
if (isObject(opt))
|
|
3037
|
-
|
|
3038
|
-
|
|
3320
|
+
if (isObject(opt)) {
|
|
3321
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
3322
|
+
else injected = inject(opt.from || key);
|
|
3323
|
+
} else injected = inject(opt);
|
|
3039
3324
|
if (isRef$1(injected)) Object.defineProperty(ctx, key, {
|
|
3040
3325
|
enumerable: true,
|
|
3041
3326
|
configurable: true,
|
|
@@ -3056,13 +3341,14 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3056
3341
|
if (isFunction(handler)) watch(getter, handler);
|
|
3057
3342
|
else if (!!(process.env.NODE_ENV !== "production")) warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
3058
3343
|
} else if (isFunction(raw)) watch(getter, raw.bind(publicThis));
|
|
3059
|
-
else if (isObject(raw))
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3344
|
+
else if (isObject(raw)) {
|
|
3345
|
+
if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
3346
|
+
else {
|
|
3347
|
+
const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
3348
|
+
if (isFunction(handler)) watch(getter, handler, raw);
|
|
3349
|
+
else if (!!(process.env.NODE_ENV !== "production")) warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
3350
|
+
}
|
|
3351
|
+
} else if (!!(process.env.NODE_ENV !== "production")) warn$1(`Invalid watch option: "${key}"`, raw);
|
|
3066
3352
|
}
|
|
3067
3353
|
/**
|
|
3068
3354
|
* Resolve merged options and cache it on the component.
|
|
@@ -3148,7 +3434,7 @@ function mergeObjectOptions(to, from) {
|
|
|
3148
3434
|
}
|
|
3149
3435
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
3150
3436
|
if (to) {
|
|
3151
|
-
if (isArray(to) && isArray(from)) return [
|
|
3437
|
+
if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
3152
3438
|
return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
3153
3439
|
} else return from;
|
|
3154
3440
|
}
|
|
@@ -3273,8 +3559,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
3273
3559
|
} else if (!!(process.env.NODE_ENV !== "production")) warn$1(`Cannot unmount an app that is not mounted.`);
|
|
3274
3560
|
},
|
|
3275
3561
|
provide(key, value) {
|
|
3276
|
-
if (!!(process.env.NODE_ENV !== "production") && key in context.provides)
|
|
3277
|
-
|
|
3562
|
+
if (!!(process.env.NODE_ENV !== "production") && key in context.provides) {
|
|
3563
|
+
if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
|
|
3564
|
+
else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
|
|
3565
|
+
}
|
|
3278
3566
|
context.provides[key] = value;
|
|
3279
3567
|
return app;
|
|
3280
3568
|
},
|
|
@@ -3313,13 +3601,17 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
3313
3601
|
const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
|
|
3314
3602
|
const res = customRef$1((track, trigger) => {
|
|
3315
3603
|
let localValue;
|
|
3604
|
+
let prevPropValue = EMPTY_OBJ;
|
|
3316
3605
|
let prevSetValue = EMPTY_OBJ;
|
|
3317
3606
|
let prevEmittedValue;
|
|
3318
3607
|
watchSyncEffect(() => {
|
|
3319
3608
|
const propValue = props[camelizedName];
|
|
3320
|
-
if (hasChanged(
|
|
3321
|
-
|
|
3322
|
-
|
|
3609
|
+
if (hasChanged(prevPropValue, propValue)) {
|
|
3610
|
+
prevPropValue = propValue;
|
|
3611
|
+
if (hasChanged(localValue, propValue)) {
|
|
3612
|
+
localValue = propValue;
|
|
3613
|
+
trigger();
|
|
3614
|
+
}
|
|
3323
3615
|
}
|
|
3324
3616
|
});
|
|
3325
3617
|
return {
|
|
@@ -3342,12 +3634,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
3342
3634
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
3343
3635
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
3344
3636
|
}
|
|
3345
|
-
|
|
3637
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
3638
|
+
if (!hasVModel) {
|
|
3346
3639
|
localValue = value;
|
|
3347
3640
|
trigger();
|
|
3348
3641
|
}
|
|
3349
3642
|
i.emit(`update:${name}`, emittedValue);
|
|
3350
|
-
if (hasChanged(value,
|
|
3643
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
3351
3644
|
prevSetValue = value;
|
|
3352
3645
|
prevEmittedValue = emittedValue;
|
|
3353
3646
|
}
|
|
@@ -3380,12 +3673,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3380
3673
|
if (instance.isUnmounted) return;
|
|
3381
3674
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3382
3675
|
const { emitsOptions, propsOptions } = instance;
|
|
3383
|
-
if (emitsOptions)
|
|
3384
|
-
if (!
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
if (
|
|
3676
|
+
if (emitsOptions) {
|
|
3677
|
+
if (!(event in emitsOptions) && true) {
|
|
3678
|
+
if (!propsOptions || !propsOptions[0] || !(toHandlerKey$1(camelize$1(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey$1(camelize$1(event))}" prop.`);
|
|
3679
|
+
} else {
|
|
3680
|
+
const validator = emitsOptions[event];
|
|
3681
|
+
if (isFunction(validator)) {
|
|
3682
|
+
if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
3683
|
+
}
|
|
3389
3684
|
}
|
|
3390
3685
|
}
|
|
3391
3686
|
}
|
|
@@ -3394,7 +3689,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3394
3689
|
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
3395
3690
|
if (modifiers) {
|
|
3396
3691
|
if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
3397
|
-
if (modifiers.number) args =
|
|
3692
|
+
if (modifiers.number) args = args.map(looseToNumber);
|
|
3398
3693
|
}
|
|
3399
3694
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsComponentEmit(instance, event, args);
|
|
3400
3695
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
@@ -3454,7 +3749,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
3454
3749
|
*/
|
|
3455
3750
|
function isEmitListener(options, key) {
|
|
3456
3751
|
if (!options || !isOn(key)) return false;
|
|
3457
|
-
key = key.slice(2)
|
|
3752
|
+
key = key.slice(2);
|
|
3753
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
3458
3754
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
3459
3755
|
}
|
|
3460
3756
|
//#endregion
|
|
@@ -3524,8 +3820,9 @@ function renderComponentRoot(instance) {
|
|
|
3524
3820
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
3525
3821
|
}
|
|
3526
3822
|
if (vnode.transition) {
|
|
3527
|
-
|
|
3528
|
-
|
|
3823
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
3824
|
+
if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
3825
|
+
setTransitionHooks(child, vnode.transition);
|
|
3529
3826
|
}
|
|
3530
3827
|
if (!!(process.env.NODE_ENV !== "production") && setRoot) setRoot(root);
|
|
3531
3828
|
else result = root;
|
|
@@ -3576,18 +3873,21 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
3576
3873
|
for (let i = 0; i < children.length; i++) {
|
|
3577
3874
|
const child = children[i];
|
|
3578
3875
|
if (isVNode(child)) {
|
|
3579
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3876
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
3877
|
+
if (singleRoot) return;
|
|
3878
|
+
else {
|
|
3879
|
+
singleRoot = child;
|
|
3880
|
+
if (!!(process.env.NODE_ENV !== "production") && recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
3881
|
+
}
|
|
3583
3882
|
}
|
|
3584
3883
|
} else return;
|
|
3585
3884
|
}
|
|
3586
3885
|
return singleRoot;
|
|
3587
3886
|
}
|
|
3887
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
|
|
3588
3888
|
const getFunctionalFallthrough = (attrs) => {
|
|
3589
3889
|
let res;
|
|
3590
|
-
for (const key in attrs) if (
|
|
3890
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
3591
3891
|
return res;
|
|
3592
3892
|
};
|
|
3593
3893
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -3699,16 +3999,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3699
3999
|
let key = propsToUpdate[i];
|
|
3700
4000
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
3701
4001
|
const value = rawProps[key];
|
|
3702
|
-
if (options)
|
|
3703
|
-
if (
|
|
3704
|
-
attrs[key]
|
|
3705
|
-
|
|
4002
|
+
if (options) {
|
|
4003
|
+
if (hasOwn(attrs, key)) {
|
|
4004
|
+
if (value !== attrs[key]) {
|
|
4005
|
+
attrs[key] = value;
|
|
4006
|
+
hasAttrsChanged = true;
|
|
4007
|
+
}
|
|
4008
|
+
} else {
|
|
4009
|
+
const camelizedKey = camelize$1(key);
|
|
4010
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3706
4011
|
}
|
|
3707
|
-
} else {
|
|
3708
|
-
const camelizedKey = camelize$1(key);
|
|
3709
|
-
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3710
|
-
}
|
|
3711
|
-
else if (value !== attrs[key]) {
|
|
4012
|
+
} else if (value !== attrs[key]) {
|
|
3712
4013
|
attrs[key] = value;
|
|
3713
4014
|
hasAttrsChanged = true;
|
|
3714
4015
|
}
|
|
@@ -3717,9 +4018,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3717
4018
|
} else {
|
|
3718
4019
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
3719
4020
|
let kebabKey;
|
|
3720
|
-
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))
|
|
3721
|
-
if (
|
|
3722
|
-
|
|
4021
|
+
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
|
|
4022
|
+
if (options) {
|
|
4023
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
4024
|
+
} else delete props[key];
|
|
4025
|
+
}
|
|
3723
4026
|
if (attrs !== rawCurrentProps) {
|
|
3724
4027
|
for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && true) {
|
|
3725
4028
|
delete attrs[key];
|
|
@@ -3738,9 +4041,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3738
4041
|
if (isReservedProp(key)) continue;
|
|
3739
4042
|
const value = rawProps[key];
|
|
3740
4043
|
let camelKey;
|
|
3741
|
-
if (options && hasOwn(options, camelKey = camelize$1(key)))
|
|
3742
|
-
|
|
3743
|
-
|
|
4044
|
+
if (options && hasOwn(options, camelKey = camelize$1(key))) {
|
|
4045
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
4046
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
4047
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3744
4048
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
3745
4049
|
attrs[key] = value;
|
|
3746
4050
|
hasAttrsChanged = true;
|
|
@@ -3787,7 +4091,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
3787
4091
|
const prev = setCurrentInstance(instance);
|
|
3788
4092
|
const props = toRaw$1(instance.props);
|
|
3789
4093
|
value = factory.call(null, props);
|
|
3790
|
-
|
|
4094
|
+
restoreCurrentInstance(prev);
|
|
3791
4095
|
return value;
|
|
3792
4096
|
}
|
|
3793
4097
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -3903,7 +4207,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
|
|
|
3903
4207
|
}
|
|
3904
4208
|
if (validator && !validator(value, !!(process.env.NODE_ENV !== "production") ? shallowReadonly$1(resolvedProps) : resolvedProps)) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
|
|
3905
4209
|
}
|
|
3906
|
-
const isSimpleType =
|
|
4210
|
+
const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
|
|
3907
4211
|
/**
|
|
3908
4212
|
* dev only
|
|
3909
4213
|
*/
|
|
@@ -3933,7 +4237,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
3933
4237
|
const receivedType = toRawType(value);
|
|
3934
4238
|
const expectedValue = styleValue(value, expectedType);
|
|
3935
4239
|
const receivedValue = styleValue(value, receivedType);
|
|
3936
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
4240
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
3937
4241
|
message += `, got ${receivedType} `;
|
|
3938
4242
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
3939
4243
|
return message;
|
|
@@ -3942,7 +4246,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
3942
4246
|
* dev only
|
|
3943
4247
|
*/
|
|
3944
4248
|
function styleValue(value, type) {
|
|
3945
|
-
if (
|
|
4249
|
+
if (isSymbol(value)) return value.toString();
|
|
4250
|
+
else if (type === "String") return `"${value}"`;
|
|
3946
4251
|
else if (type === "Number") return `${Number(value)}`;
|
|
3947
4252
|
else return `${value}`;
|
|
3948
4253
|
}
|
|
@@ -3959,8 +4264,11 @@ function isExplicable(type) {
|
|
|
3959
4264
|
/**
|
|
3960
4265
|
* dev only
|
|
3961
4266
|
*/
|
|
3962
|
-
function
|
|
3963
|
-
return args.
|
|
4267
|
+
function isCoercible(...args) {
|
|
4268
|
+
return args.every((elem) => {
|
|
4269
|
+
const value = elem.toLowerCase();
|
|
4270
|
+
return value !== "boolean" && value !== "symbol";
|
|
4271
|
+
});
|
|
3964
4272
|
}
|
|
3965
4273
|
//#endregion
|
|
3966
4274
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -4012,12 +4320,13 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4012
4320
|
let deletionComparisonTarget = EMPTY_OBJ;
|
|
4013
4321
|
if (vnode.shapeFlag & 32) {
|
|
4014
4322
|
const type = children._;
|
|
4015
|
-
if (type)
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4323
|
+
if (type) {
|
|
4324
|
+
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
|
|
4325
|
+
assignSlots(slots, children, optimized);
|
|
4326
|
+
trigger(instance, "set", "$slots");
|
|
4327
|
+
} else if (optimized && type === 1) needDeletionCheck = false;
|
|
4328
|
+
else assignSlots(slots, children, optimized);
|
|
4329
|
+
} else {
|
|
4021
4330
|
needDeletionCheck = !children.$stable;
|
|
4022
4331
|
normalizeObjectSlots(children, slots, instance);
|
|
4023
4332
|
}
|
|
@@ -4035,7 +4344,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4035
4344
|
let supported;
|
|
4036
4345
|
let perf;
|
|
4037
4346
|
let cachedNow = 0;
|
|
4038
|
-
const p =
|
|
4347
|
+
const p = /*@__PURE__*/ Promise.resolve();
|
|
4039
4348
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = isSupported() ? perf.now() : Date.now());
|
|
4040
4349
|
/**
|
|
4041
4350
|
* @internal
|
|
@@ -4146,6 +4455,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4146
4455
|
optimized = false;
|
|
4147
4456
|
n2.dynamicChildren = null;
|
|
4148
4457
|
}
|
|
4458
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
4459
|
+
if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
|
|
4460
|
+
n2.dynamicChildren.hasOnce = true;
|
|
4461
|
+
}
|
|
4149
4462
|
const { type, ref, shapeFlag } = n2;
|
|
4150
4463
|
switch (type) {
|
|
4151
4464
|
case Text:
|
|
@@ -4162,7 +4475,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4162
4475
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4163
4476
|
break;
|
|
4164
4477
|
case VaporSlot:
|
|
4165
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
4478
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
4166
4479
|
break;
|
|
4167
4480
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4168
4481
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -4283,7 +4596,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4283
4596
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
4284
4597
|
};
|
|
4285
4598
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
4286
|
-
for (let i = start; i < children.length; i++)
|
|
4599
|
+
for (let i = start; i < children.length; i++) {
|
|
4600
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
4601
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4602
|
+
}
|
|
4287
4603
|
};
|
|
4288
4604
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4289
4605
|
const el = n2.el = n1.el;
|
|
@@ -4295,9 +4611,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4295
4611
|
let vnodeHook;
|
|
4296
4612
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
4297
4613
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4614
|
+
if (n2.ibu) n2.ibu();
|
|
4298
4615
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4299
4616
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
4300
|
-
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
|
|
4617
|
+
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
4301
4618
|
patchFlag = 0;
|
|
4302
4619
|
optimized = false;
|
|
4303
4620
|
dynamicChildren = null;
|
|
@@ -4328,8 +4645,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4328
4645
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
4329
4646
|
}
|
|
4330
4647
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
4331
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
4648
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
4332
4649
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4650
|
+
n2.iu && n2.iu();
|
|
4333
4651
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4334
4652
|
}, void 0, parentSuspense);
|
|
4335
4653
|
};
|
|
@@ -4337,7 +4655,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4337
4655
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4338
4656
|
const oldVNode = oldChildren[i];
|
|
4339
4657
|
const newVNode = newChildren[i];
|
|
4340
|
-
|
|
4658
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
4659
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4341
4660
|
}
|
|
4342
4661
|
};
|
|
4343
4662
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -4376,25 +4695,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4376
4695
|
};
|
|
4377
4696
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4378
4697
|
n2.slotScopeIds = slotScopeIds;
|
|
4379
|
-
if (n2.type.__vapor)
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
}
|
|
4389
|
-
else {
|
|
4390
|
-
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized), () => {
|
|
4391
|
-
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4392
|
-
});
|
|
4393
|
-
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, n1, parentComponent, "updated"), void 0, parentSuspense);
|
|
4394
|
-
}
|
|
4395
|
-
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
4396
|
-
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
4397
|
-
else updateComponent(n1, n2, optimized);
|
|
4698
|
+
if (n2.type.__vapor) {
|
|
4699
|
+
if (n1 == null) {
|
|
4700
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
4701
|
+
else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
|
|
4702
|
+
} else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
|
|
4703
|
+
} else if (n1 == null) {
|
|
4704
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
4705
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
4706
|
+
} else updateComponent(n1, n2, optimized);
|
|
4398
4707
|
};
|
|
4399
4708
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
4400
4709
|
const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
|
|
@@ -4439,16 +4748,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4439
4748
|
};
|
|
4440
4749
|
const updateComponent = (n1, n2, optimized) => {
|
|
4441
4750
|
const instance = n2.component = n1.component;
|
|
4442
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
4443
|
-
if (
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4751
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
4752
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4753
|
+
if (!!(process.env.NODE_ENV !== "production")) pushWarningContext(n2);
|
|
4754
|
+
n2.el = n1.el;
|
|
4755
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
4756
|
+
if (!!(process.env.NODE_ENV !== "production")) popWarningContext();
|
|
4757
|
+
return;
|
|
4758
|
+
} else {
|
|
4759
|
+
instance.next = n2;
|
|
4760
|
+
instance.effect.run();
|
|
4761
|
+
}
|
|
4447
4762
|
} else {
|
|
4448
|
-
instance.next = n2;
|
|
4449
|
-
instance.effect.run();
|
|
4450
|
-
}
|
|
4451
|
-
else {
|
|
4452
4763
|
n2.el = n1.el;
|
|
4453
4764
|
instance.vnode = n2;
|
|
4454
4765
|
}
|
|
@@ -4548,6 +4859,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4548
4859
|
} else next = vnode;
|
|
4549
4860
|
if (bu) invokeArrayFns(bu);
|
|
4550
4861
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4862
|
+
if (next.ibu) next.ibu();
|
|
4551
4863
|
toggleRecurse(instance, true);
|
|
4552
4864
|
if (!!(process.env.NODE_ENV !== "production")) startMeasure(instance, `render`);
|
|
4553
4865
|
const nextTree = renderComponentRoot(instance);
|
|
@@ -4560,7 +4872,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4560
4872
|
next.el = nextTree.el;
|
|
4561
4873
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
4562
4874
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
4563
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
4875
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
4876
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4877
|
+
next.iu && next.iu();
|
|
4878
|
+
}, void 0, parentSuspense);
|
|
4564
4879
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsComponentUpdated(instance);
|
|
4565
4880
|
if (!!(process.env.NODE_ENV !== "production")) popWarningContext();
|
|
4566
4881
|
}
|
|
@@ -4600,9 +4915,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4600
4915
|
if (shapeFlag & 8) {
|
|
4601
4916
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
4602
4917
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
4603
|
-
} else if (prevShapeFlag & 16)
|
|
4604
|
-
|
|
4605
|
-
|
|
4918
|
+
} else if (prevShapeFlag & 16) {
|
|
4919
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4920
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
4921
|
+
} else {
|
|
4606
4922
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
4607
4923
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4608
4924
|
}
|
|
@@ -4701,15 +5017,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4701
5017
|
const anchorVNode = c2[nextIndex + 1];
|
|
4702
5018
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
4703
5019
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4704
|
-
else if (moved)
|
|
4705
|
-
|
|
5020
|
+
else if (moved) {
|
|
5021
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
5022
|
+
else j--;
|
|
5023
|
+
}
|
|
4706
5024
|
}
|
|
4707
5025
|
}
|
|
4708
5026
|
};
|
|
4709
5027
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
4710
5028
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
4711
5029
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
4712
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
5030
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
4713
5031
|
return;
|
|
4714
5032
|
}
|
|
4715
5033
|
if (shapeFlag & 6) {
|
|
@@ -4734,49 +5052,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4734
5052
|
moveStaticNode(vnode, container, anchor);
|
|
4735
5053
|
return;
|
|
4736
5054
|
}
|
|
4737
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
const remove = () => {
|
|
5055
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
5056
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
5057
|
+
else performTransitionLeave(el, transition, () => {
|
|
4741
5058
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
4742
5059
|
else hostInsert(el, container, anchor);
|
|
4743
|
-
};
|
|
4744
|
-
|
|
4745
|
-
if (el._isLeaving) el[leaveCbKey](true);
|
|
4746
|
-
leave(el, () => {
|
|
4747
|
-
remove();
|
|
4748
|
-
afterLeave && afterLeave();
|
|
4749
|
-
});
|
|
4750
|
-
};
|
|
4751
|
-
if (delayLeave) delayLeave(el, remove, performLeave);
|
|
4752
|
-
else performLeave();
|
|
4753
|
-
}
|
|
4754
|
-
else hostInsert(el, container, anchor);
|
|
5060
|
+
}, true, true);
|
|
5061
|
+
} else hostInsert(el, container, anchor);
|
|
4755
5062
|
};
|
|
4756
5063
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
4757
5064
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
4758
|
-
if (patchFlag === -2) optimized = false;
|
|
5065
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
4759
5066
|
if (ref != null) {
|
|
4760
5067
|
const prevSub = setActiveSub();
|
|
4761
5068
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
4762
5069
|
setActiveSub(prevSub);
|
|
4763
5070
|
}
|
|
4764
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
5071
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
4765
5072
|
if (shapeFlag & 256) {
|
|
4766
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
5073
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
4767
5074
|
else parentComponent.ctx.deactivate(vnode);
|
|
4768
5075
|
return;
|
|
4769
5076
|
}
|
|
5077
|
+
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
5078
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
5079
|
+
return;
|
|
5080
|
+
}
|
|
4770
5081
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
4771
5082
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
4772
5083
|
let vnodeHook;
|
|
4773
5084
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
4774
|
-
if (shapeFlag & 6)
|
|
4775
|
-
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
4776
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
4777
|
-
if (dirs) queuePostRenderEffect(() => invokeDirectiveHook(vnode, null, parentComponent, "unmounted"), void 0, parentSuspense);
|
|
4778
|
-
return;
|
|
4779
|
-
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
5085
|
+
if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
4780
5086
|
else {
|
|
4781
5087
|
if (shapeFlag & 128) {
|
|
4782
5088
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -4787,7 +5093,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4787
5093
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
4788
5094
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
4789
5095
|
if (type === VaporSlot) {
|
|
4790
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
5096
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
4791
5097
|
return;
|
|
4792
5098
|
}
|
|
4793
5099
|
if (doRemove) remove(vnode);
|
|
@@ -4811,6 +5117,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4811
5117
|
}
|
|
4812
5118
|
if (type === Static) {
|
|
4813
5119
|
removeStaticNode(vnode);
|
|
5120
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
4814
5121
|
return;
|
|
4815
5122
|
}
|
|
4816
5123
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -4835,6 +5142,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4835
5142
|
if (effect) {
|
|
4836
5143
|
effect.stop();
|
|
4837
5144
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5145
|
+
} else if (instance.vnode.el && subTree) {
|
|
5146
|
+
subTree.transition = instance.vnode.transition;
|
|
5147
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
4838
5148
|
}
|
|
4839
5149
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
4840
5150
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
@@ -4909,12 +5219,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
4909
5219
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
4910
5220
|
}
|
|
4911
5221
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
4912
|
-
if (!vapor)
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
5222
|
+
if (!vapor) {
|
|
5223
|
+
if (allowed) {
|
|
5224
|
+
effect.flags |= 128;
|
|
5225
|
+
job.flags |= 2;
|
|
5226
|
+
} else {
|
|
5227
|
+
effect.flags &= -129;
|
|
5228
|
+
job.flags &= -3;
|
|
5229
|
+
}
|
|
4918
5230
|
}
|
|
4919
5231
|
}
|
|
4920
5232
|
function needTransition(parentSuspense, transition) {
|
|
@@ -4954,13 +5266,19 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
4954
5266
|
}
|
|
4955
5267
|
function locateNonHydratedAsyncRoot(instance) {
|
|
4956
5268
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
4957
|
-
if (subComponent)
|
|
4958
|
-
|
|
5269
|
+
if (subComponent) {
|
|
5270
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
5271
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
5272
|
+
}
|
|
4959
5273
|
}
|
|
4960
5274
|
function invalidateMount(hooks) {
|
|
4961
5275
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
4962
5276
|
}
|
|
4963
5277
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
5278
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
5279
|
+
insert();
|
|
5280
|
+
return;
|
|
5281
|
+
}
|
|
4964
5282
|
if (force || needTransition(parentSuspense, transition)) {
|
|
4965
5283
|
transition.beforeEnter(el);
|
|
4966
5284
|
insert();
|
|
@@ -4970,13 +5288,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
4970
5288
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
4971
5289
|
const performRemove = () => {
|
|
4972
5290
|
remove();
|
|
4973
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5291
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
4974
5292
|
};
|
|
4975
5293
|
if (force || isElement && transition && !transition.persisted) {
|
|
4976
5294
|
const { leave, delayLeave } = transition;
|
|
4977
5295
|
const performLeave = () => {
|
|
5296
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
4978
5297
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
4979
|
-
|
|
5298
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
5299
|
+
else leave(el, performRemove);
|
|
4980
5300
|
};
|
|
4981
5301
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
4982
5302
|
else performLeave();
|
|
@@ -4995,7 +5315,7 @@ function isVaporComponent(type) {
|
|
|
4995
5315
|
/**
|
|
4996
5316
|
* shared between vdom and vapor
|
|
4997
5317
|
*/
|
|
4998
|
-
function getInheritedScopeIds(vnode, parentComponent) {
|
|
5318
|
+
function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
|
|
4999
5319
|
const inheritedScopeIds = [];
|
|
5000
5320
|
let currentParent = parentComponent;
|
|
5001
5321
|
let currentVNode = vnode;
|
|
@@ -5011,6 +5331,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
5011
5331
|
currentParent = currentParent.parent;
|
|
5012
5332
|
} else break;
|
|
5013
5333
|
}
|
|
5334
|
+
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
5335
|
+
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
5014
5336
|
return inheritedScopeIds;
|
|
5015
5337
|
}
|
|
5016
5338
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
@@ -5029,7 +5351,7 @@ const Suspense = {
|
|
|
5029
5351
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
5030
5352
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
5031
5353
|
else {
|
|
5032
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
5354
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
5033
5355
|
n2.suspense = n1.suspense;
|
|
5034
5356
|
n2.suspense.vnode = n2;
|
|
5035
5357
|
n2.el = n1.el;
|
|
@@ -5067,10 +5389,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5067
5389
|
if (pendingBranch) {
|
|
5068
5390
|
suspense.pendingBranch = newBranch;
|
|
5069
5391
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
5070
|
-
|
|
5392
|
+
suspense.deps++;
|
|
5393
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
5394
|
+
suspense.deps--;
|
|
5071
5395
|
if (suspense.deps <= 0) suspense.resolve();
|
|
5072
5396
|
else if (isInFallback) {
|
|
5073
|
-
if (!isHydrating) {
|
|
5397
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
5074
5398
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5075
5399
|
setActiveBranch(suspense, newFallback);
|
|
5076
5400
|
}
|
|
@@ -5082,12 +5406,16 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5082
5406
|
suspense.activeBranch = pendingBranch;
|
|
5083
5407
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
5084
5408
|
suspense.deps = 0;
|
|
5409
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
5410
|
+
const effect = suspense.effects[i];
|
|
5411
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
5412
|
+
}
|
|
5085
5413
|
suspense.effects.length = 0;
|
|
5086
5414
|
suspense.hiddenContainer = createElement("div");
|
|
5087
5415
|
if (isInFallback) {
|
|
5088
5416
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
5089
5417
|
if (suspense.deps <= 0) suspense.resolve();
|
|
5090
|
-
else {
|
|
5418
|
+
else if (!suspense.isFallbackMountPending) {
|
|
5091
5419
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5092
5420
|
setActiveBranch(suspense, newFallback);
|
|
5093
5421
|
}
|
|
@@ -5165,15 +5493,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5165
5493
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
5166
5494
|
else if (!resume) {
|
|
5167
5495
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
5496
|
+
let hasUpdatedAnchor = false;
|
|
5168
5497
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
5169
5498
|
if (pendingId === suspense.pendingId) {
|
|
5170
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
5499
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
5171
5500
|
queuePostFlushCb(effects);
|
|
5172
5501
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
5173
5502
|
}
|
|
5174
5503
|
};
|
|
5175
5504
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
5176
|
-
if (parentNode(activeBranch.el) === container)
|
|
5505
|
+
if (parentNode(activeBranch.el) === container) {
|
|
5506
|
+
anchor = next(activeBranch);
|
|
5507
|
+
hasUpdatedAnchor = true;
|
|
5508
|
+
}
|
|
5177
5509
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
5178
5510
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
5179
5511
|
}
|
|
@@ -5187,7 +5519,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5187
5519
|
let hasUnresolvedAncestor = false;
|
|
5188
5520
|
while (parent) {
|
|
5189
5521
|
if (parent.pendingBranch) {
|
|
5190
|
-
parent.effects.push(
|
|
5522
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
5191
5523
|
hasUnresolvedAncestor = true;
|
|
5192
5524
|
break;
|
|
5193
5525
|
}
|
|
@@ -5197,6 +5529,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5197
5529
|
suspense.effects = [];
|
|
5198
5530
|
if (isSuspensible) {
|
|
5199
5531
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
5532
|
+
parentSuspenseId = void 0;
|
|
5200
5533
|
parentSuspense.deps--;
|
|
5201
5534
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
5202
5535
|
}
|
|
@@ -5211,8 +5544,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5211
5544
|
const mountFallback = () => {
|
|
5212
5545
|
suspense.isFallbackMountPending = false;
|
|
5213
5546
|
if (!suspense.isInFallback) return;
|
|
5214
|
-
|
|
5215
|
-
|
|
5547
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
5548
|
+
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
5549
|
+
setActiveBranch(suspense, latestFallback);
|
|
5216
5550
|
};
|
|
5217
5551
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
5218
5552
|
if (delayEnter) {
|
|
@@ -5233,10 +5567,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5233
5567
|
registerDep(instance, onResolve) {
|
|
5234
5568
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5235
5569
|
if (isInPendingSuspense) suspense.deps++;
|
|
5570
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
5236
5571
|
instance.asyncDep.catch((err) => {
|
|
5237
5572
|
handleError(err, instance, 0);
|
|
5238
5573
|
}).then((asyncSetupResult) => {
|
|
5239
5574
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
5575
|
+
setCurrentInstance(null, void 0);
|
|
5576
|
+
if (hydratedEl && !instance.scope.active) {
|
|
5577
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
5578
|
+
return;
|
|
5579
|
+
}
|
|
5240
5580
|
instance.asyncResolved = true;
|
|
5241
5581
|
onResolve(asyncSetupResult);
|
|
5242
5582
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -5287,9 +5627,10 @@ function normalizeSuspenseSlot(s) {
|
|
|
5287
5627
|
return s;
|
|
5288
5628
|
}
|
|
5289
5629
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
5290
|
-
if (suspense && suspense.pendingBranch)
|
|
5291
|
-
|
|
5292
|
-
|
|
5630
|
+
if (suspense && suspense.pendingBranch) {
|
|
5631
|
+
if (isArray(fn)) suspense.effects.push(...fn);
|
|
5632
|
+
else suspense.effects.push(fn);
|
|
5633
|
+
} else queuePostFlushCb(fn, id);
|
|
5293
5634
|
}
|
|
5294
5635
|
function setActiveBranch(suspense, branch) {
|
|
5295
5636
|
suspense.activeBranch = branch;
|
|
@@ -5456,9 +5797,24 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
5456
5797
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
5457
5798
|
} else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
5458
5799
|
if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
5800
|
+
if (!!(process.env.NODE_ENV !== "production") && props && vnode.shapeFlag & 1) {
|
|
5801
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
5802
|
+
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.`);
|
|
5803
|
+
}
|
|
5459
5804
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
5460
5805
|
return vnode;
|
|
5461
5806
|
}
|
|
5807
|
+
/**
|
|
5808
|
+
* dev only
|
|
5809
|
+
* Whether children would actually render something. Empty text and empty
|
|
5810
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
5811
|
+
* for `v-html` / `v-text`.
|
|
5812
|
+
*/
|
|
5813
|
+
function hasContentChildren(children) {
|
|
5814
|
+
if (isString(children)) return children !== "";
|
|
5815
|
+
if (isArray(children)) return children.length > 0;
|
|
5816
|
+
return false;
|
|
5817
|
+
}
|
|
5462
5818
|
const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode;
|
|
5463
5819
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
5464
5820
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -5468,8 +5824,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
5468
5824
|
if (isVNode(type)) {
|
|
5469
5825
|
const cloned = cloneVNode(type, props, true);
|
|
5470
5826
|
if (children) normalizeChildren(cloned, children);
|
|
5471
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
5472
|
-
|
|
5827
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
5828
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
5829
|
+
else currentBlock.push(cloned);
|
|
5830
|
+
}
|
|
5473
5831
|
cloned.patchFlag = -2;
|
|
5474
5832
|
return cloned;
|
|
5475
5833
|
}
|
|
@@ -5526,11 +5884,31 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5526
5884
|
el: vnode.el,
|
|
5527
5885
|
anchor: vnode.anchor,
|
|
5528
5886
|
ctx: vnode.ctx,
|
|
5529
|
-
ce: vnode.ce
|
|
5887
|
+
ce: vnode.ce,
|
|
5888
|
+
vi: vnode.vi,
|
|
5889
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
5890
|
+
vb: vnode.vb,
|
|
5891
|
+
ibu: vnode.ibu,
|
|
5892
|
+
iu: vnode.iu,
|
|
5893
|
+
cacheIndex: vnode.cacheIndex
|
|
5530
5894
|
};
|
|
5531
5895
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5532
5896
|
return cloned;
|
|
5533
5897
|
}
|
|
5898
|
+
function cloneVaporSlotMeta(vnode) {
|
|
5899
|
+
const vaporSlot = vnode.vs;
|
|
5900
|
+
if (!vaporSlot) return vaporSlot;
|
|
5901
|
+
const cloned = {
|
|
5902
|
+
slot: vaporSlot.slot,
|
|
5903
|
+
outlets: vaporSlot.outlets
|
|
5904
|
+
};
|
|
5905
|
+
if (vnode.el) {
|
|
5906
|
+
cloned.state = vaporSlot.state;
|
|
5907
|
+
cloned.ref = vaporSlot.ref;
|
|
5908
|
+
cloned.scope = vaporSlot.scope;
|
|
5909
|
+
}
|
|
5910
|
+
return cloned;
|
|
5911
|
+
}
|
|
5534
5912
|
/**
|
|
5535
5913
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
5536
5914
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -5574,25 +5952,32 @@ function normalizeChildren(vnode, children) {
|
|
|
5574
5952
|
const { shapeFlag } = vnode;
|
|
5575
5953
|
if (children == null) children = null;
|
|
5576
5954
|
else if (isArray(children)) type = 16;
|
|
5577
|
-
else if (typeof children === "object")
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5955
|
+
else if (typeof children === "object") {
|
|
5956
|
+
if (shapeFlag & 65) {
|
|
5957
|
+
const slot = children.default;
|
|
5958
|
+
if (slot) {
|
|
5959
|
+
slot._c && (slot._d = false);
|
|
5960
|
+
normalizeChildren(vnode, slot());
|
|
5961
|
+
slot._c && (slot._d = true);
|
|
5962
|
+
}
|
|
5963
|
+
return;
|
|
5964
|
+
} else {
|
|
5965
|
+
type = 32;
|
|
5966
|
+
const slotFlag = children._;
|
|
5967
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
5968
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
5969
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
5970
|
+
else {
|
|
5971
|
+
children._ = 2;
|
|
5972
|
+
vnode.patchFlag |= 1024;
|
|
5973
|
+
}
|
|
5974
|
+
}
|
|
5583
5975
|
}
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
5589
|
-
else if (slotFlag === 3 && currentRenderingInstance) if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
5590
|
-
else {
|
|
5591
|
-
children._ = 2;
|
|
5592
|
-
vnode.patchFlag |= 1024;
|
|
5976
|
+
} else if (isFunction(children)) {
|
|
5977
|
+
if (shapeFlag & 65) {
|
|
5978
|
+
normalizeChildren(vnode, { default: children });
|
|
5979
|
+
return;
|
|
5593
5980
|
}
|
|
5594
|
-
}
|
|
5595
|
-
else if (isFunction(children)) {
|
|
5596
5981
|
children = {
|
|
5597
5982
|
default: children,
|
|
5598
5983
|
_ctx: currentRenderingInstance
|
|
@@ -5665,6 +6050,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
5665
6050
|
simpleSetCurrentInstance(instance);
|
|
5666
6051
|
}
|
|
5667
6052
|
};
|
|
6053
|
+
/**
|
|
6054
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
6055
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
6056
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
6057
|
+
* @internal
|
|
6058
|
+
*/
|
|
6059
|
+
const restoreCurrentInstance = (prev) => {
|
|
6060
|
+
setCurrentScope(prev[1]);
|
|
6061
|
+
simpleSetCurrentInstance(prev[0]);
|
|
6062
|
+
};
|
|
5668
6063
|
const internalOptions = [
|
|
5669
6064
|
"ce",
|
|
5670
6065
|
"type",
|
|
@@ -5696,7 +6091,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
5696
6091
|
};
|
|
5697
6092
|
//#endregion
|
|
5698
6093
|
//#region packages/runtime-core/src/component.ts
|
|
5699
|
-
const emptyAppContext =
|
|
6094
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
5700
6095
|
let uid = 0;
|
|
5701
6096
|
/**
|
|
5702
6097
|
* @internal for vapor
|
|
@@ -5825,7 +6220,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5825
6220
|
const setupResult = callWithErrorHandling(setup, instance, 0, [!!(process.env.NODE_ENV !== "production") ? shallowReadonly$1(instance.props) : instance.props, setupContext]);
|
|
5826
6221
|
const isAsyncSetup = isPromise(setupResult);
|
|
5827
6222
|
setActiveSub(prevSub);
|
|
5828
|
-
|
|
6223
|
+
restoreCurrentInstance(prev);
|
|
5829
6224
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
5830
6225
|
if (isAsyncSetup) {
|
|
5831
6226
|
const unsetCurrentInstance = () => {
|
|
@@ -5833,7 +6228,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5833
6228
|
};
|
|
5834
6229
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
5835
6230
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
5836
|
-
|
|
6231
|
+
setInSSRSetupState(true);
|
|
6232
|
+
try {
|
|
6233
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
6234
|
+
} finally {
|
|
6235
|
+
setInSSRSetupState(false);
|
|
6236
|
+
}
|
|
5837
6237
|
}).catch((e) => {
|
|
5838
6238
|
handleError(e, instance, 0);
|
|
5839
6239
|
});
|
|
@@ -5845,9 +6245,10 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5845
6245
|
} else finishComponentSetup(instance, isSSR);
|
|
5846
6246
|
}
|
|
5847
6247
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
5848
|
-
if (isFunction(setupResult))
|
|
5849
|
-
|
|
5850
|
-
|
|
6248
|
+
if (isFunction(setupResult)) {
|
|
6249
|
+
if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
|
|
6250
|
+
else instance.render = setupResult;
|
|
6251
|
+
} else if (isObject(setupResult)) {
|
|
5851
6252
|
if (!!(process.env.NODE_ENV !== "production") && isVNode(setupResult)) warn$1("setup() should not return VNodes directly - return a render function instead.");
|
|
5852
6253
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) instance.devtoolsRawSetupState = setupResult;
|
|
5853
6254
|
instance.setupState = proxyRefs$1(setupResult);
|
|
@@ -5895,13 +6296,15 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
5895
6296
|
applyOptions(instance);
|
|
5896
6297
|
} finally {
|
|
5897
6298
|
setActiveSub(prevSub);
|
|
5898
|
-
|
|
6299
|
+
restoreCurrentInstance(prevInstance);
|
|
5899
6300
|
}
|
|
5900
6301
|
}
|
|
5901
|
-
if (!!(process.env.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR)
|
|
6302
|
+
if (!!(process.env.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR) {
|
|
6303
|
+
if (!compile && Component.template)
|
|
5902
6304
|
/* v8 ignore start */
|
|
5903
|
-
|
|
5904
|
-
|
|
6305
|
+
warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias \"vue\" to \"vue/dist/vue.esm-bundler.js\".");
|
|
6306
|
+
else warn$1(`Component is missing template or render function: `, Component);
|
|
6307
|
+
}
|
|
5905
6308
|
}
|
|
5906
6309
|
const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
|
|
5907
6310
|
get(target, key) {
|
|
@@ -5974,14 +6377,13 @@ function getComponentPublicInstance(instance) {
|
|
|
5974
6377
|
if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs$1(markRaw$1(instance.exposed)), {
|
|
5975
6378
|
get(target, key) {
|
|
5976
6379
|
if (key in target) return target[key];
|
|
5977
|
-
else {
|
|
6380
|
+
else if (!instance.vapor) {
|
|
5978
6381
|
const publicPropertiesMap = getPublicPropertiesMap();
|
|
5979
6382
|
if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
|
|
5980
6383
|
}
|
|
5981
6384
|
},
|
|
5982
6385
|
has(target, key) {
|
|
5983
|
-
|
|
5984
|
-
return key in target || key in publicPropertiesMap;
|
|
6386
|
+
return key in target || !instance.vapor && key in getPublicPropertiesMap();
|
|
5985
6387
|
}
|
|
5986
6388
|
}));
|
|
5987
6389
|
else return instance.proxy;
|
|
@@ -6019,11 +6421,12 @@ function h(type, propsOrChildren, children) {
|
|
|
6019
6421
|
try {
|
|
6020
6422
|
setBlockTracking(-1);
|
|
6021
6423
|
const l = arguments.length;
|
|
6022
|
-
if (l === 2)
|
|
6023
|
-
if (
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6424
|
+
if (l === 2) {
|
|
6425
|
+
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
6426
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
6427
|
+
return createVNode(type, propsOrChildren);
|
|
6428
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
6429
|
+
} else {
|
|
6027
6430
|
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
6028
6431
|
else if (l === 3 && isVNode(children)) children = [children];
|
|
6029
6432
|
return createVNode(type, propsOrChildren, children);
|
|
@@ -6215,7 +6618,7 @@ function isMemoSame(cached, memo) {
|
|
|
6215
6618
|
}
|
|
6216
6619
|
//#endregion
|
|
6217
6620
|
//#region packages/runtime-core/src/index.ts
|
|
6218
|
-
const version = "3.6.0-
|
|
6621
|
+
const version = "3.6.0-rc.10";
|
|
6219
6622
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
6220
6623
|
/**
|
|
6221
6624
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -6238,7 +6641,10 @@ const ssrUtils = {
|
|
|
6238
6641
|
getComponentPublicInstance,
|
|
6239
6642
|
ensureValidVNode,
|
|
6240
6643
|
pushWarningContext,
|
|
6241
|
-
popWarningContext
|
|
6644
|
+
popWarningContext,
|
|
6645
|
+
VaporSlot,
|
|
6646
|
+
rawVaporSlotKey,
|
|
6647
|
+
invokeSlotFallback
|
|
6242
6648
|
};
|
|
6243
6649
|
/**
|
|
6244
6650
|
* @internal only exposed in compat builds
|
|
@@ -6250,4 +6656,4 @@ const resolveFilter = null;
|
|
|
6250
6656
|
const compatUtils = null;
|
|
6251
6657
|
const DeprecationTypes = null;
|
|
6252
6658
|
//#endregion
|
|
6253
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure,
|
|
6659
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defaultPropGetter, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, expose, filterModelListeners, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, invokeSlotFallback, invokeVNodeHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isUnchangedResourceProp, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveCssVars, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|