@vue/runtime-core 3.5.17 → 3.6.0-alpha.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 +868 -583
- package/dist/runtime-core.cjs.prod.js +697 -436
- package/dist/runtime-core.d.ts +121 -55
- package/dist/runtime-core.esm-bundler.js +886 -587
- package/package.json +3 -3
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.
|
|
2
|
+
* @vue/runtime-core v3.6.0-alpha.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
import {
|
|
6
|
+
import { setActiveSub, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, setCurrentScope, WatcherEffect, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1 } from '@vue/reactivity';
|
|
7
7
|
export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
8
|
-
import { isString, isFunction, EMPTY_OBJ, isPromise, isArray,
|
|
8
|
+
import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol, NOOP, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, makeMap, toRawType, getSequence, hasChanged, looseToNumber, isModelListener, toNumber, isBuiltInTag } from '@vue/shared';
|
|
9
9
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
10
10
|
|
|
11
11
|
const stack = [];
|
|
12
|
-
function pushWarningContext(
|
|
13
|
-
stack.push(
|
|
12
|
+
function pushWarningContext(ctx) {
|
|
13
|
+
stack.push(ctx);
|
|
14
14
|
}
|
|
15
15
|
function popWarningContext() {
|
|
16
16
|
stack.pop();
|
|
@@ -19,8 +19,9 @@ let isWarning = false;
|
|
|
19
19
|
function warn$1(msg, ...args) {
|
|
20
20
|
if (isWarning) return;
|
|
21
21
|
isWarning = true;
|
|
22
|
-
|
|
23
|
-
const
|
|
22
|
+
const prevSub = setActiveSub();
|
|
23
|
+
const entry = stack.length ? stack[stack.length - 1] : null;
|
|
24
|
+
const instance = isVNode(entry) ? entry.component : entry;
|
|
24
25
|
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
25
26
|
const trace = getComponentTrace();
|
|
26
27
|
if (appWarnHandler) {
|
|
@@ -34,9 +35,9 @@ function warn$1(msg, ...args) {
|
|
|
34
35
|
var _a, _b;
|
|
35
36
|
return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
|
|
36
37
|
}).join(""),
|
|
37
|
-
instance && instance.proxy,
|
|
38
|
+
instance && instance.proxy || instance,
|
|
38
39
|
trace.map(
|
|
39
|
-
({
|
|
40
|
+
({ ctx }) => `at <${formatComponentName(instance, ctx.type)}>`
|
|
40
41
|
).join("\n"),
|
|
41
42
|
trace
|
|
42
43
|
]
|
|
@@ -50,27 +51,31 @@ function warn$1(msg, ...args) {
|
|
|
50
51
|
}
|
|
51
52
|
console.warn(...warnArgs);
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
+
setActiveSub(prevSub);
|
|
54
55
|
isWarning = false;
|
|
55
56
|
}
|
|
56
57
|
function getComponentTrace() {
|
|
57
|
-
let
|
|
58
|
-
if (!
|
|
58
|
+
let currentCtx = stack[stack.length - 1];
|
|
59
|
+
if (!currentCtx) {
|
|
59
60
|
return [];
|
|
60
61
|
}
|
|
61
62
|
const normalizedStack = [];
|
|
62
|
-
while (
|
|
63
|
+
while (currentCtx) {
|
|
63
64
|
const last = normalizedStack[0];
|
|
64
|
-
if (last && last.
|
|
65
|
+
if (last && last.ctx === currentCtx) {
|
|
65
66
|
last.recurseCount++;
|
|
66
67
|
} else {
|
|
67
68
|
normalizedStack.push({
|
|
68
|
-
|
|
69
|
+
ctx: currentCtx,
|
|
69
70
|
recurseCount: 0
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
if (isVNode(currentCtx)) {
|
|
74
|
+
const parent = currentCtx.component && currentCtx.component.parent;
|
|
75
|
+
currentCtx = parent && parent.vnode || parent;
|
|
76
|
+
} else {
|
|
77
|
+
currentCtx = currentCtx.parent;
|
|
78
|
+
}
|
|
74
79
|
}
|
|
75
80
|
return normalizedStack;
|
|
76
81
|
}
|
|
@@ -82,16 +87,13 @@ function formatTrace(trace) {
|
|
|
82
87
|
});
|
|
83
88
|
return logs;
|
|
84
89
|
}
|
|
85
|
-
function formatTraceEntry({
|
|
90
|
+
function formatTraceEntry({ ctx, recurseCount }) {
|
|
86
91
|
const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
vnode.type,
|
|
91
|
-
isRoot
|
|
92
|
-
)}`;
|
|
92
|
+
const instance = isVNode(ctx) ? ctx.component : ctx;
|
|
93
|
+
const isRoot = instance ? instance.parent == null : false;
|
|
94
|
+
const open = ` at <${formatComponentName(instance, ctx.type, isRoot)}`;
|
|
93
95
|
const close = `>` + postfix;
|
|
94
|
-
return
|
|
96
|
+
return ctx.props ? [open, ...formatProps(ctx.props), close] : [open + close];
|
|
95
97
|
}
|
|
96
98
|
function formatProps(props) {
|
|
97
99
|
const res = [];
|
|
@@ -224,11 +226,10 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
224
226
|
}
|
|
225
227
|
}
|
|
226
228
|
function handleError(err, instance, type, throwInDev = true) {
|
|
227
|
-
const contextVNode = instance ? instance.vnode : null;
|
|
228
229
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
|
|
229
230
|
if (instance) {
|
|
230
231
|
let cur = instance.parent;
|
|
231
|
-
const exposedInstance = instance.proxy;
|
|
232
|
+
const exposedInstance = instance.proxy || instance;
|
|
232
233
|
const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;
|
|
233
234
|
while (cur) {
|
|
234
235
|
const errorCapturedHooks = cur.ec;
|
|
@@ -242,26 +243,26 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
242
243
|
cur = cur.parent;
|
|
243
244
|
}
|
|
244
245
|
if (errorHandler) {
|
|
245
|
-
|
|
246
|
+
const prevSub = setActiveSub();
|
|
246
247
|
callWithErrorHandling(errorHandler, null, 10, [
|
|
247
248
|
err,
|
|
248
249
|
exposedInstance,
|
|
249
250
|
errorInfo
|
|
250
251
|
]);
|
|
251
|
-
|
|
252
|
+
setActiveSub(prevSub);
|
|
252
253
|
return;
|
|
253
254
|
}
|
|
254
255
|
}
|
|
255
|
-
logError(err, type,
|
|
256
|
+
logError(err, type, instance, throwInDev, throwUnhandledErrorInProduction);
|
|
256
257
|
}
|
|
257
|
-
function logError(err, type,
|
|
258
|
+
function logError(err, type, instance, throwInDev = true, throwInProd = false) {
|
|
258
259
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
259
260
|
const info = ErrorTypeStrings$1[type];
|
|
260
|
-
if (
|
|
261
|
-
pushWarningContext(
|
|
261
|
+
if (instance) {
|
|
262
|
+
pushWarningContext(instance);
|
|
262
263
|
}
|
|
263
264
|
warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
264
|
-
if (
|
|
265
|
+
if (instance) {
|
|
265
266
|
popWarningContext();
|
|
266
267
|
}
|
|
267
268
|
if (throwInDev) {
|
|
@@ -276,26 +277,23 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
|
|
|
276
277
|
}
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
const
|
|
280
|
-
let
|
|
281
|
-
|
|
282
|
-
let
|
|
280
|
+
const jobs = [];
|
|
281
|
+
let postJobs = [];
|
|
282
|
+
let activePostJobs = null;
|
|
283
|
+
let currentFlushPromise = null;
|
|
284
|
+
let jobsLength = 0;
|
|
285
|
+
let flushIndex = 0;
|
|
283
286
|
let postFlushIndex = 0;
|
|
284
287
|
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
|
|
285
|
-
let currentFlushPromise = null;
|
|
286
288
|
const RECURSION_LIMIT = 100;
|
|
287
289
|
function nextTick(fn) {
|
|
288
290
|
const p = currentFlushPromise || resolvedPromise;
|
|
289
291
|
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
290
292
|
}
|
|
291
|
-
function findInsertionIndex(
|
|
292
|
-
let start = flushIndex + 1;
|
|
293
|
-
let end = queue.length;
|
|
293
|
+
function findInsertionIndex(order, queue, start, end) {
|
|
294
294
|
while (start < end) {
|
|
295
295
|
const middle = start + end >>> 1;
|
|
296
|
-
|
|
297
|
-
const middleJobId = getId(middleJob);
|
|
298
|
-
if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
|
|
296
|
+
if (queue[middle].order <= order) {
|
|
299
297
|
start = middle + 1;
|
|
300
298
|
} else {
|
|
301
299
|
end = middle;
|
|
@@ -303,130 +301,168 @@ function findInsertionIndex(id) {
|
|
|
303
301
|
}
|
|
304
302
|
return start;
|
|
305
303
|
}
|
|
306
|
-
function queueJob(job) {
|
|
307
|
-
if (
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
304
|
+
function queueJob(job, id, isPre = false) {
|
|
305
|
+
if (queueJobWorker(
|
|
306
|
+
job,
|
|
307
|
+
id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1,
|
|
308
|
+
jobs,
|
|
309
|
+
jobsLength,
|
|
310
|
+
flushIndex
|
|
311
|
+
)) {
|
|
312
|
+
jobsLength++;
|
|
313
|
+
queueFlush();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
function queueJobWorker(job, order, queue, length, flushIndex2) {
|
|
317
|
+
const flags = job.flags;
|
|
318
|
+
if (!(flags & 1)) {
|
|
319
|
+
job.flags = flags | 1;
|
|
320
|
+
job.order = order;
|
|
321
|
+
if (flushIndex2 === length || // fast path when the job id is larger than the tail
|
|
322
|
+
order >= queue[length - 1].order) {
|
|
323
|
+
queue[length] = job;
|
|
313
324
|
} else {
|
|
314
|
-
queue.splice(findInsertionIndex(
|
|
325
|
+
queue.splice(findInsertionIndex(order, queue, flushIndex2, length), 0, job);
|
|
315
326
|
}
|
|
316
|
-
|
|
317
|
-
queueFlush();
|
|
327
|
+
return true;
|
|
318
328
|
}
|
|
329
|
+
return false;
|
|
319
330
|
}
|
|
331
|
+
const doFlushJobs = () => {
|
|
332
|
+
try {
|
|
333
|
+
flushJobs();
|
|
334
|
+
} catch (e) {
|
|
335
|
+
currentFlushPromise = null;
|
|
336
|
+
throw e;
|
|
337
|
+
}
|
|
338
|
+
};
|
|
320
339
|
function queueFlush() {
|
|
321
340
|
if (!currentFlushPromise) {
|
|
322
|
-
currentFlushPromise = resolvedPromise.then(
|
|
341
|
+
currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
323
342
|
}
|
|
324
343
|
}
|
|
325
|
-
function queuePostFlushCb(
|
|
326
|
-
if (!isArray(
|
|
327
|
-
if (
|
|
328
|
-
|
|
329
|
-
} else
|
|
330
|
-
|
|
331
|
-
cb.flags |= 1;
|
|
344
|
+
function queuePostFlushCb(jobs2, id = Infinity) {
|
|
345
|
+
if (!isArray(jobs2)) {
|
|
346
|
+
if (activePostJobs && id === -1) {
|
|
347
|
+
activePostJobs.splice(postFlushIndex, 0, jobs2);
|
|
348
|
+
} else {
|
|
349
|
+
queueJobWorker(jobs2, id, postJobs, postJobs.length, 0);
|
|
332
350
|
}
|
|
333
351
|
} else {
|
|
334
|
-
|
|
352
|
+
for (const job of jobs2) {
|
|
353
|
+
queueJobWorker(job, id, postJobs, postJobs.length, 0);
|
|
354
|
+
}
|
|
335
355
|
}
|
|
336
356
|
queueFlush();
|
|
337
357
|
}
|
|
338
|
-
function flushPreFlushCbs(instance, seen
|
|
358
|
+
function flushPreFlushCbs(instance, seen) {
|
|
339
359
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
340
360
|
seen = seen || /* @__PURE__ */ new Map();
|
|
341
361
|
}
|
|
342
|
-
for (; i <
|
|
343
|
-
const cb =
|
|
344
|
-
if (cb
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
362
|
+
for (let i = flushIndex; i < jobsLength; i++) {
|
|
363
|
+
const cb = jobs[i];
|
|
364
|
+
if (cb.order & 1 || cb.order === Infinity) {
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
if (instance && cb.order !== instance.uid * 2) {
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
|
|
371
|
+
continue;
|
|
372
|
+
}
|
|
373
|
+
jobs.splice(i, 1);
|
|
374
|
+
i--;
|
|
375
|
+
jobsLength--;
|
|
376
|
+
if (cb.flags & 2) {
|
|
377
|
+
cb.flags &= -2;
|
|
378
|
+
}
|
|
379
|
+
cb();
|
|
380
|
+
if (!(cb.flags & 2)) {
|
|
381
|
+
cb.flags &= -2;
|
|
360
382
|
}
|
|
361
383
|
}
|
|
362
384
|
}
|
|
363
385
|
function flushPostFlushCbs(seen) {
|
|
364
|
-
if (
|
|
365
|
-
|
|
366
|
-
(
|
|
367
|
-
|
|
368
|
-
pendingPostFlushCbs.length = 0;
|
|
369
|
-
if (activePostFlushCbs) {
|
|
370
|
-
activePostFlushCbs.push(...deduped);
|
|
386
|
+
if (postJobs.length) {
|
|
387
|
+
if (activePostJobs) {
|
|
388
|
+
activePostJobs.push(...postJobs);
|
|
389
|
+
postJobs.length = 0;
|
|
371
390
|
return;
|
|
372
391
|
}
|
|
373
|
-
|
|
392
|
+
activePostJobs = postJobs;
|
|
393
|
+
postJobs = [];
|
|
374
394
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
375
395
|
seen = seen || /* @__PURE__ */ new Map();
|
|
376
396
|
}
|
|
377
|
-
|
|
378
|
-
const cb =
|
|
397
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
398
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
379
399
|
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
|
|
380
400
|
continue;
|
|
381
401
|
}
|
|
382
|
-
if (cb.flags &
|
|
402
|
+
if (cb.flags & 2) {
|
|
383
403
|
cb.flags &= -2;
|
|
384
404
|
}
|
|
385
|
-
if (!(cb.flags &
|
|
386
|
-
|
|
405
|
+
if (!(cb.flags & 4)) {
|
|
406
|
+
try {
|
|
407
|
+
cb();
|
|
408
|
+
} finally {
|
|
409
|
+
cb.flags &= -2;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
387
412
|
}
|
|
388
|
-
|
|
413
|
+
activePostJobs = null;
|
|
389
414
|
postFlushIndex = 0;
|
|
390
415
|
}
|
|
391
416
|
}
|
|
392
|
-
|
|
417
|
+
let isFlushing = false;
|
|
418
|
+
function flushOnAppMount() {
|
|
419
|
+
if (!isFlushing) {
|
|
420
|
+
isFlushing = true;
|
|
421
|
+
flushPreFlushCbs();
|
|
422
|
+
flushPostFlushCbs();
|
|
423
|
+
isFlushing = false;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
393
426
|
function flushJobs(seen) {
|
|
394
427
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
395
|
-
seen
|
|
428
|
+
seen || (seen = /* @__PURE__ */ new Map());
|
|
396
429
|
}
|
|
397
|
-
const check = !!(process.env.NODE_ENV !== "production") ? (job) => checkRecursiveUpdates(seen, job) : NOOP;
|
|
398
430
|
try {
|
|
399
|
-
|
|
400
|
-
const job =
|
|
401
|
-
|
|
402
|
-
|
|
431
|
+
while (flushIndex < jobsLength) {
|
|
432
|
+
const job = jobs[flushIndex];
|
|
433
|
+
jobs[flushIndex++] = void 0;
|
|
434
|
+
if (!(job.flags & 4)) {
|
|
435
|
+
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, job)) {
|
|
403
436
|
continue;
|
|
404
437
|
}
|
|
405
|
-
if (job.flags &
|
|
438
|
+
if (job.flags & 2) {
|
|
406
439
|
job.flags &= ~1;
|
|
407
440
|
}
|
|
408
|
-
|
|
409
|
-
job
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
441
|
+
try {
|
|
442
|
+
job();
|
|
443
|
+
} catch (err) {
|
|
444
|
+
handleError(
|
|
445
|
+
err,
|
|
446
|
+
job.i,
|
|
447
|
+
job.i ? 15 : 14
|
|
448
|
+
);
|
|
449
|
+
} finally {
|
|
450
|
+
if (!(job.flags & 2)) {
|
|
451
|
+
job.flags &= ~1;
|
|
452
|
+
}
|
|
415
453
|
}
|
|
416
454
|
}
|
|
417
455
|
}
|
|
418
456
|
} finally {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
job.flags &= -2;
|
|
423
|
-
}
|
|
457
|
+
while (flushIndex < jobsLength) {
|
|
458
|
+
jobs[flushIndex].flags &= -2;
|
|
459
|
+
jobs[flushIndex++] = void 0;
|
|
424
460
|
}
|
|
425
|
-
flushIndex =
|
|
426
|
-
|
|
461
|
+
flushIndex = 0;
|
|
462
|
+
jobsLength = 0;
|
|
427
463
|
flushPostFlushCbs(seen);
|
|
428
464
|
currentFlushPromise = null;
|
|
429
|
-
if (
|
|
465
|
+
if (jobsLength || postJobs.length) {
|
|
430
466
|
flushJobs(seen);
|
|
431
467
|
}
|
|
432
468
|
}
|
|
@@ -493,10 +529,17 @@ function rerender(id, newRender) {
|
|
|
493
529
|
instance.render = newRender;
|
|
494
530
|
normalizeClassComponent(instance.type).render = newRender;
|
|
495
531
|
}
|
|
496
|
-
instance.renderCache = [];
|
|
497
532
|
isHmrUpdating = true;
|
|
498
|
-
instance.
|
|
499
|
-
|
|
533
|
+
if (instance.vapor) {
|
|
534
|
+
instance.hmrRerender();
|
|
535
|
+
} else {
|
|
536
|
+
const i = instance;
|
|
537
|
+
i.renderCache = [];
|
|
538
|
+
i.effect.run();
|
|
539
|
+
}
|
|
540
|
+
nextTick(() => {
|
|
541
|
+
isHmrUpdating = false;
|
|
542
|
+
});
|
|
500
543
|
});
|
|
501
544
|
}
|
|
502
545
|
function reload(id, newComp) {
|
|
@@ -505,42 +548,54 @@ function reload(id, newComp) {
|
|
|
505
548
|
newComp = normalizeClassComponent(newComp);
|
|
506
549
|
updateComponentDef(record.initialDef, newComp);
|
|
507
550
|
const instances = [...record.instances];
|
|
508
|
-
|
|
509
|
-
const instance
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
if (instance.ceReload) {
|
|
551
|
+
if (newComp.__vapor) {
|
|
552
|
+
for (const instance of instances) {
|
|
553
|
+
instance.hmrReload(newComp);
|
|
554
|
+
}
|
|
555
|
+
} else {
|
|
556
|
+
for (const instance of instances) {
|
|
557
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
558
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
559
|
+
if (!dirtyInstances) {
|
|
560
|
+
if (oldComp !== record.initialDef) {
|
|
561
|
+
updateComponentDef(oldComp, newComp);
|
|
562
|
+
}
|
|
563
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
564
|
+
}
|
|
523
565
|
dirtyInstances.add(instance);
|
|
524
|
-
instance.
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
instance.
|
|
530
|
-
isHmrUpdating = false;
|
|
566
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
567
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
568
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
569
|
+
if (instance.ceReload) {
|
|
570
|
+
dirtyInstances.add(instance);
|
|
571
|
+
instance.ceReload(newComp.styles);
|
|
531
572
|
dirtyInstances.delete(instance);
|
|
532
|
-
})
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
573
|
+
} else if (instance.parent) {
|
|
574
|
+
queueJob(() => {
|
|
575
|
+
isHmrUpdating = true;
|
|
576
|
+
const parent = instance.parent;
|
|
577
|
+
if (parent.vapor) {
|
|
578
|
+
parent.hmrRerender();
|
|
579
|
+
} else {
|
|
580
|
+
parent.effect.run();
|
|
581
|
+
}
|
|
582
|
+
nextTick(() => {
|
|
583
|
+
isHmrUpdating = false;
|
|
584
|
+
});
|
|
585
|
+
dirtyInstances.delete(instance);
|
|
586
|
+
});
|
|
587
|
+
} else if (instance.appContext.reload) {
|
|
588
|
+
instance.appContext.reload();
|
|
589
|
+
} else if (typeof window !== "undefined") {
|
|
590
|
+
window.location.reload();
|
|
591
|
+
} else {
|
|
592
|
+
console.warn(
|
|
593
|
+
"[HMR] Root or manually mounted instance modified. Full reload required."
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
if (instance.root.ce && instance !== instance.root) {
|
|
597
|
+
instance.root.ce._removeChildStyle(oldComp);
|
|
598
|
+
}
|
|
544
599
|
}
|
|
545
600
|
}
|
|
546
601
|
queuePostFlushCb(() => {
|
|
@@ -753,14 +808,14 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
753
808
|
}
|
|
754
809
|
let hook = binding.dir[name];
|
|
755
810
|
if (hook) {
|
|
756
|
-
|
|
811
|
+
const prevSub = setActiveSub();
|
|
757
812
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
758
813
|
vnode.el,
|
|
759
814
|
binding,
|
|
760
815
|
vnode,
|
|
761
816
|
prevVNode
|
|
762
817
|
]);
|
|
763
|
-
|
|
818
|
+
setActiveSub(prevSub);
|
|
764
819
|
}
|
|
765
820
|
}
|
|
766
821
|
}
|
|
@@ -860,29 +915,37 @@ const TeleportImpl = {
|
|
|
860
915
|
}
|
|
861
916
|
if (isTeleportDeferred(n2.props)) {
|
|
862
917
|
n2.el.__isMounted = false;
|
|
863
|
-
queuePostRenderEffect(
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
918
|
+
queuePostRenderEffect(
|
|
919
|
+
() => {
|
|
920
|
+
mountToTarget();
|
|
921
|
+
delete n2.el.__isMounted;
|
|
922
|
+
},
|
|
923
|
+
void 0,
|
|
924
|
+
parentSuspense
|
|
925
|
+
);
|
|
867
926
|
} else {
|
|
868
927
|
mountToTarget();
|
|
869
928
|
}
|
|
870
929
|
} else {
|
|
871
930
|
if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
|
|
872
|
-
queuePostRenderEffect(
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
931
|
+
queuePostRenderEffect(
|
|
932
|
+
() => {
|
|
933
|
+
TeleportImpl.process(
|
|
934
|
+
n1,
|
|
935
|
+
n2,
|
|
936
|
+
container,
|
|
937
|
+
anchor,
|
|
938
|
+
parentComponent,
|
|
939
|
+
parentSuspense,
|
|
940
|
+
namespace,
|
|
941
|
+
slotScopeIds,
|
|
942
|
+
optimized,
|
|
943
|
+
internals
|
|
944
|
+
);
|
|
945
|
+
},
|
|
946
|
+
void 0,
|
|
947
|
+
parentSuspense
|
|
948
|
+
);
|
|
886
949
|
return;
|
|
887
950
|
}
|
|
888
951
|
n2.el = n1.el;
|
|
@@ -929,6 +992,7 @@ const TeleportImpl = {
|
|
|
929
992
|
container,
|
|
930
993
|
mainAnchor,
|
|
931
994
|
internals,
|
|
995
|
+
parentComponent,
|
|
932
996
|
1
|
|
933
997
|
);
|
|
934
998
|
} else {
|
|
@@ -948,6 +1012,7 @@ const TeleportImpl = {
|
|
|
948
1012
|
nextTarget,
|
|
949
1013
|
null,
|
|
950
1014
|
internals,
|
|
1015
|
+
parentComponent,
|
|
951
1016
|
0
|
|
952
1017
|
);
|
|
953
1018
|
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
@@ -963,6 +1028,7 @@ const TeleportImpl = {
|
|
|
963
1028
|
target,
|
|
964
1029
|
targetAnchor,
|
|
965
1030
|
internals,
|
|
1031
|
+
parentComponent,
|
|
966
1032
|
1
|
|
967
1033
|
);
|
|
968
1034
|
}
|
|
@@ -1002,7 +1068,7 @@ const TeleportImpl = {
|
|
|
1002
1068
|
move: moveTeleport,
|
|
1003
1069
|
hydrate: hydrateTeleport
|
|
1004
1070
|
};
|
|
1005
|
-
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
|
|
1071
|
+
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
|
|
1006
1072
|
if (moveType === 0) {
|
|
1007
1073
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
1008
1074
|
}
|
|
@@ -1018,7 +1084,8 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
1018
1084
|
children[i],
|
|
1019
1085
|
container,
|
|
1020
1086
|
parentAnchor,
|
|
1021
|
-
2
|
|
1087
|
+
2,
|
|
1088
|
+
parentComponent
|
|
1022
1089
|
);
|
|
1023
1090
|
}
|
|
1024
1091
|
}
|
|
@@ -1203,7 +1270,7 @@ const BaseTransitionImpl = {
|
|
|
1203
1270
|
state.isLeaving = true;
|
|
1204
1271
|
leavingHooks.afterLeave = () => {
|
|
1205
1272
|
state.isLeaving = false;
|
|
1206
|
-
if (!(instance.job.flags &
|
|
1273
|
+
if (!(instance.job.flags & 4)) {
|
|
1207
1274
|
instance.update();
|
|
1208
1275
|
}
|
|
1209
1276
|
delete leavingHooks.afterLeave;
|
|
@@ -1483,7 +1550,7 @@ function defineComponent(options, extraOptions) {
|
|
|
1483
1550
|
}
|
|
1484
1551
|
|
|
1485
1552
|
function useId() {
|
|
1486
|
-
const i =
|
|
1553
|
+
const i = getCurrentGenericInstance();
|
|
1487
1554
|
if (i) {
|
|
1488
1555
|
return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
|
|
1489
1556
|
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
@@ -1499,7 +1566,7 @@ function markAsyncBoundary(instance) {
|
|
|
1499
1566
|
|
|
1500
1567
|
const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
|
|
1501
1568
|
function useTemplateRef(key) {
|
|
1502
|
-
const i =
|
|
1569
|
+
const i = getCurrentGenericInstance();
|
|
1503
1570
|
const r = shallowRef(null);
|
|
1504
1571
|
if (i) {
|
|
1505
1572
|
const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
|
|
@@ -1619,8 +1686,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1619
1686
|
}
|
|
1620
1687
|
};
|
|
1621
1688
|
if (value) {
|
|
1622
|
-
doSet
|
|
1623
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
1689
|
+
queuePostRenderEffect(doSet, -1, parentSuspense);
|
|
1624
1690
|
} else {
|
|
1625
1691
|
doSet();
|
|
1626
1692
|
}
|
|
@@ -1788,6 +1854,9 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1788
1854
|
);
|
|
1789
1855
|
}
|
|
1790
1856
|
} else if (shapeFlag & 6) {
|
|
1857
|
+
if (vnode.type.__vapor) {
|
|
1858
|
+
throw new Error("Vapor component hydration is not supported yet.");
|
|
1859
|
+
}
|
|
1791
1860
|
vnode.slotScopeIds = slotScopeIds;
|
|
1792
1861
|
const container = parentNode(node);
|
|
1793
1862
|
if (isFragmentStart) {
|
|
@@ -1960,11 +2029,15 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
1960
2029
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
1961
2030
|
}
|
|
1962
2031
|
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
1963
|
-
queueEffectWithSuspense(
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
2032
|
+
queueEffectWithSuspense(
|
|
2033
|
+
() => {
|
|
2034
|
+
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
2035
|
+
needCallTransitionHooks && transition.enter(el);
|
|
2036
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
2037
|
+
},
|
|
2038
|
+
void 0,
|
|
2039
|
+
parentSuspense
|
|
2040
|
+
);
|
|
1968
2041
|
}
|
|
1969
2042
|
}
|
|
1970
2043
|
return el.nextSibling;
|
|
@@ -2244,14 +2317,16 @@ function resolveCssVars(instance, vnode, expectedMap) {
|
|
|
2244
2317
|
if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
|
|
2245
2318
|
const cssVars = instance.getCssVars();
|
|
2246
2319
|
for (const key in cssVars) {
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
String(cssVars[key])
|
|
2250
|
-
);
|
|
2320
|
+
const value = normalizeCssVarValue(cssVars[key]);
|
|
2321
|
+
expectedMap.set(`--${getEscapedCssVarName(key, false)}`, value);
|
|
2251
2322
|
}
|
|
2252
2323
|
}
|
|
2253
2324
|
if (vnode === root && instance.parent) {
|
|
2254
|
-
resolveCssVars(
|
|
2325
|
+
resolveCssVars(
|
|
2326
|
+
instance.parent,
|
|
2327
|
+
instance.vnode,
|
|
2328
|
+
expectedMap
|
|
2329
|
+
);
|
|
2255
2330
|
}
|
|
2256
2331
|
}
|
|
2257
2332
|
const allowMismatchAttr = "data-allow-mismatch";
|
|
@@ -2510,7 +2585,7 @@ function defineAsyncComponent(source) {
|
|
|
2510
2585
|
}
|
|
2511
2586
|
load().then(() => {
|
|
2512
2587
|
loaded.value = true;
|
|
2513
|
-
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
2588
|
+
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
|
|
2514
2589
|
instance.parent.update();
|
|
2515
2590
|
}
|
|
2516
2591
|
}).catch((err) => {
|
|
@@ -2553,8 +2628,8 @@ const KeepAliveImpl = {
|
|
|
2553
2628
|
max: [String, Number]
|
|
2554
2629
|
},
|
|
2555
2630
|
setup(props, { slots }) {
|
|
2556
|
-
const
|
|
2557
|
-
const sharedContext =
|
|
2631
|
+
const keepAliveInstance = getCurrentInstance();
|
|
2632
|
+
const sharedContext = keepAliveInstance.ctx;
|
|
2558
2633
|
if (!sharedContext.renderer) {
|
|
2559
2634
|
return () => {
|
|
2560
2635
|
const children = slots.default && slots.default();
|
|
@@ -2565,9 +2640,9 @@ const KeepAliveImpl = {
|
|
|
2565
2640
|
const keys = /* @__PURE__ */ new Set();
|
|
2566
2641
|
let current = null;
|
|
2567
2642
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
2568
|
-
|
|
2643
|
+
keepAliveInstance.__v_cache = cache;
|
|
2569
2644
|
}
|
|
2570
|
-
const parentSuspense =
|
|
2645
|
+
const parentSuspense = keepAliveInstance.suspense;
|
|
2571
2646
|
const {
|
|
2572
2647
|
renderer: {
|
|
2573
2648
|
p: patch,
|
|
@@ -2578,58 +2653,80 @@ const KeepAliveImpl = {
|
|
|
2578
2653
|
} = sharedContext;
|
|
2579
2654
|
const storageContainer = createElement("div");
|
|
2580
2655
|
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
2581
|
-
const
|
|
2582
|
-
move(
|
|
2656
|
+
const instance = vnode.component;
|
|
2657
|
+
move(
|
|
2658
|
+
vnode,
|
|
2659
|
+
container,
|
|
2660
|
+
anchor,
|
|
2661
|
+
0,
|
|
2662
|
+
keepAliveInstance,
|
|
2663
|
+
parentSuspense
|
|
2664
|
+
);
|
|
2583
2665
|
patch(
|
|
2584
|
-
|
|
2666
|
+
instance.vnode,
|
|
2585
2667
|
vnode,
|
|
2586
2668
|
container,
|
|
2587
2669
|
anchor,
|
|
2588
|
-
|
|
2670
|
+
instance,
|
|
2589
2671
|
parentSuspense,
|
|
2590
2672
|
namespace,
|
|
2591
2673
|
vnode.slotScopeIds,
|
|
2592
2674
|
optimized
|
|
2593
2675
|
);
|
|
2594
|
-
queuePostRenderEffect(
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2676
|
+
queuePostRenderEffect(
|
|
2677
|
+
() => {
|
|
2678
|
+
instance.isDeactivated = false;
|
|
2679
|
+
if (instance.a) {
|
|
2680
|
+
invokeArrayFns(instance.a);
|
|
2681
|
+
}
|
|
2682
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
2683
|
+
if (vnodeHook) {
|
|
2684
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
2685
|
+
}
|
|
2686
|
+
},
|
|
2687
|
+
void 0,
|
|
2688
|
+
parentSuspense
|
|
2689
|
+
);
|
|
2604
2690
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
2605
|
-
devtoolsComponentAdded(
|
|
2691
|
+
devtoolsComponentAdded(instance);
|
|
2606
2692
|
}
|
|
2607
2693
|
};
|
|
2608
2694
|
sharedContext.deactivate = (vnode) => {
|
|
2609
|
-
const
|
|
2610
|
-
invalidateMount(
|
|
2611
|
-
invalidateMount(
|
|
2612
|
-
move(
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2695
|
+
const instance = vnode.component;
|
|
2696
|
+
invalidateMount(instance.m);
|
|
2697
|
+
invalidateMount(instance.a);
|
|
2698
|
+
move(
|
|
2699
|
+
vnode,
|
|
2700
|
+
storageContainer,
|
|
2701
|
+
null,
|
|
2702
|
+
1,
|
|
2703
|
+
keepAliveInstance,
|
|
2704
|
+
parentSuspense
|
|
2705
|
+
);
|
|
2706
|
+
queuePostRenderEffect(
|
|
2707
|
+
() => {
|
|
2708
|
+
if (instance.da) {
|
|
2709
|
+
invokeArrayFns(instance.da);
|
|
2710
|
+
}
|
|
2711
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
2712
|
+
if (vnodeHook) {
|
|
2713
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
2714
|
+
}
|
|
2715
|
+
instance.isDeactivated = true;
|
|
2716
|
+
},
|
|
2717
|
+
void 0,
|
|
2718
|
+
parentSuspense
|
|
2719
|
+
);
|
|
2623
2720
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
2624
|
-
devtoolsComponentAdded(
|
|
2721
|
+
devtoolsComponentAdded(instance);
|
|
2625
2722
|
}
|
|
2626
2723
|
if (!!(process.env.NODE_ENV !== "production") && true) {
|
|
2627
|
-
|
|
2724
|
+
instance.__keepAliveStorageContainer = storageContainer;
|
|
2628
2725
|
}
|
|
2629
2726
|
};
|
|
2630
2727
|
function unmount(vnode) {
|
|
2631
2728
|
resetShapeFlag(vnode);
|
|
2632
|
-
_unmount(vnode,
|
|
2729
|
+
_unmount(vnode, keepAliveInstance, parentSuspense, true);
|
|
2633
2730
|
}
|
|
2634
2731
|
function pruneCache(filter) {
|
|
2635
2732
|
cache.forEach((vnode, key) => {
|
|
@@ -2661,12 +2758,19 @@ const KeepAliveImpl = {
|
|
|
2661
2758
|
let pendingCacheKey = null;
|
|
2662
2759
|
const cacheSubtree = () => {
|
|
2663
2760
|
if (pendingCacheKey != null) {
|
|
2664
|
-
if (isSuspense(
|
|
2665
|
-
queuePostRenderEffect(
|
|
2666
|
-
|
|
2667
|
-
|
|
2761
|
+
if (isSuspense(keepAliveInstance.subTree.type)) {
|
|
2762
|
+
queuePostRenderEffect(
|
|
2763
|
+
() => {
|
|
2764
|
+
cache.set(
|
|
2765
|
+
pendingCacheKey,
|
|
2766
|
+
getInnerChild(keepAliveInstance.subTree)
|
|
2767
|
+
);
|
|
2768
|
+
},
|
|
2769
|
+
void 0,
|
|
2770
|
+
keepAliveInstance.subTree.suspense
|
|
2771
|
+
);
|
|
2668
2772
|
} else {
|
|
2669
|
-
cache.set(pendingCacheKey, getInnerChild(
|
|
2773
|
+
cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
2670
2774
|
}
|
|
2671
2775
|
}
|
|
2672
2776
|
};
|
|
@@ -2674,12 +2778,12 @@ const KeepAliveImpl = {
|
|
|
2674
2778
|
onUpdated(cacheSubtree);
|
|
2675
2779
|
onBeforeUnmount(() => {
|
|
2676
2780
|
cache.forEach((cached) => {
|
|
2677
|
-
const { subTree, suspense } =
|
|
2781
|
+
const { subTree, suspense } = keepAliveInstance;
|
|
2678
2782
|
const vnode = getInnerChild(subTree);
|
|
2679
2783
|
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
2680
2784
|
resetShapeFlag(vnode);
|
|
2681
2785
|
const da = vnode.component.da;
|
|
2682
|
-
da && queuePostRenderEffect(da, suspense);
|
|
2786
|
+
da && queuePostRenderEffect(da, void 0, suspense);
|
|
2683
2787
|
return;
|
|
2684
2788
|
}
|
|
2685
2789
|
unmount(cached);
|
|
@@ -2765,7 +2869,7 @@ function onActivated(hook, target) {
|
|
|
2765
2869
|
function onDeactivated(hook, target) {
|
|
2766
2870
|
registerKeepAliveHook(hook, "da", target);
|
|
2767
2871
|
}
|
|
2768
|
-
function registerKeepAliveHook(hook, type, target =
|
|
2872
|
+
function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
|
|
2769
2873
|
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
2770
2874
|
let current = target;
|
|
2771
2875
|
while (current) {
|
|
@@ -2779,7 +2883,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
2779
2883
|
injectHook(type, wrappedHook, target);
|
|
2780
2884
|
if (target) {
|
|
2781
2885
|
let current = target.parent;
|
|
2782
|
-
while (current && current.parent) {
|
|
2886
|
+
while (current && current.parent && current.parent.vnode) {
|
|
2783
2887
|
if (isKeepAlive(current.parent.vnode)) {
|
|
2784
2888
|
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
2785
2889
|
}
|
|
@@ -2811,12 +2915,14 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
2811
2915
|
if (target) {
|
|
2812
2916
|
const hooks = target[type] || (target[type] = []);
|
|
2813
2917
|
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
2814
|
-
|
|
2815
|
-
const
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2918
|
+
const prevSub = setActiveSub();
|
|
2919
|
+
const prev = setCurrentInstance(target);
|
|
2920
|
+
try {
|
|
2921
|
+
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
2922
|
+
} finally {
|
|
2923
|
+
setCurrentInstance(...prev);
|
|
2924
|
+
setActiveSub(prevSub);
|
|
2925
|
+
}
|
|
2820
2926
|
});
|
|
2821
2927
|
if (prepend) {
|
|
2822
2928
|
hooks.unshift(wrappedHook);
|
|
@@ -2887,7 +2993,11 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
2887
2993
|
const res = (
|
|
2888
2994
|
// local registration
|
|
2889
2995
|
// check instance[type] first which is resolved for options API
|
|
2890
|
-
resolve(
|
|
2996
|
+
resolve(
|
|
2997
|
+
instance[type] || Component[type],
|
|
2998
|
+
name
|
|
2999
|
+
) || // global registration
|
|
3000
|
+
// @ts-expect-error filters only exist in compat mode
|
|
2891
3001
|
resolve(instance.appContext[type], name)
|
|
2892
3002
|
);
|
|
2893
3003
|
if (!res && maybeSelfReference) {
|
|
@@ -2981,7 +3091,13 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2981
3091
|
}
|
|
2982
3092
|
|
|
2983
3093
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
2984
|
-
|
|
3094
|
+
let slot = slots[name];
|
|
3095
|
+
if (slot && slot.__vapor) {
|
|
3096
|
+
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
3097
|
+
ret.vs = { slot, fallback };
|
|
3098
|
+
return ret;
|
|
3099
|
+
}
|
|
3100
|
+
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
2985
3101
|
if (name !== "default") props.name = name;
|
|
2986
3102
|
return openBlock(), createBlock(
|
|
2987
3103
|
Fragment,
|
|
@@ -2990,7 +3106,6 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2990
3106
|
64
|
|
2991
3107
|
);
|
|
2992
3108
|
}
|
|
2993
|
-
let slot = slots[name];
|
|
2994
3109
|
if (!!(process.env.NODE_ENV !== "production") && slot && slot.length > 1) {
|
|
2995
3110
|
warn$1(
|
|
2996
3111
|
`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.`
|
|
@@ -3045,8 +3160,9 @@ function toHandlers(obj, preserveCaseIfNecessary) {
|
|
|
3045
3160
|
}
|
|
3046
3161
|
|
|
3047
3162
|
const getPublicInstance = (i) => {
|
|
3048
|
-
if (!i) return null;
|
|
3049
|
-
if (isStatefulComponent(i))
|
|
3163
|
+
if (!i || i.vapor) return null;
|
|
3164
|
+
if (isStatefulComponent(i))
|
|
3165
|
+
return getComponentPublicInstance(i);
|
|
3050
3166
|
return getPublicInstance(i.parent);
|
|
3051
3167
|
};
|
|
3052
3168
|
const publicPropertiesMap = (
|
|
@@ -3339,11 +3455,16 @@ function useAttrs() {
|
|
|
3339
3455
|
return getContext().attrs;
|
|
3340
3456
|
}
|
|
3341
3457
|
function getContext() {
|
|
3342
|
-
const i =
|
|
3458
|
+
const i = getCurrentGenericInstance();
|
|
3343
3459
|
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
3344
3460
|
warn$1(`useContext() called without active instance.`);
|
|
3345
3461
|
}
|
|
3346
|
-
|
|
3462
|
+
if (i.vapor) {
|
|
3463
|
+
return i;
|
|
3464
|
+
} else {
|
|
3465
|
+
const ii = i;
|
|
3466
|
+
return ii.setupContext || (ii.setupContext = createSetupContext(ii));
|
|
3467
|
+
}
|
|
3347
3468
|
}
|
|
3348
3469
|
function normalizePropsOrEmits(props) {
|
|
3349
3470
|
return isArray(props) ? props.reduce(
|
|
@@ -3391,14 +3512,14 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
3391
3512
|
return ret;
|
|
3392
3513
|
}
|
|
3393
3514
|
function withAsyncContext(getAwaitable) {
|
|
3394
|
-
const ctx =
|
|
3515
|
+
const ctx = getCurrentGenericInstance();
|
|
3395
3516
|
if (!!(process.env.NODE_ENV !== "production") && !ctx) {
|
|
3396
3517
|
warn$1(
|
|
3397
3518
|
`withAsyncContext called without active current instance. This is likely a bug.`
|
|
3398
3519
|
);
|
|
3399
3520
|
}
|
|
3400
3521
|
let awaitable = getAwaitable();
|
|
3401
|
-
|
|
3522
|
+
setCurrentInstance(null, void 0);
|
|
3402
3523
|
if (isPromise(awaitable)) {
|
|
3403
3524
|
awaitable = awaitable.catch((e) => {
|
|
3404
3525
|
setCurrentInstance(ctx);
|
|
@@ -3847,7 +3968,7 @@ function createAppContext() {
|
|
|
3847
3968
|
};
|
|
3848
3969
|
}
|
|
3849
3970
|
let uid$1 = 0;
|
|
3850
|
-
function createAppAPI(
|
|
3971
|
+
function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
3851
3972
|
return function createApp(rootComponent, rootProps = null) {
|
|
3852
3973
|
if (!isFunction(rootComponent)) {
|
|
3853
3974
|
rootComponent = extend({}, rootComponent);
|
|
@@ -3942,33 +4063,15 @@ function createAppAPI(render, hydrate) {
|
|
|
3942
4063
|
If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
|
|
3943
4064
|
);
|
|
3944
4065
|
}
|
|
3945
|
-
const
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
} else if (namespace === false) {
|
|
3950
|
-
namespace = void 0;
|
|
3951
|
-
}
|
|
3952
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3953
|
-
context.reload = () => {
|
|
3954
|
-
const cloned = cloneVNode(vnode);
|
|
3955
|
-
cloned.el = null;
|
|
3956
|
-
render(cloned, rootContainer, namespace);
|
|
3957
|
-
};
|
|
3958
|
-
}
|
|
3959
|
-
if (isHydrate && hydrate) {
|
|
3960
|
-
hydrate(vnode, rootContainer);
|
|
3961
|
-
} else {
|
|
3962
|
-
render(vnode, rootContainer, namespace);
|
|
4066
|
+
const instance = mount(app, rootContainer, isHydrate, namespace);
|
|
4067
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
4068
|
+
app._instance = instance;
|
|
4069
|
+
devtoolsInitApp(app, version);
|
|
3963
4070
|
}
|
|
3964
4071
|
isMounted = true;
|
|
3965
4072
|
app._container = rootContainer;
|
|
3966
4073
|
rootContainer.__vue_app__ = app;
|
|
3967
|
-
|
|
3968
|
-
app._instance = vnode.component;
|
|
3969
|
-
devtoolsInitApp(app, version);
|
|
3970
|
-
}
|
|
3971
|
-
return getComponentPublicInstance(vnode.component);
|
|
4074
|
+
return getPublicInstance(instance);
|
|
3972
4075
|
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
3973
4076
|
warn$1(
|
|
3974
4077
|
`App has already been mounted.
|
|
@@ -3991,7 +4094,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
3991
4094
|
app._instance,
|
|
3992
4095
|
16
|
|
3993
4096
|
);
|
|
3994
|
-
|
|
4097
|
+
unmount(app);
|
|
3995
4098
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
3996
4099
|
app._instance = null;
|
|
3997
4100
|
devtoolsUnmountApp(app);
|
|
@@ -4032,6 +4135,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
4032
4135
|
let currentApp = null;
|
|
4033
4136
|
|
|
4034
4137
|
function provide(key, value) {
|
|
4138
|
+
const currentInstance = getCurrentGenericInstance();
|
|
4035
4139
|
if (!currentInstance) {
|
|
4036
4140
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4037
4141
|
warn$1(`provide() can only be used inside setup().`);
|
|
@@ -4046,9 +4150,9 @@ function provide(key, value) {
|
|
|
4046
4150
|
}
|
|
4047
4151
|
}
|
|
4048
4152
|
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
4049
|
-
const instance =
|
|
4153
|
+
const instance = getCurrentGenericInstance();
|
|
4050
4154
|
if (instance || currentApp) {
|
|
4051
|
-
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.
|
|
4155
|
+
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
4052
4156
|
if (provides && key in provides) {
|
|
4053
4157
|
return provides[key];
|
|
4054
4158
|
} else if (arguments.length > 1) {
|
|
@@ -4061,7 +4165,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
4061
4165
|
}
|
|
4062
4166
|
}
|
|
4063
4167
|
function hasInjectionContext() {
|
|
4064
|
-
return !!(
|
|
4168
|
+
return !!(getCurrentGenericInstance() || currentApp);
|
|
4065
4169
|
}
|
|
4066
4170
|
|
|
4067
4171
|
const internalObjectProto = {};
|
|
@@ -4069,7 +4173,7 @@ const createInternalObject = () => Object.create(internalObjectProto);
|
|
|
4069
4173
|
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
4070
4174
|
|
|
4071
4175
|
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
4072
|
-
const props = {};
|
|
4176
|
+
const props = instance.props = {};
|
|
4073
4177
|
const attrs = createInternalObject();
|
|
4074
4178
|
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
4075
4179
|
setFullProps(instance, rawProps, props, attrs);
|
|
@@ -4079,7 +4183,7 @@ function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
|
4079
4183
|
}
|
|
4080
4184
|
}
|
|
4081
4185
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4082
|
-
validateProps(rawProps || {}, props, instance);
|
|
4186
|
+
validateProps(rawProps || {}, props, instance.propsOptions[0]);
|
|
4083
4187
|
}
|
|
4084
4188
|
if (isStateful) {
|
|
4085
4189
|
instance.props = isSSR ? props : shallowReactive(props);
|
|
@@ -4131,11 +4235,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4131
4235
|
const camelizedKey = camelize(key);
|
|
4132
4236
|
props[camelizedKey] = resolvePropValue(
|
|
4133
4237
|
options,
|
|
4134
|
-
rawCurrentProps,
|
|
4135
4238
|
camelizedKey,
|
|
4136
4239
|
value,
|
|
4137
4240
|
instance,
|
|
4138
|
-
|
|
4241
|
+
baseResolveDefault
|
|
4139
4242
|
);
|
|
4140
4243
|
}
|
|
4141
4244
|
} else {
|
|
@@ -4162,10 +4265,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4162
4265
|
rawPrevProps[kebabKey] !== void 0)) {
|
|
4163
4266
|
props[key] = resolvePropValue(
|
|
4164
4267
|
options,
|
|
4165
|
-
rawCurrentProps,
|
|
4166
4268
|
key,
|
|
4167
4269
|
void 0,
|
|
4168
4270
|
instance,
|
|
4271
|
+
baseResolveDefault,
|
|
4169
4272
|
true
|
|
4170
4273
|
);
|
|
4171
4274
|
}
|
|
@@ -4187,7 +4290,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4187
4290
|
trigger(instance.attrs, "set", "");
|
|
4188
4291
|
}
|
|
4189
4292
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4190
|
-
validateProps(rawProps || {}, props, instance);
|
|
4293
|
+
validateProps(rawProps || {}, props, instance.propsOptions[0]);
|
|
4191
4294
|
}
|
|
4192
4295
|
}
|
|
4193
4296
|
function setFullProps(instance, rawProps, props, attrs) {
|
|
@@ -4216,39 +4319,37 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
4216
4319
|
}
|
|
4217
4320
|
}
|
|
4218
4321
|
if (needCastKeys) {
|
|
4219
|
-
const rawCurrentProps = toRaw(props);
|
|
4220
4322
|
const castValues = rawCastValues || EMPTY_OBJ;
|
|
4221
4323
|
for (let i = 0; i < needCastKeys.length; i++) {
|
|
4222
4324
|
const key = needCastKeys[i];
|
|
4223
4325
|
props[key] = resolvePropValue(
|
|
4224
4326
|
options,
|
|
4225
|
-
rawCurrentProps,
|
|
4226
4327
|
key,
|
|
4227
4328
|
castValues[key],
|
|
4228
4329
|
instance,
|
|
4330
|
+
baseResolveDefault,
|
|
4229
4331
|
!hasOwn(castValues, key)
|
|
4230
4332
|
);
|
|
4231
4333
|
}
|
|
4232
4334
|
}
|
|
4233
4335
|
return hasAttrsChanged;
|
|
4234
4336
|
}
|
|
4235
|
-
function resolvePropValue(options,
|
|
4337
|
+
function resolvePropValue(options, key, value, instance, resolveDefault, isAbsent = false) {
|
|
4236
4338
|
const opt = options[key];
|
|
4237
4339
|
if (opt != null) {
|
|
4238
4340
|
const hasDefault = hasOwn(opt, "default");
|
|
4239
4341
|
if (hasDefault && value === void 0) {
|
|
4240
4342
|
const defaultValue = opt.default;
|
|
4241
4343
|
if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
|
|
4242
|
-
const
|
|
4243
|
-
if (key
|
|
4244
|
-
value =
|
|
4344
|
+
const cachedDefaults = instance.propsDefaults || (instance.propsDefaults = {});
|
|
4345
|
+
if (hasOwn(cachedDefaults, key)) {
|
|
4346
|
+
value = cachedDefaults[key];
|
|
4245
4347
|
} else {
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4348
|
+
value = cachedDefaults[key] = resolveDefault(
|
|
4349
|
+
defaultValue,
|
|
4350
|
+
instance,
|
|
4351
|
+
key
|
|
4250
4352
|
);
|
|
4251
|
-
reset();
|
|
4252
4353
|
}
|
|
4253
4354
|
} else {
|
|
4254
4355
|
value = defaultValue;
|
|
@@ -4267,6 +4368,17 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
4267
4368
|
}
|
|
4268
4369
|
return value;
|
|
4269
4370
|
}
|
|
4371
|
+
function baseResolveDefault(factory, instance, key) {
|
|
4372
|
+
let value;
|
|
4373
|
+
const prev = setCurrentInstance(instance);
|
|
4374
|
+
const props = toRaw(instance.props);
|
|
4375
|
+
value = factory.call(
|
|
4376
|
+
null,
|
|
4377
|
+
props
|
|
4378
|
+
);
|
|
4379
|
+
setCurrentInstance(...prev);
|
|
4380
|
+
return value;
|
|
4381
|
+
}
|
|
4270
4382
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
4271
4383
|
function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
4272
4384
|
const cache = __VUE_OPTIONS_API__ && asMixin ? mixinPropsCache : appContext.propsCache;
|
|
@@ -4301,6 +4413,14 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
4301
4413
|
}
|
|
4302
4414
|
return EMPTY_ARR;
|
|
4303
4415
|
}
|
|
4416
|
+
baseNormalizePropsOptions(raw, normalized, needCastKeys);
|
|
4417
|
+
const res = [normalized, needCastKeys];
|
|
4418
|
+
if (isObject(comp)) {
|
|
4419
|
+
cache.set(comp, res);
|
|
4420
|
+
}
|
|
4421
|
+
return res;
|
|
4422
|
+
}
|
|
4423
|
+
function baseNormalizePropsOptions(raw, normalized, needCastKeys) {
|
|
4304
4424
|
if (isArray(raw)) {
|
|
4305
4425
|
for (let i = 0; i < raw.length; i++) {
|
|
4306
4426
|
if (!!(process.env.NODE_ENV !== "production") && !isString(raw[i])) {
|
|
@@ -4345,11 +4465,6 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
4345
4465
|
}
|
|
4346
4466
|
}
|
|
4347
4467
|
}
|
|
4348
|
-
const res = [normalized, needCastKeys];
|
|
4349
|
-
if (isObject(comp)) {
|
|
4350
|
-
cache.set(comp, res);
|
|
4351
|
-
}
|
|
4352
|
-
return res;
|
|
4353
4468
|
}
|
|
4354
4469
|
function validatePropName(key) {
|
|
4355
4470
|
if (key[0] !== "$" && !isReservedProp(key)) {
|
|
@@ -4371,26 +4486,26 @@ function getType(ctor) {
|
|
|
4371
4486
|
}
|
|
4372
4487
|
return "";
|
|
4373
4488
|
}
|
|
4374
|
-
function validateProps(rawProps,
|
|
4375
|
-
|
|
4376
|
-
const options = instance.propsOptions[0];
|
|
4489
|
+
function validateProps(rawProps, resolvedProps, options) {
|
|
4490
|
+
resolvedProps = toRaw(resolvedProps);
|
|
4377
4491
|
const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
|
|
4378
4492
|
for (const key in options) {
|
|
4379
|
-
|
|
4380
|
-
if (opt
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4493
|
+
const opt = options[key];
|
|
4494
|
+
if (opt != null) {
|
|
4495
|
+
validateProp(
|
|
4496
|
+
key,
|
|
4497
|
+
resolvedProps[key],
|
|
4498
|
+
opt,
|
|
4499
|
+
resolvedProps,
|
|
4500
|
+
!camelizePropsKey.includes(key)
|
|
4501
|
+
);
|
|
4502
|
+
}
|
|
4388
4503
|
}
|
|
4389
4504
|
}
|
|
4390
|
-
function validateProp(
|
|
4391
|
-
const { type, required, validator, skipCheck } =
|
|
4505
|
+
function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
|
|
4506
|
+
const { type, required, validator, skipCheck } = propOptions;
|
|
4392
4507
|
if (required && isAbsent) {
|
|
4393
|
-
warn$1('Missing required prop: "' +
|
|
4508
|
+
warn$1('Missing required prop: "' + key + '"');
|
|
4394
4509
|
return;
|
|
4395
4510
|
}
|
|
4396
4511
|
if (value == null && !required) {
|
|
@@ -4406,12 +4521,12 @@ function validateProp(name, value, prop, props, isAbsent) {
|
|
|
4406
4521
|
isValid = valid;
|
|
4407
4522
|
}
|
|
4408
4523
|
if (!isValid) {
|
|
4409
|
-
warn$1(getInvalidTypeMessage(
|
|
4524
|
+
warn$1(getInvalidTypeMessage(key, value, expectedTypes));
|
|
4410
4525
|
return;
|
|
4411
4526
|
}
|
|
4412
4527
|
}
|
|
4413
|
-
if (validator && !validator(value,
|
|
4414
|
-
warn$1('Invalid prop: custom validator check failed for prop "' +
|
|
4528
|
+
if (validator && !validator(value, !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedProps) : resolvedProps)) {
|
|
4529
|
+
warn$1('Invalid prop: custom validator check failed for prop "' + key + '".');
|
|
4415
4530
|
}
|
|
4416
4531
|
}
|
|
4417
4532
|
const isSimpleType = /* @__PURE__ */ makeMap(
|
|
@@ -4482,7 +4597,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
|
|
|
4482
4597
|
return rawSlot;
|
|
4483
4598
|
}
|
|
4484
4599
|
const normalized = withCtx((...args) => {
|
|
4485
|
-
if (!!(process.env.NODE_ENV !== "production") && currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
|
|
4600
|
+
if (!!(process.env.NODE_ENV !== "production") && currentInstance && !currentInstance.vapor && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
|
|
4486
4601
|
warn$1(
|
|
4487
4602
|
`Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
|
|
4488
4603
|
);
|
|
@@ -4579,12 +4694,15 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4579
4694
|
|
|
4580
4695
|
let supported;
|
|
4581
4696
|
let perf;
|
|
4697
|
+
let cachedNow = 0;
|
|
4698
|
+
const p = /* @__PURE__ */ Promise.resolve();
|
|
4699
|
+
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = isSupported() ? perf.now() : Date.now());
|
|
4582
4700
|
function startMeasure(instance, type) {
|
|
4583
4701
|
if (instance.appContext.config.performance && isSupported()) {
|
|
4584
4702
|
perf.mark(`vue-${type}-${instance.uid}`);
|
|
4585
4703
|
}
|
|
4586
4704
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
4587
|
-
devtoolsPerfStart(instance, type,
|
|
4705
|
+
devtoolsPerfStart(instance, type, getNow());
|
|
4588
4706
|
}
|
|
4589
4707
|
}
|
|
4590
4708
|
function endMeasure(instance, type) {
|
|
@@ -4601,7 +4719,7 @@ function endMeasure(instance, type) {
|
|
|
4601
4719
|
perf.clearMarks(endTag);
|
|
4602
4720
|
}
|
|
4603
4721
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
4604
|
-
devtoolsPerfEnd(instance, type,
|
|
4722
|
+
devtoolsPerfEnd(instance, type, getNow());
|
|
4605
4723
|
}
|
|
4606
4724
|
}
|
|
4607
4725
|
function isSupported() {
|
|
@@ -4617,7 +4735,9 @@ function isSupported() {
|
|
|
4617
4735
|
return supported;
|
|
4618
4736
|
}
|
|
4619
4737
|
|
|
4738
|
+
let initialized = false;
|
|
4620
4739
|
function initFeatureFlags() {
|
|
4740
|
+
if (initialized) return;
|
|
4621
4741
|
const needWarn = [];
|
|
4622
4742
|
if (typeof __VUE_OPTIONS_API__ !== "boolean") {
|
|
4623
4743
|
!!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_OPTIONS_API__`);
|
|
@@ -4639,8 +4759,17 @@ function initFeatureFlags() {
|
|
|
4639
4759
|
For more details, see https://link.vuejs.org/feature-flags.`
|
|
4640
4760
|
);
|
|
4641
4761
|
}
|
|
4762
|
+
initialized = true;
|
|
4642
4763
|
}
|
|
4643
4764
|
|
|
4765
|
+
const MoveType = {
|
|
4766
|
+
"ENTER": 0,
|
|
4767
|
+
"0": "ENTER",
|
|
4768
|
+
"LEAVE": 1,
|
|
4769
|
+
"1": "LEAVE",
|
|
4770
|
+
"REORDER": 2,
|
|
4771
|
+
"2": "REORDER"
|
|
4772
|
+
};
|
|
4644
4773
|
const queuePostRenderEffect = queueEffectWithSuspense ;
|
|
4645
4774
|
function createRenderer(options) {
|
|
4646
4775
|
return baseCreateRenderer(options);
|
|
@@ -4712,6 +4841,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4712
4841
|
optimized
|
|
4713
4842
|
);
|
|
4714
4843
|
break;
|
|
4844
|
+
case VaporSlot:
|
|
4845
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
|
|
4846
|
+
break;
|
|
4715
4847
|
default:
|
|
4716
4848
|
if (shapeFlag & 1) {
|
|
4717
4849
|
processElement(
|
|
@@ -4924,11 +5056,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4924
5056
|
}
|
|
4925
5057
|
hostInsert(el, container, anchor);
|
|
4926
5058
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
4927
|
-
queuePostRenderEffect(
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
5059
|
+
queuePostRenderEffect(
|
|
5060
|
+
() => {
|
|
5061
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5062
|
+
needCallTransitionHooks && transition.enter(el);
|
|
5063
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
5064
|
+
},
|
|
5065
|
+
void 0,
|
|
5066
|
+
parentSuspense
|
|
5067
|
+
);
|
|
4932
5068
|
}
|
|
4933
5069
|
};
|
|
4934
5070
|
const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
|
|
@@ -4940,8 +5076,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4940
5076
|
hostSetScopeId(el, slotScopeIds[i]);
|
|
4941
5077
|
}
|
|
4942
5078
|
}
|
|
4943
|
-
|
|
4944
|
-
|
|
5079
|
+
let subTree = parentComponent && parentComponent.subTree;
|
|
5080
|
+
if (subTree) {
|
|
4945
5081
|
if (!!(process.env.NODE_ENV !== "production") && subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
|
|
4946
5082
|
subTree = filterSingleRoot(subTree.children) || subTree;
|
|
4947
5083
|
}
|
|
@@ -5058,10 +5194,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5058
5194
|
patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
5059
5195
|
}
|
|
5060
5196
|
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
|
|
5061
|
-
queuePostRenderEffect(
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5197
|
+
queuePostRenderEffect(
|
|
5198
|
+
() => {
|
|
5199
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
5200
|
+
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
5201
|
+
},
|
|
5202
|
+
void 0,
|
|
5203
|
+
parentSuspense
|
|
5204
|
+
);
|
|
5065
5205
|
}
|
|
5066
5206
|
};
|
|
5067
5207
|
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
|
|
@@ -5200,7 +5340,22 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5200
5340
|
};
|
|
5201
5341
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
5202
5342
|
n2.slotScopeIds = slotScopeIds;
|
|
5203
|
-
if (
|
|
5343
|
+
if (n2.type.__vapor) {
|
|
5344
|
+
if (n1 == null) {
|
|
5345
|
+
getVaporInterface(parentComponent, n2).mount(
|
|
5346
|
+
n2,
|
|
5347
|
+
container,
|
|
5348
|
+
anchor,
|
|
5349
|
+
parentComponent
|
|
5350
|
+
);
|
|
5351
|
+
} else {
|
|
5352
|
+
getVaporInterface(parentComponent, n2).update(
|
|
5353
|
+
n1,
|
|
5354
|
+
n2,
|
|
5355
|
+
shouldUpdateComponent(n1, n2, optimized)
|
|
5356
|
+
);
|
|
5357
|
+
}
|
|
5358
|
+
} else if (n1 == null) {
|
|
5204
5359
|
if (n2.shapeFlag & 512) {
|
|
5205
5360
|
parentComponent.ctx.activate(
|
|
5206
5361
|
n2,
|
|
@@ -5286,15 +5441,52 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5286
5441
|
return;
|
|
5287
5442
|
} else {
|
|
5288
5443
|
instance.next = n2;
|
|
5289
|
-
instance.
|
|
5444
|
+
instance.effect.run();
|
|
5290
5445
|
}
|
|
5291
5446
|
} else {
|
|
5292
5447
|
n2.el = n1.el;
|
|
5293
5448
|
instance.vnode = n2;
|
|
5294
5449
|
}
|
|
5295
5450
|
};
|
|
5296
|
-
|
|
5297
|
-
|
|
5451
|
+
class SetupRenderEffect extends ReactiveEffect {
|
|
5452
|
+
constructor(instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) {
|
|
5453
|
+
const prevScope = setCurrentScope(instance.scope);
|
|
5454
|
+
super();
|
|
5455
|
+
this.instance = instance;
|
|
5456
|
+
this.initialVNode = initialVNode;
|
|
5457
|
+
this.container = container;
|
|
5458
|
+
this.anchor = anchor;
|
|
5459
|
+
this.parentSuspense = parentSuspense;
|
|
5460
|
+
this.namespace = namespace;
|
|
5461
|
+
this.optimized = optimized;
|
|
5462
|
+
setCurrentScope(prevScope);
|
|
5463
|
+
this.job = instance.job = () => {
|
|
5464
|
+
if (this.dirty) {
|
|
5465
|
+
this.run();
|
|
5466
|
+
}
|
|
5467
|
+
};
|
|
5468
|
+
this.job.i = instance;
|
|
5469
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
5470
|
+
this.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
|
|
5471
|
+
this.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
|
|
5472
|
+
}
|
|
5473
|
+
}
|
|
5474
|
+
notify() {
|
|
5475
|
+
if (!(this.flags & 256)) {
|
|
5476
|
+
const job = this.job;
|
|
5477
|
+
queueJob(job, job.i.uid);
|
|
5478
|
+
}
|
|
5479
|
+
}
|
|
5480
|
+
fn() {
|
|
5481
|
+
const {
|
|
5482
|
+
instance,
|
|
5483
|
+
initialVNode,
|
|
5484
|
+
container,
|
|
5485
|
+
anchor,
|
|
5486
|
+
parentSuspense,
|
|
5487
|
+
namespace,
|
|
5488
|
+
optimized
|
|
5489
|
+
} = this;
|
|
5298
5490
|
if (!instance.isMounted) {
|
|
5299
5491
|
let vnodeHook;
|
|
5300
5492
|
const { el, props } = initialVNode;
|
|
@@ -5370,23 +5562,24 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5370
5562
|
initialVNode.el = subTree.el;
|
|
5371
5563
|
}
|
|
5372
5564
|
if (m) {
|
|
5373
|
-
queuePostRenderEffect(m, parentSuspense);
|
|
5565
|
+
queuePostRenderEffect(m, void 0, parentSuspense);
|
|
5374
5566
|
}
|
|
5375
5567
|
if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
|
|
5376
5568
|
const scopedInitialVNode = initialVNode;
|
|
5377
5569
|
queuePostRenderEffect(
|
|
5378
5570
|
() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
|
|
5571
|
+
void 0,
|
|
5379
5572
|
parentSuspense
|
|
5380
5573
|
);
|
|
5381
5574
|
}
|
|
5382
|
-
if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
|
|
5383
|
-
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
5575
|
+
if (initialVNode.shapeFlag & 256 || parent && parent.vnode && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
|
|
5576
|
+
instance.a && queuePostRenderEffect(instance.a, void 0, parentSuspense);
|
|
5384
5577
|
}
|
|
5385
5578
|
instance.isMounted = true;
|
|
5386
5579
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
5387
5580
|
devtoolsComponentAdded(instance);
|
|
5388
5581
|
}
|
|
5389
|
-
initialVNode = container = anchor = null;
|
|
5582
|
+
this.initialVNode = this.container = this.anchor = null;
|
|
5390
5583
|
} else {
|
|
5391
5584
|
let { next, bu, u, parent, vnode } = instance;
|
|
5392
5585
|
{
|
|
@@ -5398,7 +5591,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5398
5591
|
}
|
|
5399
5592
|
nonHydratedAsyncRoot.asyncDep.then(() => {
|
|
5400
5593
|
if (!instance.isUnmounted) {
|
|
5401
|
-
|
|
5594
|
+
this.fn();
|
|
5402
5595
|
}
|
|
5403
5596
|
});
|
|
5404
5597
|
return;
|
|
@@ -5454,11 +5647,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5454
5647
|
updateHOCHostEl(instance, nextTree.el);
|
|
5455
5648
|
}
|
|
5456
5649
|
if (u) {
|
|
5457
|
-
queuePostRenderEffect(u, parentSuspense);
|
|
5650
|
+
queuePostRenderEffect(u, void 0, parentSuspense);
|
|
5458
5651
|
}
|
|
5459
5652
|
if (vnodeHook = next.props && next.props.onVnodeUpdated) {
|
|
5460
5653
|
queuePostRenderEffect(
|
|
5461
5654
|
() => invokeVNodeHook(vnodeHook, parent, next, vnode),
|
|
5655
|
+
void 0,
|
|
5462
5656
|
parentSuspense
|
|
5463
5657
|
);
|
|
5464
5658
|
}
|
|
@@ -5469,21 +5663,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5469
5663
|
popWarningContext();
|
|
5470
5664
|
}
|
|
5471
5665
|
}
|
|
5472
|
-
};
|
|
5473
|
-
instance.scope.on();
|
|
5474
|
-
const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
|
|
5475
|
-
instance.scope.off();
|
|
5476
|
-
const update = instance.update = effect.run.bind(effect);
|
|
5477
|
-
const job = instance.job = effect.runIfDirty.bind(effect);
|
|
5478
|
-
job.i = instance;
|
|
5479
|
-
job.id = instance.uid;
|
|
5480
|
-
effect.scheduler = () => queueJob(job);
|
|
5481
|
-
toggleRecurse(instance, true);
|
|
5482
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
5483
|
-
effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
|
|
5484
|
-
effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
|
|
5485
5666
|
}
|
|
5486
|
-
|
|
5667
|
+
}
|
|
5668
|
+
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
|
|
5669
|
+
const effect = instance.effect = new SetupRenderEffect(
|
|
5670
|
+
instance,
|
|
5671
|
+
initialVNode,
|
|
5672
|
+
container,
|
|
5673
|
+
anchor,
|
|
5674
|
+
parentSuspense,
|
|
5675
|
+
namespace,
|
|
5676
|
+
optimized
|
|
5677
|
+
);
|
|
5678
|
+
instance.update = effect.run.bind(effect);
|
|
5679
|
+
toggleRecurse(instance, true);
|
|
5680
|
+
effect.run();
|
|
5487
5681
|
};
|
|
5488
5682
|
const updateComponentPreRender = (instance, nextVNode, optimized) => {
|
|
5489
5683
|
nextVNode.component = instance;
|
|
@@ -5492,9 +5686,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5492
5686
|
instance.next = null;
|
|
5493
5687
|
updateProps(instance, nextVNode.props, prevProps, optimized);
|
|
5494
5688
|
updateSlots(instance, nextVNode.children, optimized);
|
|
5495
|
-
|
|
5689
|
+
const prevSub = setActiveSub();
|
|
5496
5690
|
flushPreFlushCbs(instance);
|
|
5497
|
-
|
|
5691
|
+
setActiveSub(prevSub);
|
|
5498
5692
|
};
|
|
5499
5693
|
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
|
|
5500
5694
|
const c1 = n1 && n1.children;
|
|
@@ -5771,7 +5965,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5771
5965
|
);
|
|
5772
5966
|
} else if (moved) {
|
|
5773
5967
|
if (j < 0 || i !== increasingNewIndexSequence[j]) {
|
|
5774
|
-
move(
|
|
5968
|
+
move(
|
|
5969
|
+
nextChild,
|
|
5970
|
+
container,
|
|
5971
|
+
anchor,
|
|
5972
|
+
2,
|
|
5973
|
+
parentComponent
|
|
5974
|
+
);
|
|
5775
5975
|
} else {
|
|
5776
5976
|
j--;
|
|
5777
5977
|
}
|
|
@@ -5779,10 +5979,20 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5779
5979
|
}
|
|
5780
5980
|
}
|
|
5781
5981
|
};
|
|
5782
|
-
const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
|
|
5982
|
+
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
5783
5983
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
5784
5984
|
if (shapeFlag & 6) {
|
|
5785
|
-
|
|
5985
|
+
if (type.__vapor) {
|
|
5986
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
|
|
5987
|
+
} else {
|
|
5988
|
+
move(
|
|
5989
|
+
vnode.component.subTree,
|
|
5990
|
+
container,
|
|
5991
|
+
anchor,
|
|
5992
|
+
moveType,
|
|
5993
|
+
parentComponent
|
|
5994
|
+
);
|
|
5995
|
+
}
|
|
5786
5996
|
return;
|
|
5787
5997
|
}
|
|
5788
5998
|
if (shapeFlag & 128) {
|
|
@@ -5790,13 +6000,25 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5790
6000
|
return;
|
|
5791
6001
|
}
|
|
5792
6002
|
if (shapeFlag & 64) {
|
|
5793
|
-
type.move(
|
|
6003
|
+
type.move(
|
|
6004
|
+
vnode,
|
|
6005
|
+
container,
|
|
6006
|
+
anchor,
|
|
6007
|
+
internals,
|
|
6008
|
+
parentComponent
|
|
6009
|
+
);
|
|
5794
6010
|
return;
|
|
5795
6011
|
}
|
|
5796
6012
|
if (type === Fragment) {
|
|
5797
6013
|
hostInsert(el, container, anchor);
|
|
5798
6014
|
for (let i = 0; i < children.length; i++) {
|
|
5799
|
-
move(
|
|
6015
|
+
move(
|
|
6016
|
+
children[i],
|
|
6017
|
+
container,
|
|
6018
|
+
anchor,
|
|
6019
|
+
moveType,
|
|
6020
|
+
parentComponent
|
|
6021
|
+
);
|
|
5800
6022
|
}
|
|
5801
6023
|
hostInsert(vnode.anchor, container, anchor);
|
|
5802
6024
|
return;
|
|
@@ -5810,7 +6032,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5810
6032
|
if (moveType === 0) {
|
|
5811
6033
|
transition.beforeEnter(el);
|
|
5812
6034
|
hostInsert(el, container, anchor);
|
|
5813
|
-
queuePostRenderEffect(
|
|
6035
|
+
queuePostRenderEffect(
|
|
6036
|
+
() => transition.enter(el),
|
|
6037
|
+
void 0,
|
|
6038
|
+
parentSuspense
|
|
6039
|
+
);
|
|
5814
6040
|
} else {
|
|
5815
6041
|
const { leave, delayLeave, afterLeave } = transition;
|
|
5816
6042
|
const remove2 = () => {
|
|
@@ -5852,9 +6078,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5852
6078
|
optimized = false;
|
|
5853
6079
|
}
|
|
5854
6080
|
if (ref != null) {
|
|
5855
|
-
|
|
6081
|
+
const prevSub = setActiveSub();
|
|
5856
6082
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
5857
|
-
|
|
6083
|
+
setActiveSub(prevSub);
|
|
5858
6084
|
}
|
|
5859
6085
|
if (cacheIndex != null) {
|
|
5860
6086
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
@@ -5870,7 +6096,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5870
6096
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5871
6097
|
}
|
|
5872
6098
|
if (shapeFlag & 6) {
|
|
5873
|
-
|
|
6099
|
+
if (type.__vapor) {
|
|
6100
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
6101
|
+
return;
|
|
6102
|
+
} else {
|
|
6103
|
+
unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
6104
|
+
}
|
|
5874
6105
|
} else {
|
|
5875
6106
|
if (shapeFlag & 128) {
|
|
5876
6107
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -5904,15 +6135,23 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5904
6135
|
} else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
|
|
5905
6136
|
unmountChildren(children, parentComponent, parentSuspense);
|
|
5906
6137
|
}
|
|
6138
|
+
if (type === VaporSlot) {
|
|
6139
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
6140
|
+
return;
|
|
6141
|
+
}
|
|
5907
6142
|
if (doRemove) {
|
|
5908
6143
|
remove(vnode);
|
|
5909
6144
|
}
|
|
5910
6145
|
}
|
|
5911
6146
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
|
|
5912
|
-
queuePostRenderEffect(
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
6147
|
+
queuePostRenderEffect(
|
|
6148
|
+
() => {
|
|
6149
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
6150
|
+
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
6151
|
+
},
|
|
6152
|
+
void 0,
|
|
6153
|
+
parentSuspense
|
|
6154
|
+
);
|
|
5916
6155
|
}
|
|
5917
6156
|
};
|
|
5918
6157
|
const remove = (vnode) => {
|
|
@@ -5969,7 +6208,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5969
6208
|
const {
|
|
5970
6209
|
bum,
|
|
5971
6210
|
scope,
|
|
5972
|
-
|
|
6211
|
+
effect,
|
|
5973
6212
|
subTree,
|
|
5974
6213
|
um,
|
|
5975
6214
|
m,
|
|
@@ -5988,16 +6227,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5988
6227
|
});
|
|
5989
6228
|
}
|
|
5990
6229
|
scope.stop();
|
|
5991
|
-
if (
|
|
5992
|
-
|
|
6230
|
+
if (effect) {
|
|
6231
|
+
effect.stop();
|
|
5993
6232
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5994
6233
|
}
|
|
5995
6234
|
if (um) {
|
|
5996
|
-
queuePostRenderEffect(um, parentSuspense);
|
|
6235
|
+
queuePostRenderEffect(um, void 0, parentSuspense);
|
|
5997
6236
|
}
|
|
5998
|
-
queuePostRenderEffect(
|
|
5999
|
-
instance.isUnmounted = true
|
|
6000
|
-
|
|
6237
|
+
queuePostRenderEffect(
|
|
6238
|
+
() => instance.isUnmounted = true,
|
|
6239
|
+
void 0,
|
|
6240
|
+
parentSuspense
|
|
6241
|
+
);
|
|
6001
6242
|
if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
|
|
6002
6243
|
parentSuspense.deps--;
|
|
6003
6244
|
if (parentSuspense.deps === 0) {
|
|
@@ -6015,6 +6256,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6015
6256
|
};
|
|
6016
6257
|
const getNextHostNode = (vnode) => {
|
|
6017
6258
|
if (vnode.shapeFlag & 6) {
|
|
6259
|
+
if (vnode.type.__vapor) {
|
|
6260
|
+
return hostNextSibling(vnode.component.block);
|
|
6261
|
+
}
|
|
6018
6262
|
return getNextHostNode(vnode.component.subTree);
|
|
6019
6263
|
}
|
|
6020
6264
|
if (vnode.shapeFlag & 128) {
|
|
@@ -6024,7 +6268,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6024
6268
|
const teleportEnd = el && el[TeleportEndKey];
|
|
6025
6269
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
6026
6270
|
};
|
|
6027
|
-
let isFlushing = false;
|
|
6028
6271
|
const render = (vnode, container, namespace) => {
|
|
6029
6272
|
if (vnode == null) {
|
|
6030
6273
|
if (container._vnode) {
|
|
@@ -6042,12 +6285,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6042
6285
|
);
|
|
6043
6286
|
}
|
|
6044
6287
|
container._vnode = vnode;
|
|
6045
|
-
|
|
6046
|
-
isFlushing = true;
|
|
6047
|
-
flushPreFlushCbs();
|
|
6048
|
-
flushPostFlushCbs();
|
|
6049
|
-
isFlushing = false;
|
|
6050
|
-
}
|
|
6288
|
+
flushOnAppMount();
|
|
6051
6289
|
};
|
|
6052
6290
|
const internals = {
|
|
6053
6291
|
p: patch,
|
|
@@ -6055,6 +6293,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6055
6293
|
m: move,
|
|
6056
6294
|
r: remove,
|
|
6057
6295
|
mt: mountComponent,
|
|
6296
|
+
umt: unmountComponent,
|
|
6058
6297
|
mc: mountChildren,
|
|
6059
6298
|
pc: patchChildren,
|
|
6060
6299
|
pbc: patchBlockChildren,
|
|
@@ -6068,22 +6307,53 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6068
6307
|
internals
|
|
6069
6308
|
);
|
|
6070
6309
|
}
|
|
6310
|
+
const mountApp = (app, container, isHydrate, namespace) => {
|
|
6311
|
+
const vnode = app._ceVNode || createVNode(app._component, app._props);
|
|
6312
|
+
vnode.appContext = app._context;
|
|
6313
|
+
if (namespace === true) {
|
|
6314
|
+
namespace = "svg";
|
|
6315
|
+
} else if (namespace === false) {
|
|
6316
|
+
namespace = void 0;
|
|
6317
|
+
}
|
|
6318
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6319
|
+
app._context.reload = () => {
|
|
6320
|
+
const cloned = cloneVNode(vnode);
|
|
6321
|
+
cloned.el = null;
|
|
6322
|
+
render(cloned, container, namespace);
|
|
6323
|
+
};
|
|
6324
|
+
}
|
|
6325
|
+
if (isHydrate && hydrate) {
|
|
6326
|
+
hydrate(vnode, container);
|
|
6327
|
+
} else {
|
|
6328
|
+
render(vnode, container, namespace);
|
|
6329
|
+
}
|
|
6330
|
+
return vnode.component;
|
|
6331
|
+
};
|
|
6332
|
+
const unmountApp = (app) => {
|
|
6333
|
+
render(null, app._container);
|
|
6334
|
+
};
|
|
6071
6335
|
return {
|
|
6072
6336
|
render,
|
|
6073
6337
|
hydrate,
|
|
6074
|
-
|
|
6338
|
+
internals,
|
|
6339
|
+
createApp: createAppAPI(
|
|
6340
|
+
mountApp,
|
|
6341
|
+
unmountApp,
|
|
6342
|
+
getComponentPublicInstance)
|
|
6075
6343
|
};
|
|
6076
6344
|
}
|
|
6077
6345
|
function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
6078
6346
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
6079
6347
|
}
|
|
6080
|
-
function toggleRecurse({ effect, job }, allowed) {
|
|
6081
|
-
if (
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6348
|
+
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
6349
|
+
if (!vapor) {
|
|
6350
|
+
if (allowed) {
|
|
6351
|
+
effect.flags |= 128;
|
|
6352
|
+
job.flags |= 2;
|
|
6353
|
+
} else {
|
|
6354
|
+
effect.flags &= -129;
|
|
6355
|
+
job.flags &= -3;
|
|
6356
|
+
}
|
|
6087
6357
|
}
|
|
6088
6358
|
}
|
|
6089
6359
|
function needTransition(parentSuspense, transition) {
|
|
@@ -6116,48 +6386,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
6116
6386
|
}
|
|
6117
6387
|
}
|
|
6118
6388
|
}
|
|
6119
|
-
function getSequence(arr) {
|
|
6120
|
-
const p = arr.slice();
|
|
6121
|
-
const result = [0];
|
|
6122
|
-
let i, j, u, v, c;
|
|
6123
|
-
const len = arr.length;
|
|
6124
|
-
for (i = 0; i < len; i++) {
|
|
6125
|
-
const arrI = arr[i];
|
|
6126
|
-
if (arrI !== 0) {
|
|
6127
|
-
j = result[result.length - 1];
|
|
6128
|
-
if (arr[j] < arrI) {
|
|
6129
|
-
p[i] = j;
|
|
6130
|
-
result.push(i);
|
|
6131
|
-
continue;
|
|
6132
|
-
}
|
|
6133
|
-
u = 0;
|
|
6134
|
-
v = result.length - 1;
|
|
6135
|
-
while (u < v) {
|
|
6136
|
-
c = u + v >> 1;
|
|
6137
|
-
if (arr[result[c]] < arrI) {
|
|
6138
|
-
u = c + 1;
|
|
6139
|
-
} else {
|
|
6140
|
-
v = c;
|
|
6141
|
-
}
|
|
6142
|
-
}
|
|
6143
|
-
if (arrI < arr[result[u]]) {
|
|
6144
|
-
if (u > 0) {
|
|
6145
|
-
p[i] = result[u - 1];
|
|
6146
|
-
}
|
|
6147
|
-
result[u] = i;
|
|
6148
|
-
}
|
|
6149
|
-
}
|
|
6150
|
-
}
|
|
6151
|
-
u = result.length;
|
|
6152
|
-
v = result[u - 1];
|
|
6153
|
-
while (u-- > 0) {
|
|
6154
|
-
result[u] = v;
|
|
6155
|
-
v = p[v];
|
|
6156
|
-
}
|
|
6157
|
-
return result;
|
|
6158
|
-
}
|
|
6159
6389
|
function locateNonHydratedAsyncRoot(instance) {
|
|
6160
|
-
const subComponent = instance.subTree.component;
|
|
6390
|
+
const subComponent = instance.vapor ? null : instance.subTree.component;
|
|
6161
6391
|
if (subComponent) {
|
|
6162
6392
|
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
6163
6393
|
return subComponent;
|
|
@@ -6169,9 +6399,23 @@ function locateNonHydratedAsyncRoot(instance) {
|
|
|
6169
6399
|
function invalidateMount(hooks) {
|
|
6170
6400
|
if (hooks) {
|
|
6171
6401
|
for (let i = 0; i < hooks.length; i++)
|
|
6172
|
-
hooks[i].flags |=
|
|
6402
|
+
hooks[i].flags |= 4;
|
|
6173
6403
|
}
|
|
6174
6404
|
}
|
|
6405
|
+
function getVaporInterface(instance, vnode) {
|
|
6406
|
+
const ctx = instance ? instance.appContext : vnode.appContext;
|
|
6407
|
+
const res = ctx && ctx.vapor;
|
|
6408
|
+
if (!!(process.env.NODE_ENV !== "production") && !res) {
|
|
6409
|
+
warn$1(
|
|
6410
|
+
`Vapor component found in vdom tree but vapor-in-vdom interop was not installed. Make sure to install it:
|
|
6411
|
+
\`\`\`
|
|
6412
|
+
import { vaporInteropPlugin } from 'vue'
|
|
6413
|
+
app.use(vaporInteropPlugin)
|
|
6414
|
+
\`\`\``
|
|
6415
|
+
);
|
|
6416
|
+
}
|
|
6417
|
+
return res;
|
|
6418
|
+
}
|
|
6175
6419
|
|
|
6176
6420
|
const ssrContextKey = Symbol.for("v-scx");
|
|
6177
6421
|
const useSSRContext = () => {
|
|
@@ -6211,8 +6455,41 @@ function watch(source, cb, options) {
|
|
|
6211
6455
|
}
|
|
6212
6456
|
return doWatch(source, cb, options);
|
|
6213
6457
|
}
|
|
6458
|
+
class RenderWatcherEffect extends WatcherEffect {
|
|
6459
|
+
constructor(instance, source, cb, options, flush) {
|
|
6460
|
+
super(source, cb, options);
|
|
6461
|
+
this.flush = flush;
|
|
6462
|
+
const job = () => {
|
|
6463
|
+
if (this.dirty) {
|
|
6464
|
+
this.run();
|
|
6465
|
+
}
|
|
6466
|
+
};
|
|
6467
|
+
if (cb) {
|
|
6468
|
+
this.flags |= 128;
|
|
6469
|
+
job.flags |= 2;
|
|
6470
|
+
}
|
|
6471
|
+
if (instance) {
|
|
6472
|
+
job.i = instance;
|
|
6473
|
+
}
|
|
6474
|
+
this.job = job;
|
|
6475
|
+
}
|
|
6476
|
+
notify() {
|
|
6477
|
+
const flags = this.flags;
|
|
6478
|
+
if (!(flags & 256)) {
|
|
6479
|
+
const flush = this.flush;
|
|
6480
|
+
const job = this.job;
|
|
6481
|
+
if (flush === "post") {
|
|
6482
|
+
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
6483
|
+
} else if (flush === "pre") {
|
|
6484
|
+
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
6485
|
+
} else {
|
|
6486
|
+
job();
|
|
6487
|
+
}
|
|
6488
|
+
}
|
|
6489
|
+
}
|
|
6490
|
+
}
|
|
6214
6491
|
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
6215
|
-
const { immediate, deep, flush, once } = options;
|
|
6492
|
+
const { immediate, deep, flush = "pre", once } = options;
|
|
6216
6493
|
if (!!(process.env.NODE_ENV !== "production") && !cb) {
|
|
6217
6494
|
if (immediate !== void 0) {
|
|
6218
6495
|
warn$1(
|
|
@@ -6249,42 +6526,32 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
|
6249
6526
|
}
|
|
6250
6527
|
const instance = currentInstance;
|
|
6251
6528
|
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
};
|
|
6529
|
+
const effect = new RenderWatcherEffect(
|
|
6530
|
+
instance,
|
|
6531
|
+
source,
|
|
6532
|
+
cb,
|
|
6533
|
+
baseWatchOptions,
|
|
6534
|
+
flush
|
|
6535
|
+
);
|
|
6536
|
+
if (cb) {
|
|
6537
|
+
effect.run(true);
|
|
6538
|
+
} else if (flush === "post") {
|
|
6539
|
+
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
6540
|
+
} else {
|
|
6541
|
+
effect.run(true);
|
|
6266
6542
|
}
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
if (isPre) {
|
|
6272
|
-
job.flags |= 2;
|
|
6273
|
-
if (instance) {
|
|
6274
|
-
job.id = instance.uid;
|
|
6275
|
-
job.i = instance;
|
|
6276
|
-
}
|
|
6277
|
-
}
|
|
6278
|
-
};
|
|
6279
|
-
const watchHandle = watch$1(source, cb, baseWatchOptions);
|
|
6543
|
+
const stop = effect.stop.bind(effect);
|
|
6544
|
+
stop.pause = effect.pause.bind(effect);
|
|
6545
|
+
stop.resume = effect.resume.bind(effect);
|
|
6546
|
+
stop.stop = stop;
|
|
6280
6547
|
if (isInSSRComponentSetup) {
|
|
6281
6548
|
if (ssrCleanup) {
|
|
6282
|
-
ssrCleanup.push(
|
|
6549
|
+
ssrCleanup.push(stop);
|
|
6283
6550
|
} else if (runsImmediately) {
|
|
6284
|
-
|
|
6551
|
+
stop();
|
|
6285
6552
|
}
|
|
6286
6553
|
}
|
|
6287
|
-
return
|
|
6554
|
+
return stop;
|
|
6288
6555
|
}
|
|
6289
6556
|
function instanceWatch(source, value, options) {
|
|
6290
6557
|
const publicThis = this.proxy;
|
|
@@ -6296,9 +6563,9 @@ function instanceWatch(source, value, options) {
|
|
|
6296
6563
|
cb = value.handler;
|
|
6297
6564
|
options = value;
|
|
6298
6565
|
}
|
|
6299
|
-
const
|
|
6566
|
+
const prev = setCurrentInstance(this);
|
|
6300
6567
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
6301
|
-
|
|
6568
|
+
setCurrentInstance(...prev);
|
|
6302
6569
|
return res;
|
|
6303
6570
|
}
|
|
6304
6571
|
function createPathGetter(ctx, path) {
|
|
@@ -6313,7 +6580,7 @@ function createPathGetter(ctx, path) {
|
|
|
6313
6580
|
}
|
|
6314
6581
|
|
|
6315
6582
|
function useModel(props, name, options = EMPTY_OBJ) {
|
|
6316
|
-
const i =
|
|
6583
|
+
const i = getCurrentGenericInstance();
|
|
6317
6584
|
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
6318
6585
|
warn$1(`useModel() called without active instance.`);
|
|
6319
6586
|
return ref();
|
|
@@ -6324,7 +6591,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6324
6591
|
return ref();
|
|
6325
6592
|
}
|
|
6326
6593
|
const hyphenatedName = hyphenate(name);
|
|
6327
|
-
const modifiers = getModelModifiers(props, camelizedName);
|
|
6594
|
+
const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
|
|
6328
6595
|
const res = customRef((track, trigger) => {
|
|
6329
6596
|
let localValue;
|
|
6330
6597
|
let prevSetValue = EMPTY_OBJ;
|
|
@@ -6346,9 +6613,25 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6346
6613
|
if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
|
|
6347
6614
|
return;
|
|
6348
6615
|
}
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6616
|
+
let rawPropKeys;
|
|
6617
|
+
let parentPassedModelValue = false;
|
|
6618
|
+
let parentPassedModelUpdater = false;
|
|
6619
|
+
if (i.rawKeys) {
|
|
6620
|
+
rawPropKeys = i.rawKeys();
|
|
6621
|
+
} else {
|
|
6622
|
+
const rawProps = i.vnode.props;
|
|
6623
|
+
rawPropKeys = rawProps && Object.keys(rawProps);
|
|
6624
|
+
}
|
|
6625
|
+
if (rawPropKeys) {
|
|
6626
|
+
for (const key of rawPropKeys) {
|
|
6627
|
+
if (key === name || key === camelizedName || key === hyphenatedName) {
|
|
6628
|
+
parentPassedModelValue = true;
|
|
6629
|
+
} else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) {
|
|
6630
|
+
parentPassedModelUpdater = true;
|
|
6631
|
+
}
|
|
6632
|
+
}
|
|
6633
|
+
}
|
|
6634
|
+
if (!parentPassedModelValue || !parentPassedModelUpdater) {
|
|
6352
6635
|
localValue = value;
|
|
6353
6636
|
trigger();
|
|
6354
6637
|
}
|
|
@@ -6375,21 +6658,26 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6375
6658
|
};
|
|
6376
6659
|
return res;
|
|
6377
6660
|
}
|
|
6378
|
-
const getModelModifiers = (props, modelName) => {
|
|
6379
|
-
return modelName === "modelValue" || modelName === "model-value" ? props
|
|
6661
|
+
const getModelModifiers = (props, modelName, getter) => {
|
|
6662
|
+
return modelName === "modelValue" || modelName === "model-value" ? getter(props, "modelModifiers") : getter(props, `${modelName}Modifiers`) || getter(props, `${camelize(modelName)}Modifiers`) || getter(props, `${hyphenate(modelName)}Modifiers`);
|
|
6380
6663
|
};
|
|
6381
6664
|
|
|
6382
6665
|
function emit(instance, event, ...rawArgs) {
|
|
6666
|
+
return baseEmit(
|
|
6667
|
+
instance,
|
|
6668
|
+
instance.vnode.props || EMPTY_OBJ,
|
|
6669
|
+
defaultPropGetter,
|
|
6670
|
+
event,
|
|
6671
|
+
...rawArgs
|
|
6672
|
+
);
|
|
6673
|
+
}
|
|
6674
|
+
function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
6383
6675
|
if (instance.isUnmounted) return;
|
|
6384
|
-
const props = instance.vnode.props || EMPTY_OBJ;
|
|
6385
6676
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6386
|
-
const {
|
|
6387
|
-
emitsOptions,
|
|
6388
|
-
propsOptions: [propsOptions]
|
|
6389
|
-
} = instance;
|
|
6677
|
+
const { emitsOptions, propsOptions } = instance;
|
|
6390
6678
|
if (emitsOptions) {
|
|
6391
6679
|
if (!(event in emitsOptions) && true) {
|
|
6392
|
-
if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
|
|
6680
|
+
if (!propsOptions || !propsOptions[0] || !(toHandlerKey(camelize(event)) in propsOptions[0])) {
|
|
6393
6681
|
warn$1(
|
|
6394
6682
|
`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
|
|
6395
6683
|
);
|
|
@@ -6409,7 +6697,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6409
6697
|
}
|
|
6410
6698
|
let args = rawArgs;
|
|
6411
6699
|
const isModelListener = event.startsWith("update:");
|
|
6412
|
-
const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
|
|
6700
|
+
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
6413
6701
|
if (modifiers) {
|
|
6414
6702
|
if (modifiers.trim) {
|
|
6415
6703
|
args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
@@ -6423,7 +6711,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6423
6711
|
}
|
|
6424
6712
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6425
6713
|
const lowerCaseEvent = event.toLowerCase();
|
|
6426
|
-
if (lowerCaseEvent !== event && props
|
|
6714
|
+
if (lowerCaseEvent !== event && getter(props, toHandlerKey(lowerCaseEvent))) {
|
|
6427
6715
|
warn$1(
|
|
6428
6716
|
`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
|
|
6429
6717
|
instance,
|
|
@@ -6435,10 +6723,10 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6435
6723
|
}
|
|
6436
6724
|
}
|
|
6437
6725
|
let handlerName;
|
|
6438
|
-
let handler = props
|
|
6439
|
-
props
|
|
6726
|
+
let handler = getter(props, handlerName = toHandlerKey(event)) || // also try camelCase event handler (#2249)
|
|
6727
|
+
getter(props, handlerName = toHandlerKey(camelize(event)));
|
|
6440
6728
|
if (!handler && isModelListener) {
|
|
6441
|
-
handler = props
|
|
6729
|
+
handler = getter(props, handlerName = toHandlerKey(hyphenate(event)));
|
|
6442
6730
|
}
|
|
6443
6731
|
if (handler) {
|
|
6444
6732
|
callWithAsyncErrorHandling(
|
|
@@ -6448,7 +6736,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6448
6736
|
args
|
|
6449
6737
|
);
|
|
6450
6738
|
}
|
|
6451
|
-
const onceHandler = props
|
|
6739
|
+
const onceHandler = getter(props, handlerName + `Once`);
|
|
6452
6740
|
if (onceHandler) {
|
|
6453
6741
|
if (!instance.emitted) {
|
|
6454
6742
|
instance.emitted = {};
|
|
@@ -6464,6 +6752,9 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6464
6752
|
);
|
|
6465
6753
|
}
|
|
6466
6754
|
}
|
|
6755
|
+
function defaultPropGetter(props, key) {
|
|
6756
|
+
return props[key];
|
|
6757
|
+
}
|
|
6467
6758
|
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
6468
6759
|
const cache = appContext.emitsCache;
|
|
6469
6760
|
const cached = cache.get(comp);
|
|
@@ -6791,7 +7082,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
6791
7082
|
return false;
|
|
6792
7083
|
}
|
|
6793
7084
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
6794
|
-
while (parent) {
|
|
7085
|
+
while (parent && !parent.vapor) {
|
|
6795
7086
|
const root = parent.subTree;
|
|
6796
7087
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
6797
7088
|
root.el = vnode.el;
|
|
@@ -7142,7 +7433,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7142
7433
|
pendingBranch,
|
|
7143
7434
|
container2,
|
|
7144
7435
|
anchor === initialAnchor ? next(activeBranch) : anchor,
|
|
7145
|
-
0
|
|
7436
|
+
0,
|
|
7437
|
+
parentComponent2
|
|
7146
7438
|
);
|
|
7147
7439
|
queuePostFlushCb(effects);
|
|
7148
7440
|
}
|
|
@@ -7155,7 +7447,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7155
7447
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
7156
7448
|
}
|
|
7157
7449
|
if (!delayEnter) {
|
|
7158
|
-
move(
|
|
7450
|
+
move(
|
|
7451
|
+
pendingBranch,
|
|
7452
|
+
container2,
|
|
7453
|
+
anchor,
|
|
7454
|
+
0,
|
|
7455
|
+
parentComponent2
|
|
7456
|
+
);
|
|
7159
7457
|
}
|
|
7160
7458
|
}
|
|
7161
7459
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -7228,7 +7526,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7228
7526
|
}
|
|
7229
7527
|
},
|
|
7230
7528
|
move(container2, anchor2, type) {
|
|
7231
|
-
suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
|
|
7529
|
+
suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type, parentComponent);
|
|
7232
7530
|
suspense.container = container2;
|
|
7233
7531
|
},
|
|
7234
7532
|
next() {
|
|
@@ -7368,7 +7666,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
7368
7666
|
}
|
|
7369
7667
|
return s;
|
|
7370
7668
|
}
|
|
7371
|
-
function queueEffectWithSuspense(fn, suspense) {
|
|
7669
|
+
function queueEffectWithSuspense(fn, id, suspense) {
|
|
7372
7670
|
if (suspense && suspense.pendingBranch) {
|
|
7373
7671
|
if (isArray(fn)) {
|
|
7374
7672
|
suspense.effects.push(...fn);
|
|
@@ -7376,7 +7674,7 @@ function queueEffectWithSuspense(fn, suspense) {
|
|
|
7376
7674
|
suspense.effects.push(fn);
|
|
7377
7675
|
}
|
|
7378
7676
|
} else {
|
|
7379
|
-
queuePostFlushCb(fn);
|
|
7677
|
+
queuePostFlushCb(fn, id);
|
|
7380
7678
|
}
|
|
7381
7679
|
}
|
|
7382
7680
|
function setActiveBranch(suspense, branch) {
|
|
@@ -7402,6 +7700,7 @@ const Fragment = Symbol.for("v-fgt");
|
|
|
7402
7700
|
const Text = Symbol.for("v-txt");
|
|
7403
7701
|
const Comment = Symbol.for("v-cmt");
|
|
7404
7702
|
const Static = Symbol.for("v-stc");
|
|
7703
|
+
const VaporSlot = Symbol.for("v-vps");
|
|
7405
7704
|
const blockStack = [];
|
|
7406
7705
|
let currentBlock = null;
|
|
7407
7706
|
function openBlock(disableTracking = false) {
|
|
@@ -7775,8 +8074,45 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
7775
8074
|
]);
|
|
7776
8075
|
}
|
|
7777
8076
|
|
|
8077
|
+
let currentInstance = null;
|
|
8078
|
+
const getCurrentGenericInstance = () => currentInstance || currentRenderingInstance;
|
|
8079
|
+
const getCurrentInstance = () => currentInstance && !currentInstance.vapor ? currentInstance : currentRenderingInstance;
|
|
8080
|
+
let isInSSRComponentSetup = false;
|
|
8081
|
+
let setInSSRSetupState;
|
|
8082
|
+
let simpleSetCurrentInstance;
|
|
8083
|
+
{
|
|
8084
|
+
const g = getGlobalThis();
|
|
8085
|
+
const registerGlobalSetter = (key, setter) => {
|
|
8086
|
+
let setters;
|
|
8087
|
+
if (!(setters = g[key])) setters = g[key] = [];
|
|
8088
|
+
setters.push(setter);
|
|
8089
|
+
return (v) => {
|
|
8090
|
+
if (setters.length > 1) setters.forEach((set) => set(v));
|
|
8091
|
+
else setters[0](v);
|
|
8092
|
+
};
|
|
8093
|
+
};
|
|
8094
|
+
simpleSetCurrentInstance = registerGlobalSetter(
|
|
8095
|
+
`__VUE_INSTANCE_SETTERS__`,
|
|
8096
|
+
(v) => currentInstance = v
|
|
8097
|
+
);
|
|
8098
|
+
setInSSRSetupState = registerGlobalSetter(
|
|
8099
|
+
`__VUE_SSR_SETTERS__`,
|
|
8100
|
+
(v) => isInSSRComponentSetup = v
|
|
8101
|
+
);
|
|
8102
|
+
}
|
|
8103
|
+
const setCurrentInstance = (instance, scope = instance !== null ? instance.scope : void 0) => {
|
|
8104
|
+
try {
|
|
8105
|
+
return [currentInstance, setCurrentScope(scope)];
|
|
8106
|
+
} finally {
|
|
8107
|
+
simpleSetCurrentInstance(instance);
|
|
8108
|
+
}
|
|
8109
|
+
};
|
|
8110
|
+
|
|
7778
8111
|
const emptyAppContext = createAppContext();
|
|
7779
8112
|
let uid = 0;
|
|
8113
|
+
function nextUid() {
|
|
8114
|
+
return uid++;
|
|
8115
|
+
}
|
|
7780
8116
|
function createComponentInstance(vnode, parent, suspense) {
|
|
7781
8117
|
const type = vnode.type;
|
|
7782
8118
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
@@ -7819,7 +8155,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7819
8155
|
// to be set immediately
|
|
7820
8156
|
emitted: null,
|
|
7821
8157
|
// props default value
|
|
7822
|
-
propsDefaults:
|
|
8158
|
+
propsDefaults: null,
|
|
7823
8159
|
// inheritAttrs
|
|
7824
8160
|
inheritAttrs: type.inheritAttrs,
|
|
7825
8161
|
// state
|
|
@@ -7868,44 +8204,6 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7868
8204
|
}
|
|
7869
8205
|
return instance;
|
|
7870
8206
|
}
|
|
7871
|
-
let currentInstance = null;
|
|
7872
|
-
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
7873
|
-
let internalSetCurrentInstance;
|
|
7874
|
-
let setInSSRSetupState;
|
|
7875
|
-
{
|
|
7876
|
-
const g = getGlobalThis();
|
|
7877
|
-
const registerGlobalSetter = (key, setter) => {
|
|
7878
|
-
let setters;
|
|
7879
|
-
if (!(setters = g[key])) setters = g[key] = [];
|
|
7880
|
-
setters.push(setter);
|
|
7881
|
-
return (v) => {
|
|
7882
|
-
if (setters.length > 1) setters.forEach((set) => set(v));
|
|
7883
|
-
else setters[0](v);
|
|
7884
|
-
};
|
|
7885
|
-
};
|
|
7886
|
-
internalSetCurrentInstance = registerGlobalSetter(
|
|
7887
|
-
`__VUE_INSTANCE_SETTERS__`,
|
|
7888
|
-
(v) => currentInstance = v
|
|
7889
|
-
);
|
|
7890
|
-
setInSSRSetupState = registerGlobalSetter(
|
|
7891
|
-
`__VUE_SSR_SETTERS__`,
|
|
7892
|
-
(v) => isInSSRComponentSetup = v
|
|
7893
|
-
);
|
|
7894
|
-
}
|
|
7895
|
-
const setCurrentInstance = (instance) => {
|
|
7896
|
-
const prev = currentInstance;
|
|
7897
|
-
internalSetCurrentInstance(instance);
|
|
7898
|
-
instance.scope.on();
|
|
7899
|
-
return () => {
|
|
7900
|
-
instance.scope.off();
|
|
7901
|
-
internalSetCurrentInstance(prev);
|
|
7902
|
-
};
|
|
7903
|
-
};
|
|
7904
|
-
const unsetCurrentInstance = () => {
|
|
7905
|
-
currentInstance && currentInstance.scope.off();
|
|
7906
|
-
internalSetCurrentInstance(null);
|
|
7907
|
-
};
|
|
7908
|
-
const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
|
|
7909
8207
|
function validateComponentName(name, { isNativeTag }) {
|
|
7910
8208
|
if (isBuiltInTag(name) || isNativeTag(name)) {
|
|
7911
8209
|
warn$1(
|
|
@@ -7916,13 +8214,16 @@ function validateComponentName(name, { isNativeTag }) {
|
|
|
7916
8214
|
function isStatefulComponent(instance) {
|
|
7917
8215
|
return instance.vnode.shapeFlag & 4;
|
|
7918
8216
|
}
|
|
7919
|
-
let isInSSRComponentSetup = false;
|
|
7920
8217
|
function setupComponent(instance, isSSR = false, optimized = false) {
|
|
7921
8218
|
isSSR && setInSSRSetupState(isSSR);
|
|
7922
|
-
const { props, children } = instance.vnode;
|
|
8219
|
+
const { props, children, vi } = instance.vnode;
|
|
7923
8220
|
const isStateful = isStatefulComponent(instance);
|
|
7924
|
-
|
|
7925
|
-
|
|
8221
|
+
if (vi) {
|
|
8222
|
+
vi(instance);
|
|
8223
|
+
} else {
|
|
8224
|
+
initProps(instance, props, isStateful, isSSR);
|
|
8225
|
+
initSlots(instance, children, optimized || isSSR);
|
|
8226
|
+
}
|
|
7926
8227
|
const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
|
|
7927
8228
|
isSSR && setInSSRSetupState(false);
|
|
7928
8229
|
return setupResult;
|
|
@@ -7959,9 +8260,9 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7959
8260
|
}
|
|
7960
8261
|
const { setup } = Component;
|
|
7961
8262
|
if (setup) {
|
|
7962
|
-
|
|
8263
|
+
const prevSub = setActiveSub();
|
|
7963
8264
|
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
7964
|
-
const
|
|
8265
|
+
const prev = setCurrentInstance(instance);
|
|
7965
8266
|
const setupResult = callWithErrorHandling(
|
|
7966
8267
|
setup,
|
|
7967
8268
|
instance,
|
|
@@ -7972,12 +8273,15 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7972
8273
|
]
|
|
7973
8274
|
);
|
|
7974
8275
|
const isAsyncSetup = isPromise(setupResult);
|
|
7975
|
-
|
|
7976
|
-
|
|
8276
|
+
setActiveSub(prevSub);
|
|
8277
|
+
setCurrentInstance(...prev);
|
|
7977
8278
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
7978
8279
|
markAsyncBoundary(instance);
|
|
7979
8280
|
}
|
|
7980
8281
|
if (isAsyncSetup) {
|
|
8282
|
+
const unsetCurrentInstance = () => {
|
|
8283
|
+
setCurrentInstance(null, void 0);
|
|
8284
|
+
};
|
|
7981
8285
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
7982
8286
|
if (isSSR) {
|
|
7983
8287
|
return setupResult.then((resolvedResult) => {
|
|
@@ -8072,13 +8376,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
8072
8376
|
}
|
|
8073
8377
|
}
|
|
8074
8378
|
if (__VUE_OPTIONS_API__ && true) {
|
|
8075
|
-
const
|
|
8076
|
-
|
|
8379
|
+
const prevInstance = setCurrentInstance(instance);
|
|
8380
|
+
const prevSub = setActiveSub();
|
|
8077
8381
|
try {
|
|
8078
8382
|
applyOptions(instance);
|
|
8079
8383
|
} finally {
|
|
8080
|
-
|
|
8081
|
-
|
|
8384
|
+
setActiveSub(prevSub);
|
|
8385
|
+
setCurrentInstance(...prevInstance);
|
|
8082
8386
|
}
|
|
8083
8387
|
}
|
|
8084
8388
|
if (!!(process.env.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR) {
|
|
@@ -8120,29 +8424,6 @@ function getSlotsProxy(instance) {
|
|
|
8120
8424
|
});
|
|
8121
8425
|
}
|
|
8122
8426
|
function createSetupContext(instance) {
|
|
8123
|
-
const expose = (exposed) => {
|
|
8124
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
8125
|
-
if (instance.exposed) {
|
|
8126
|
-
warn$1(`expose() should be called only once per setup().`);
|
|
8127
|
-
}
|
|
8128
|
-
if (exposed != null) {
|
|
8129
|
-
let exposedType = typeof exposed;
|
|
8130
|
-
if (exposedType === "object") {
|
|
8131
|
-
if (isArray(exposed)) {
|
|
8132
|
-
exposedType = "array";
|
|
8133
|
-
} else if (isRef(exposed)) {
|
|
8134
|
-
exposedType = "ref";
|
|
8135
|
-
}
|
|
8136
|
-
}
|
|
8137
|
-
if (exposedType !== "object") {
|
|
8138
|
-
warn$1(
|
|
8139
|
-
`expose() should be passed a plain object, received ${exposedType}.`
|
|
8140
|
-
);
|
|
8141
|
-
}
|
|
8142
|
-
}
|
|
8143
|
-
}
|
|
8144
|
-
instance.exposed = exposed || {};
|
|
8145
|
-
};
|
|
8146
8427
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
8147
8428
|
let attrsProxy;
|
|
8148
8429
|
let slotsProxy;
|
|
@@ -8156,17 +8437,40 @@ function createSetupContext(instance) {
|
|
|
8156
8437
|
get emit() {
|
|
8157
8438
|
return (event, ...args) => instance.emit(event, ...args);
|
|
8158
8439
|
},
|
|
8159
|
-
expose
|
|
8440
|
+
expose: (exposed) => expose(instance, exposed)
|
|
8160
8441
|
});
|
|
8161
8442
|
} else {
|
|
8162
8443
|
return {
|
|
8163
8444
|
attrs: new Proxy(instance.attrs, attrsProxyHandlers),
|
|
8164
8445
|
slots: instance.slots,
|
|
8165
8446
|
emit: instance.emit,
|
|
8166
|
-
expose
|
|
8447
|
+
expose: (exposed) => expose(instance, exposed)
|
|
8167
8448
|
};
|
|
8168
8449
|
}
|
|
8169
8450
|
}
|
|
8451
|
+
function expose(instance, exposed) {
|
|
8452
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
8453
|
+
if (instance.exposed) {
|
|
8454
|
+
warn$1(`expose() should be called only once per setup().`);
|
|
8455
|
+
}
|
|
8456
|
+
if (exposed != null) {
|
|
8457
|
+
let exposedType = typeof exposed;
|
|
8458
|
+
if (exposedType === "object") {
|
|
8459
|
+
if (isArray(exposed)) {
|
|
8460
|
+
exposedType = "array";
|
|
8461
|
+
} else if (isRef(exposed)) {
|
|
8462
|
+
exposedType = "ref";
|
|
8463
|
+
}
|
|
8464
|
+
}
|
|
8465
|
+
if (exposedType !== "object") {
|
|
8466
|
+
warn$1(
|
|
8467
|
+
`expose() should be passed a plain object, received ${exposedType}.`
|
|
8468
|
+
);
|
|
8469
|
+
}
|
|
8470
|
+
}
|
|
8471
|
+
}
|
|
8472
|
+
instance.exposed = exposed || {};
|
|
8473
|
+
}
|
|
8170
8474
|
function getComponentPublicInstance(instance) {
|
|
8171
8475
|
if (instance.exposed) {
|
|
8172
8476
|
return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
@@ -8174,7 +8478,9 @@ function getComponentPublicInstance(instance) {
|
|
|
8174
8478
|
if (key in target) {
|
|
8175
8479
|
return target[key];
|
|
8176
8480
|
} else if (key in publicPropertiesMap) {
|
|
8177
|
-
return publicPropertiesMap[key](
|
|
8481
|
+
return publicPropertiesMap[key](
|
|
8482
|
+
instance
|
|
8483
|
+
);
|
|
8178
8484
|
}
|
|
8179
8485
|
},
|
|
8180
8486
|
has(target, key) {
|
|
@@ -8217,14 +8523,7 @@ function isClassComponent(value) {
|
|
|
8217
8523
|
}
|
|
8218
8524
|
|
|
8219
8525
|
const computed = (getterOrOptions, debugOptions) => {
|
|
8220
|
-
|
|
8221
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
8222
|
-
const i = getCurrentInstance();
|
|
8223
|
-
if (i && i.appContext.config.warnRecursiveComputed) {
|
|
8224
|
-
c._warnRecursive = true;
|
|
8225
|
-
}
|
|
8226
|
-
}
|
|
8227
|
-
return c;
|
|
8526
|
+
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
8228
8527
|
};
|
|
8229
8528
|
|
|
8230
8529
|
function h(type, propsOrChildren, children) {
|
|
@@ -8265,9 +8564,9 @@ function initCustomFormatter() {
|
|
|
8265
8564
|
if (obj.__isVue) {
|
|
8266
8565
|
return ["div", vueStyle, `VueInstance`];
|
|
8267
8566
|
} else if (isRef(obj)) {
|
|
8268
|
-
|
|
8567
|
+
const prevSub = setActiveSub();
|
|
8269
8568
|
const value = obj.value;
|
|
8270
|
-
|
|
8569
|
+
setActiveSub(prevSub);
|
|
8271
8570
|
return [
|
|
8272
8571
|
"div",
|
|
8273
8572
|
{},
|
|
@@ -8454,7 +8753,7 @@ function isMemoSame(cached, memo) {
|
|
|
8454
8753
|
return true;
|
|
8455
8754
|
}
|
|
8456
8755
|
|
|
8457
|
-
const version = "3.
|
|
8756
|
+
const version = "3.6.0-alpha.2";
|
|
8458
8757
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
8459
8758
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8460
8759
|
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
|
@@ -8476,4 +8775,4 @@ const resolveFilter = null;
|
|
|
8476
8775
|
const compatUtils = null;
|
|
8477
8776
|
const DeprecationTypes = null;
|
|
8478
8777
|
|
|
8479
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, Static, Suspense, Teleport, Text, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, computed, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeModels, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, queuePostFlushCb, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, ssrContextKey, ssrUtils, toHandlers, transformVNodeArgs, useAttrs, useId, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
|
8778
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MoveType, Static, Suspense, Teleport, Text, assertNumber, baseEmit, baseNormalizePropsOptions, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, computed, createAppAPI, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, endMeasure, expose, flushOnAppMount, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, isEmitListener, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, popWarningContext, provide, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTransitionHooks, setBlockTracking, setCurrentInstance, setDevtoolsHook, setTransitionHooks, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, toHandlers, transformVNodeArgs, unregisterHMR, useAttrs, useId, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|