@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
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
**/
|
|
@@ -11,8 +11,8 @@ var reactivity = require('@vue/reactivity');
|
|
|
11
11
|
var shared = require('@vue/shared');
|
|
12
12
|
|
|
13
13
|
const stack = [];
|
|
14
|
-
function pushWarningContext(
|
|
15
|
-
stack.push(
|
|
14
|
+
function pushWarningContext(ctx) {
|
|
15
|
+
stack.push(ctx);
|
|
16
16
|
}
|
|
17
17
|
function popWarningContext() {
|
|
18
18
|
stack.pop();
|
|
@@ -21,8 +21,9 @@ let isWarning = false;
|
|
|
21
21
|
function warn$1(msg, ...args) {
|
|
22
22
|
if (isWarning) return;
|
|
23
23
|
isWarning = true;
|
|
24
|
-
reactivity.
|
|
25
|
-
const
|
|
24
|
+
const prevSub = reactivity.setActiveSub();
|
|
25
|
+
const entry = stack.length ? stack[stack.length - 1] : null;
|
|
26
|
+
const instance = isVNode(entry) ? entry.component : entry;
|
|
26
27
|
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
27
28
|
const trace = getComponentTrace();
|
|
28
29
|
if (appWarnHandler) {
|
|
@@ -36,9 +37,9 @@ function warn$1(msg, ...args) {
|
|
|
36
37
|
var _a, _b;
|
|
37
38
|
return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
|
|
38
39
|
}).join(""),
|
|
39
|
-
instance && instance.proxy,
|
|
40
|
+
instance && instance.proxy || instance,
|
|
40
41
|
trace.map(
|
|
41
|
-
({
|
|
42
|
+
({ ctx }) => `at <${formatComponentName(instance, ctx.type)}>`
|
|
42
43
|
).join("\n"),
|
|
43
44
|
trace
|
|
44
45
|
]
|
|
@@ -52,27 +53,31 @@ function warn$1(msg, ...args) {
|
|
|
52
53
|
}
|
|
53
54
|
console.warn(...warnArgs);
|
|
54
55
|
}
|
|
55
|
-
reactivity.
|
|
56
|
+
reactivity.setActiveSub(prevSub);
|
|
56
57
|
isWarning = false;
|
|
57
58
|
}
|
|
58
59
|
function getComponentTrace() {
|
|
59
|
-
let
|
|
60
|
-
if (!
|
|
60
|
+
let currentCtx = stack[stack.length - 1];
|
|
61
|
+
if (!currentCtx) {
|
|
61
62
|
return [];
|
|
62
63
|
}
|
|
63
64
|
const normalizedStack = [];
|
|
64
|
-
while (
|
|
65
|
+
while (currentCtx) {
|
|
65
66
|
const last = normalizedStack[0];
|
|
66
|
-
if (last && last.
|
|
67
|
+
if (last && last.ctx === currentCtx) {
|
|
67
68
|
last.recurseCount++;
|
|
68
69
|
} else {
|
|
69
70
|
normalizedStack.push({
|
|
70
|
-
|
|
71
|
+
ctx: currentCtx,
|
|
71
72
|
recurseCount: 0
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
if (isVNode(currentCtx)) {
|
|
76
|
+
const parent = currentCtx.component && currentCtx.component.parent;
|
|
77
|
+
currentCtx = parent && parent.vnode || parent;
|
|
78
|
+
} else {
|
|
79
|
+
currentCtx = currentCtx.parent;
|
|
80
|
+
}
|
|
76
81
|
}
|
|
77
82
|
return normalizedStack;
|
|
78
83
|
}
|
|
@@ -84,16 +89,13 @@ function formatTrace(trace) {
|
|
|
84
89
|
});
|
|
85
90
|
return logs;
|
|
86
91
|
}
|
|
87
|
-
function formatTraceEntry({
|
|
92
|
+
function formatTraceEntry({ ctx, recurseCount }) {
|
|
88
93
|
const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
vnode.type,
|
|
93
|
-
isRoot
|
|
94
|
-
)}`;
|
|
94
|
+
const instance = isVNode(ctx) ? ctx.component : ctx;
|
|
95
|
+
const isRoot = instance ? instance.parent == null : false;
|
|
96
|
+
const open = ` at <${formatComponentName(instance, ctx.type, isRoot)}`;
|
|
95
97
|
const close = `>` + postfix;
|
|
96
|
-
return
|
|
98
|
+
return ctx.props ? [open, ...formatProps(ctx.props), close] : [open + close];
|
|
97
99
|
}
|
|
98
100
|
function formatProps(props) {
|
|
99
101
|
const res = [];
|
|
@@ -225,11 +227,10 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
225
227
|
}
|
|
226
228
|
}
|
|
227
229
|
function handleError(err, instance, type, throwInDev = true) {
|
|
228
|
-
const contextVNode = instance ? instance.vnode : null;
|
|
229
230
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ;
|
|
230
231
|
if (instance) {
|
|
231
232
|
let cur = instance.parent;
|
|
232
|
-
const exposedInstance = instance.proxy;
|
|
233
|
+
const exposedInstance = instance.proxy || instance;
|
|
233
234
|
const errorInfo = ErrorTypeStrings$1[type] ;
|
|
234
235
|
while (cur) {
|
|
235
236
|
const errorCapturedHooks = cur.ec;
|
|
@@ -243,26 +244,26 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
243
244
|
cur = cur.parent;
|
|
244
245
|
}
|
|
245
246
|
if (errorHandler) {
|
|
246
|
-
reactivity.
|
|
247
|
+
const prevSub = reactivity.setActiveSub();
|
|
247
248
|
callWithErrorHandling(errorHandler, null, 10, [
|
|
248
249
|
err,
|
|
249
250
|
exposedInstance,
|
|
250
251
|
errorInfo
|
|
251
252
|
]);
|
|
252
|
-
reactivity.
|
|
253
|
+
reactivity.setActiveSub(prevSub);
|
|
253
254
|
return;
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
|
-
logError(err, type,
|
|
257
|
+
logError(err, type, instance, throwInDev, throwUnhandledErrorInProduction);
|
|
257
258
|
}
|
|
258
|
-
function logError(err, type,
|
|
259
|
+
function logError(err, type, instance, throwInDev = true, throwInProd = false) {
|
|
259
260
|
{
|
|
260
261
|
const info = ErrorTypeStrings$1[type];
|
|
261
|
-
if (
|
|
262
|
-
pushWarningContext(
|
|
262
|
+
if (instance) {
|
|
263
|
+
pushWarningContext(instance);
|
|
263
264
|
}
|
|
264
265
|
warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
265
|
-
if (
|
|
266
|
+
if (instance) {
|
|
266
267
|
popWarningContext();
|
|
267
268
|
}
|
|
268
269
|
if (throwInDev) {
|
|
@@ -273,26 +274,23 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
|
|
|
273
274
|
}
|
|
274
275
|
}
|
|
275
276
|
|
|
276
|
-
const
|
|
277
|
-
let
|
|
278
|
-
|
|
279
|
-
let
|
|
277
|
+
const jobs = [];
|
|
278
|
+
let postJobs = [];
|
|
279
|
+
let activePostJobs = null;
|
|
280
|
+
let currentFlushPromise = null;
|
|
281
|
+
let jobsLength = 0;
|
|
282
|
+
let flushIndex = 0;
|
|
280
283
|
let postFlushIndex = 0;
|
|
281
284
|
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
|
|
282
|
-
let currentFlushPromise = null;
|
|
283
285
|
const RECURSION_LIMIT = 100;
|
|
284
286
|
function nextTick(fn) {
|
|
285
287
|
const p = currentFlushPromise || resolvedPromise;
|
|
286
288
|
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
287
289
|
}
|
|
288
|
-
function findInsertionIndex(
|
|
289
|
-
let start = flushIndex + 1;
|
|
290
|
-
let end = queue.length;
|
|
290
|
+
function findInsertionIndex(order, queue, start, end) {
|
|
291
291
|
while (start < end) {
|
|
292
292
|
const middle = start + end >>> 1;
|
|
293
|
-
|
|
294
|
-
const middleJobId = getId(middleJob);
|
|
295
|
-
if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
|
|
293
|
+
if (queue[middle].order <= order) {
|
|
296
294
|
start = middle + 1;
|
|
297
295
|
} else {
|
|
298
296
|
end = middle;
|
|
@@ -300,130 +298,168 @@ function findInsertionIndex(id) {
|
|
|
300
298
|
}
|
|
301
299
|
return start;
|
|
302
300
|
}
|
|
303
|
-
function queueJob(job) {
|
|
304
|
-
if (
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
301
|
+
function queueJob(job, id, isPre = false) {
|
|
302
|
+
if (queueJobWorker(
|
|
303
|
+
job,
|
|
304
|
+
id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1,
|
|
305
|
+
jobs,
|
|
306
|
+
jobsLength,
|
|
307
|
+
flushIndex
|
|
308
|
+
)) {
|
|
309
|
+
jobsLength++;
|
|
310
|
+
queueFlush();
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
function queueJobWorker(job, order, queue, length, flushIndex2) {
|
|
314
|
+
const flags = job.flags;
|
|
315
|
+
if (!(flags & 1)) {
|
|
316
|
+
job.flags = flags | 1;
|
|
317
|
+
job.order = order;
|
|
318
|
+
if (flushIndex2 === length || // fast path when the job id is larger than the tail
|
|
319
|
+
order >= queue[length - 1].order) {
|
|
320
|
+
queue[length] = job;
|
|
310
321
|
} else {
|
|
311
|
-
queue.splice(findInsertionIndex(
|
|
322
|
+
queue.splice(findInsertionIndex(order, queue, flushIndex2, length), 0, job);
|
|
312
323
|
}
|
|
313
|
-
|
|
314
|
-
queueFlush();
|
|
324
|
+
return true;
|
|
315
325
|
}
|
|
326
|
+
return false;
|
|
316
327
|
}
|
|
328
|
+
const doFlushJobs = () => {
|
|
329
|
+
try {
|
|
330
|
+
flushJobs();
|
|
331
|
+
} catch (e) {
|
|
332
|
+
currentFlushPromise = null;
|
|
333
|
+
throw e;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
317
336
|
function queueFlush() {
|
|
318
337
|
if (!currentFlushPromise) {
|
|
319
|
-
currentFlushPromise = resolvedPromise.then(
|
|
338
|
+
currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
320
339
|
}
|
|
321
340
|
}
|
|
322
|
-
function queuePostFlushCb(
|
|
323
|
-
if (!shared.isArray(
|
|
324
|
-
if (
|
|
325
|
-
|
|
326
|
-
} else
|
|
327
|
-
|
|
328
|
-
cb.flags |= 1;
|
|
341
|
+
function queuePostFlushCb(jobs2, id = Infinity) {
|
|
342
|
+
if (!shared.isArray(jobs2)) {
|
|
343
|
+
if (activePostJobs && id === -1) {
|
|
344
|
+
activePostJobs.splice(postFlushIndex, 0, jobs2);
|
|
345
|
+
} else {
|
|
346
|
+
queueJobWorker(jobs2, id, postJobs, postJobs.length, 0);
|
|
329
347
|
}
|
|
330
348
|
} else {
|
|
331
|
-
|
|
349
|
+
for (const job of jobs2) {
|
|
350
|
+
queueJobWorker(job, id, postJobs, postJobs.length, 0);
|
|
351
|
+
}
|
|
332
352
|
}
|
|
333
353
|
queueFlush();
|
|
334
354
|
}
|
|
335
|
-
function flushPreFlushCbs(instance, seen
|
|
355
|
+
function flushPreFlushCbs(instance, seen) {
|
|
336
356
|
{
|
|
337
357
|
seen = seen || /* @__PURE__ */ new Map();
|
|
338
358
|
}
|
|
339
|
-
for (; i <
|
|
340
|
-
const cb =
|
|
341
|
-
if (cb
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
359
|
+
for (let i = flushIndex; i < jobsLength; i++) {
|
|
360
|
+
const cb = jobs[i];
|
|
361
|
+
if (cb.order & 1 || cb.order === Infinity) {
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
if (instance && cb.order !== instance.uid * 2) {
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
if (checkRecursiveUpdates(seen, cb)) {
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
jobs.splice(i, 1);
|
|
371
|
+
i--;
|
|
372
|
+
jobsLength--;
|
|
373
|
+
if (cb.flags & 2) {
|
|
374
|
+
cb.flags &= -2;
|
|
375
|
+
}
|
|
376
|
+
cb();
|
|
377
|
+
if (!(cb.flags & 2)) {
|
|
378
|
+
cb.flags &= -2;
|
|
357
379
|
}
|
|
358
380
|
}
|
|
359
381
|
}
|
|
360
382
|
function flushPostFlushCbs(seen) {
|
|
361
|
-
if (
|
|
362
|
-
|
|
363
|
-
(
|
|
364
|
-
|
|
365
|
-
pendingPostFlushCbs.length = 0;
|
|
366
|
-
if (activePostFlushCbs) {
|
|
367
|
-
activePostFlushCbs.push(...deduped);
|
|
383
|
+
if (postJobs.length) {
|
|
384
|
+
if (activePostJobs) {
|
|
385
|
+
activePostJobs.push(...postJobs);
|
|
386
|
+
postJobs.length = 0;
|
|
368
387
|
return;
|
|
369
388
|
}
|
|
370
|
-
|
|
389
|
+
activePostJobs = postJobs;
|
|
390
|
+
postJobs = [];
|
|
371
391
|
{
|
|
372
392
|
seen = seen || /* @__PURE__ */ new Map();
|
|
373
393
|
}
|
|
374
|
-
|
|
375
|
-
const cb =
|
|
394
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
395
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
376
396
|
if (checkRecursiveUpdates(seen, cb)) {
|
|
377
397
|
continue;
|
|
378
398
|
}
|
|
379
|
-
if (cb.flags &
|
|
399
|
+
if (cb.flags & 2) {
|
|
380
400
|
cb.flags &= -2;
|
|
381
401
|
}
|
|
382
|
-
if (!(cb.flags &
|
|
383
|
-
|
|
402
|
+
if (!(cb.flags & 4)) {
|
|
403
|
+
try {
|
|
404
|
+
cb();
|
|
405
|
+
} finally {
|
|
406
|
+
cb.flags &= -2;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
384
409
|
}
|
|
385
|
-
|
|
410
|
+
activePostJobs = null;
|
|
386
411
|
postFlushIndex = 0;
|
|
387
412
|
}
|
|
388
413
|
}
|
|
389
|
-
|
|
414
|
+
let isFlushing = false;
|
|
415
|
+
function flushOnAppMount() {
|
|
416
|
+
if (!isFlushing) {
|
|
417
|
+
isFlushing = true;
|
|
418
|
+
flushPreFlushCbs();
|
|
419
|
+
flushPostFlushCbs();
|
|
420
|
+
isFlushing = false;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
390
423
|
function flushJobs(seen) {
|
|
391
424
|
{
|
|
392
|
-
seen
|
|
425
|
+
seen || (seen = /* @__PURE__ */ new Map());
|
|
393
426
|
}
|
|
394
|
-
const check = (job) => checkRecursiveUpdates(seen, job) ;
|
|
395
427
|
try {
|
|
396
|
-
|
|
397
|
-
const job =
|
|
398
|
-
|
|
399
|
-
|
|
428
|
+
while (flushIndex < jobsLength) {
|
|
429
|
+
const job = jobs[flushIndex];
|
|
430
|
+
jobs[flushIndex++] = void 0;
|
|
431
|
+
if (!(job.flags & 4)) {
|
|
432
|
+
if (checkRecursiveUpdates(seen, job)) {
|
|
400
433
|
continue;
|
|
401
434
|
}
|
|
402
|
-
if (job.flags &
|
|
435
|
+
if (job.flags & 2) {
|
|
403
436
|
job.flags &= ~1;
|
|
404
437
|
}
|
|
405
|
-
|
|
406
|
-
job
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
438
|
+
try {
|
|
439
|
+
job();
|
|
440
|
+
} catch (err) {
|
|
441
|
+
handleError(
|
|
442
|
+
err,
|
|
443
|
+
job.i,
|
|
444
|
+
job.i ? 15 : 14
|
|
445
|
+
);
|
|
446
|
+
} finally {
|
|
447
|
+
if (!(job.flags & 2)) {
|
|
448
|
+
job.flags &= ~1;
|
|
449
|
+
}
|
|
412
450
|
}
|
|
413
451
|
}
|
|
414
452
|
}
|
|
415
453
|
} finally {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
job.flags &= -2;
|
|
420
|
-
}
|
|
454
|
+
while (flushIndex < jobsLength) {
|
|
455
|
+
jobs[flushIndex].flags &= -2;
|
|
456
|
+
jobs[flushIndex++] = void 0;
|
|
421
457
|
}
|
|
422
|
-
flushIndex =
|
|
423
|
-
|
|
458
|
+
flushIndex = 0;
|
|
459
|
+
jobsLength = 0;
|
|
424
460
|
flushPostFlushCbs(seen);
|
|
425
461
|
currentFlushPromise = null;
|
|
426
|
-
if (
|
|
462
|
+
if (jobsLength || postJobs.length) {
|
|
427
463
|
flushJobs(seen);
|
|
428
464
|
}
|
|
429
465
|
}
|
|
@@ -490,10 +526,17 @@ function rerender(id, newRender) {
|
|
|
490
526
|
instance.render = newRender;
|
|
491
527
|
normalizeClassComponent(instance.type).render = newRender;
|
|
492
528
|
}
|
|
493
|
-
instance.renderCache = [];
|
|
494
529
|
isHmrUpdating = true;
|
|
495
|
-
instance.
|
|
496
|
-
|
|
530
|
+
if (instance.vapor) {
|
|
531
|
+
instance.hmrRerender();
|
|
532
|
+
} else {
|
|
533
|
+
const i = instance;
|
|
534
|
+
i.renderCache = [];
|
|
535
|
+
i.effect.run();
|
|
536
|
+
}
|
|
537
|
+
nextTick(() => {
|
|
538
|
+
isHmrUpdating = false;
|
|
539
|
+
});
|
|
497
540
|
});
|
|
498
541
|
}
|
|
499
542
|
function reload(id, newComp) {
|
|
@@ -502,42 +545,54 @@ function reload(id, newComp) {
|
|
|
502
545
|
newComp = normalizeClassComponent(newComp);
|
|
503
546
|
updateComponentDef(record.initialDef, newComp);
|
|
504
547
|
const instances = [...record.instances];
|
|
505
|
-
|
|
506
|
-
const instance
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
if (instance.ceReload) {
|
|
548
|
+
if (newComp.__vapor) {
|
|
549
|
+
for (const instance of instances) {
|
|
550
|
+
instance.hmrReload(newComp);
|
|
551
|
+
}
|
|
552
|
+
} else {
|
|
553
|
+
for (const instance of instances) {
|
|
554
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
555
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
556
|
+
if (!dirtyInstances) {
|
|
557
|
+
if (oldComp !== record.initialDef) {
|
|
558
|
+
updateComponentDef(oldComp, newComp);
|
|
559
|
+
}
|
|
560
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
561
|
+
}
|
|
520
562
|
dirtyInstances.add(instance);
|
|
521
|
-
instance.
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
instance.
|
|
527
|
-
isHmrUpdating = false;
|
|
563
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
564
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
565
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
566
|
+
if (instance.ceReload) {
|
|
567
|
+
dirtyInstances.add(instance);
|
|
568
|
+
instance.ceReload(newComp.styles);
|
|
528
569
|
dirtyInstances.delete(instance);
|
|
529
|
-
})
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
570
|
+
} else if (instance.parent) {
|
|
571
|
+
queueJob(() => {
|
|
572
|
+
isHmrUpdating = true;
|
|
573
|
+
const parent = instance.parent;
|
|
574
|
+
if (parent.vapor) {
|
|
575
|
+
parent.hmrRerender();
|
|
576
|
+
} else {
|
|
577
|
+
parent.effect.run();
|
|
578
|
+
}
|
|
579
|
+
nextTick(() => {
|
|
580
|
+
isHmrUpdating = false;
|
|
581
|
+
});
|
|
582
|
+
dirtyInstances.delete(instance);
|
|
583
|
+
});
|
|
584
|
+
} else if (instance.appContext.reload) {
|
|
585
|
+
instance.appContext.reload();
|
|
586
|
+
} else if (typeof window !== "undefined") {
|
|
587
|
+
window.location.reload();
|
|
588
|
+
} else {
|
|
589
|
+
console.warn(
|
|
590
|
+
"[HMR] Root or manually mounted instance modified. Full reload required."
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
if (instance.root.ce && instance !== instance.root) {
|
|
594
|
+
instance.root.ce._removeChildStyle(oldComp);
|
|
595
|
+
}
|
|
541
596
|
}
|
|
542
597
|
}
|
|
543
598
|
queuePostFlushCb(() => {
|
|
@@ -750,14 +805,14 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
750
805
|
}
|
|
751
806
|
let hook = binding.dir[name];
|
|
752
807
|
if (hook) {
|
|
753
|
-
reactivity.
|
|
808
|
+
const prevSub = reactivity.setActiveSub();
|
|
754
809
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
755
810
|
vnode.el,
|
|
756
811
|
binding,
|
|
757
812
|
vnode,
|
|
758
813
|
prevVNode
|
|
759
814
|
]);
|
|
760
|
-
reactivity.
|
|
815
|
+
reactivity.setActiveSub(prevSub);
|
|
761
816
|
}
|
|
762
817
|
}
|
|
763
818
|
}
|
|
@@ -857,29 +912,37 @@ const TeleportImpl = {
|
|
|
857
912
|
}
|
|
858
913
|
if (isTeleportDeferred(n2.props)) {
|
|
859
914
|
n2.el.__isMounted = false;
|
|
860
|
-
queuePostRenderEffect(
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
915
|
+
queuePostRenderEffect(
|
|
916
|
+
() => {
|
|
917
|
+
mountToTarget();
|
|
918
|
+
delete n2.el.__isMounted;
|
|
919
|
+
},
|
|
920
|
+
void 0,
|
|
921
|
+
parentSuspense
|
|
922
|
+
);
|
|
864
923
|
} else {
|
|
865
924
|
mountToTarget();
|
|
866
925
|
}
|
|
867
926
|
} else {
|
|
868
927
|
if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
|
|
869
|
-
queuePostRenderEffect(
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
928
|
+
queuePostRenderEffect(
|
|
929
|
+
() => {
|
|
930
|
+
TeleportImpl.process(
|
|
931
|
+
n1,
|
|
932
|
+
n2,
|
|
933
|
+
container,
|
|
934
|
+
anchor,
|
|
935
|
+
parentComponent,
|
|
936
|
+
parentSuspense,
|
|
937
|
+
namespace,
|
|
938
|
+
slotScopeIds,
|
|
939
|
+
optimized,
|
|
940
|
+
internals
|
|
941
|
+
);
|
|
942
|
+
},
|
|
943
|
+
void 0,
|
|
944
|
+
parentSuspense
|
|
945
|
+
);
|
|
883
946
|
return;
|
|
884
947
|
}
|
|
885
948
|
n2.el = n1.el;
|
|
@@ -926,6 +989,7 @@ const TeleportImpl = {
|
|
|
926
989
|
container,
|
|
927
990
|
mainAnchor,
|
|
928
991
|
internals,
|
|
992
|
+
parentComponent,
|
|
929
993
|
1
|
|
930
994
|
);
|
|
931
995
|
} else {
|
|
@@ -945,6 +1009,7 @@ const TeleportImpl = {
|
|
|
945
1009
|
nextTarget,
|
|
946
1010
|
null,
|
|
947
1011
|
internals,
|
|
1012
|
+
parentComponent,
|
|
948
1013
|
0
|
|
949
1014
|
);
|
|
950
1015
|
} else {
|
|
@@ -960,6 +1025,7 @@ const TeleportImpl = {
|
|
|
960
1025
|
target,
|
|
961
1026
|
targetAnchor,
|
|
962
1027
|
internals,
|
|
1028
|
+
parentComponent,
|
|
963
1029
|
1
|
|
964
1030
|
);
|
|
965
1031
|
}
|
|
@@ -999,7 +1065,7 @@ const TeleportImpl = {
|
|
|
999
1065
|
move: moveTeleport,
|
|
1000
1066
|
hydrate: hydrateTeleport
|
|
1001
1067
|
};
|
|
1002
|
-
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
|
|
1068
|
+
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
|
|
1003
1069
|
if (moveType === 0) {
|
|
1004
1070
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
1005
1071
|
}
|
|
@@ -1015,7 +1081,8 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
1015
1081
|
children[i],
|
|
1016
1082
|
container,
|
|
1017
1083
|
parentAnchor,
|
|
1018
|
-
2
|
|
1084
|
+
2,
|
|
1085
|
+
parentComponent
|
|
1019
1086
|
);
|
|
1020
1087
|
}
|
|
1021
1088
|
}
|
|
@@ -1200,7 +1267,7 @@ const BaseTransitionImpl = {
|
|
|
1200
1267
|
state.isLeaving = true;
|
|
1201
1268
|
leavingHooks.afterLeave = () => {
|
|
1202
1269
|
state.isLeaving = false;
|
|
1203
|
-
if (!(instance.job.flags &
|
|
1270
|
+
if (!(instance.job.flags & 4)) {
|
|
1204
1271
|
instance.update();
|
|
1205
1272
|
}
|
|
1206
1273
|
delete leavingHooks.afterLeave;
|
|
@@ -1479,7 +1546,7 @@ function defineComponent(options, extraOptions) {
|
|
|
1479
1546
|
}
|
|
1480
1547
|
|
|
1481
1548
|
function useId() {
|
|
1482
|
-
const i =
|
|
1549
|
+
const i = getCurrentGenericInstance();
|
|
1483
1550
|
if (i) {
|
|
1484
1551
|
return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
|
|
1485
1552
|
} else {
|
|
@@ -1495,7 +1562,7 @@ function markAsyncBoundary(instance) {
|
|
|
1495
1562
|
|
|
1496
1563
|
const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
|
|
1497
1564
|
function useTemplateRef(key) {
|
|
1498
|
-
const i =
|
|
1565
|
+
const i = getCurrentGenericInstance();
|
|
1499
1566
|
const r = reactivity.shallowRef(null);
|
|
1500
1567
|
if (i) {
|
|
1501
1568
|
const refs = i.refs === shared.EMPTY_OBJ ? i.refs = {} : i.refs;
|
|
@@ -1615,8 +1682,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1615
1682
|
}
|
|
1616
1683
|
};
|
|
1617
1684
|
if (value) {
|
|
1618
|
-
doSet
|
|
1619
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
1685
|
+
queuePostRenderEffect(doSet, -1, parentSuspense);
|
|
1620
1686
|
} else {
|
|
1621
1687
|
doSet();
|
|
1622
1688
|
}
|
|
@@ -1784,6 +1850,9 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1784
1850
|
);
|
|
1785
1851
|
}
|
|
1786
1852
|
} else if (shapeFlag & 6) {
|
|
1853
|
+
if (vnode.type.__vapor) {
|
|
1854
|
+
throw new Error("Vapor component hydration is not supported yet.");
|
|
1855
|
+
}
|
|
1787
1856
|
vnode.slotScopeIds = slotScopeIds;
|
|
1788
1857
|
const container = parentNode(node);
|
|
1789
1858
|
if (isFragmentStart) {
|
|
@@ -1945,11 +2014,15 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
1945
2014
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
1946
2015
|
}
|
|
1947
2016
|
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
1948
|
-
queueEffectWithSuspense(
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
2017
|
+
queueEffectWithSuspense(
|
|
2018
|
+
() => {
|
|
2019
|
+
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
2020
|
+
needCallTransitionHooks && transition.enter(el);
|
|
2021
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
2022
|
+
},
|
|
2023
|
+
void 0,
|
|
2024
|
+
parentSuspense
|
|
2025
|
+
);
|
|
1953
2026
|
}
|
|
1954
2027
|
}
|
|
1955
2028
|
return el.nextSibling;
|
|
@@ -2229,14 +2302,16 @@ function resolveCssVars(instance, vnode, expectedMap) {
|
|
|
2229
2302
|
if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
|
|
2230
2303
|
const cssVars = instance.getCssVars();
|
|
2231
2304
|
for (const key in cssVars) {
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
String(cssVars[key])
|
|
2235
|
-
);
|
|
2305
|
+
const value = shared.normalizeCssVarValue(cssVars[key]);
|
|
2306
|
+
expectedMap.set(`--${shared.getEscapedCssVarName(key, false)}`, value);
|
|
2236
2307
|
}
|
|
2237
2308
|
}
|
|
2238
2309
|
if (vnode === root && instance.parent) {
|
|
2239
|
-
resolveCssVars(
|
|
2310
|
+
resolveCssVars(
|
|
2311
|
+
instance.parent,
|
|
2312
|
+
instance.vnode,
|
|
2313
|
+
expectedMap
|
|
2314
|
+
);
|
|
2240
2315
|
}
|
|
2241
2316
|
}
|
|
2242
2317
|
const allowMismatchAttr = "data-allow-mismatch";
|
|
@@ -2495,7 +2570,7 @@ function defineAsyncComponent(source) {
|
|
|
2495
2570
|
}
|
|
2496
2571
|
load().then(() => {
|
|
2497
2572
|
loaded.value = true;
|
|
2498
|
-
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
2573
|
+
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
|
|
2499
2574
|
instance.parent.update();
|
|
2500
2575
|
}
|
|
2501
2576
|
}).catch((err) => {
|
|
@@ -2538,8 +2613,8 @@ const KeepAliveImpl = {
|
|
|
2538
2613
|
max: [String, Number]
|
|
2539
2614
|
},
|
|
2540
2615
|
setup(props, { slots }) {
|
|
2541
|
-
const
|
|
2542
|
-
const sharedContext =
|
|
2616
|
+
const keepAliveInstance = getCurrentInstance();
|
|
2617
|
+
const sharedContext = keepAliveInstance.ctx;
|
|
2543
2618
|
if (!sharedContext.renderer) {
|
|
2544
2619
|
return () => {
|
|
2545
2620
|
const children = slots.default && slots.default();
|
|
@@ -2550,9 +2625,9 @@ const KeepAliveImpl = {
|
|
|
2550
2625
|
const keys = /* @__PURE__ */ new Set();
|
|
2551
2626
|
let current = null;
|
|
2552
2627
|
{
|
|
2553
|
-
|
|
2628
|
+
keepAliveInstance.__v_cache = cache;
|
|
2554
2629
|
}
|
|
2555
|
-
const parentSuspense =
|
|
2630
|
+
const parentSuspense = keepAliveInstance.suspense;
|
|
2556
2631
|
const {
|
|
2557
2632
|
renderer: {
|
|
2558
2633
|
p: patch,
|
|
@@ -2563,55 +2638,77 @@ const KeepAliveImpl = {
|
|
|
2563
2638
|
} = sharedContext;
|
|
2564
2639
|
const storageContainer = createElement("div");
|
|
2565
2640
|
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
2566
|
-
const
|
|
2567
|
-
move(
|
|
2641
|
+
const instance = vnode.component;
|
|
2642
|
+
move(
|
|
2643
|
+
vnode,
|
|
2644
|
+
container,
|
|
2645
|
+
anchor,
|
|
2646
|
+
0,
|
|
2647
|
+
keepAliveInstance,
|
|
2648
|
+
parentSuspense
|
|
2649
|
+
);
|
|
2568
2650
|
patch(
|
|
2569
|
-
|
|
2651
|
+
instance.vnode,
|
|
2570
2652
|
vnode,
|
|
2571
2653
|
container,
|
|
2572
2654
|
anchor,
|
|
2573
|
-
|
|
2655
|
+
instance,
|
|
2574
2656
|
parentSuspense,
|
|
2575
2657
|
namespace,
|
|
2576
2658
|
vnode.slotScopeIds,
|
|
2577
2659
|
optimized
|
|
2578
2660
|
);
|
|
2579
|
-
queuePostRenderEffect(
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2661
|
+
queuePostRenderEffect(
|
|
2662
|
+
() => {
|
|
2663
|
+
instance.isDeactivated = false;
|
|
2664
|
+
if (instance.a) {
|
|
2665
|
+
shared.invokeArrayFns(instance.a);
|
|
2666
|
+
}
|
|
2667
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
2668
|
+
if (vnodeHook) {
|
|
2669
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
2670
|
+
}
|
|
2671
|
+
},
|
|
2672
|
+
void 0,
|
|
2673
|
+
parentSuspense
|
|
2674
|
+
);
|
|
2589
2675
|
{
|
|
2590
|
-
devtoolsComponentAdded(
|
|
2676
|
+
devtoolsComponentAdded(instance);
|
|
2591
2677
|
}
|
|
2592
2678
|
};
|
|
2593
2679
|
sharedContext.deactivate = (vnode) => {
|
|
2594
|
-
const
|
|
2595
|
-
invalidateMount(
|
|
2596
|
-
invalidateMount(
|
|
2597
|
-
move(
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2680
|
+
const instance = vnode.component;
|
|
2681
|
+
invalidateMount(instance.m);
|
|
2682
|
+
invalidateMount(instance.a);
|
|
2683
|
+
move(
|
|
2684
|
+
vnode,
|
|
2685
|
+
storageContainer,
|
|
2686
|
+
null,
|
|
2687
|
+
1,
|
|
2688
|
+
keepAliveInstance,
|
|
2689
|
+
parentSuspense
|
|
2690
|
+
);
|
|
2691
|
+
queuePostRenderEffect(
|
|
2692
|
+
() => {
|
|
2693
|
+
if (instance.da) {
|
|
2694
|
+
shared.invokeArrayFns(instance.da);
|
|
2695
|
+
}
|
|
2696
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
2697
|
+
if (vnodeHook) {
|
|
2698
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
2699
|
+
}
|
|
2700
|
+
instance.isDeactivated = true;
|
|
2701
|
+
},
|
|
2702
|
+
void 0,
|
|
2703
|
+
parentSuspense
|
|
2704
|
+
);
|
|
2608
2705
|
{
|
|
2609
|
-
devtoolsComponentAdded(
|
|
2706
|
+
devtoolsComponentAdded(instance);
|
|
2610
2707
|
}
|
|
2611
2708
|
};
|
|
2612
2709
|
function unmount(vnode) {
|
|
2613
2710
|
resetShapeFlag(vnode);
|
|
2614
|
-
_unmount(vnode,
|
|
2711
|
+
_unmount(vnode, keepAliveInstance, parentSuspense, true);
|
|
2615
2712
|
}
|
|
2616
2713
|
function pruneCache(filter) {
|
|
2617
2714
|
cache.forEach((vnode, key) => {
|
|
@@ -2643,12 +2740,19 @@ const KeepAliveImpl = {
|
|
|
2643
2740
|
let pendingCacheKey = null;
|
|
2644
2741
|
const cacheSubtree = () => {
|
|
2645
2742
|
if (pendingCacheKey != null) {
|
|
2646
|
-
if (isSuspense(
|
|
2647
|
-
queuePostRenderEffect(
|
|
2648
|
-
|
|
2649
|
-
|
|
2743
|
+
if (isSuspense(keepAliveInstance.subTree.type)) {
|
|
2744
|
+
queuePostRenderEffect(
|
|
2745
|
+
() => {
|
|
2746
|
+
cache.set(
|
|
2747
|
+
pendingCacheKey,
|
|
2748
|
+
getInnerChild(keepAliveInstance.subTree)
|
|
2749
|
+
);
|
|
2750
|
+
},
|
|
2751
|
+
void 0,
|
|
2752
|
+
keepAliveInstance.subTree.suspense
|
|
2753
|
+
);
|
|
2650
2754
|
} else {
|
|
2651
|
-
cache.set(pendingCacheKey, getInnerChild(
|
|
2755
|
+
cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
2652
2756
|
}
|
|
2653
2757
|
}
|
|
2654
2758
|
};
|
|
@@ -2656,12 +2760,12 @@ const KeepAliveImpl = {
|
|
|
2656
2760
|
onUpdated(cacheSubtree);
|
|
2657
2761
|
onBeforeUnmount(() => {
|
|
2658
2762
|
cache.forEach((cached) => {
|
|
2659
|
-
const { subTree, suspense } =
|
|
2763
|
+
const { subTree, suspense } = keepAliveInstance;
|
|
2660
2764
|
const vnode = getInnerChild(subTree);
|
|
2661
2765
|
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
2662
2766
|
resetShapeFlag(vnode);
|
|
2663
2767
|
const da = vnode.component.da;
|
|
2664
|
-
da && queuePostRenderEffect(da, suspense);
|
|
2768
|
+
da && queuePostRenderEffect(da, void 0, suspense);
|
|
2665
2769
|
return;
|
|
2666
2770
|
}
|
|
2667
2771
|
unmount(cached);
|
|
@@ -2747,7 +2851,7 @@ function onActivated(hook, target) {
|
|
|
2747
2851
|
function onDeactivated(hook, target) {
|
|
2748
2852
|
registerKeepAliveHook(hook, "da", target);
|
|
2749
2853
|
}
|
|
2750
|
-
function registerKeepAliveHook(hook, type, target =
|
|
2854
|
+
function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
|
|
2751
2855
|
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
2752
2856
|
let current = target;
|
|
2753
2857
|
while (current) {
|
|
@@ -2761,7 +2865,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
2761
2865
|
injectHook(type, wrappedHook, target);
|
|
2762
2866
|
if (target) {
|
|
2763
2867
|
let current = target.parent;
|
|
2764
|
-
while (current && current.parent) {
|
|
2868
|
+
while (current && current.parent && current.parent.vnode) {
|
|
2765
2869
|
if (isKeepAlive(current.parent.vnode)) {
|
|
2766
2870
|
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
2767
2871
|
}
|
|
@@ -2793,12 +2897,14 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
2793
2897
|
if (target) {
|
|
2794
2898
|
const hooks = target[type] || (target[type] = []);
|
|
2795
2899
|
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
2796
|
-
reactivity.
|
|
2797
|
-
const
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2900
|
+
const prevSub = reactivity.setActiveSub();
|
|
2901
|
+
const prev = setCurrentInstance(target);
|
|
2902
|
+
try {
|
|
2903
|
+
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
2904
|
+
} finally {
|
|
2905
|
+
setCurrentInstance(...prev);
|
|
2906
|
+
reactivity.setActiveSub(prevSub);
|
|
2907
|
+
}
|
|
2802
2908
|
});
|
|
2803
2909
|
if (prepend) {
|
|
2804
2910
|
hooks.unshift(wrappedHook);
|
|
@@ -2869,7 +2975,11 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
2869
2975
|
const res = (
|
|
2870
2976
|
// local registration
|
|
2871
2977
|
// check instance[type] first which is resolved for options API
|
|
2872
|
-
resolve(
|
|
2978
|
+
resolve(
|
|
2979
|
+
instance[type] || Component[type],
|
|
2980
|
+
name
|
|
2981
|
+
) || // global registration
|
|
2982
|
+
// @ts-expect-error filters only exist in compat mode
|
|
2873
2983
|
resolve(instance.appContext[type], name)
|
|
2874
2984
|
);
|
|
2875
2985
|
if (!res && maybeSelfReference) {
|
|
@@ -2963,7 +3073,13 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2963
3073
|
}
|
|
2964
3074
|
|
|
2965
3075
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
2966
|
-
|
|
3076
|
+
let slot = slots[name];
|
|
3077
|
+
if (slot && slot.__vapor) {
|
|
3078
|
+
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
3079
|
+
ret.vs = { slot, fallback };
|
|
3080
|
+
return ret;
|
|
3081
|
+
}
|
|
3082
|
+
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
2967
3083
|
if (name !== "default") props.name = name;
|
|
2968
3084
|
return openBlock(), createBlock(
|
|
2969
3085
|
Fragment,
|
|
@@ -2972,7 +3088,6 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2972
3088
|
64
|
|
2973
3089
|
);
|
|
2974
3090
|
}
|
|
2975
|
-
let slot = slots[name];
|
|
2976
3091
|
if (slot && slot.length > 1) {
|
|
2977
3092
|
warn$1(
|
|
2978
3093
|
`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.`
|
|
@@ -3027,8 +3142,9 @@ function toHandlers(obj, preserveCaseIfNecessary) {
|
|
|
3027
3142
|
}
|
|
3028
3143
|
|
|
3029
3144
|
const getPublicInstance = (i) => {
|
|
3030
|
-
if (!i) return null;
|
|
3031
|
-
if (isStatefulComponent(i))
|
|
3145
|
+
if (!i || i.vapor) return null;
|
|
3146
|
+
if (isStatefulComponent(i))
|
|
3147
|
+
return getComponentPublicInstance(i);
|
|
3032
3148
|
return getPublicInstance(i.parent);
|
|
3033
3149
|
};
|
|
3034
3150
|
const publicPropertiesMap = (
|
|
@@ -3321,11 +3437,16 @@ function useAttrs() {
|
|
|
3321
3437
|
return getContext().attrs;
|
|
3322
3438
|
}
|
|
3323
3439
|
function getContext() {
|
|
3324
|
-
const i =
|
|
3440
|
+
const i = getCurrentGenericInstance();
|
|
3325
3441
|
if (!i) {
|
|
3326
3442
|
warn$1(`useContext() called without active instance.`);
|
|
3327
3443
|
}
|
|
3328
|
-
|
|
3444
|
+
if (i.vapor) {
|
|
3445
|
+
return i;
|
|
3446
|
+
} else {
|
|
3447
|
+
const ii = i;
|
|
3448
|
+
return ii.setupContext || (ii.setupContext = createSetupContext(ii));
|
|
3449
|
+
}
|
|
3329
3450
|
}
|
|
3330
3451
|
function normalizePropsOrEmits(props) {
|
|
3331
3452
|
return shared.isArray(props) ? props.reduce(
|
|
@@ -3373,14 +3494,14 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
3373
3494
|
return ret;
|
|
3374
3495
|
}
|
|
3375
3496
|
function withAsyncContext(getAwaitable) {
|
|
3376
|
-
const ctx =
|
|
3497
|
+
const ctx = getCurrentGenericInstance();
|
|
3377
3498
|
if (!ctx) {
|
|
3378
3499
|
warn$1(
|
|
3379
3500
|
`withAsyncContext called without active current instance. This is likely a bug.`
|
|
3380
3501
|
);
|
|
3381
3502
|
}
|
|
3382
3503
|
let awaitable = getAwaitable();
|
|
3383
|
-
|
|
3504
|
+
setCurrentInstance(null, void 0);
|
|
3384
3505
|
if (shared.isPromise(awaitable)) {
|
|
3385
3506
|
awaitable = awaitable.catch((e) => {
|
|
3386
3507
|
setCurrentInstance(ctx);
|
|
@@ -3827,7 +3948,7 @@ function createAppContext() {
|
|
|
3827
3948
|
};
|
|
3828
3949
|
}
|
|
3829
3950
|
let uid$1 = 0;
|
|
3830
|
-
function createAppAPI(
|
|
3951
|
+
function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
3831
3952
|
return function createApp(rootComponent, rootProps = null) {
|
|
3832
3953
|
if (!shared.isFunction(rootComponent)) {
|
|
3833
3954
|
rootComponent = shared.extend({}, rootComponent);
|
|
@@ -3920,33 +4041,15 @@ function createAppAPI(render, hydrate) {
|
|
|
3920
4041
|
If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
|
|
3921
4042
|
);
|
|
3922
4043
|
}
|
|
3923
|
-
const
|
|
3924
|
-
vnode.appContext = context;
|
|
3925
|
-
if (namespace === true) {
|
|
3926
|
-
namespace = "svg";
|
|
3927
|
-
} else if (namespace === false) {
|
|
3928
|
-
namespace = void 0;
|
|
3929
|
-
}
|
|
4044
|
+
const instance = mount(app, rootContainer, isHydrate, namespace);
|
|
3930
4045
|
{
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
cloned.el = null;
|
|
3934
|
-
render(cloned, rootContainer, namespace);
|
|
3935
|
-
};
|
|
3936
|
-
}
|
|
3937
|
-
if (isHydrate && hydrate) {
|
|
3938
|
-
hydrate(vnode, rootContainer);
|
|
3939
|
-
} else {
|
|
3940
|
-
render(vnode, rootContainer, namespace);
|
|
4046
|
+
app._instance = instance;
|
|
4047
|
+
devtoolsInitApp(app, version);
|
|
3941
4048
|
}
|
|
3942
4049
|
isMounted = true;
|
|
3943
4050
|
app._container = rootContainer;
|
|
3944
4051
|
rootContainer.__vue_app__ = app;
|
|
3945
|
-
|
|
3946
|
-
app._instance = vnode.component;
|
|
3947
|
-
devtoolsInitApp(app, version);
|
|
3948
|
-
}
|
|
3949
|
-
return getComponentPublicInstance(vnode.component);
|
|
4052
|
+
return getPublicInstance(instance);
|
|
3950
4053
|
} else {
|
|
3951
4054
|
warn$1(
|
|
3952
4055
|
`App has already been mounted.
|
|
@@ -3969,7 +4072,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
3969
4072
|
app._instance,
|
|
3970
4073
|
16
|
|
3971
4074
|
);
|
|
3972
|
-
|
|
4075
|
+
unmount(app);
|
|
3973
4076
|
{
|
|
3974
4077
|
app._instance = null;
|
|
3975
4078
|
devtoolsUnmountApp(app);
|
|
@@ -4010,6 +4113,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
4010
4113
|
let currentApp = null;
|
|
4011
4114
|
|
|
4012
4115
|
function provide(key, value) {
|
|
4116
|
+
const currentInstance = getCurrentGenericInstance();
|
|
4013
4117
|
if (!currentInstance) {
|
|
4014
4118
|
{
|
|
4015
4119
|
warn$1(`provide() can only be used inside setup().`);
|
|
@@ -4024,9 +4128,9 @@ function provide(key, value) {
|
|
|
4024
4128
|
}
|
|
4025
4129
|
}
|
|
4026
4130
|
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
4027
|
-
const instance =
|
|
4131
|
+
const instance = getCurrentGenericInstance();
|
|
4028
4132
|
if (instance || currentApp) {
|
|
4029
|
-
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.
|
|
4133
|
+
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
4030
4134
|
if (provides && key in provides) {
|
|
4031
4135
|
return provides[key];
|
|
4032
4136
|
} else if (arguments.length > 1) {
|
|
@@ -4039,7 +4143,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
4039
4143
|
}
|
|
4040
4144
|
}
|
|
4041
4145
|
function hasInjectionContext() {
|
|
4042
|
-
return !!(
|
|
4146
|
+
return !!(getCurrentGenericInstance() || currentApp);
|
|
4043
4147
|
}
|
|
4044
4148
|
|
|
4045
4149
|
const internalObjectProto = {};
|
|
@@ -4047,7 +4151,7 @@ const createInternalObject = () => Object.create(internalObjectProto);
|
|
|
4047
4151
|
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
4048
4152
|
|
|
4049
4153
|
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
4050
|
-
const props = {};
|
|
4154
|
+
const props = instance.props = {};
|
|
4051
4155
|
const attrs = createInternalObject();
|
|
4052
4156
|
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
4053
4157
|
setFullProps(instance, rawProps, props, attrs);
|
|
@@ -4057,7 +4161,7 @@ function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
|
4057
4161
|
}
|
|
4058
4162
|
}
|
|
4059
4163
|
{
|
|
4060
|
-
validateProps(rawProps || {}, props, instance);
|
|
4164
|
+
validateProps(rawProps || {}, props, instance.propsOptions[0]);
|
|
4061
4165
|
}
|
|
4062
4166
|
if (isStateful) {
|
|
4063
4167
|
instance.props = isSSR ? props : reactivity.shallowReactive(props);
|
|
@@ -4109,11 +4213,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4109
4213
|
const camelizedKey = shared.camelize(key);
|
|
4110
4214
|
props[camelizedKey] = resolvePropValue(
|
|
4111
4215
|
options,
|
|
4112
|
-
rawCurrentProps,
|
|
4113
4216
|
camelizedKey,
|
|
4114
4217
|
value,
|
|
4115
4218
|
instance,
|
|
4116
|
-
|
|
4219
|
+
baseResolveDefault
|
|
4117
4220
|
);
|
|
4118
4221
|
}
|
|
4119
4222
|
} else {
|
|
@@ -4140,10 +4243,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4140
4243
|
rawPrevProps[kebabKey] !== void 0)) {
|
|
4141
4244
|
props[key] = resolvePropValue(
|
|
4142
4245
|
options,
|
|
4143
|
-
rawCurrentProps,
|
|
4144
4246
|
key,
|
|
4145
4247
|
void 0,
|
|
4146
4248
|
instance,
|
|
4249
|
+
baseResolveDefault,
|
|
4147
4250
|
true
|
|
4148
4251
|
);
|
|
4149
4252
|
}
|
|
@@ -4165,7 +4268,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4165
4268
|
reactivity.trigger(instance.attrs, "set", "");
|
|
4166
4269
|
}
|
|
4167
4270
|
{
|
|
4168
|
-
validateProps(rawProps || {}, props, instance);
|
|
4271
|
+
validateProps(rawProps || {}, props, instance.propsOptions[0]);
|
|
4169
4272
|
}
|
|
4170
4273
|
}
|
|
4171
4274
|
function setFullProps(instance, rawProps, props, attrs) {
|
|
@@ -4194,39 +4297,37 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
4194
4297
|
}
|
|
4195
4298
|
}
|
|
4196
4299
|
if (needCastKeys) {
|
|
4197
|
-
const rawCurrentProps = reactivity.toRaw(props);
|
|
4198
4300
|
const castValues = rawCastValues || shared.EMPTY_OBJ;
|
|
4199
4301
|
for (let i = 0; i < needCastKeys.length; i++) {
|
|
4200
4302
|
const key = needCastKeys[i];
|
|
4201
4303
|
props[key] = resolvePropValue(
|
|
4202
4304
|
options,
|
|
4203
|
-
rawCurrentProps,
|
|
4204
4305
|
key,
|
|
4205
4306
|
castValues[key],
|
|
4206
4307
|
instance,
|
|
4308
|
+
baseResolveDefault,
|
|
4207
4309
|
!shared.hasOwn(castValues, key)
|
|
4208
4310
|
);
|
|
4209
4311
|
}
|
|
4210
4312
|
}
|
|
4211
4313
|
return hasAttrsChanged;
|
|
4212
4314
|
}
|
|
4213
|
-
function resolvePropValue(options,
|
|
4315
|
+
function resolvePropValue(options, key, value, instance, resolveDefault, isAbsent = false) {
|
|
4214
4316
|
const opt = options[key];
|
|
4215
4317
|
if (opt != null) {
|
|
4216
4318
|
const hasDefault = shared.hasOwn(opt, "default");
|
|
4217
4319
|
if (hasDefault && value === void 0) {
|
|
4218
4320
|
const defaultValue = opt.default;
|
|
4219
4321
|
if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
|
|
4220
|
-
const
|
|
4221
|
-
if (key
|
|
4222
|
-
value =
|
|
4322
|
+
const cachedDefaults = instance.propsDefaults || (instance.propsDefaults = {});
|
|
4323
|
+
if (shared.hasOwn(cachedDefaults, key)) {
|
|
4324
|
+
value = cachedDefaults[key];
|
|
4223
4325
|
} else {
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4326
|
+
value = cachedDefaults[key] = resolveDefault(
|
|
4327
|
+
defaultValue,
|
|
4328
|
+
instance,
|
|
4329
|
+
key
|
|
4228
4330
|
);
|
|
4229
|
-
reset();
|
|
4230
4331
|
}
|
|
4231
4332
|
} else {
|
|
4232
4333
|
value = defaultValue;
|
|
@@ -4245,6 +4346,17 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
4245
4346
|
}
|
|
4246
4347
|
return value;
|
|
4247
4348
|
}
|
|
4349
|
+
function baseResolveDefault(factory, instance, key) {
|
|
4350
|
+
let value;
|
|
4351
|
+
const prev = setCurrentInstance(instance);
|
|
4352
|
+
const props = reactivity.toRaw(instance.props);
|
|
4353
|
+
value = factory.call(
|
|
4354
|
+
null,
|
|
4355
|
+
props
|
|
4356
|
+
);
|
|
4357
|
+
setCurrentInstance(...prev);
|
|
4358
|
+
return value;
|
|
4359
|
+
}
|
|
4248
4360
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
4249
4361
|
function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
4250
4362
|
const cache = asMixin ? mixinPropsCache : appContext.propsCache;
|
|
@@ -4279,6 +4391,14 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
4279
4391
|
}
|
|
4280
4392
|
return shared.EMPTY_ARR;
|
|
4281
4393
|
}
|
|
4394
|
+
baseNormalizePropsOptions(raw, normalized, needCastKeys);
|
|
4395
|
+
const res = [normalized, needCastKeys];
|
|
4396
|
+
if (shared.isObject(comp)) {
|
|
4397
|
+
cache.set(comp, res);
|
|
4398
|
+
}
|
|
4399
|
+
return res;
|
|
4400
|
+
}
|
|
4401
|
+
function baseNormalizePropsOptions(raw, normalized, needCastKeys) {
|
|
4282
4402
|
if (shared.isArray(raw)) {
|
|
4283
4403
|
for (let i = 0; i < raw.length; i++) {
|
|
4284
4404
|
if (!shared.isString(raw[i])) {
|
|
@@ -4323,11 +4443,6 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
4323
4443
|
}
|
|
4324
4444
|
}
|
|
4325
4445
|
}
|
|
4326
|
-
const res = [normalized, needCastKeys];
|
|
4327
|
-
if (shared.isObject(comp)) {
|
|
4328
|
-
cache.set(comp, res);
|
|
4329
|
-
}
|
|
4330
|
-
return res;
|
|
4331
4446
|
}
|
|
4332
4447
|
function validatePropName(key) {
|
|
4333
4448
|
if (key[0] !== "$" && !shared.isReservedProp(key)) {
|
|
@@ -4349,26 +4464,26 @@ function getType(ctor) {
|
|
|
4349
4464
|
}
|
|
4350
4465
|
return "";
|
|
4351
4466
|
}
|
|
4352
|
-
function validateProps(rawProps,
|
|
4353
|
-
|
|
4354
|
-
const options = instance.propsOptions[0];
|
|
4467
|
+
function validateProps(rawProps, resolvedProps, options) {
|
|
4468
|
+
resolvedProps = reactivity.toRaw(resolvedProps);
|
|
4355
4469
|
const camelizePropsKey = Object.keys(rawProps).map((key) => shared.camelize(key));
|
|
4356
4470
|
for (const key in options) {
|
|
4357
|
-
|
|
4358
|
-
if (opt
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4471
|
+
const opt = options[key];
|
|
4472
|
+
if (opt != null) {
|
|
4473
|
+
validateProp(
|
|
4474
|
+
key,
|
|
4475
|
+
resolvedProps[key],
|
|
4476
|
+
opt,
|
|
4477
|
+
resolvedProps,
|
|
4478
|
+
!camelizePropsKey.includes(key)
|
|
4479
|
+
);
|
|
4480
|
+
}
|
|
4366
4481
|
}
|
|
4367
4482
|
}
|
|
4368
|
-
function validateProp(
|
|
4369
|
-
const { type, required, validator, skipCheck } =
|
|
4483
|
+
function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
|
|
4484
|
+
const { type, required, validator, skipCheck } = propOptions;
|
|
4370
4485
|
if (required && isAbsent) {
|
|
4371
|
-
warn$1('Missing required prop: "' +
|
|
4486
|
+
warn$1('Missing required prop: "' + key + '"');
|
|
4372
4487
|
return;
|
|
4373
4488
|
}
|
|
4374
4489
|
if (value == null && !required) {
|
|
@@ -4384,12 +4499,12 @@ function validateProp(name, value, prop, props, isAbsent) {
|
|
|
4384
4499
|
isValid = valid;
|
|
4385
4500
|
}
|
|
4386
4501
|
if (!isValid) {
|
|
4387
|
-
warn$1(getInvalidTypeMessage(
|
|
4502
|
+
warn$1(getInvalidTypeMessage(key, value, expectedTypes));
|
|
4388
4503
|
return;
|
|
4389
4504
|
}
|
|
4390
4505
|
}
|
|
4391
|
-
if (validator && !validator(value,
|
|
4392
|
-
warn$1('Invalid prop: custom validator check failed for prop "' +
|
|
4506
|
+
if (validator && !validator(value, reactivity.shallowReadonly(resolvedProps) )) {
|
|
4507
|
+
warn$1('Invalid prop: custom validator check failed for prop "' + key + '".');
|
|
4393
4508
|
}
|
|
4394
4509
|
}
|
|
4395
4510
|
const isSimpleType = /* @__PURE__ */ shared.makeMap(
|
|
@@ -4460,7 +4575,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
|
|
|
4460
4575
|
return rawSlot;
|
|
4461
4576
|
}
|
|
4462
4577
|
const normalized = withCtx((...args) => {
|
|
4463
|
-
if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
|
|
4578
|
+
if (currentInstance && !currentInstance.vapor && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
|
|
4464
4579
|
warn$1(
|
|
4465
4580
|
`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.`
|
|
4466
4581
|
);
|
|
@@ -4557,12 +4672,15 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4557
4672
|
|
|
4558
4673
|
let supported;
|
|
4559
4674
|
let perf;
|
|
4675
|
+
let cachedNow = 0;
|
|
4676
|
+
const p = /* @__PURE__ */ Promise.resolve();
|
|
4677
|
+
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = isSupported() ? perf.now() : Date.now());
|
|
4560
4678
|
function startMeasure(instance, type) {
|
|
4561
4679
|
if (instance.appContext.config.performance && isSupported()) {
|
|
4562
4680
|
perf.mark(`vue-${type}-${instance.uid}`);
|
|
4563
4681
|
}
|
|
4564
4682
|
{
|
|
4565
|
-
devtoolsPerfStart(instance, type,
|
|
4683
|
+
devtoolsPerfStart(instance, type, getNow());
|
|
4566
4684
|
}
|
|
4567
4685
|
}
|
|
4568
4686
|
function endMeasure(instance, type) {
|
|
@@ -4579,7 +4697,7 @@ function endMeasure(instance, type) {
|
|
|
4579
4697
|
perf.clearMarks(endTag);
|
|
4580
4698
|
}
|
|
4581
4699
|
{
|
|
4582
|
-
devtoolsPerfEnd(instance, type,
|
|
4700
|
+
devtoolsPerfEnd(instance, type, getNow());
|
|
4583
4701
|
}
|
|
4584
4702
|
}
|
|
4585
4703
|
function isSupported() {
|
|
@@ -4663,6 +4781,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4663
4781
|
optimized
|
|
4664
4782
|
);
|
|
4665
4783
|
break;
|
|
4784
|
+
case VaporSlot:
|
|
4785
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
|
|
4786
|
+
break;
|
|
4666
4787
|
default:
|
|
4667
4788
|
if (shapeFlag & 1) {
|
|
4668
4789
|
processElement(
|
|
@@ -4875,11 +4996,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4875
4996
|
}
|
|
4876
4997
|
hostInsert(el, container, anchor);
|
|
4877
4998
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
4878
|
-
queuePostRenderEffect(
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4999
|
+
queuePostRenderEffect(
|
|
5000
|
+
() => {
|
|
5001
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5002
|
+
needCallTransitionHooks && transition.enter(el);
|
|
5003
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
5004
|
+
},
|
|
5005
|
+
void 0,
|
|
5006
|
+
parentSuspense
|
|
5007
|
+
);
|
|
4883
5008
|
}
|
|
4884
5009
|
};
|
|
4885
5010
|
const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
|
|
@@ -4891,8 +5016,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4891
5016
|
hostSetScopeId(el, slotScopeIds[i]);
|
|
4892
5017
|
}
|
|
4893
5018
|
}
|
|
4894
|
-
|
|
4895
|
-
|
|
5019
|
+
let subTree = parentComponent && parentComponent.subTree;
|
|
5020
|
+
if (subTree) {
|
|
4896
5021
|
if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
|
|
4897
5022
|
subTree = filterSingleRoot(subTree.children) || subTree;
|
|
4898
5023
|
}
|
|
@@ -5009,10 +5134,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5009
5134
|
patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
5010
5135
|
}
|
|
5011
5136
|
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
|
|
5012
|
-
queuePostRenderEffect(
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5137
|
+
queuePostRenderEffect(
|
|
5138
|
+
() => {
|
|
5139
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
5140
|
+
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
5141
|
+
},
|
|
5142
|
+
void 0,
|
|
5143
|
+
parentSuspense
|
|
5144
|
+
);
|
|
5016
5145
|
}
|
|
5017
5146
|
};
|
|
5018
5147
|
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
|
|
@@ -5140,7 +5269,22 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5140
5269
|
};
|
|
5141
5270
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
5142
5271
|
n2.slotScopeIds = slotScopeIds;
|
|
5143
|
-
if (
|
|
5272
|
+
if (n2.type.__vapor) {
|
|
5273
|
+
if (n1 == null) {
|
|
5274
|
+
getVaporInterface(parentComponent, n2).mount(
|
|
5275
|
+
n2,
|
|
5276
|
+
container,
|
|
5277
|
+
anchor,
|
|
5278
|
+
parentComponent
|
|
5279
|
+
);
|
|
5280
|
+
} else {
|
|
5281
|
+
getVaporInterface(parentComponent, n2).update(
|
|
5282
|
+
n1,
|
|
5283
|
+
n2,
|
|
5284
|
+
shouldUpdateComponent(n1, n2, optimized)
|
|
5285
|
+
);
|
|
5286
|
+
}
|
|
5287
|
+
} else if (n1 == null) {
|
|
5144
5288
|
if (n2.shapeFlag & 512) {
|
|
5145
5289
|
parentComponent.ctx.activate(
|
|
5146
5290
|
n2,
|
|
@@ -5226,15 +5370,52 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5226
5370
|
return;
|
|
5227
5371
|
} else {
|
|
5228
5372
|
instance.next = n2;
|
|
5229
|
-
instance.
|
|
5373
|
+
instance.effect.run();
|
|
5230
5374
|
}
|
|
5231
5375
|
} else {
|
|
5232
5376
|
n2.el = n1.el;
|
|
5233
5377
|
instance.vnode = n2;
|
|
5234
5378
|
}
|
|
5235
5379
|
};
|
|
5236
|
-
|
|
5237
|
-
|
|
5380
|
+
class SetupRenderEffect extends reactivity.ReactiveEffect {
|
|
5381
|
+
constructor(instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) {
|
|
5382
|
+
const prevScope = reactivity.setCurrentScope(instance.scope);
|
|
5383
|
+
super();
|
|
5384
|
+
this.instance = instance;
|
|
5385
|
+
this.initialVNode = initialVNode;
|
|
5386
|
+
this.container = container;
|
|
5387
|
+
this.anchor = anchor;
|
|
5388
|
+
this.parentSuspense = parentSuspense;
|
|
5389
|
+
this.namespace = namespace;
|
|
5390
|
+
this.optimized = optimized;
|
|
5391
|
+
reactivity.setCurrentScope(prevScope);
|
|
5392
|
+
this.job = instance.job = () => {
|
|
5393
|
+
if (this.dirty) {
|
|
5394
|
+
this.run();
|
|
5395
|
+
}
|
|
5396
|
+
};
|
|
5397
|
+
this.job.i = instance;
|
|
5398
|
+
{
|
|
5399
|
+
this.onTrack = instance.rtc ? (e) => shared.invokeArrayFns(instance.rtc, e) : void 0;
|
|
5400
|
+
this.onTrigger = instance.rtg ? (e) => shared.invokeArrayFns(instance.rtg, e) : void 0;
|
|
5401
|
+
}
|
|
5402
|
+
}
|
|
5403
|
+
notify() {
|
|
5404
|
+
if (!(this.flags & 256)) {
|
|
5405
|
+
const job = this.job;
|
|
5406
|
+
queueJob(job, job.i.uid);
|
|
5407
|
+
}
|
|
5408
|
+
}
|
|
5409
|
+
fn() {
|
|
5410
|
+
const {
|
|
5411
|
+
instance,
|
|
5412
|
+
initialVNode,
|
|
5413
|
+
container,
|
|
5414
|
+
anchor,
|
|
5415
|
+
parentSuspense,
|
|
5416
|
+
namespace,
|
|
5417
|
+
optimized
|
|
5418
|
+
} = this;
|
|
5238
5419
|
if (!instance.isMounted) {
|
|
5239
5420
|
let vnodeHook;
|
|
5240
5421
|
const { el, props } = initialVNode;
|
|
@@ -5310,23 +5491,24 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5310
5491
|
initialVNode.el = subTree.el;
|
|
5311
5492
|
}
|
|
5312
5493
|
if (m) {
|
|
5313
|
-
queuePostRenderEffect(m, parentSuspense);
|
|
5494
|
+
queuePostRenderEffect(m, void 0, parentSuspense);
|
|
5314
5495
|
}
|
|
5315
5496
|
if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
|
|
5316
5497
|
const scopedInitialVNode = initialVNode;
|
|
5317
5498
|
queuePostRenderEffect(
|
|
5318
5499
|
() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
|
|
5500
|
+
void 0,
|
|
5319
5501
|
parentSuspense
|
|
5320
5502
|
);
|
|
5321
5503
|
}
|
|
5322
|
-
if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
|
|
5323
|
-
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
5504
|
+
if (initialVNode.shapeFlag & 256 || parent && parent.vnode && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
|
|
5505
|
+
instance.a && queuePostRenderEffect(instance.a, void 0, parentSuspense);
|
|
5324
5506
|
}
|
|
5325
5507
|
instance.isMounted = true;
|
|
5326
5508
|
{
|
|
5327
5509
|
devtoolsComponentAdded(instance);
|
|
5328
5510
|
}
|
|
5329
|
-
initialVNode = container = anchor = null;
|
|
5511
|
+
this.initialVNode = this.container = this.anchor = null;
|
|
5330
5512
|
} else {
|
|
5331
5513
|
let { next, bu, u, parent, vnode } = instance;
|
|
5332
5514
|
{
|
|
@@ -5338,7 +5520,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5338
5520
|
}
|
|
5339
5521
|
nonHydratedAsyncRoot.asyncDep.then(() => {
|
|
5340
5522
|
if (!instance.isUnmounted) {
|
|
5341
|
-
|
|
5523
|
+
this.fn();
|
|
5342
5524
|
}
|
|
5343
5525
|
});
|
|
5344
5526
|
return;
|
|
@@ -5394,11 +5576,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5394
5576
|
updateHOCHostEl(instance, nextTree.el);
|
|
5395
5577
|
}
|
|
5396
5578
|
if (u) {
|
|
5397
|
-
queuePostRenderEffect(u, parentSuspense);
|
|
5579
|
+
queuePostRenderEffect(u, void 0, parentSuspense);
|
|
5398
5580
|
}
|
|
5399
5581
|
if (vnodeHook = next.props && next.props.onVnodeUpdated) {
|
|
5400
5582
|
queuePostRenderEffect(
|
|
5401
5583
|
() => invokeVNodeHook(vnodeHook, parent, next, vnode),
|
|
5584
|
+
void 0,
|
|
5402
5585
|
parentSuspense
|
|
5403
5586
|
);
|
|
5404
5587
|
}
|
|
@@ -5409,21 +5592,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5409
5592
|
popWarningContext();
|
|
5410
5593
|
}
|
|
5411
5594
|
}
|
|
5412
|
-
};
|
|
5413
|
-
instance.scope.on();
|
|
5414
|
-
const effect = instance.effect = new reactivity.ReactiveEffect(componentUpdateFn);
|
|
5415
|
-
instance.scope.off();
|
|
5416
|
-
const update = instance.update = effect.run.bind(effect);
|
|
5417
|
-
const job = instance.job = effect.runIfDirty.bind(effect);
|
|
5418
|
-
job.i = instance;
|
|
5419
|
-
job.id = instance.uid;
|
|
5420
|
-
effect.scheduler = () => queueJob(job);
|
|
5421
|
-
toggleRecurse(instance, true);
|
|
5422
|
-
{
|
|
5423
|
-
effect.onTrack = instance.rtc ? (e) => shared.invokeArrayFns(instance.rtc, e) : void 0;
|
|
5424
|
-
effect.onTrigger = instance.rtg ? (e) => shared.invokeArrayFns(instance.rtg, e) : void 0;
|
|
5425
5595
|
}
|
|
5426
|
-
|
|
5596
|
+
}
|
|
5597
|
+
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
|
|
5598
|
+
const effect = instance.effect = new SetupRenderEffect(
|
|
5599
|
+
instance,
|
|
5600
|
+
initialVNode,
|
|
5601
|
+
container,
|
|
5602
|
+
anchor,
|
|
5603
|
+
parentSuspense,
|
|
5604
|
+
namespace,
|
|
5605
|
+
optimized
|
|
5606
|
+
);
|
|
5607
|
+
instance.update = effect.run.bind(effect);
|
|
5608
|
+
toggleRecurse(instance, true);
|
|
5609
|
+
effect.run();
|
|
5427
5610
|
};
|
|
5428
5611
|
const updateComponentPreRender = (instance, nextVNode, optimized) => {
|
|
5429
5612
|
nextVNode.component = instance;
|
|
@@ -5432,9 +5615,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5432
5615
|
instance.next = null;
|
|
5433
5616
|
updateProps(instance, nextVNode.props, prevProps, optimized);
|
|
5434
5617
|
updateSlots(instance, nextVNode.children, optimized);
|
|
5435
|
-
reactivity.
|
|
5618
|
+
const prevSub = reactivity.setActiveSub();
|
|
5436
5619
|
flushPreFlushCbs(instance);
|
|
5437
|
-
reactivity.
|
|
5620
|
+
reactivity.setActiveSub(prevSub);
|
|
5438
5621
|
};
|
|
5439
5622
|
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
|
|
5440
5623
|
const c1 = n1 && n1.children;
|
|
@@ -5691,7 +5874,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5691
5874
|
patched++;
|
|
5692
5875
|
}
|
|
5693
5876
|
}
|
|
5694
|
-
const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
|
|
5877
|
+
const increasingNewIndexSequence = moved ? shared.getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
|
|
5695
5878
|
j = increasingNewIndexSequence.length - 1;
|
|
5696
5879
|
for (i = toBePatched - 1; i >= 0; i--) {
|
|
5697
5880
|
const nextIndex = s2 + i;
|
|
@@ -5711,7 +5894,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5711
5894
|
);
|
|
5712
5895
|
} else if (moved) {
|
|
5713
5896
|
if (j < 0 || i !== increasingNewIndexSequence[j]) {
|
|
5714
|
-
move(
|
|
5897
|
+
move(
|
|
5898
|
+
nextChild,
|
|
5899
|
+
container,
|
|
5900
|
+
anchor,
|
|
5901
|
+
2,
|
|
5902
|
+
parentComponent
|
|
5903
|
+
);
|
|
5715
5904
|
} else {
|
|
5716
5905
|
j--;
|
|
5717
5906
|
}
|
|
@@ -5719,10 +5908,20 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5719
5908
|
}
|
|
5720
5909
|
}
|
|
5721
5910
|
};
|
|
5722
|
-
const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
|
|
5911
|
+
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
5723
5912
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
5724
5913
|
if (shapeFlag & 6) {
|
|
5725
|
-
|
|
5914
|
+
if (type.__vapor) {
|
|
5915
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
|
|
5916
|
+
} else {
|
|
5917
|
+
move(
|
|
5918
|
+
vnode.component.subTree,
|
|
5919
|
+
container,
|
|
5920
|
+
anchor,
|
|
5921
|
+
moveType,
|
|
5922
|
+
parentComponent
|
|
5923
|
+
);
|
|
5924
|
+
}
|
|
5726
5925
|
return;
|
|
5727
5926
|
}
|
|
5728
5927
|
if (shapeFlag & 128) {
|
|
@@ -5730,13 +5929,25 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5730
5929
|
return;
|
|
5731
5930
|
}
|
|
5732
5931
|
if (shapeFlag & 64) {
|
|
5733
|
-
type.move(
|
|
5932
|
+
type.move(
|
|
5933
|
+
vnode,
|
|
5934
|
+
container,
|
|
5935
|
+
anchor,
|
|
5936
|
+
internals,
|
|
5937
|
+
parentComponent
|
|
5938
|
+
);
|
|
5734
5939
|
return;
|
|
5735
5940
|
}
|
|
5736
5941
|
if (type === Fragment) {
|
|
5737
5942
|
hostInsert(el, container, anchor);
|
|
5738
5943
|
for (let i = 0; i < children.length; i++) {
|
|
5739
|
-
move(
|
|
5944
|
+
move(
|
|
5945
|
+
children[i],
|
|
5946
|
+
container,
|
|
5947
|
+
anchor,
|
|
5948
|
+
moveType,
|
|
5949
|
+
parentComponent
|
|
5950
|
+
);
|
|
5740
5951
|
}
|
|
5741
5952
|
hostInsert(vnode.anchor, container, anchor);
|
|
5742
5953
|
return;
|
|
@@ -5750,7 +5961,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5750
5961
|
if (moveType === 0) {
|
|
5751
5962
|
transition.beforeEnter(el);
|
|
5752
5963
|
hostInsert(el, container, anchor);
|
|
5753
|
-
queuePostRenderEffect(
|
|
5964
|
+
queuePostRenderEffect(
|
|
5965
|
+
() => transition.enter(el),
|
|
5966
|
+
void 0,
|
|
5967
|
+
parentSuspense
|
|
5968
|
+
);
|
|
5754
5969
|
} else {
|
|
5755
5970
|
const { leave, delayLeave, afterLeave } = transition;
|
|
5756
5971
|
const remove2 = () => {
|
|
@@ -5792,9 +6007,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5792
6007
|
optimized = false;
|
|
5793
6008
|
}
|
|
5794
6009
|
if (ref != null) {
|
|
5795
|
-
reactivity.
|
|
6010
|
+
const prevSub = reactivity.setActiveSub();
|
|
5796
6011
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
5797
|
-
reactivity.
|
|
6012
|
+
reactivity.setActiveSub(prevSub);
|
|
5798
6013
|
}
|
|
5799
6014
|
if (cacheIndex != null) {
|
|
5800
6015
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
@@ -5810,7 +6025,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5810
6025
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5811
6026
|
}
|
|
5812
6027
|
if (shapeFlag & 6) {
|
|
5813
|
-
|
|
6028
|
+
if (type.__vapor) {
|
|
6029
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
6030
|
+
return;
|
|
6031
|
+
} else {
|
|
6032
|
+
unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
6033
|
+
}
|
|
5814
6034
|
} else {
|
|
5815
6035
|
if (shapeFlag & 128) {
|
|
5816
6036
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -5844,15 +6064,23 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5844
6064
|
} else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
|
|
5845
6065
|
unmountChildren(children, parentComponent, parentSuspense);
|
|
5846
6066
|
}
|
|
6067
|
+
if (type === VaporSlot) {
|
|
6068
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
6069
|
+
return;
|
|
6070
|
+
}
|
|
5847
6071
|
if (doRemove) {
|
|
5848
6072
|
remove(vnode);
|
|
5849
6073
|
}
|
|
5850
6074
|
}
|
|
5851
6075
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
|
|
5852
|
-
queuePostRenderEffect(
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
6076
|
+
queuePostRenderEffect(
|
|
6077
|
+
() => {
|
|
6078
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
6079
|
+
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
6080
|
+
},
|
|
6081
|
+
void 0,
|
|
6082
|
+
parentSuspense
|
|
6083
|
+
);
|
|
5856
6084
|
}
|
|
5857
6085
|
};
|
|
5858
6086
|
const remove = (vnode) => {
|
|
@@ -5909,7 +6137,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5909
6137
|
const {
|
|
5910
6138
|
bum,
|
|
5911
6139
|
scope,
|
|
5912
|
-
|
|
6140
|
+
effect,
|
|
5913
6141
|
subTree,
|
|
5914
6142
|
um,
|
|
5915
6143
|
m,
|
|
@@ -5928,16 +6156,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5928
6156
|
});
|
|
5929
6157
|
}
|
|
5930
6158
|
scope.stop();
|
|
5931
|
-
if (
|
|
5932
|
-
|
|
6159
|
+
if (effect) {
|
|
6160
|
+
effect.stop();
|
|
5933
6161
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5934
6162
|
}
|
|
5935
6163
|
if (um) {
|
|
5936
|
-
queuePostRenderEffect(um, parentSuspense);
|
|
6164
|
+
queuePostRenderEffect(um, void 0, parentSuspense);
|
|
5937
6165
|
}
|
|
5938
|
-
queuePostRenderEffect(
|
|
5939
|
-
instance.isUnmounted = true
|
|
5940
|
-
|
|
6166
|
+
queuePostRenderEffect(
|
|
6167
|
+
() => instance.isUnmounted = true,
|
|
6168
|
+
void 0,
|
|
6169
|
+
parentSuspense
|
|
6170
|
+
);
|
|
5941
6171
|
if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
|
|
5942
6172
|
parentSuspense.deps--;
|
|
5943
6173
|
if (parentSuspense.deps === 0) {
|
|
@@ -5955,6 +6185,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5955
6185
|
};
|
|
5956
6186
|
const getNextHostNode = (vnode) => {
|
|
5957
6187
|
if (vnode.shapeFlag & 6) {
|
|
6188
|
+
if (vnode.type.__vapor) {
|
|
6189
|
+
return hostNextSibling(vnode.component.block);
|
|
6190
|
+
}
|
|
5958
6191
|
return getNextHostNode(vnode.component.subTree);
|
|
5959
6192
|
}
|
|
5960
6193
|
if (vnode.shapeFlag & 128) {
|
|
@@ -5964,7 +6197,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5964
6197
|
const teleportEnd = el && el[TeleportEndKey];
|
|
5965
6198
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
5966
6199
|
};
|
|
5967
|
-
let isFlushing = false;
|
|
5968
6200
|
const render = (vnode, container, namespace) => {
|
|
5969
6201
|
if (vnode == null) {
|
|
5970
6202
|
if (container._vnode) {
|
|
@@ -5982,12 +6214,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5982
6214
|
);
|
|
5983
6215
|
}
|
|
5984
6216
|
container._vnode = vnode;
|
|
5985
|
-
|
|
5986
|
-
isFlushing = true;
|
|
5987
|
-
flushPreFlushCbs();
|
|
5988
|
-
flushPostFlushCbs();
|
|
5989
|
-
isFlushing = false;
|
|
5990
|
-
}
|
|
6217
|
+
flushOnAppMount();
|
|
5991
6218
|
};
|
|
5992
6219
|
const internals = {
|
|
5993
6220
|
p: patch,
|
|
@@ -5995,6 +6222,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5995
6222
|
m: move,
|
|
5996
6223
|
r: remove,
|
|
5997
6224
|
mt: mountComponent,
|
|
6225
|
+
umt: unmountComponent,
|
|
5998
6226
|
mc: mountChildren,
|
|
5999
6227
|
pc: patchChildren,
|
|
6000
6228
|
pbc: patchBlockChildren,
|
|
@@ -6008,22 +6236,53 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6008
6236
|
internals
|
|
6009
6237
|
);
|
|
6010
6238
|
}
|
|
6239
|
+
const mountApp = (app, container, isHydrate, namespace) => {
|
|
6240
|
+
const vnode = app._ceVNode || createVNode(app._component, app._props);
|
|
6241
|
+
vnode.appContext = app._context;
|
|
6242
|
+
if (namespace === true) {
|
|
6243
|
+
namespace = "svg";
|
|
6244
|
+
} else if (namespace === false) {
|
|
6245
|
+
namespace = void 0;
|
|
6246
|
+
}
|
|
6247
|
+
{
|
|
6248
|
+
app._context.reload = () => {
|
|
6249
|
+
const cloned = cloneVNode(vnode);
|
|
6250
|
+
cloned.el = null;
|
|
6251
|
+
render(cloned, container, namespace);
|
|
6252
|
+
};
|
|
6253
|
+
}
|
|
6254
|
+
if (isHydrate && hydrate) {
|
|
6255
|
+
hydrate(vnode, container);
|
|
6256
|
+
} else {
|
|
6257
|
+
render(vnode, container, namespace);
|
|
6258
|
+
}
|
|
6259
|
+
return vnode.component;
|
|
6260
|
+
};
|
|
6261
|
+
const unmountApp = (app) => {
|
|
6262
|
+
render(null, app._container);
|
|
6263
|
+
};
|
|
6011
6264
|
return {
|
|
6012
6265
|
render,
|
|
6013
6266
|
hydrate,
|
|
6014
|
-
|
|
6267
|
+
internals,
|
|
6268
|
+
createApp: createAppAPI(
|
|
6269
|
+
mountApp,
|
|
6270
|
+
unmountApp,
|
|
6271
|
+
getComponentPublicInstance)
|
|
6015
6272
|
};
|
|
6016
6273
|
}
|
|
6017
6274
|
function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
6018
6275
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
6019
6276
|
}
|
|
6020
|
-
function toggleRecurse({ effect, job }, allowed) {
|
|
6021
|
-
if (
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6277
|
+
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
6278
|
+
if (!vapor) {
|
|
6279
|
+
if (allowed) {
|
|
6280
|
+
effect.flags |= 128;
|
|
6281
|
+
job.flags |= 2;
|
|
6282
|
+
} else {
|
|
6283
|
+
effect.flags &= -129;
|
|
6284
|
+
job.flags &= -3;
|
|
6285
|
+
}
|
|
6027
6286
|
}
|
|
6028
6287
|
}
|
|
6029
6288
|
function needTransition(parentSuspense, transition) {
|
|
@@ -6056,48 +6315,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
6056
6315
|
}
|
|
6057
6316
|
}
|
|
6058
6317
|
}
|
|
6059
|
-
function getSequence(arr) {
|
|
6060
|
-
const p = arr.slice();
|
|
6061
|
-
const result = [0];
|
|
6062
|
-
let i, j, u, v, c;
|
|
6063
|
-
const len = arr.length;
|
|
6064
|
-
for (i = 0; i < len; i++) {
|
|
6065
|
-
const arrI = arr[i];
|
|
6066
|
-
if (arrI !== 0) {
|
|
6067
|
-
j = result[result.length - 1];
|
|
6068
|
-
if (arr[j] < arrI) {
|
|
6069
|
-
p[i] = j;
|
|
6070
|
-
result.push(i);
|
|
6071
|
-
continue;
|
|
6072
|
-
}
|
|
6073
|
-
u = 0;
|
|
6074
|
-
v = result.length - 1;
|
|
6075
|
-
while (u < v) {
|
|
6076
|
-
c = u + v >> 1;
|
|
6077
|
-
if (arr[result[c]] < arrI) {
|
|
6078
|
-
u = c + 1;
|
|
6079
|
-
} else {
|
|
6080
|
-
v = c;
|
|
6081
|
-
}
|
|
6082
|
-
}
|
|
6083
|
-
if (arrI < arr[result[u]]) {
|
|
6084
|
-
if (u > 0) {
|
|
6085
|
-
p[i] = result[u - 1];
|
|
6086
|
-
}
|
|
6087
|
-
result[u] = i;
|
|
6088
|
-
}
|
|
6089
|
-
}
|
|
6090
|
-
}
|
|
6091
|
-
u = result.length;
|
|
6092
|
-
v = result[u - 1];
|
|
6093
|
-
while (u-- > 0) {
|
|
6094
|
-
result[u] = v;
|
|
6095
|
-
v = p[v];
|
|
6096
|
-
}
|
|
6097
|
-
return result;
|
|
6098
|
-
}
|
|
6099
6318
|
function locateNonHydratedAsyncRoot(instance) {
|
|
6100
|
-
const subComponent = instance.subTree.component;
|
|
6319
|
+
const subComponent = instance.vapor ? null : instance.subTree.component;
|
|
6101
6320
|
if (subComponent) {
|
|
6102
6321
|
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
6103
6322
|
return subComponent;
|
|
@@ -6109,9 +6328,23 @@ function locateNonHydratedAsyncRoot(instance) {
|
|
|
6109
6328
|
function invalidateMount(hooks) {
|
|
6110
6329
|
if (hooks) {
|
|
6111
6330
|
for (let i = 0; i < hooks.length; i++)
|
|
6112
|
-
hooks[i].flags |=
|
|
6331
|
+
hooks[i].flags |= 4;
|
|
6113
6332
|
}
|
|
6114
6333
|
}
|
|
6334
|
+
function getVaporInterface(instance, vnode) {
|
|
6335
|
+
const ctx = instance ? instance.appContext : vnode.appContext;
|
|
6336
|
+
const res = ctx && ctx.vapor;
|
|
6337
|
+
if (!res) {
|
|
6338
|
+
warn$1(
|
|
6339
|
+
`Vapor component found in vdom tree but vapor-in-vdom interop was not installed. Make sure to install it:
|
|
6340
|
+
\`\`\`
|
|
6341
|
+
import { vaporInteropPlugin } from 'vue'
|
|
6342
|
+
app.use(vaporInteropPlugin)
|
|
6343
|
+
\`\`\``
|
|
6344
|
+
);
|
|
6345
|
+
}
|
|
6346
|
+
return res;
|
|
6347
|
+
}
|
|
6115
6348
|
|
|
6116
6349
|
const ssrContextKey = Symbol.for("v-scx");
|
|
6117
6350
|
const useSSRContext = () => {
|
|
@@ -6151,8 +6384,41 @@ function watch(source, cb, options) {
|
|
|
6151
6384
|
}
|
|
6152
6385
|
return doWatch(source, cb, options);
|
|
6153
6386
|
}
|
|
6387
|
+
class RenderWatcherEffect extends reactivity.WatcherEffect {
|
|
6388
|
+
constructor(instance, source, cb, options, flush) {
|
|
6389
|
+
super(source, cb, options);
|
|
6390
|
+
this.flush = flush;
|
|
6391
|
+
const job = () => {
|
|
6392
|
+
if (this.dirty) {
|
|
6393
|
+
this.run();
|
|
6394
|
+
}
|
|
6395
|
+
};
|
|
6396
|
+
if (cb) {
|
|
6397
|
+
this.flags |= 128;
|
|
6398
|
+
job.flags |= 2;
|
|
6399
|
+
}
|
|
6400
|
+
if (instance) {
|
|
6401
|
+
job.i = instance;
|
|
6402
|
+
}
|
|
6403
|
+
this.job = job;
|
|
6404
|
+
}
|
|
6405
|
+
notify() {
|
|
6406
|
+
const flags = this.flags;
|
|
6407
|
+
if (!(flags & 256)) {
|
|
6408
|
+
const flush = this.flush;
|
|
6409
|
+
const job = this.job;
|
|
6410
|
+
if (flush === "post") {
|
|
6411
|
+
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
6412
|
+
} else if (flush === "pre") {
|
|
6413
|
+
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
6414
|
+
} else {
|
|
6415
|
+
job();
|
|
6416
|
+
}
|
|
6417
|
+
}
|
|
6418
|
+
}
|
|
6419
|
+
}
|
|
6154
6420
|
function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
6155
|
-
const { immediate, deep, flush, once } = options;
|
|
6421
|
+
const { immediate, deep, flush = "pre", once } = options;
|
|
6156
6422
|
if (!cb) {
|
|
6157
6423
|
if (immediate !== void 0) {
|
|
6158
6424
|
warn$1(
|
|
@@ -6189,42 +6455,32 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
|
6189
6455
|
}
|
|
6190
6456
|
const instance = currentInstance;
|
|
6191
6457
|
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
};
|
|
6458
|
+
const effect = new RenderWatcherEffect(
|
|
6459
|
+
instance,
|
|
6460
|
+
source,
|
|
6461
|
+
cb,
|
|
6462
|
+
baseWatchOptions,
|
|
6463
|
+
flush
|
|
6464
|
+
);
|
|
6465
|
+
if (cb) {
|
|
6466
|
+
effect.run(true);
|
|
6467
|
+
} else if (flush === "post") {
|
|
6468
|
+
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
6469
|
+
} else {
|
|
6470
|
+
effect.run(true);
|
|
6206
6471
|
}
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
if (isPre) {
|
|
6212
|
-
job.flags |= 2;
|
|
6213
|
-
if (instance) {
|
|
6214
|
-
job.id = instance.uid;
|
|
6215
|
-
job.i = instance;
|
|
6216
|
-
}
|
|
6217
|
-
}
|
|
6218
|
-
};
|
|
6219
|
-
const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
|
|
6472
|
+
const stop = effect.stop.bind(effect);
|
|
6473
|
+
stop.pause = effect.pause.bind(effect);
|
|
6474
|
+
stop.resume = effect.resume.bind(effect);
|
|
6475
|
+
stop.stop = stop;
|
|
6220
6476
|
if (isInSSRComponentSetup) {
|
|
6221
6477
|
if (ssrCleanup) {
|
|
6222
|
-
ssrCleanup.push(
|
|
6478
|
+
ssrCleanup.push(stop);
|
|
6223
6479
|
} else if (runsImmediately) {
|
|
6224
|
-
|
|
6480
|
+
stop();
|
|
6225
6481
|
}
|
|
6226
6482
|
}
|
|
6227
|
-
return
|
|
6483
|
+
return stop;
|
|
6228
6484
|
}
|
|
6229
6485
|
function instanceWatch(source, value, options) {
|
|
6230
6486
|
const publicThis = this.proxy;
|
|
@@ -6236,9 +6492,9 @@ function instanceWatch(source, value, options) {
|
|
|
6236
6492
|
cb = value.handler;
|
|
6237
6493
|
options = value;
|
|
6238
6494
|
}
|
|
6239
|
-
const
|
|
6495
|
+
const prev = setCurrentInstance(this);
|
|
6240
6496
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
6241
|
-
|
|
6497
|
+
setCurrentInstance(...prev);
|
|
6242
6498
|
return res;
|
|
6243
6499
|
}
|
|
6244
6500
|
function createPathGetter(ctx, path) {
|
|
@@ -6253,7 +6509,7 @@ function createPathGetter(ctx, path) {
|
|
|
6253
6509
|
}
|
|
6254
6510
|
|
|
6255
6511
|
function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
6256
|
-
const i =
|
|
6512
|
+
const i = getCurrentGenericInstance();
|
|
6257
6513
|
if (!i) {
|
|
6258
6514
|
warn$1(`useModel() called without active instance.`);
|
|
6259
6515
|
return reactivity.ref();
|
|
@@ -6264,7 +6520,7 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
6264
6520
|
return reactivity.ref();
|
|
6265
6521
|
}
|
|
6266
6522
|
const hyphenatedName = shared.hyphenate(name);
|
|
6267
|
-
const modifiers = getModelModifiers(props, camelizedName);
|
|
6523
|
+
const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
|
|
6268
6524
|
const res = reactivity.customRef((track, trigger) => {
|
|
6269
6525
|
let localValue;
|
|
6270
6526
|
let prevSetValue = shared.EMPTY_OBJ;
|
|
@@ -6286,9 +6542,25 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
6286
6542
|
if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
|
|
6287
6543
|
return;
|
|
6288
6544
|
}
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6545
|
+
let rawPropKeys;
|
|
6546
|
+
let parentPassedModelValue = false;
|
|
6547
|
+
let parentPassedModelUpdater = false;
|
|
6548
|
+
if (i.rawKeys) {
|
|
6549
|
+
rawPropKeys = i.rawKeys();
|
|
6550
|
+
} else {
|
|
6551
|
+
const rawProps = i.vnode.props;
|
|
6552
|
+
rawPropKeys = rawProps && Object.keys(rawProps);
|
|
6553
|
+
}
|
|
6554
|
+
if (rawPropKeys) {
|
|
6555
|
+
for (const key of rawPropKeys) {
|
|
6556
|
+
if (key === name || key === camelizedName || key === hyphenatedName) {
|
|
6557
|
+
parentPassedModelValue = true;
|
|
6558
|
+
} else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) {
|
|
6559
|
+
parentPassedModelUpdater = true;
|
|
6560
|
+
}
|
|
6561
|
+
}
|
|
6562
|
+
}
|
|
6563
|
+
if (!parentPassedModelValue || !parentPassedModelUpdater) {
|
|
6292
6564
|
localValue = value;
|
|
6293
6565
|
trigger();
|
|
6294
6566
|
}
|
|
@@ -6315,21 +6587,26 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
6315
6587
|
};
|
|
6316
6588
|
return res;
|
|
6317
6589
|
}
|
|
6318
|
-
const getModelModifiers = (props, modelName) => {
|
|
6319
|
-
return modelName === "modelValue" || modelName === "model-value" ? props
|
|
6590
|
+
const getModelModifiers = (props, modelName, getter) => {
|
|
6591
|
+
return modelName === "modelValue" || modelName === "model-value" ? getter(props, "modelModifiers") : getter(props, `${modelName}Modifiers`) || getter(props, `${shared.camelize(modelName)}Modifiers`) || getter(props, `${shared.hyphenate(modelName)}Modifiers`);
|
|
6320
6592
|
};
|
|
6321
6593
|
|
|
6322
6594
|
function emit(instance, event, ...rawArgs) {
|
|
6595
|
+
return baseEmit(
|
|
6596
|
+
instance,
|
|
6597
|
+
instance.vnode.props || shared.EMPTY_OBJ,
|
|
6598
|
+
defaultPropGetter,
|
|
6599
|
+
event,
|
|
6600
|
+
...rawArgs
|
|
6601
|
+
);
|
|
6602
|
+
}
|
|
6603
|
+
function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
6323
6604
|
if (instance.isUnmounted) return;
|
|
6324
|
-
const props = instance.vnode.props || shared.EMPTY_OBJ;
|
|
6325
6605
|
{
|
|
6326
|
-
const {
|
|
6327
|
-
emitsOptions,
|
|
6328
|
-
propsOptions: [propsOptions]
|
|
6329
|
-
} = instance;
|
|
6606
|
+
const { emitsOptions, propsOptions } = instance;
|
|
6330
6607
|
if (emitsOptions) {
|
|
6331
6608
|
if (!(event in emitsOptions) && true) {
|
|
6332
|
-
if (!propsOptions || !(shared.toHandlerKey(shared.camelize(event)) in propsOptions)) {
|
|
6609
|
+
if (!propsOptions || !propsOptions[0] || !(shared.toHandlerKey(shared.camelize(event)) in propsOptions[0])) {
|
|
6333
6610
|
warn$1(
|
|
6334
6611
|
`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${shared.toHandlerKey(shared.camelize(event))}" prop.`
|
|
6335
6612
|
);
|
|
@@ -6349,7 +6626,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6349
6626
|
}
|
|
6350
6627
|
let args = rawArgs;
|
|
6351
6628
|
const isModelListener = event.startsWith("update:");
|
|
6352
|
-
const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
|
|
6629
|
+
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
6353
6630
|
if (modifiers) {
|
|
6354
6631
|
if (modifiers.trim) {
|
|
6355
6632
|
args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a);
|
|
@@ -6363,7 +6640,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6363
6640
|
}
|
|
6364
6641
|
{
|
|
6365
6642
|
const lowerCaseEvent = event.toLowerCase();
|
|
6366
|
-
if (lowerCaseEvent !== event && props
|
|
6643
|
+
if (lowerCaseEvent !== event && getter(props, shared.toHandlerKey(lowerCaseEvent))) {
|
|
6367
6644
|
warn$1(
|
|
6368
6645
|
`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
|
|
6369
6646
|
instance,
|
|
@@ -6375,10 +6652,10 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6375
6652
|
}
|
|
6376
6653
|
}
|
|
6377
6654
|
let handlerName;
|
|
6378
|
-
let handler = props
|
|
6379
|
-
props
|
|
6655
|
+
let handler = getter(props, handlerName = shared.toHandlerKey(event)) || // also try camelCase event handler (#2249)
|
|
6656
|
+
getter(props, handlerName = shared.toHandlerKey(shared.camelize(event)));
|
|
6380
6657
|
if (!handler && isModelListener) {
|
|
6381
|
-
handler = props
|
|
6658
|
+
handler = getter(props, handlerName = shared.toHandlerKey(shared.hyphenate(event)));
|
|
6382
6659
|
}
|
|
6383
6660
|
if (handler) {
|
|
6384
6661
|
callWithAsyncErrorHandling(
|
|
@@ -6388,7 +6665,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6388
6665
|
args
|
|
6389
6666
|
);
|
|
6390
6667
|
}
|
|
6391
|
-
const onceHandler = props
|
|
6668
|
+
const onceHandler = getter(props, handlerName + `Once`);
|
|
6392
6669
|
if (onceHandler) {
|
|
6393
6670
|
if (!instance.emitted) {
|
|
6394
6671
|
instance.emitted = {};
|
|
@@ -6404,6 +6681,9 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6404
6681
|
);
|
|
6405
6682
|
}
|
|
6406
6683
|
}
|
|
6684
|
+
function defaultPropGetter(props, key) {
|
|
6685
|
+
return props[key];
|
|
6686
|
+
}
|
|
6407
6687
|
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
6408
6688
|
const cache = appContext.emitsCache;
|
|
6409
6689
|
const cached = cache.get(comp);
|
|
@@ -6731,7 +7011,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
6731
7011
|
return false;
|
|
6732
7012
|
}
|
|
6733
7013
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
6734
|
-
while (parent) {
|
|
7014
|
+
while (parent && !parent.vapor) {
|
|
6735
7015
|
const root = parent.subTree;
|
|
6736
7016
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
6737
7017
|
root.el = vnode.el;
|
|
@@ -7082,7 +7362,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7082
7362
|
pendingBranch,
|
|
7083
7363
|
container2,
|
|
7084
7364
|
anchor === initialAnchor ? next(activeBranch) : anchor,
|
|
7085
|
-
0
|
|
7365
|
+
0,
|
|
7366
|
+
parentComponent2
|
|
7086
7367
|
);
|
|
7087
7368
|
queuePostFlushCb(effects);
|
|
7088
7369
|
}
|
|
@@ -7095,7 +7376,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7095
7376
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
7096
7377
|
}
|
|
7097
7378
|
if (!delayEnter) {
|
|
7098
|
-
move(
|
|
7379
|
+
move(
|
|
7380
|
+
pendingBranch,
|
|
7381
|
+
container2,
|
|
7382
|
+
anchor,
|
|
7383
|
+
0,
|
|
7384
|
+
parentComponent2
|
|
7385
|
+
);
|
|
7099
7386
|
}
|
|
7100
7387
|
}
|
|
7101
7388
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -7168,7 +7455,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7168
7455
|
}
|
|
7169
7456
|
},
|
|
7170
7457
|
move(container2, anchor2, type) {
|
|
7171
|
-
suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
|
|
7458
|
+
suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type, parentComponent);
|
|
7172
7459
|
suspense.container = container2;
|
|
7173
7460
|
},
|
|
7174
7461
|
next() {
|
|
@@ -7308,7 +7595,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
7308
7595
|
}
|
|
7309
7596
|
return s;
|
|
7310
7597
|
}
|
|
7311
|
-
function queueEffectWithSuspense(fn, suspense) {
|
|
7598
|
+
function queueEffectWithSuspense(fn, id, suspense) {
|
|
7312
7599
|
if (suspense && suspense.pendingBranch) {
|
|
7313
7600
|
if (shared.isArray(fn)) {
|
|
7314
7601
|
suspense.effects.push(...fn);
|
|
@@ -7316,7 +7603,7 @@ function queueEffectWithSuspense(fn, suspense) {
|
|
|
7316
7603
|
suspense.effects.push(fn);
|
|
7317
7604
|
}
|
|
7318
7605
|
} else {
|
|
7319
|
-
queuePostFlushCb(fn);
|
|
7606
|
+
queuePostFlushCb(fn, id);
|
|
7320
7607
|
}
|
|
7321
7608
|
}
|
|
7322
7609
|
function setActiveBranch(suspense, branch) {
|
|
@@ -7342,6 +7629,7 @@ const Fragment = Symbol.for("v-fgt");
|
|
|
7342
7629
|
const Text = Symbol.for("v-txt");
|
|
7343
7630
|
const Comment = Symbol.for("v-cmt");
|
|
7344
7631
|
const Static = Symbol.for("v-stc");
|
|
7632
|
+
const VaporSlot = Symbol.for("v-vps");
|
|
7345
7633
|
const blockStack = [];
|
|
7346
7634
|
let currentBlock = null;
|
|
7347
7635
|
function openBlock(disableTracking = false) {
|
|
@@ -7715,6 +8003,40 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
7715
8003
|
]);
|
|
7716
8004
|
}
|
|
7717
8005
|
|
|
8006
|
+
let currentInstance = null;
|
|
8007
|
+
const getCurrentGenericInstance = () => currentInstance || currentRenderingInstance;
|
|
8008
|
+
const getCurrentInstance = () => currentInstance && !currentInstance.vapor ? currentInstance : currentRenderingInstance;
|
|
8009
|
+
let isInSSRComponentSetup = false;
|
|
8010
|
+
let setInSSRSetupState;
|
|
8011
|
+
let simpleSetCurrentInstance;
|
|
8012
|
+
{
|
|
8013
|
+
const g = shared.getGlobalThis();
|
|
8014
|
+
const registerGlobalSetter = (key, setter) => {
|
|
8015
|
+
let setters;
|
|
8016
|
+
if (!(setters = g[key])) setters = g[key] = [];
|
|
8017
|
+
setters.push(setter);
|
|
8018
|
+
return (v) => {
|
|
8019
|
+
if (setters.length > 1) setters.forEach((set) => set(v));
|
|
8020
|
+
else setters[0](v);
|
|
8021
|
+
};
|
|
8022
|
+
};
|
|
8023
|
+
simpleSetCurrentInstance = registerGlobalSetter(
|
|
8024
|
+
`__VUE_INSTANCE_SETTERS__`,
|
|
8025
|
+
(v) => currentInstance = v
|
|
8026
|
+
);
|
|
8027
|
+
setInSSRSetupState = registerGlobalSetter(
|
|
8028
|
+
`__VUE_SSR_SETTERS__`,
|
|
8029
|
+
(v) => isInSSRComponentSetup = v
|
|
8030
|
+
);
|
|
8031
|
+
}
|
|
8032
|
+
const setCurrentInstance = (instance, scope = instance !== null ? instance.scope : void 0) => {
|
|
8033
|
+
try {
|
|
8034
|
+
return [currentInstance, reactivity.setCurrentScope(scope)];
|
|
8035
|
+
} finally {
|
|
8036
|
+
simpleSetCurrentInstance(instance);
|
|
8037
|
+
}
|
|
8038
|
+
};
|
|
8039
|
+
|
|
7718
8040
|
const emptyAppContext = createAppContext();
|
|
7719
8041
|
let uid = 0;
|
|
7720
8042
|
function createComponentInstance(vnode, parent, suspense) {
|
|
@@ -7759,7 +8081,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7759
8081
|
// to be set immediately
|
|
7760
8082
|
emitted: null,
|
|
7761
8083
|
// props default value
|
|
7762
|
-
propsDefaults:
|
|
8084
|
+
propsDefaults: null,
|
|
7763
8085
|
// inheritAttrs
|
|
7764
8086
|
inheritAttrs: type.inheritAttrs,
|
|
7765
8087
|
// state
|
|
@@ -7806,46 +8128,8 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7806
8128
|
}
|
|
7807
8129
|
return instance;
|
|
7808
8130
|
}
|
|
7809
|
-
let currentInstance = null;
|
|
7810
|
-
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
7811
|
-
let internalSetCurrentInstance;
|
|
7812
|
-
let setInSSRSetupState;
|
|
7813
|
-
{
|
|
7814
|
-
const g = shared.getGlobalThis();
|
|
7815
|
-
const registerGlobalSetter = (key, setter) => {
|
|
7816
|
-
let setters;
|
|
7817
|
-
if (!(setters = g[key])) setters = g[key] = [];
|
|
7818
|
-
setters.push(setter);
|
|
7819
|
-
return (v) => {
|
|
7820
|
-
if (setters.length > 1) setters.forEach((set) => set(v));
|
|
7821
|
-
else setters[0](v);
|
|
7822
|
-
};
|
|
7823
|
-
};
|
|
7824
|
-
internalSetCurrentInstance = registerGlobalSetter(
|
|
7825
|
-
`__VUE_INSTANCE_SETTERS__`,
|
|
7826
|
-
(v) => currentInstance = v
|
|
7827
|
-
);
|
|
7828
|
-
setInSSRSetupState = registerGlobalSetter(
|
|
7829
|
-
`__VUE_SSR_SETTERS__`,
|
|
7830
|
-
(v) => isInSSRComponentSetup = v
|
|
7831
|
-
);
|
|
7832
|
-
}
|
|
7833
|
-
const setCurrentInstance = (instance) => {
|
|
7834
|
-
const prev = currentInstance;
|
|
7835
|
-
internalSetCurrentInstance(instance);
|
|
7836
|
-
instance.scope.on();
|
|
7837
|
-
return () => {
|
|
7838
|
-
instance.scope.off();
|
|
7839
|
-
internalSetCurrentInstance(prev);
|
|
7840
|
-
};
|
|
7841
|
-
};
|
|
7842
|
-
const unsetCurrentInstance = () => {
|
|
7843
|
-
currentInstance && currentInstance.scope.off();
|
|
7844
|
-
internalSetCurrentInstance(null);
|
|
7845
|
-
};
|
|
7846
|
-
const isBuiltInTag = /* @__PURE__ */ shared.makeMap("slot,component");
|
|
7847
8131
|
function validateComponentName(name, { isNativeTag }) {
|
|
7848
|
-
if (isBuiltInTag(name) || isNativeTag(name)) {
|
|
8132
|
+
if (shared.isBuiltInTag(name) || isNativeTag(name)) {
|
|
7849
8133
|
warn$1(
|
|
7850
8134
|
"Do not use built-in or reserved HTML elements as component id: " + name
|
|
7851
8135
|
);
|
|
@@ -7854,13 +8138,16 @@ function validateComponentName(name, { isNativeTag }) {
|
|
|
7854
8138
|
function isStatefulComponent(instance) {
|
|
7855
8139
|
return instance.vnode.shapeFlag & 4;
|
|
7856
8140
|
}
|
|
7857
|
-
let isInSSRComponentSetup = false;
|
|
7858
8141
|
function setupComponent(instance, isSSR = false, optimized = false) {
|
|
7859
8142
|
isSSR && setInSSRSetupState(isSSR);
|
|
7860
|
-
const { props, children } = instance.vnode;
|
|
8143
|
+
const { props, children, vi } = instance.vnode;
|
|
7861
8144
|
const isStateful = isStatefulComponent(instance);
|
|
7862
|
-
|
|
7863
|
-
|
|
8145
|
+
if (vi) {
|
|
8146
|
+
vi(instance);
|
|
8147
|
+
} else {
|
|
8148
|
+
initProps(instance, props, isStateful, isSSR);
|
|
8149
|
+
initSlots(instance, children, optimized || isSSR);
|
|
8150
|
+
}
|
|
7864
8151
|
const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
|
|
7865
8152
|
isSSR && setInSSRSetupState(false);
|
|
7866
8153
|
return setupResult;
|
|
@@ -7897,9 +8184,9 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7897
8184
|
}
|
|
7898
8185
|
const { setup } = Component;
|
|
7899
8186
|
if (setup) {
|
|
7900
|
-
reactivity.
|
|
8187
|
+
const prevSub = reactivity.setActiveSub();
|
|
7901
8188
|
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
7902
|
-
const
|
|
8189
|
+
const prev = setCurrentInstance(instance);
|
|
7903
8190
|
const setupResult = callWithErrorHandling(
|
|
7904
8191
|
setup,
|
|
7905
8192
|
instance,
|
|
@@ -7910,12 +8197,15 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7910
8197
|
]
|
|
7911
8198
|
);
|
|
7912
8199
|
const isAsyncSetup = shared.isPromise(setupResult);
|
|
7913
|
-
reactivity.
|
|
7914
|
-
|
|
8200
|
+
reactivity.setActiveSub(prevSub);
|
|
8201
|
+
setCurrentInstance(...prev);
|
|
7915
8202
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
7916
8203
|
markAsyncBoundary(instance);
|
|
7917
8204
|
}
|
|
7918
8205
|
if (isAsyncSetup) {
|
|
8206
|
+
const unsetCurrentInstance = () => {
|
|
8207
|
+
setCurrentInstance(null, void 0);
|
|
8208
|
+
};
|
|
7919
8209
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
7920
8210
|
if (isSSR) {
|
|
7921
8211
|
return setupResult.then((resolvedResult) => {
|
|
@@ -8010,13 +8300,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
8010
8300
|
}
|
|
8011
8301
|
}
|
|
8012
8302
|
{
|
|
8013
|
-
const
|
|
8014
|
-
reactivity.
|
|
8303
|
+
const prevInstance = setCurrentInstance(instance);
|
|
8304
|
+
const prevSub = reactivity.setActiveSub();
|
|
8015
8305
|
try {
|
|
8016
8306
|
applyOptions(instance);
|
|
8017
8307
|
} finally {
|
|
8018
|
-
reactivity.
|
|
8019
|
-
|
|
8308
|
+
reactivity.setActiveSub(prevSub);
|
|
8309
|
+
setCurrentInstance(...prevInstance);
|
|
8020
8310
|
}
|
|
8021
8311
|
}
|
|
8022
8312
|
if (!Component.render && instance.render === shared.NOOP && !isSSR) {
|
|
@@ -8053,29 +8343,6 @@ function getSlotsProxy(instance) {
|
|
|
8053
8343
|
});
|
|
8054
8344
|
}
|
|
8055
8345
|
function createSetupContext(instance) {
|
|
8056
|
-
const expose = (exposed) => {
|
|
8057
|
-
{
|
|
8058
|
-
if (instance.exposed) {
|
|
8059
|
-
warn$1(`expose() should be called only once per setup().`);
|
|
8060
|
-
}
|
|
8061
|
-
if (exposed != null) {
|
|
8062
|
-
let exposedType = typeof exposed;
|
|
8063
|
-
if (exposedType === "object") {
|
|
8064
|
-
if (shared.isArray(exposed)) {
|
|
8065
|
-
exposedType = "array";
|
|
8066
|
-
} else if (reactivity.isRef(exposed)) {
|
|
8067
|
-
exposedType = "ref";
|
|
8068
|
-
}
|
|
8069
|
-
}
|
|
8070
|
-
if (exposedType !== "object") {
|
|
8071
|
-
warn$1(
|
|
8072
|
-
`expose() should be passed a plain object, received ${exposedType}.`
|
|
8073
|
-
);
|
|
8074
|
-
}
|
|
8075
|
-
}
|
|
8076
|
-
}
|
|
8077
|
-
instance.exposed = exposed || {};
|
|
8078
|
-
};
|
|
8079
8346
|
{
|
|
8080
8347
|
let attrsProxy;
|
|
8081
8348
|
let slotsProxy;
|
|
@@ -8089,10 +8356,33 @@ function createSetupContext(instance) {
|
|
|
8089
8356
|
get emit() {
|
|
8090
8357
|
return (event, ...args) => instance.emit(event, ...args);
|
|
8091
8358
|
},
|
|
8092
|
-
expose
|
|
8359
|
+
expose: (exposed) => expose(instance, exposed)
|
|
8093
8360
|
});
|
|
8094
8361
|
}
|
|
8095
8362
|
}
|
|
8363
|
+
function expose(instance, exposed) {
|
|
8364
|
+
{
|
|
8365
|
+
if (instance.exposed) {
|
|
8366
|
+
warn$1(`expose() should be called only once per setup().`);
|
|
8367
|
+
}
|
|
8368
|
+
if (exposed != null) {
|
|
8369
|
+
let exposedType = typeof exposed;
|
|
8370
|
+
if (exposedType === "object") {
|
|
8371
|
+
if (shared.isArray(exposed)) {
|
|
8372
|
+
exposedType = "array";
|
|
8373
|
+
} else if (reactivity.isRef(exposed)) {
|
|
8374
|
+
exposedType = "ref";
|
|
8375
|
+
}
|
|
8376
|
+
}
|
|
8377
|
+
if (exposedType !== "object") {
|
|
8378
|
+
warn$1(
|
|
8379
|
+
`expose() should be passed a plain object, received ${exposedType}.`
|
|
8380
|
+
);
|
|
8381
|
+
}
|
|
8382
|
+
}
|
|
8383
|
+
}
|
|
8384
|
+
instance.exposed = exposed || {};
|
|
8385
|
+
}
|
|
8096
8386
|
function getComponentPublicInstance(instance) {
|
|
8097
8387
|
if (instance.exposed) {
|
|
8098
8388
|
return instance.exposeProxy || (instance.exposeProxy = new Proxy(reactivity.proxyRefs(reactivity.markRaw(instance.exposed)), {
|
|
@@ -8100,7 +8390,9 @@ function getComponentPublicInstance(instance) {
|
|
|
8100
8390
|
if (key in target) {
|
|
8101
8391
|
return target[key];
|
|
8102
8392
|
} else if (key in publicPropertiesMap) {
|
|
8103
|
-
return publicPropertiesMap[key](
|
|
8393
|
+
return publicPropertiesMap[key](
|
|
8394
|
+
instance
|
|
8395
|
+
);
|
|
8104
8396
|
}
|
|
8105
8397
|
},
|
|
8106
8398
|
has(target, key) {
|
|
@@ -8143,14 +8435,7 @@ function isClassComponent(value) {
|
|
|
8143
8435
|
}
|
|
8144
8436
|
|
|
8145
8437
|
const computed = (getterOrOptions, debugOptions) => {
|
|
8146
|
-
|
|
8147
|
-
{
|
|
8148
|
-
const i = getCurrentInstance();
|
|
8149
|
-
if (i && i.appContext.config.warnRecursiveComputed) {
|
|
8150
|
-
c._warnRecursive = true;
|
|
8151
|
-
}
|
|
8152
|
-
}
|
|
8153
|
-
return c;
|
|
8438
|
+
return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
8154
8439
|
};
|
|
8155
8440
|
|
|
8156
8441
|
function h(type, propsOrChildren, children) {
|
|
@@ -8191,9 +8476,9 @@ function initCustomFormatter() {
|
|
|
8191
8476
|
if (obj.__isVue) {
|
|
8192
8477
|
return ["div", vueStyle, `VueInstance`];
|
|
8193
8478
|
} else if (reactivity.isRef(obj)) {
|
|
8194
|
-
reactivity.
|
|
8479
|
+
const prevSub = reactivity.setActiveSub();
|
|
8195
8480
|
const value = obj.value;
|
|
8196
|
-
reactivity.
|
|
8481
|
+
reactivity.setActiveSub(prevSub);
|
|
8197
8482
|
return [
|
|
8198
8483
|
"div",
|
|
8199
8484
|
{},
|
|
@@ -8380,7 +8665,7 @@ function isMemoSame(cached, memo) {
|
|
|
8380
8665
|
return true;
|
|
8381
8666
|
}
|
|
8382
8667
|
|
|
8383
|
-
const version = "3.
|
|
8668
|
+
const version = "3.6.0-alpha.2";
|
|
8384
8669
|
const warn = warn$1 ;
|
|
8385
8670
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8386
8671
|
const devtools = devtools$1 ;
|