@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
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -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$1(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);
|
|
@@ -412,10 +411,10 @@ function flushPostFlushCbs(seen) {
|
|
|
412
411
|
}
|
|
413
412
|
}
|
|
414
413
|
let isFlushing = false;
|
|
415
|
-
function flushOnAppMount() {
|
|
414
|
+
function flushOnAppMount(instance) {
|
|
416
415
|
if (!isFlushing) {
|
|
417
416
|
isFlushing = true;
|
|
418
|
-
flushPreFlushCbs();
|
|
417
|
+
flushPreFlushCbs(instance);
|
|
419
418
|
flushPostFlushCbs();
|
|
420
419
|
isFlushing = false;
|
|
421
420
|
}
|
|
@@ -657,7 +656,6 @@ function setDevtoolsHook$1(hook, target) {
|
|
|
657
656
|
// (#4815)
|
|
658
657
|
typeof window !== "undefined" && // some envs mock window but not fully
|
|
659
658
|
window.HTMLElement && // also exclude jsdom
|
|
660
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
661
659
|
!((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
|
|
662
660
|
) {
|
|
663
661
|
const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
|
|
@@ -830,7 +828,203 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
830
828
|
}
|
|
831
829
|
}
|
|
832
830
|
|
|
833
|
-
|
|
831
|
+
function provide(key, value) {
|
|
832
|
+
{
|
|
833
|
+
if (!currentInstance || currentInstance.isMounted && !isHmrUpdating) {
|
|
834
|
+
warn$1(`provide() can only be used inside setup().`);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
if (currentInstance) {
|
|
838
|
+
let provides = currentInstance.provides;
|
|
839
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
840
|
+
if (parentProvides === provides) {
|
|
841
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
842
|
+
}
|
|
843
|
+
provides[key] = value;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
847
|
+
const instance = getCurrentGenericInstance();
|
|
848
|
+
if (instance || currentApp) {
|
|
849
|
+
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
850
|
+
if (provides && key in provides) {
|
|
851
|
+
return provides[key];
|
|
852
|
+
} else if (arguments.length > 1) {
|
|
853
|
+
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
854
|
+
} else {
|
|
855
|
+
warn$1(`injection "${String(key)}" not found.`);
|
|
856
|
+
}
|
|
857
|
+
} else {
|
|
858
|
+
warn$1(`inject() can only be used inside setup() or functional components.`);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
function hasInjectionContext() {
|
|
862
|
+
return !!(getCurrentGenericInstance() || currentApp);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
|
|
866
|
+
const useSSRContext = () => {
|
|
867
|
+
{
|
|
868
|
+
const ctx = inject(ssrContextKey);
|
|
869
|
+
if (!ctx) {
|
|
870
|
+
warn$1(
|
|
871
|
+
`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
return ctx;
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
|
|
878
|
+
function watchEffect(effect, options) {
|
|
879
|
+
return doWatch(effect, null, options);
|
|
880
|
+
}
|
|
881
|
+
function watchPostEffect(effect, options) {
|
|
882
|
+
return doWatch(
|
|
883
|
+
effect,
|
|
884
|
+
null,
|
|
885
|
+
shared.extend({}, options, { flush: "post" })
|
|
886
|
+
);
|
|
887
|
+
}
|
|
888
|
+
function watchSyncEffect(effect, options) {
|
|
889
|
+
return doWatch(
|
|
890
|
+
effect,
|
|
891
|
+
null,
|
|
892
|
+
shared.extend({}, options, { flush: "sync" })
|
|
893
|
+
);
|
|
894
|
+
}
|
|
895
|
+
function watch(source, cb, options) {
|
|
896
|
+
if (!shared.isFunction(cb)) {
|
|
897
|
+
warn$1(
|
|
898
|
+
`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
|
|
899
|
+
);
|
|
900
|
+
}
|
|
901
|
+
return doWatch(source, cb, options);
|
|
902
|
+
}
|
|
903
|
+
class RenderWatcherEffect extends reactivity.WatcherEffect {
|
|
904
|
+
constructor(instance, source, cb, options, flush) {
|
|
905
|
+
super(source, cb, options);
|
|
906
|
+
this.flush = flush;
|
|
907
|
+
const job = () => {
|
|
908
|
+
if (this.dirty) {
|
|
909
|
+
this.run();
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
if (cb) {
|
|
913
|
+
this.flags |= 128;
|
|
914
|
+
job.flags |= 2;
|
|
915
|
+
}
|
|
916
|
+
if (instance) {
|
|
917
|
+
job.i = instance;
|
|
918
|
+
}
|
|
919
|
+
this.job = job;
|
|
920
|
+
}
|
|
921
|
+
notify() {
|
|
922
|
+
const flags = this.flags;
|
|
923
|
+
if (!(flags & 256)) {
|
|
924
|
+
const flush = this.flush;
|
|
925
|
+
const job = this.job;
|
|
926
|
+
if (flush === "post") {
|
|
927
|
+
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
928
|
+
} else if (flush === "pre") {
|
|
929
|
+
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
930
|
+
} else {
|
|
931
|
+
job();
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
937
|
+
const { immediate, deep, flush = "pre", once } = options;
|
|
938
|
+
if (!cb) {
|
|
939
|
+
if (immediate !== void 0) {
|
|
940
|
+
warn$1(
|
|
941
|
+
`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
|
|
942
|
+
);
|
|
943
|
+
}
|
|
944
|
+
if (deep !== void 0) {
|
|
945
|
+
warn$1(
|
|
946
|
+
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
947
|
+
);
|
|
948
|
+
}
|
|
949
|
+
if (once !== void 0) {
|
|
950
|
+
warn$1(
|
|
951
|
+
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
952
|
+
);
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
const baseWatchOptions = shared.extend({}, options);
|
|
956
|
+
baseWatchOptions.onWarn = warn$1;
|
|
957
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
958
|
+
let ssrCleanup;
|
|
959
|
+
if (isInSSRComponentSetup) {
|
|
960
|
+
if (flush === "sync") {
|
|
961
|
+
const ctx = useSSRContext();
|
|
962
|
+
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
963
|
+
} else if (!runsImmediately) {
|
|
964
|
+
const watchStopHandle = () => {
|
|
965
|
+
};
|
|
966
|
+
watchStopHandle.stop = shared.NOOP;
|
|
967
|
+
watchStopHandle.resume = shared.NOOP;
|
|
968
|
+
watchStopHandle.pause = shared.NOOP;
|
|
969
|
+
return watchStopHandle;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
const instance = currentInstance;
|
|
973
|
+
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
974
|
+
const effect = new RenderWatcherEffect(
|
|
975
|
+
instance,
|
|
976
|
+
source,
|
|
977
|
+
cb,
|
|
978
|
+
baseWatchOptions,
|
|
979
|
+
flush
|
|
980
|
+
);
|
|
981
|
+
if (cb) {
|
|
982
|
+
effect.run(true);
|
|
983
|
+
} else if (flush === "post") {
|
|
984
|
+
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
985
|
+
} else {
|
|
986
|
+
effect.run(true);
|
|
987
|
+
}
|
|
988
|
+
const stop = effect.stop.bind(effect);
|
|
989
|
+
stop.pause = effect.pause.bind(effect);
|
|
990
|
+
stop.resume = effect.resume.bind(effect);
|
|
991
|
+
stop.stop = stop;
|
|
992
|
+
if (isInSSRComponentSetup) {
|
|
993
|
+
if (ssrCleanup) {
|
|
994
|
+
ssrCleanup.push(stop);
|
|
995
|
+
} else if (runsImmediately) {
|
|
996
|
+
stop();
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
return stop;
|
|
1000
|
+
}
|
|
1001
|
+
function instanceWatch(source, value, options) {
|
|
1002
|
+
const publicThis = this.proxy;
|
|
1003
|
+
const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
1004
|
+
let cb;
|
|
1005
|
+
if (shared.isFunction(value)) {
|
|
1006
|
+
cb = value;
|
|
1007
|
+
} else {
|
|
1008
|
+
cb = value.handler;
|
|
1009
|
+
options = value;
|
|
1010
|
+
}
|
|
1011
|
+
const prev = setCurrentInstance(this);
|
|
1012
|
+
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
1013
|
+
setCurrentInstance(...prev);
|
|
1014
|
+
return res;
|
|
1015
|
+
}
|
|
1016
|
+
function createPathGetter(ctx, path) {
|
|
1017
|
+
const segments = path.split(".");
|
|
1018
|
+
return () => {
|
|
1019
|
+
let cur = ctx;
|
|
1020
|
+
for (let i = 0; i < segments.length && cur; i++) {
|
|
1021
|
+
cur = cur[segments[i]];
|
|
1022
|
+
}
|
|
1023
|
+
return cur;
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
|
|
834
1028
|
const isTeleport = (type) => type.__isTeleport;
|
|
835
1029
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
836
1030
|
const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
|
|
@@ -1202,8 +1396,8 @@ function prepareAnchor(target, vnode, createText, insert) {
|
|
|
1202
1396
|
return targetAnchor;
|
|
1203
1397
|
}
|
|
1204
1398
|
|
|
1205
|
-
const leaveCbKey = Symbol("_leaveCb");
|
|
1206
|
-
const enterCbKey = Symbol("_enterCb");
|
|
1399
|
+
const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
|
|
1400
|
+
const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
|
|
1207
1401
|
function useTransitionState() {
|
|
1208
1402
|
const state = {
|
|
1209
1403
|
isMounted: false,
|
|
@@ -2456,9 +2650,17 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
2456
2650
|
}
|
|
2457
2651
|
}
|
|
2458
2652
|
|
|
2459
|
-
|
|
2460
|
-
|
|
2653
|
+
let requestIdleCallback;
|
|
2654
|
+
let cancelIdleCallback;
|
|
2655
|
+
function ensureIdleCallbacks() {
|
|
2656
|
+
if (!requestIdleCallback) {
|
|
2657
|
+
const g = shared.getGlobalThis();
|
|
2658
|
+
requestIdleCallback = g.requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
2659
|
+
cancelIdleCallback = g.cancelIdleCallback || ((id) => clearTimeout(id));
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2461
2662
|
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
2663
|
+
ensureIdleCallbacks();
|
|
2462
2664
|
const id = requestIdleCallback(hydrate, { timeout });
|
|
2463
2665
|
return () => cancelIdleCallback(id);
|
|
2464
2666
|
};
|
|
@@ -2816,7 +3018,9 @@ const KeepAliveImpl = {
|
|
|
2816
3018
|
}
|
|
2817
3019
|
function pruneCache(filter) {
|
|
2818
3020
|
cache.forEach((vnode, key) => {
|
|
2819
|
-
const name = getComponentName(
|
|
3021
|
+
const name = getComponentName(
|
|
3022
|
+
isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
|
|
3023
|
+
);
|
|
2820
3024
|
if (name && !filter(name)) {
|
|
2821
3025
|
pruneCacheEntry(key);
|
|
2822
3026
|
}
|
|
@@ -3115,7 +3319,7 @@ const DIRECTIVES = "directives";
|
|
|
3115
3319
|
function resolveComponent(name, maybeSelfReference) {
|
|
3116
3320
|
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
3117
3321
|
}
|
|
3118
|
-
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
3322
|
+
const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
|
|
3119
3323
|
function resolveDynamicComponent(component) {
|
|
3120
3324
|
if (shared.isString(component)) {
|
|
3121
3325
|
return resolveAsset(COMPONENTS, component, false) || component;
|
|
@@ -3306,14 +3510,14 @@ function ensureVaporSlotFallback(vnodes, fallback) {
|
|
|
3306
3510
|
}
|
|
3307
3511
|
}
|
|
3308
3512
|
|
|
3309
|
-
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
3513
|
+
function toHandlers(obj, preserveCaseIfNecessary, needWrap) {
|
|
3310
3514
|
const ret = {};
|
|
3311
3515
|
if (!shared.isObject(obj)) {
|
|
3312
3516
|
warn$1(`v-on with no argument expects an object value.`);
|
|
3313
3517
|
return ret;
|
|
3314
3518
|
}
|
|
3315
3519
|
for (const key in obj) {
|
|
3316
|
-
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
|
|
3520
|
+
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = needWrap ? () => obj[key] : obj[key];
|
|
3317
3521
|
}
|
|
3318
3522
|
return ret;
|
|
3319
3523
|
}
|
|
@@ -4285,202 +4489,6 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
4285
4489
|
}
|
|
4286
4490
|
let currentApp = null;
|
|
4287
4491
|
|
|
4288
|
-
function provide(key, value) {
|
|
4289
|
-
{
|
|
4290
|
-
if (!currentInstance || currentInstance.isMounted) {
|
|
4291
|
-
warn$1(`provide() can only be used inside setup().`);
|
|
4292
|
-
}
|
|
4293
|
-
}
|
|
4294
|
-
if (currentInstance) {
|
|
4295
|
-
let provides = currentInstance.provides;
|
|
4296
|
-
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
4297
|
-
if (parentProvides === provides) {
|
|
4298
|
-
provides = currentInstance.provides = Object.create(parentProvides);
|
|
4299
|
-
}
|
|
4300
|
-
provides[key] = value;
|
|
4301
|
-
}
|
|
4302
|
-
}
|
|
4303
|
-
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
4304
|
-
const instance = getCurrentGenericInstance();
|
|
4305
|
-
if (instance || currentApp) {
|
|
4306
|
-
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
4307
|
-
if (provides && key in provides) {
|
|
4308
|
-
return provides[key];
|
|
4309
|
-
} else if (arguments.length > 1) {
|
|
4310
|
-
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
4311
|
-
} else {
|
|
4312
|
-
warn$1(`injection "${String(key)}" not found.`);
|
|
4313
|
-
}
|
|
4314
|
-
} else {
|
|
4315
|
-
warn$1(`inject() can only be used inside setup() or functional components.`);
|
|
4316
|
-
}
|
|
4317
|
-
}
|
|
4318
|
-
function hasInjectionContext() {
|
|
4319
|
-
return !!(getCurrentGenericInstance() || currentApp);
|
|
4320
|
-
}
|
|
4321
|
-
|
|
4322
|
-
const ssrContextKey = Symbol.for("v-scx");
|
|
4323
|
-
const useSSRContext = () => {
|
|
4324
|
-
{
|
|
4325
|
-
const ctx = inject(ssrContextKey);
|
|
4326
|
-
if (!ctx) {
|
|
4327
|
-
warn$1(
|
|
4328
|
-
`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
|
|
4329
|
-
);
|
|
4330
|
-
}
|
|
4331
|
-
return ctx;
|
|
4332
|
-
}
|
|
4333
|
-
};
|
|
4334
|
-
|
|
4335
|
-
function watchEffect(effect, options) {
|
|
4336
|
-
return doWatch(effect, null, options);
|
|
4337
|
-
}
|
|
4338
|
-
function watchPostEffect(effect, options) {
|
|
4339
|
-
return doWatch(
|
|
4340
|
-
effect,
|
|
4341
|
-
null,
|
|
4342
|
-
shared.extend({}, options, { flush: "post" })
|
|
4343
|
-
);
|
|
4344
|
-
}
|
|
4345
|
-
function watchSyncEffect(effect, options) {
|
|
4346
|
-
return doWatch(
|
|
4347
|
-
effect,
|
|
4348
|
-
null,
|
|
4349
|
-
shared.extend({}, options, { flush: "sync" })
|
|
4350
|
-
);
|
|
4351
|
-
}
|
|
4352
|
-
function watch(source, cb, options) {
|
|
4353
|
-
if (!shared.isFunction(cb)) {
|
|
4354
|
-
warn$1(
|
|
4355
|
-
`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
|
|
4356
|
-
);
|
|
4357
|
-
}
|
|
4358
|
-
return doWatch(source, cb, options);
|
|
4359
|
-
}
|
|
4360
|
-
class RenderWatcherEffect extends reactivity.WatcherEffect {
|
|
4361
|
-
constructor(instance, source, cb, options, flush) {
|
|
4362
|
-
super(source, cb, options);
|
|
4363
|
-
this.flush = flush;
|
|
4364
|
-
const job = () => {
|
|
4365
|
-
if (this.dirty) {
|
|
4366
|
-
this.run();
|
|
4367
|
-
}
|
|
4368
|
-
};
|
|
4369
|
-
if (cb) {
|
|
4370
|
-
this.flags |= 128;
|
|
4371
|
-
job.flags |= 2;
|
|
4372
|
-
}
|
|
4373
|
-
if (instance) {
|
|
4374
|
-
job.i = instance;
|
|
4375
|
-
}
|
|
4376
|
-
this.job = job;
|
|
4377
|
-
}
|
|
4378
|
-
notify() {
|
|
4379
|
-
const flags = this.flags;
|
|
4380
|
-
if (!(flags & 256)) {
|
|
4381
|
-
const flush = this.flush;
|
|
4382
|
-
const job = this.job;
|
|
4383
|
-
if (flush === "post") {
|
|
4384
|
-
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
4385
|
-
} else if (flush === "pre") {
|
|
4386
|
-
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
4387
|
-
} else {
|
|
4388
|
-
job();
|
|
4389
|
-
}
|
|
4390
|
-
}
|
|
4391
|
-
}
|
|
4392
|
-
}
|
|
4393
|
-
function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
4394
|
-
const { immediate, deep, flush = "pre", once } = options;
|
|
4395
|
-
if (!cb) {
|
|
4396
|
-
if (immediate !== void 0) {
|
|
4397
|
-
warn$1(
|
|
4398
|
-
`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
|
|
4399
|
-
);
|
|
4400
|
-
}
|
|
4401
|
-
if (deep !== void 0) {
|
|
4402
|
-
warn$1(
|
|
4403
|
-
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
4404
|
-
);
|
|
4405
|
-
}
|
|
4406
|
-
if (once !== void 0) {
|
|
4407
|
-
warn$1(
|
|
4408
|
-
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
4409
|
-
);
|
|
4410
|
-
}
|
|
4411
|
-
}
|
|
4412
|
-
const baseWatchOptions = shared.extend({}, options);
|
|
4413
|
-
baseWatchOptions.onWarn = warn$1;
|
|
4414
|
-
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
4415
|
-
let ssrCleanup;
|
|
4416
|
-
if (isInSSRComponentSetup) {
|
|
4417
|
-
if (flush === "sync") {
|
|
4418
|
-
const ctx = useSSRContext();
|
|
4419
|
-
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
4420
|
-
} else if (!runsImmediately) {
|
|
4421
|
-
const watchStopHandle = () => {
|
|
4422
|
-
};
|
|
4423
|
-
watchStopHandle.stop = shared.NOOP;
|
|
4424
|
-
watchStopHandle.resume = shared.NOOP;
|
|
4425
|
-
watchStopHandle.pause = shared.NOOP;
|
|
4426
|
-
return watchStopHandle;
|
|
4427
|
-
}
|
|
4428
|
-
}
|
|
4429
|
-
const instance = currentInstance;
|
|
4430
|
-
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
4431
|
-
const effect = new RenderWatcherEffect(
|
|
4432
|
-
instance,
|
|
4433
|
-
source,
|
|
4434
|
-
cb,
|
|
4435
|
-
baseWatchOptions,
|
|
4436
|
-
flush
|
|
4437
|
-
);
|
|
4438
|
-
if (cb) {
|
|
4439
|
-
effect.run(true);
|
|
4440
|
-
} else if (flush === "post") {
|
|
4441
|
-
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
4442
|
-
} else {
|
|
4443
|
-
effect.run(true);
|
|
4444
|
-
}
|
|
4445
|
-
const stop = effect.stop.bind(effect);
|
|
4446
|
-
stop.pause = effect.pause.bind(effect);
|
|
4447
|
-
stop.resume = effect.resume.bind(effect);
|
|
4448
|
-
stop.stop = stop;
|
|
4449
|
-
if (isInSSRComponentSetup) {
|
|
4450
|
-
if (ssrCleanup) {
|
|
4451
|
-
ssrCleanup.push(stop);
|
|
4452
|
-
} else if (runsImmediately) {
|
|
4453
|
-
stop();
|
|
4454
|
-
}
|
|
4455
|
-
}
|
|
4456
|
-
return stop;
|
|
4457
|
-
}
|
|
4458
|
-
function instanceWatch(source, value, options) {
|
|
4459
|
-
const publicThis = this.proxy;
|
|
4460
|
-
const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
4461
|
-
let cb;
|
|
4462
|
-
if (shared.isFunction(value)) {
|
|
4463
|
-
cb = value;
|
|
4464
|
-
} else {
|
|
4465
|
-
cb = value.handler;
|
|
4466
|
-
options = value;
|
|
4467
|
-
}
|
|
4468
|
-
const prev = setCurrentInstance(this);
|
|
4469
|
-
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
4470
|
-
setCurrentInstance(...prev);
|
|
4471
|
-
return res;
|
|
4472
|
-
}
|
|
4473
|
-
function createPathGetter(ctx, path) {
|
|
4474
|
-
const segments = path.split(".");
|
|
4475
|
-
return () => {
|
|
4476
|
-
let cur = ctx;
|
|
4477
|
-
for (let i = 0; i < segments.length && cur; i++) {
|
|
4478
|
-
cur = cur[segments[i]];
|
|
4479
|
-
}
|
|
4480
|
-
return cur;
|
|
4481
|
-
};
|
|
4482
|
-
}
|
|
4483
|
-
|
|
4484
4492
|
function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
4485
4493
|
const i = getCurrentGenericInstance();
|
|
4486
4494
|
if (!i) {
|
|
@@ -5565,6 +5573,14 @@ function isSupported() {
|
|
|
5565
5573
|
return supported;
|
|
5566
5574
|
}
|
|
5567
5575
|
|
|
5576
|
+
const MoveType = {
|
|
5577
|
+
"ENTER": 0,
|
|
5578
|
+
"0": "ENTER",
|
|
5579
|
+
"LEAVE": 1,
|
|
5580
|
+
"1": "LEAVE",
|
|
5581
|
+
"REORDER": 2,
|
|
5582
|
+
"2": "REORDER"
|
|
5583
|
+
};
|
|
5568
5584
|
const queuePostRenderEffect = queueEffectWithSuspense ;
|
|
5569
5585
|
function createRenderer(options) {
|
|
5570
5586
|
return baseCreateRenderer(options);
|
|
@@ -5713,7 +5729,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5713
5729
|
} else {
|
|
5714
5730
|
const el = n2.el = n1.el;
|
|
5715
5731
|
if (n2.children !== n1.children) {
|
|
5716
|
-
|
|
5732
|
+
if (isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
|
|
5733
|
+
const childNodes = container.childNodes;
|
|
5734
|
+
const newChild = hostCreateText(n2.children);
|
|
5735
|
+
const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
|
|
5736
|
+
hostInsert(newChild, container, oldChild);
|
|
5737
|
+
hostRemove(oldChild);
|
|
5738
|
+
} else {
|
|
5739
|
+
hostSetText(el, n2.children);
|
|
5740
|
+
}
|
|
5717
5741
|
}
|
|
5718
5742
|
}
|
|
5719
5743
|
};
|
|
@@ -6099,7 +6123,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6099
6123
|
} else {
|
|
6100
6124
|
if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
|
|
6101
6125
|
// of renderSlot() with no valid children
|
|
6102
|
-
n1.dynamicChildren) {
|
|
6126
|
+
n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
|
|
6103
6127
|
patchBlockChildren(
|
|
6104
6128
|
n1.dynamicChildren,
|
|
6105
6129
|
dynamicChildren,
|
|
@@ -6787,8 +6811,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6787
6811
|
const nextChild = c2[nextIndex];
|
|
6788
6812
|
const anchorVNode = c2[nextIndex + 1];
|
|
6789
6813
|
const anchor = nextIndex + 1 < l2 ? (
|
|
6790
|
-
// #13559, fallback to el placeholder for unresolved async component
|
|
6791
|
-
anchorVNode.el || anchorVNode
|
|
6814
|
+
// #13559, #14173 fallback to el placeholder for unresolved async component
|
|
6815
|
+
anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
|
|
6792
6816
|
) : parentAnchor;
|
|
6793
6817
|
if (newIndexToOldIndexMap[i] === 0) {
|
|
6794
6818
|
patch(
|
|
@@ -7093,9 +7117,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7093
7117
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
7094
7118
|
};
|
|
7095
7119
|
const render = (vnode, container, namespace) => {
|
|
7120
|
+
let instance;
|
|
7096
7121
|
if (vnode == null) {
|
|
7097
7122
|
if (container._vnode) {
|
|
7098
7123
|
unmount(container._vnode, null, null, true);
|
|
7124
|
+
instance = container._vnode.component;
|
|
7099
7125
|
}
|
|
7100
7126
|
} else {
|
|
7101
7127
|
patch(
|
|
@@ -7109,7 +7135,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7109
7135
|
);
|
|
7110
7136
|
}
|
|
7111
7137
|
container._vnode = vnode;
|
|
7112
|
-
flushOnAppMount();
|
|
7138
|
+
flushOnAppMount(instance);
|
|
7113
7139
|
};
|
|
7114
7140
|
const internals = {
|
|
7115
7141
|
p: patch,
|
|
@@ -7199,9 +7225,13 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
7199
7225
|
if (!shallow && c2.patchFlag !== -2)
|
|
7200
7226
|
traverseStaticChildren(c1, c2);
|
|
7201
7227
|
}
|
|
7202
|
-
if (c2.type === Text
|
|
7203
|
-
|
|
7204
|
-
|
|
7228
|
+
if (c2.type === Text) {
|
|
7229
|
+
if (c2.patchFlag !== -1) {
|
|
7230
|
+
c2.el = c1.el;
|
|
7231
|
+
} else {
|
|
7232
|
+
c2.__elIndex = i + // take fragment start anchor into account
|
|
7233
|
+
(n1.type === Fragment ? 1 : 0);
|
|
7234
|
+
}
|
|
7205
7235
|
}
|
|
7206
7236
|
if (c2.type === Comment && !c2.el) {
|
|
7207
7237
|
c2.el = c1.el;
|
|
@@ -7237,16 +7267,24 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
7237
7267
|
insert();
|
|
7238
7268
|
}
|
|
7239
7269
|
}
|
|
7240
|
-
function performTransitionLeave(el, transition, remove, isElement = true) {
|
|
7270
|
+
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
7241
7271
|
const performRemove = () => {
|
|
7242
7272
|
remove();
|
|
7243
7273
|
if (transition && !transition.persisted && transition.afterLeave) {
|
|
7244
7274
|
transition.afterLeave();
|
|
7245
7275
|
}
|
|
7246
7276
|
};
|
|
7247
|
-
if (isElement && transition && !transition.persisted) {
|
|
7277
|
+
if (force || isElement && transition && !transition.persisted) {
|
|
7248
7278
|
const { leave, delayLeave } = transition;
|
|
7249
|
-
const performLeave = () =>
|
|
7279
|
+
const performLeave = () => {
|
|
7280
|
+
if (el._isLeaving && force) {
|
|
7281
|
+
el[leaveCbKey](
|
|
7282
|
+
true
|
|
7283
|
+
/* cancelled */
|
|
7284
|
+
);
|
|
7285
|
+
}
|
|
7286
|
+
leave(el, performRemove);
|
|
7287
|
+
};
|
|
7250
7288
|
if (delayLeave) {
|
|
7251
7289
|
delayLeave(el, performRemove, performLeave);
|
|
7252
7290
|
} else {
|
|
@@ -7302,6 +7340,16 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
7302
7340
|
}
|
|
7303
7341
|
return inheritedScopeIds;
|
|
7304
7342
|
}
|
|
7343
|
+
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
7344
|
+
if (anchorVnode.placeholder) {
|
|
7345
|
+
return anchorVnode.placeholder;
|
|
7346
|
+
}
|
|
7347
|
+
const instance = anchorVnode.component;
|
|
7348
|
+
if (instance) {
|
|
7349
|
+
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
7350
|
+
}
|
|
7351
|
+
return null;
|
|
7352
|
+
}
|
|
7305
7353
|
|
|
7306
7354
|
const isSuspense = (type) => type.__isSuspense;
|
|
7307
7355
|
let suspenseId = 0;
|
|
@@ -7796,7 +7844,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace
|
|
|
7796
7844
|
parentSuspense,
|
|
7797
7845
|
parentComponent,
|
|
7798
7846
|
node.parentNode,
|
|
7799
|
-
//
|
|
7847
|
+
// oxlint-disable-next-line no-restricted-globals
|
|
7800
7848
|
document.createElement("div"),
|
|
7801
7849
|
null,
|
|
7802
7850
|
namespace,
|
|
@@ -7884,11 +7932,11 @@ function isVNodeSuspensible(vnode) {
|
|
|
7884
7932
|
return suspensible != null && suspensible !== false;
|
|
7885
7933
|
}
|
|
7886
7934
|
|
|
7887
|
-
const Fragment = Symbol.for("v-fgt");
|
|
7888
|
-
const Text = Symbol.for("v-txt");
|
|
7889
|
-
const Comment = Symbol.for("v-cmt");
|
|
7890
|
-
const Static = Symbol.for("v-stc");
|
|
7891
|
-
const VaporSlot = Symbol.for("v-vps");
|
|
7935
|
+
const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
|
|
7936
|
+
const Text = /* @__PURE__ */ Symbol.for("v-txt");
|
|
7937
|
+
const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
7938
|
+
const Static = /* @__PURE__ */ Symbol.for("v-stc");
|
|
7939
|
+
const VaporSlot = /* @__PURE__ */ Symbol.for("v-vps");
|
|
7892
7940
|
const blockStack = [];
|
|
7893
7941
|
let currentBlock = null;
|
|
7894
7942
|
function openBlock(disableTracking = false) {
|
|
@@ -8292,7 +8340,7 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
8292
8340
|
simpleSetCurrentInstance(instance);
|
|
8293
8341
|
}
|
|
8294
8342
|
};
|
|
8295
|
-
const internalOptions = ["ce", "type"];
|
|
8343
|
+
const internalOptions = ["ce", "type", "uid"];
|
|
8296
8344
|
const useInstanceOption = (key, silent = false) => {
|
|
8297
8345
|
const instance = getCurrentGenericInstance();
|
|
8298
8346
|
if (!instance) {
|
|
@@ -8312,7 +8360,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
8312
8360
|
return { hasInstance: true, value: instance[key] };
|
|
8313
8361
|
};
|
|
8314
8362
|
|
|
8315
|
-
const emptyAppContext = createAppContext();
|
|
8363
|
+
const emptyAppContext = /* @__PURE__ */ createAppContext();
|
|
8316
8364
|
let uid = 0;
|
|
8317
8365
|
function createComponentInstance(vnode, parent, suspense) {
|
|
8318
8366
|
const type = vnode.type;
|
|
@@ -8944,7 +8992,7 @@ function isMemoSame(cached, memo) {
|
|
|
8944
8992
|
return true;
|
|
8945
8993
|
}
|
|
8946
8994
|
|
|
8947
|
-
const version = "3.6.0-
|
|
8995
|
+
const version = "3.6.0-beta.2";
|
|
8948
8996
|
const warn = warn$1 ;
|
|
8949
8997
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8950
8998
|
const devtools = devtools$1 ;
|
|
@@ -9012,6 +9060,7 @@ exports.ErrorCodes = ErrorCodes;
|
|
|
9012
9060
|
exports.ErrorTypeStrings = ErrorTypeStrings;
|
|
9013
9061
|
exports.Fragment = Fragment;
|
|
9014
9062
|
exports.KeepAlive = KeepAlive;
|
|
9063
|
+
exports.MoveType = MoveType;
|
|
9015
9064
|
exports.Static = Static;
|
|
9016
9065
|
exports.Suspense = Suspense;
|
|
9017
9066
|
exports.Teleport = Teleport;
|