@vue/runtime-core 3.6.0-alpha.7 → 3.6.0-beta.2
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 +279 -230
- package/dist/runtime-core.cjs.prod.js +236 -192
- package/dist/runtime-core.d.ts +9 -9
- package/dist/runtime-core.esm-bundler.js +272 -232
- 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-beta.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -32,7 +32,6 @@ function warn$2(msg, ...args) {
|
|
|
32
32
|
instance,
|
|
33
33
|
11,
|
|
34
34
|
[
|
|
35
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
36
35
|
msg + args.map((a) => {
|
|
37
36
|
var _a, _b;
|
|
38
37
|
return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
|
|
@@ -379,10 +378,10 @@ function flushPostFlushCbs(seen) {
|
|
|
379
378
|
}
|
|
380
379
|
}
|
|
381
380
|
let isFlushing = false;
|
|
382
|
-
function flushOnAppMount() {
|
|
381
|
+
function flushOnAppMount(instance) {
|
|
383
382
|
if (!isFlushing) {
|
|
384
383
|
isFlushing = true;
|
|
385
|
-
flushPreFlushCbs();
|
|
384
|
+
flushPreFlushCbs(instance);
|
|
386
385
|
flushPostFlushCbs();
|
|
387
386
|
isFlushing = false;
|
|
388
387
|
}
|
|
@@ -521,7 +520,166 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
521
520
|
}
|
|
522
521
|
}
|
|
523
522
|
|
|
524
|
-
|
|
523
|
+
function provide(key, value) {
|
|
524
|
+
if (currentInstance) {
|
|
525
|
+
let provides = currentInstance.provides;
|
|
526
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
527
|
+
if (parentProvides === provides) {
|
|
528
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
529
|
+
}
|
|
530
|
+
provides[key] = value;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
534
|
+
const instance = getCurrentGenericInstance();
|
|
535
|
+
if (instance || currentApp) {
|
|
536
|
+
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
537
|
+
if (provides && key in provides) {
|
|
538
|
+
return provides[key];
|
|
539
|
+
} else if (arguments.length > 1) {
|
|
540
|
+
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
541
|
+
} else ;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
function hasInjectionContext() {
|
|
545
|
+
return !!(getCurrentGenericInstance() || currentApp);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
|
|
549
|
+
const useSSRContext = () => {
|
|
550
|
+
{
|
|
551
|
+
const ctx = inject(ssrContextKey);
|
|
552
|
+
return ctx;
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
function watchEffect(effect, options) {
|
|
557
|
+
return doWatch(effect, null, options);
|
|
558
|
+
}
|
|
559
|
+
function watchPostEffect(effect, options) {
|
|
560
|
+
return doWatch(
|
|
561
|
+
effect,
|
|
562
|
+
null,
|
|
563
|
+
{ flush: "post" }
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
function watchSyncEffect(effect, options) {
|
|
567
|
+
return doWatch(
|
|
568
|
+
effect,
|
|
569
|
+
null,
|
|
570
|
+
{ flush: "sync" }
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
function watch(source, cb, options) {
|
|
574
|
+
return doWatch(source, cb, options);
|
|
575
|
+
}
|
|
576
|
+
class RenderWatcherEffect extends reactivity.WatcherEffect {
|
|
577
|
+
constructor(instance, source, cb, options, flush) {
|
|
578
|
+
super(source, cb, options);
|
|
579
|
+
this.flush = flush;
|
|
580
|
+
const job = () => {
|
|
581
|
+
if (this.dirty) {
|
|
582
|
+
this.run();
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
if (cb) {
|
|
586
|
+
this.flags |= 128;
|
|
587
|
+
job.flags |= 2;
|
|
588
|
+
}
|
|
589
|
+
if (instance) {
|
|
590
|
+
job.i = instance;
|
|
591
|
+
}
|
|
592
|
+
this.job = job;
|
|
593
|
+
}
|
|
594
|
+
notify() {
|
|
595
|
+
const flags = this.flags;
|
|
596
|
+
if (!(flags & 256)) {
|
|
597
|
+
const flush = this.flush;
|
|
598
|
+
const job = this.job;
|
|
599
|
+
if (flush === "post") {
|
|
600
|
+
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
601
|
+
} else if (flush === "pre") {
|
|
602
|
+
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
603
|
+
} else {
|
|
604
|
+
job();
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
610
|
+
const { immediate, deep, flush = "pre", once } = options;
|
|
611
|
+
const baseWatchOptions = shared.extend({}, options);
|
|
612
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
613
|
+
let ssrCleanup;
|
|
614
|
+
if (isInSSRComponentSetup) {
|
|
615
|
+
if (flush === "sync") {
|
|
616
|
+
const ctx = useSSRContext();
|
|
617
|
+
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
618
|
+
} else if (!runsImmediately) {
|
|
619
|
+
const watchStopHandle = () => {
|
|
620
|
+
};
|
|
621
|
+
watchStopHandle.stop = shared.NOOP;
|
|
622
|
+
watchStopHandle.resume = shared.NOOP;
|
|
623
|
+
watchStopHandle.pause = shared.NOOP;
|
|
624
|
+
return watchStopHandle;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
const instance = currentInstance;
|
|
628
|
+
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
629
|
+
const effect = new RenderWatcherEffect(
|
|
630
|
+
instance,
|
|
631
|
+
source,
|
|
632
|
+
cb,
|
|
633
|
+
baseWatchOptions,
|
|
634
|
+
flush
|
|
635
|
+
);
|
|
636
|
+
if (cb) {
|
|
637
|
+
effect.run(true);
|
|
638
|
+
} else if (flush === "post") {
|
|
639
|
+
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
640
|
+
} else {
|
|
641
|
+
effect.run(true);
|
|
642
|
+
}
|
|
643
|
+
const stop = effect.stop.bind(effect);
|
|
644
|
+
stop.pause = effect.pause.bind(effect);
|
|
645
|
+
stop.resume = effect.resume.bind(effect);
|
|
646
|
+
stop.stop = stop;
|
|
647
|
+
if (isInSSRComponentSetup) {
|
|
648
|
+
if (ssrCleanup) {
|
|
649
|
+
ssrCleanup.push(stop);
|
|
650
|
+
} else if (runsImmediately) {
|
|
651
|
+
stop();
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
return stop;
|
|
655
|
+
}
|
|
656
|
+
function instanceWatch(source, value, options) {
|
|
657
|
+
const publicThis = this.proxy;
|
|
658
|
+
const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
659
|
+
let cb;
|
|
660
|
+
if (shared.isFunction(value)) {
|
|
661
|
+
cb = value;
|
|
662
|
+
} else {
|
|
663
|
+
cb = value.handler;
|
|
664
|
+
options = value;
|
|
665
|
+
}
|
|
666
|
+
const prev = setCurrentInstance(this);
|
|
667
|
+
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
668
|
+
setCurrentInstance(...prev);
|
|
669
|
+
return res;
|
|
670
|
+
}
|
|
671
|
+
function createPathGetter(ctx, path) {
|
|
672
|
+
const segments = path.split(".");
|
|
673
|
+
return () => {
|
|
674
|
+
let cur = ctx;
|
|
675
|
+
for (let i = 0; i < segments.length && cur; i++) {
|
|
676
|
+
cur = cur[segments[i]];
|
|
677
|
+
}
|
|
678
|
+
return cur;
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
|
|
525
683
|
const isTeleport = (type) => type.__isTeleport;
|
|
526
684
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
527
685
|
const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
|
|
@@ -866,8 +1024,8 @@ function prepareAnchor(target, vnode, createText, insert) {
|
|
|
866
1024
|
return targetAnchor;
|
|
867
1025
|
}
|
|
868
1026
|
|
|
869
|
-
const leaveCbKey = Symbol("_leaveCb");
|
|
870
|
-
const enterCbKey = Symbol("_enterCb");
|
|
1027
|
+
const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
|
|
1028
|
+
const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
|
|
871
1029
|
function useTransitionState() {
|
|
872
1030
|
const state = {
|
|
873
1031
|
isMounted: false,
|
|
@@ -1882,9 +2040,17 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
1882
2040
|
}
|
|
1883
2041
|
}
|
|
1884
2042
|
|
|
1885
|
-
|
|
1886
|
-
|
|
2043
|
+
let requestIdleCallback;
|
|
2044
|
+
let cancelIdleCallback;
|
|
2045
|
+
function ensureIdleCallbacks() {
|
|
2046
|
+
if (!requestIdleCallback) {
|
|
2047
|
+
const g = shared.getGlobalThis();
|
|
2048
|
+
requestIdleCallback = g.requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
2049
|
+
cancelIdleCallback = g.cancelIdleCallback || ((id) => clearTimeout(id));
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
1887
2052
|
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
2053
|
+
ensureIdleCallbacks();
|
|
1888
2054
|
const id = requestIdleCallback(hydrate, { timeout });
|
|
1889
2055
|
return () => cancelIdleCallback(id);
|
|
1890
2056
|
};
|
|
@@ -2225,7 +2391,9 @@ const KeepAliveImpl = {
|
|
|
2225
2391
|
}
|
|
2226
2392
|
function pruneCache(filter) {
|
|
2227
2393
|
cache.forEach((vnode, key) => {
|
|
2228
|
-
const name = getComponentName(
|
|
2394
|
+
const name = getComponentName(
|
|
2395
|
+
isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
|
|
2396
|
+
);
|
|
2229
2397
|
if (name && !filter(name)) {
|
|
2230
2398
|
pruneCacheEntry(key);
|
|
2231
2399
|
}
|
|
@@ -2510,7 +2678,7 @@ const DIRECTIVES = "directives";
|
|
|
2510
2678
|
function resolveComponent(name, maybeSelfReference) {
|
|
2511
2679
|
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
2512
2680
|
}
|
|
2513
|
-
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2681
|
+
const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
|
|
2514
2682
|
function resolveDynamicComponent(component) {
|
|
2515
2683
|
if (shared.isString(component)) {
|
|
2516
2684
|
return resolveAsset(COMPONENTS, component, false) || component;
|
|
@@ -2683,10 +2851,10 @@ function ensureVaporSlotFallback(vnodes, fallback) {
|
|
|
2683
2851
|
}
|
|
2684
2852
|
}
|
|
2685
2853
|
|
|
2686
|
-
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
2854
|
+
function toHandlers(obj, preserveCaseIfNecessary, needWrap) {
|
|
2687
2855
|
const ret = {};
|
|
2688
2856
|
for (const key in obj) {
|
|
2689
|
-
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
|
|
2857
|
+
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = needWrap ? () => obj[key] : obj[key];
|
|
2690
2858
|
}
|
|
2691
2859
|
return ret;
|
|
2692
2860
|
}
|
|
@@ -3376,165 +3544,6 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
3376
3544
|
}
|
|
3377
3545
|
let currentApp = null;
|
|
3378
3546
|
|
|
3379
|
-
function provide(key, value) {
|
|
3380
|
-
if (currentInstance) {
|
|
3381
|
-
let provides = currentInstance.provides;
|
|
3382
|
-
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
3383
|
-
if (parentProvides === provides) {
|
|
3384
|
-
provides = currentInstance.provides = Object.create(parentProvides);
|
|
3385
|
-
}
|
|
3386
|
-
provides[key] = value;
|
|
3387
|
-
}
|
|
3388
|
-
}
|
|
3389
|
-
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
3390
|
-
const instance = getCurrentGenericInstance();
|
|
3391
|
-
if (instance || currentApp) {
|
|
3392
|
-
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
3393
|
-
if (provides && key in provides) {
|
|
3394
|
-
return provides[key];
|
|
3395
|
-
} else if (arguments.length > 1) {
|
|
3396
|
-
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
3397
|
-
} else ;
|
|
3398
|
-
}
|
|
3399
|
-
}
|
|
3400
|
-
function hasInjectionContext() {
|
|
3401
|
-
return !!(getCurrentGenericInstance() || currentApp);
|
|
3402
|
-
}
|
|
3403
|
-
|
|
3404
|
-
const ssrContextKey = Symbol.for("v-scx");
|
|
3405
|
-
const useSSRContext = () => {
|
|
3406
|
-
{
|
|
3407
|
-
const ctx = inject(ssrContextKey);
|
|
3408
|
-
return ctx;
|
|
3409
|
-
}
|
|
3410
|
-
};
|
|
3411
|
-
|
|
3412
|
-
function watchEffect(effect, options) {
|
|
3413
|
-
return doWatch(effect, null, options);
|
|
3414
|
-
}
|
|
3415
|
-
function watchPostEffect(effect, options) {
|
|
3416
|
-
return doWatch(
|
|
3417
|
-
effect,
|
|
3418
|
-
null,
|
|
3419
|
-
{ flush: "post" }
|
|
3420
|
-
);
|
|
3421
|
-
}
|
|
3422
|
-
function watchSyncEffect(effect, options) {
|
|
3423
|
-
return doWatch(
|
|
3424
|
-
effect,
|
|
3425
|
-
null,
|
|
3426
|
-
{ flush: "sync" }
|
|
3427
|
-
);
|
|
3428
|
-
}
|
|
3429
|
-
function watch(source, cb, options) {
|
|
3430
|
-
return doWatch(source, cb, options);
|
|
3431
|
-
}
|
|
3432
|
-
class RenderWatcherEffect extends reactivity.WatcherEffect {
|
|
3433
|
-
constructor(instance, source, cb, options, flush) {
|
|
3434
|
-
super(source, cb, options);
|
|
3435
|
-
this.flush = flush;
|
|
3436
|
-
const job = () => {
|
|
3437
|
-
if (this.dirty) {
|
|
3438
|
-
this.run();
|
|
3439
|
-
}
|
|
3440
|
-
};
|
|
3441
|
-
if (cb) {
|
|
3442
|
-
this.flags |= 128;
|
|
3443
|
-
job.flags |= 2;
|
|
3444
|
-
}
|
|
3445
|
-
if (instance) {
|
|
3446
|
-
job.i = instance;
|
|
3447
|
-
}
|
|
3448
|
-
this.job = job;
|
|
3449
|
-
}
|
|
3450
|
-
notify() {
|
|
3451
|
-
const flags = this.flags;
|
|
3452
|
-
if (!(flags & 256)) {
|
|
3453
|
-
const flush = this.flush;
|
|
3454
|
-
const job = this.job;
|
|
3455
|
-
if (flush === "post") {
|
|
3456
|
-
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
3457
|
-
} else if (flush === "pre") {
|
|
3458
|
-
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
3459
|
-
} else {
|
|
3460
|
-
job();
|
|
3461
|
-
}
|
|
3462
|
-
}
|
|
3463
|
-
}
|
|
3464
|
-
}
|
|
3465
|
-
function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
3466
|
-
const { immediate, deep, flush = "pre", once } = options;
|
|
3467
|
-
const baseWatchOptions = shared.extend({}, options);
|
|
3468
|
-
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
3469
|
-
let ssrCleanup;
|
|
3470
|
-
if (isInSSRComponentSetup) {
|
|
3471
|
-
if (flush === "sync") {
|
|
3472
|
-
const ctx = useSSRContext();
|
|
3473
|
-
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
3474
|
-
} else if (!runsImmediately) {
|
|
3475
|
-
const watchStopHandle = () => {
|
|
3476
|
-
};
|
|
3477
|
-
watchStopHandle.stop = shared.NOOP;
|
|
3478
|
-
watchStopHandle.resume = shared.NOOP;
|
|
3479
|
-
watchStopHandle.pause = shared.NOOP;
|
|
3480
|
-
return watchStopHandle;
|
|
3481
|
-
}
|
|
3482
|
-
}
|
|
3483
|
-
const instance = currentInstance;
|
|
3484
|
-
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
3485
|
-
const effect = new RenderWatcherEffect(
|
|
3486
|
-
instance,
|
|
3487
|
-
source,
|
|
3488
|
-
cb,
|
|
3489
|
-
baseWatchOptions,
|
|
3490
|
-
flush
|
|
3491
|
-
);
|
|
3492
|
-
if (cb) {
|
|
3493
|
-
effect.run(true);
|
|
3494
|
-
} else if (flush === "post") {
|
|
3495
|
-
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
3496
|
-
} else {
|
|
3497
|
-
effect.run(true);
|
|
3498
|
-
}
|
|
3499
|
-
const stop = effect.stop.bind(effect);
|
|
3500
|
-
stop.pause = effect.pause.bind(effect);
|
|
3501
|
-
stop.resume = effect.resume.bind(effect);
|
|
3502
|
-
stop.stop = stop;
|
|
3503
|
-
if (isInSSRComponentSetup) {
|
|
3504
|
-
if (ssrCleanup) {
|
|
3505
|
-
ssrCleanup.push(stop);
|
|
3506
|
-
} else if (runsImmediately) {
|
|
3507
|
-
stop();
|
|
3508
|
-
}
|
|
3509
|
-
}
|
|
3510
|
-
return stop;
|
|
3511
|
-
}
|
|
3512
|
-
function instanceWatch(source, value, options) {
|
|
3513
|
-
const publicThis = this.proxy;
|
|
3514
|
-
const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
3515
|
-
let cb;
|
|
3516
|
-
if (shared.isFunction(value)) {
|
|
3517
|
-
cb = value;
|
|
3518
|
-
} else {
|
|
3519
|
-
cb = value.handler;
|
|
3520
|
-
options = value;
|
|
3521
|
-
}
|
|
3522
|
-
const prev = setCurrentInstance(this);
|
|
3523
|
-
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3524
|
-
setCurrentInstance(...prev);
|
|
3525
|
-
return res;
|
|
3526
|
-
}
|
|
3527
|
-
function createPathGetter(ctx, path) {
|
|
3528
|
-
const segments = path.split(".");
|
|
3529
|
-
return () => {
|
|
3530
|
-
let cur = ctx;
|
|
3531
|
-
for (let i = 0; i < segments.length && cur; i++) {
|
|
3532
|
-
cur = cur[segments[i]];
|
|
3533
|
-
}
|
|
3534
|
-
return cur;
|
|
3535
|
-
};
|
|
3536
|
-
}
|
|
3537
|
-
|
|
3538
3547
|
function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
3539
3548
|
const i = getCurrentGenericInstance();
|
|
3540
3549
|
const camelizedName = shared.camelize(name);
|
|
@@ -4298,6 +4307,14 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4298
4307
|
}
|
|
4299
4308
|
};
|
|
4300
4309
|
|
|
4310
|
+
const MoveType = {
|
|
4311
|
+
"ENTER": 0,
|
|
4312
|
+
"0": "ENTER",
|
|
4313
|
+
"LEAVE": 1,
|
|
4314
|
+
"1": "LEAVE",
|
|
4315
|
+
"REORDER": 2,
|
|
4316
|
+
"2": "REORDER"
|
|
4317
|
+
};
|
|
4301
4318
|
const queuePostRenderEffect = queueEffectWithSuspense ;
|
|
4302
4319
|
function createRenderer(options) {
|
|
4303
4320
|
return baseCreateRenderer(options);
|
|
@@ -4439,7 +4456,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4439
4456
|
} else {
|
|
4440
4457
|
const el = n2.el = n1.el;
|
|
4441
4458
|
if (n2.children !== n1.children) {
|
|
4442
|
-
|
|
4459
|
+
{
|
|
4460
|
+
hostSetText(el, n2.children);
|
|
4461
|
+
}
|
|
4443
4462
|
}
|
|
4444
4463
|
}
|
|
4445
4464
|
};
|
|
@@ -4787,7 +4806,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4787
4806
|
} else {
|
|
4788
4807
|
if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
|
|
4789
4808
|
// of renderSlot() with no valid children
|
|
4790
|
-
n1.dynamicChildren) {
|
|
4809
|
+
n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
|
|
4791
4810
|
patchBlockChildren(
|
|
4792
4811
|
n1.dynamicChildren,
|
|
4793
4812
|
dynamicChildren,
|
|
@@ -5397,8 +5416,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5397
5416
|
const nextChild = c2[nextIndex];
|
|
5398
5417
|
const anchorVNode = c2[nextIndex + 1];
|
|
5399
5418
|
const anchor = nextIndex + 1 < l2 ? (
|
|
5400
|
-
// #13559, fallback to el placeholder for unresolved async component
|
|
5401
|
-
anchorVNode.el || anchorVNode
|
|
5419
|
+
// #13559, #14173 fallback to el placeholder for unresolved async component
|
|
5420
|
+
anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
|
|
5402
5421
|
) : parentAnchor;
|
|
5403
5422
|
if (newIndexToOldIndexMap[i] === 0) {
|
|
5404
5423
|
patch(
|
|
@@ -5689,9 +5708,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5689
5708
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
5690
5709
|
};
|
|
5691
5710
|
const render = (vnode, container, namespace) => {
|
|
5711
|
+
let instance;
|
|
5692
5712
|
if (vnode == null) {
|
|
5693
5713
|
if (container._vnode) {
|
|
5694
5714
|
unmount(container._vnode, null, null, true);
|
|
5715
|
+
instance = container._vnode.component;
|
|
5695
5716
|
}
|
|
5696
5717
|
} else {
|
|
5697
5718
|
patch(
|
|
@@ -5705,7 +5726,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5705
5726
|
);
|
|
5706
5727
|
}
|
|
5707
5728
|
container._vnode = vnode;
|
|
5708
|
-
flushOnAppMount();
|
|
5729
|
+
flushOnAppMount(instance);
|
|
5709
5730
|
};
|
|
5710
5731
|
const internals = {
|
|
5711
5732
|
p: patch,
|
|
@@ -5788,9 +5809,13 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
5788
5809
|
if (!shallow && c2.patchFlag !== -2)
|
|
5789
5810
|
traverseStaticChildren(c1, c2);
|
|
5790
5811
|
}
|
|
5791
|
-
if (c2.type === Text
|
|
5792
|
-
|
|
5793
|
-
|
|
5812
|
+
if (c2.type === Text) {
|
|
5813
|
+
if (c2.patchFlag !== -1) {
|
|
5814
|
+
c2.el = c1.el;
|
|
5815
|
+
} else {
|
|
5816
|
+
c2.__elIndex = i + // take fragment start anchor into account
|
|
5817
|
+
(n1.type === Fragment ? 1 : 0);
|
|
5818
|
+
}
|
|
5794
5819
|
}
|
|
5795
5820
|
if (c2.type === Comment && !c2.el) {
|
|
5796
5821
|
c2.el = c1.el;
|
|
@@ -5823,16 +5848,24 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
5823
5848
|
insert();
|
|
5824
5849
|
}
|
|
5825
5850
|
}
|
|
5826
|
-
function performTransitionLeave(el, transition, remove, isElement = true) {
|
|
5851
|
+
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
5827
5852
|
const performRemove = () => {
|
|
5828
5853
|
remove();
|
|
5829
5854
|
if (transition && !transition.persisted && transition.afterLeave) {
|
|
5830
5855
|
transition.afterLeave();
|
|
5831
5856
|
}
|
|
5832
5857
|
};
|
|
5833
|
-
if (isElement && transition && !transition.persisted) {
|
|
5858
|
+
if (force || isElement && transition && !transition.persisted) {
|
|
5834
5859
|
const { leave, delayLeave } = transition;
|
|
5835
|
-
const performLeave = () =>
|
|
5860
|
+
const performLeave = () => {
|
|
5861
|
+
if (el._isLeaving && force) {
|
|
5862
|
+
el[leaveCbKey](
|
|
5863
|
+
true
|
|
5864
|
+
/* cancelled */
|
|
5865
|
+
);
|
|
5866
|
+
}
|
|
5867
|
+
leave(el, performRemove);
|
|
5868
|
+
};
|
|
5836
5869
|
if (delayLeave) {
|
|
5837
5870
|
delayLeave(el, performRemove, performLeave);
|
|
5838
5871
|
} else {
|
|
@@ -5873,6 +5906,16 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
5873
5906
|
}
|
|
5874
5907
|
return inheritedScopeIds;
|
|
5875
5908
|
}
|
|
5909
|
+
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
5910
|
+
if (anchorVnode.placeholder) {
|
|
5911
|
+
return anchorVnode.placeholder;
|
|
5912
|
+
}
|
|
5913
|
+
const instance = anchorVnode.component;
|
|
5914
|
+
if (instance) {
|
|
5915
|
+
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
5916
|
+
}
|
|
5917
|
+
return null;
|
|
5918
|
+
}
|
|
5876
5919
|
|
|
5877
5920
|
const isSuspense = (type) => type.__isSuspense;
|
|
5878
5921
|
let suspenseId = 0;
|
|
@@ -6345,7 +6388,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace
|
|
|
6345
6388
|
parentSuspense,
|
|
6346
6389
|
parentComponent,
|
|
6347
6390
|
node.parentNode,
|
|
6348
|
-
//
|
|
6391
|
+
// oxlint-disable-next-line no-restricted-globals
|
|
6349
6392
|
document.createElement("div"),
|
|
6350
6393
|
null,
|
|
6351
6394
|
namespace,
|
|
@@ -6430,11 +6473,11 @@ function isVNodeSuspensible(vnode) {
|
|
|
6430
6473
|
return suspensible != null && suspensible !== false;
|
|
6431
6474
|
}
|
|
6432
6475
|
|
|
6433
|
-
const Fragment = Symbol.for("v-fgt");
|
|
6434
|
-
const Text = Symbol.for("v-txt");
|
|
6435
|
-
const Comment = Symbol.for("v-cmt");
|
|
6436
|
-
const Static = Symbol.for("v-stc");
|
|
6437
|
-
const VaporSlot = Symbol.for("v-vps");
|
|
6476
|
+
const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
|
|
6477
|
+
const Text = /* @__PURE__ */ Symbol.for("v-txt");
|
|
6478
|
+
const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
6479
|
+
const Static = /* @__PURE__ */ Symbol.for("v-stc");
|
|
6480
|
+
const VaporSlot = /* @__PURE__ */ Symbol.for("v-vps");
|
|
6438
6481
|
const blockStack = [];
|
|
6439
6482
|
let currentBlock = null;
|
|
6440
6483
|
function openBlock(disableTracking = false) {
|
|
@@ -6801,7 +6844,7 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
6801
6844
|
simpleSetCurrentInstance(instance);
|
|
6802
6845
|
}
|
|
6803
6846
|
};
|
|
6804
|
-
const internalOptions = ["ce", "type"];
|
|
6847
|
+
const internalOptions = ["ce", "type", "uid"];
|
|
6805
6848
|
const useInstanceOption = (key, silent = false) => {
|
|
6806
6849
|
const instance = getCurrentGenericInstance();
|
|
6807
6850
|
if (!instance) {
|
|
@@ -6813,7 +6856,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
6813
6856
|
return { hasInstance: true, value: instance[key] };
|
|
6814
6857
|
};
|
|
6815
6858
|
|
|
6816
|
-
const emptyAppContext = createAppContext();
|
|
6859
|
+
const emptyAppContext = /* @__PURE__ */ createAppContext();
|
|
6817
6860
|
let uid = 0;
|
|
6818
6861
|
function createComponentInstance(vnode, parent, suspense) {
|
|
6819
6862
|
const type = vnode.type;
|
|
@@ -7158,7 +7201,7 @@ function isMemoSame(cached, memo) {
|
|
|
7158
7201
|
return true;
|
|
7159
7202
|
}
|
|
7160
7203
|
|
|
7161
|
-
const version = "3.6.0-
|
|
7204
|
+
const version = "3.6.0-beta.2";
|
|
7162
7205
|
const warn$1 = shared.NOOP;
|
|
7163
7206
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
7164
7207
|
const devtools = void 0;
|
|
@@ -7226,6 +7269,7 @@ exports.ErrorCodes = ErrorCodes;
|
|
|
7226
7269
|
exports.ErrorTypeStrings = ErrorTypeStrings;
|
|
7227
7270
|
exports.Fragment = Fragment;
|
|
7228
7271
|
exports.KeepAlive = KeepAlive;
|
|
7272
|
+
exports.MoveType = MoveType;
|
|
7229
7273
|
exports.Static = Static;
|
|
7230
7274
|
exports.Suspense = Suspense;
|
|
7231
7275
|
exports.Teleport = Teleport;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -209,7 +209,7 @@ export declare function defineProps<TypeProps>(): DefineProps<LooseRequired<Type
|
|
|
209
209
|
export type DefineProps<T, BKeys extends keyof T> = Readonly<T> & {
|
|
210
210
|
readonly [K in BKeys]-?: boolean;
|
|
211
211
|
};
|
|
212
|
-
type BooleanKey<T, K extends keyof T = keyof T> = K extends any ?
|
|
212
|
+
type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? T[K] extends boolean | undefined ? T[K] extends never | undefined ? never : K : never : never;
|
|
213
213
|
/**
|
|
214
214
|
* Vue `<script setup>` compiler macro for declaring a component's emitted
|
|
215
215
|
* events. The expected argument is the same as the component `emits` option.
|
|
@@ -479,7 +479,7 @@ type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props,
|
|
|
479
479
|
__isFragment?: never;
|
|
480
480
|
__isTeleport?: never;
|
|
481
481
|
__isSuspense?: never;
|
|
482
|
-
new (
|
|
482
|
+
new (...args: any[]): T;
|
|
483
483
|
};
|
|
484
484
|
/**
|
|
485
485
|
* @deprecated This is no longer used internally, but exported and relied on by
|
|
@@ -558,7 +558,7 @@ declare const SuspenseImpl: {
|
|
|
558
558
|
};
|
|
559
559
|
export declare const Suspense: {
|
|
560
560
|
__isSuspense: true;
|
|
561
|
-
new (
|
|
561
|
+
new (): {
|
|
562
562
|
$props: VNodeProps & SuspenseProps;
|
|
563
563
|
$slots: {
|
|
564
564
|
default(): VNode[];
|
|
@@ -720,7 +720,7 @@ type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | nul
|
|
|
720
720
|
type RemoveFn = (vnode: VNode) => void;
|
|
721
721
|
type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
|
|
722
722
|
type UnmountComponentFn = (instance: ComponentInternalInstance, parentSuspense: SuspenseBoundary | null, doRemove?: boolean) => void;
|
|
723
|
-
declare enum MoveType {
|
|
723
|
+
export declare enum MoveType {
|
|
724
724
|
ENTER = 0,
|
|
725
725
|
LEAVE = 1,
|
|
726
726
|
REORDER = 2
|
|
@@ -758,7 +758,7 @@ export interface KeepAliveContext extends ComponentRenderContext {
|
|
|
758
758
|
}
|
|
759
759
|
export declare const KeepAlive: {
|
|
760
760
|
__isKeepAlive: true;
|
|
761
|
-
new (
|
|
761
|
+
new (): {
|
|
762
762
|
$props: VNodeProps & KeepAliveProps;
|
|
763
763
|
$slots: {
|
|
764
764
|
default(): VNode[];
|
|
@@ -1187,7 +1187,7 @@ declare function moveTeleport(vnode: VNode, container: RendererElement, parentAn
|
|
|
1187
1187
|
declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector, insert, createText }, }: RendererInternals<Node, Element>, hydrateChildren: (node: Node | null, vnode: VNode, container: Element, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
|
|
1188
1188
|
export declare const Teleport: {
|
|
1189
1189
|
__isTeleport: true;
|
|
1190
|
-
new (
|
|
1190
|
+
new (): {
|
|
1191
1191
|
$props: VNodeProps & TeleportProps;
|
|
1192
1192
|
$slots: {
|
|
1193
1193
|
default(): VNode[];
|
|
@@ -1376,7 +1376,7 @@ type Data = Record<string, unknown>;
|
|
|
1376
1376
|
* ```
|
|
1377
1377
|
*/
|
|
1378
1378
|
export type ComponentInstance<T> = T extends {
|
|
1379
|
-
new (
|
|
1379
|
+
new (): ComponentPublicInstance;
|
|
1380
1380
|
} ? InstanceType<T> : T extends FunctionalComponent<infer Props, infer Emits> ? ComponentPublicInstance<Props, {}, {}, {}, {}, ShortEmitsToObject<Emits>> : T extends Component<infer PropsOrInstance, infer RawBindings, infer D, infer C, infer M> ? PropsOrInstance extends {
|
|
1381
1381
|
$props: unknown;
|
|
1382
1382
|
} ? PropsOrInstance : ComponentPublicInstance<unknown extends PropsOrInstance ? {} : PropsOrInstance, unknown extends RawBindings ? {} : RawBindings, unknown extends D ? {} : D, C, M> : never;
|
|
@@ -1644,7 +1644,7 @@ interface Constructor<P = any> {
|
|
|
1644
1644
|
__isFragment?: never;
|
|
1645
1645
|
__isTeleport?: never;
|
|
1646
1646
|
__isSuspense?: never;
|
|
1647
|
-
new (
|
|
1647
|
+
new (...args: any[]): {
|
|
1648
1648
|
$props: P;
|
|
1649
1649
|
};
|
|
1650
1650
|
}
|
|
@@ -1782,7 +1782,7 @@ export declare function renderList<T>(source: T, renderItem: <K extends keyof T>
|
|
|
1782
1782
|
* For prefixing keys in v-on="obj" with "on"
|
|
1783
1783
|
* @private
|
|
1784
1784
|
*/
|
|
1785
|
-
export declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean): Record<string, any>;
|
|
1785
|
+
export declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean, needWrap?: boolean): Record<string, any>;
|
|
1786
1786
|
|
|
1787
1787
|
/**
|
|
1788
1788
|
* Compiler runtime helper for rendering `<slot/>`
|