@vue/runtime-core 3.5.16 → 3.6.0-alpha.1
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 +874 -584
- package/dist/runtime-core.cjs.prod.js +703 -437
- package/dist/runtime-core.d.ts +121 -55
- package/dist/runtime-core.esm-bundler.js +892 -588
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.
|
|
2
|
+
* @vue/runtime-core v3.6.0-alpha.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
var reactivity = require('@vue/reactivity');
|
|
11
11
|
var shared = require('@vue/shared');
|
|
12
12
|
|
|
13
|
-
function pushWarningContext(
|
|
13
|
+
function pushWarningContext(ctx) {
|
|
14
14
|
}
|
|
15
15
|
function popWarningContext() {
|
|
16
16
|
}
|
|
@@ -107,11 +107,10 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
function handleError(err, instance, type, throwInDev = true) {
|
|
110
|
-
const contextVNode = instance ? instance.vnode : null;
|
|
111
110
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ;
|
|
112
111
|
if (instance) {
|
|
113
112
|
let cur = instance.parent;
|
|
114
|
-
const exposedInstance = instance.proxy;
|
|
113
|
+
const exposedInstance = instance.proxy || instance;
|
|
115
114
|
const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
|
|
116
115
|
while (cur) {
|
|
117
116
|
const errorCapturedHooks = cur.ec;
|
|
@@ -125,19 +124,19 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
125
124
|
cur = cur.parent;
|
|
126
125
|
}
|
|
127
126
|
if (errorHandler) {
|
|
128
|
-
reactivity.
|
|
127
|
+
const prevSub = reactivity.setActiveSub();
|
|
129
128
|
callWithErrorHandling(errorHandler, null, 10, [
|
|
130
129
|
err,
|
|
131
130
|
exposedInstance,
|
|
132
131
|
errorInfo
|
|
133
132
|
]);
|
|
134
|
-
reactivity.
|
|
133
|
+
reactivity.setActiveSub(prevSub);
|
|
135
134
|
return;
|
|
136
135
|
}
|
|
137
136
|
}
|
|
138
|
-
logError(err, type,
|
|
137
|
+
logError(err, type, instance, throwInDev, throwUnhandledErrorInProduction);
|
|
139
138
|
}
|
|
140
|
-
function logError(err, type,
|
|
139
|
+
function logError(err, type, instance, throwInDev = true, throwInProd = false) {
|
|
141
140
|
if (throwInProd) {
|
|
142
141
|
throw err;
|
|
143
142
|
} else {
|
|
@@ -145,25 +144,22 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
|
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
146
|
|
|
148
|
-
const
|
|
149
|
-
let
|
|
150
|
-
|
|
151
|
-
let
|
|
147
|
+
const jobs = [];
|
|
148
|
+
let postJobs = [];
|
|
149
|
+
let activePostJobs = null;
|
|
150
|
+
let currentFlushPromise = null;
|
|
151
|
+
let jobsLength = 0;
|
|
152
|
+
let flushIndex = 0;
|
|
152
153
|
let postFlushIndex = 0;
|
|
153
154
|
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
|
|
154
|
-
let currentFlushPromise = null;
|
|
155
155
|
function nextTick(fn) {
|
|
156
156
|
const p = currentFlushPromise || resolvedPromise;
|
|
157
157
|
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
158
158
|
}
|
|
159
|
-
function findInsertionIndex(
|
|
160
|
-
let start = flushIndex + 1;
|
|
161
|
-
let end = queue.length;
|
|
159
|
+
function findInsertionIndex(order, queue, start, end) {
|
|
162
160
|
while (start < end) {
|
|
163
161
|
const middle = start + end >>> 1;
|
|
164
|
-
|
|
165
|
-
const middleJobId = getId(middleJob);
|
|
166
|
-
if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
|
|
162
|
+
if (queue[middle].order <= order) {
|
|
167
163
|
start = middle + 1;
|
|
168
164
|
} else {
|
|
169
165
|
end = middle;
|
|
@@ -171,112 +167,151 @@ function findInsertionIndex(id) {
|
|
|
171
167
|
}
|
|
172
168
|
return start;
|
|
173
169
|
}
|
|
174
|
-
function queueJob(job) {
|
|
175
|
-
if (
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
170
|
+
function queueJob(job, id, isPre = false) {
|
|
171
|
+
if (queueJobWorker(
|
|
172
|
+
job,
|
|
173
|
+
id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1,
|
|
174
|
+
jobs,
|
|
175
|
+
jobsLength,
|
|
176
|
+
flushIndex
|
|
177
|
+
)) {
|
|
178
|
+
jobsLength++;
|
|
179
|
+
queueFlush();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function queueJobWorker(job, order, queue, length, flushIndex2) {
|
|
183
|
+
const flags = job.flags;
|
|
184
|
+
if (!(flags & 1)) {
|
|
185
|
+
job.flags = flags | 1;
|
|
186
|
+
job.order = order;
|
|
187
|
+
if (flushIndex2 === length || // fast path when the job id is larger than the tail
|
|
188
|
+
order >= queue[length - 1].order) {
|
|
189
|
+
queue[length] = job;
|
|
181
190
|
} else {
|
|
182
|
-
queue.splice(findInsertionIndex(
|
|
191
|
+
queue.splice(findInsertionIndex(order, queue, flushIndex2, length), 0, job);
|
|
183
192
|
}
|
|
184
|
-
|
|
185
|
-
queueFlush();
|
|
193
|
+
return true;
|
|
186
194
|
}
|
|
195
|
+
return false;
|
|
187
196
|
}
|
|
197
|
+
const doFlushJobs = () => {
|
|
198
|
+
try {
|
|
199
|
+
flushJobs();
|
|
200
|
+
} catch (e) {
|
|
201
|
+
currentFlushPromise = null;
|
|
202
|
+
throw e;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
188
205
|
function queueFlush() {
|
|
189
206
|
if (!currentFlushPromise) {
|
|
190
|
-
currentFlushPromise = resolvedPromise.then(
|
|
207
|
+
currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
191
208
|
}
|
|
192
209
|
}
|
|
193
|
-
function queuePostFlushCb(
|
|
194
|
-
if (!shared.isArray(
|
|
195
|
-
if (
|
|
196
|
-
|
|
197
|
-
} else
|
|
198
|
-
|
|
199
|
-
cb.flags |= 1;
|
|
210
|
+
function queuePostFlushCb(jobs2, id = Infinity) {
|
|
211
|
+
if (!shared.isArray(jobs2)) {
|
|
212
|
+
if (activePostJobs && id === -1) {
|
|
213
|
+
activePostJobs.splice(postFlushIndex, 0, jobs2);
|
|
214
|
+
} else {
|
|
215
|
+
queueJobWorker(jobs2, id, postJobs, postJobs.length, 0);
|
|
200
216
|
}
|
|
201
217
|
} else {
|
|
202
|
-
|
|
218
|
+
for (const job of jobs2) {
|
|
219
|
+
queueJobWorker(job, id, postJobs, postJobs.length, 0);
|
|
220
|
+
}
|
|
203
221
|
}
|
|
204
222
|
queueFlush();
|
|
205
223
|
}
|
|
206
|
-
function flushPreFlushCbs(instance, seen
|
|
207
|
-
for (; i <
|
|
208
|
-
const cb =
|
|
209
|
-
if (cb
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
function flushPreFlushCbs(instance, seen) {
|
|
225
|
+
for (let i = flushIndex; i < jobsLength; i++) {
|
|
226
|
+
const cb = jobs[i];
|
|
227
|
+
if (cb.order & 1 || cb.order === Infinity) {
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
if (instance && cb.order !== instance.uid * 2) {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
jobs.splice(i, 1);
|
|
234
|
+
i--;
|
|
235
|
+
jobsLength--;
|
|
236
|
+
if (cb.flags & 2) {
|
|
237
|
+
cb.flags &= -2;
|
|
238
|
+
}
|
|
239
|
+
cb();
|
|
240
|
+
if (!(cb.flags & 2)) {
|
|
241
|
+
cb.flags &= -2;
|
|
222
242
|
}
|
|
223
243
|
}
|
|
224
244
|
}
|
|
225
245
|
function flushPostFlushCbs(seen) {
|
|
226
|
-
if (
|
|
227
|
-
|
|
228
|
-
(
|
|
229
|
-
|
|
230
|
-
pendingPostFlushCbs.length = 0;
|
|
231
|
-
if (activePostFlushCbs) {
|
|
232
|
-
activePostFlushCbs.push(...deduped);
|
|
246
|
+
if (postJobs.length) {
|
|
247
|
+
if (activePostJobs) {
|
|
248
|
+
activePostJobs.push(...postJobs);
|
|
249
|
+
postJobs.length = 0;
|
|
233
250
|
return;
|
|
234
251
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
252
|
+
activePostJobs = postJobs;
|
|
253
|
+
postJobs = [];
|
|
254
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
255
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
256
|
+
if (cb.flags & 2) {
|
|
239
257
|
cb.flags &= -2;
|
|
240
258
|
}
|
|
241
|
-
if (!(cb.flags &
|
|
242
|
-
|
|
259
|
+
if (!(cb.flags & 4)) {
|
|
260
|
+
try {
|
|
261
|
+
cb();
|
|
262
|
+
} finally {
|
|
263
|
+
cb.flags &= -2;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
243
266
|
}
|
|
244
|
-
|
|
267
|
+
activePostJobs = null;
|
|
245
268
|
postFlushIndex = 0;
|
|
246
269
|
}
|
|
247
270
|
}
|
|
248
|
-
|
|
271
|
+
let isFlushing = false;
|
|
272
|
+
function flushOnAppMount() {
|
|
273
|
+
if (!isFlushing) {
|
|
274
|
+
isFlushing = true;
|
|
275
|
+
flushPreFlushCbs();
|
|
276
|
+
flushPostFlushCbs();
|
|
277
|
+
isFlushing = false;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
249
280
|
function flushJobs(seen) {
|
|
250
281
|
try {
|
|
251
|
-
|
|
252
|
-
const job =
|
|
253
|
-
|
|
282
|
+
while (flushIndex < jobsLength) {
|
|
283
|
+
const job = jobs[flushIndex];
|
|
284
|
+
jobs[flushIndex++] = void 0;
|
|
285
|
+
if (!(job.flags & 4)) {
|
|
254
286
|
if (false) ;
|
|
255
|
-
if (job.flags &
|
|
287
|
+
if (job.flags & 2) {
|
|
256
288
|
job.flags &= ~1;
|
|
257
289
|
}
|
|
258
|
-
|
|
259
|
-
job
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
290
|
+
try {
|
|
291
|
+
job();
|
|
292
|
+
} catch (err) {
|
|
293
|
+
handleError(
|
|
294
|
+
err,
|
|
295
|
+
job.i,
|
|
296
|
+
job.i ? 15 : 14
|
|
297
|
+
);
|
|
298
|
+
} finally {
|
|
299
|
+
if (!(job.flags & 2)) {
|
|
300
|
+
job.flags &= ~1;
|
|
301
|
+
}
|
|
265
302
|
}
|
|
266
303
|
}
|
|
267
304
|
}
|
|
268
305
|
} finally {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
job.flags &= -2;
|
|
273
|
-
}
|
|
306
|
+
while (flushIndex < jobsLength) {
|
|
307
|
+
jobs[flushIndex].flags &= -2;
|
|
308
|
+
jobs[flushIndex++] = void 0;
|
|
274
309
|
}
|
|
275
|
-
flushIndex =
|
|
276
|
-
|
|
310
|
+
flushIndex = 0;
|
|
311
|
+
jobsLength = 0;
|
|
277
312
|
flushPostFlushCbs();
|
|
278
313
|
currentFlushPromise = null;
|
|
279
|
-
if (
|
|
314
|
+
if (jobsLength || postJobs.length) {
|
|
280
315
|
flushJobs();
|
|
281
316
|
}
|
|
282
317
|
}
|
|
@@ -364,14 +399,14 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
364
399
|
}
|
|
365
400
|
let hook = binding.dir[name];
|
|
366
401
|
if (hook) {
|
|
367
|
-
reactivity.
|
|
402
|
+
const prevSub = reactivity.setActiveSub();
|
|
368
403
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
369
404
|
vnode.el,
|
|
370
405
|
binding,
|
|
371
406
|
vnode,
|
|
372
407
|
prevVNode
|
|
373
408
|
]);
|
|
374
|
-
reactivity.
|
|
409
|
+
reactivity.setActiveSub(prevSub);
|
|
375
410
|
}
|
|
376
411
|
}
|
|
377
412
|
}
|
|
@@ -450,29 +485,37 @@ const TeleportImpl = {
|
|
|
450
485
|
}
|
|
451
486
|
if (isTeleportDeferred(n2.props)) {
|
|
452
487
|
n2.el.__isMounted = false;
|
|
453
|
-
queuePostRenderEffect(
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
488
|
+
queuePostRenderEffect(
|
|
489
|
+
() => {
|
|
490
|
+
mountToTarget();
|
|
491
|
+
delete n2.el.__isMounted;
|
|
492
|
+
},
|
|
493
|
+
void 0,
|
|
494
|
+
parentSuspense
|
|
495
|
+
);
|
|
457
496
|
} else {
|
|
458
497
|
mountToTarget();
|
|
459
498
|
}
|
|
460
499
|
} else {
|
|
461
500
|
if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
|
|
462
|
-
queuePostRenderEffect(
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
501
|
+
queuePostRenderEffect(
|
|
502
|
+
() => {
|
|
503
|
+
TeleportImpl.process(
|
|
504
|
+
n1,
|
|
505
|
+
n2,
|
|
506
|
+
container,
|
|
507
|
+
anchor,
|
|
508
|
+
parentComponent,
|
|
509
|
+
parentSuspense,
|
|
510
|
+
namespace,
|
|
511
|
+
slotScopeIds,
|
|
512
|
+
optimized,
|
|
513
|
+
internals
|
|
514
|
+
);
|
|
515
|
+
},
|
|
516
|
+
void 0,
|
|
517
|
+
parentSuspense
|
|
518
|
+
);
|
|
476
519
|
return;
|
|
477
520
|
}
|
|
478
521
|
n2.el = n1.el;
|
|
@@ -519,6 +562,7 @@ const TeleportImpl = {
|
|
|
519
562
|
container,
|
|
520
563
|
mainAnchor,
|
|
521
564
|
internals,
|
|
565
|
+
parentComponent,
|
|
522
566
|
1
|
|
523
567
|
);
|
|
524
568
|
} else {
|
|
@@ -538,6 +582,7 @@ const TeleportImpl = {
|
|
|
538
582
|
nextTarget,
|
|
539
583
|
null,
|
|
540
584
|
internals,
|
|
585
|
+
parentComponent,
|
|
541
586
|
0
|
|
542
587
|
);
|
|
543
588
|
}
|
|
@@ -547,6 +592,7 @@ const TeleportImpl = {
|
|
|
547
592
|
target,
|
|
548
593
|
targetAnchor,
|
|
549
594
|
internals,
|
|
595
|
+
parentComponent,
|
|
550
596
|
1
|
|
551
597
|
);
|
|
552
598
|
}
|
|
@@ -586,7 +632,7 @@ const TeleportImpl = {
|
|
|
586
632
|
move: moveTeleport,
|
|
587
633
|
hydrate: hydrateTeleport
|
|
588
634
|
};
|
|
589
|
-
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
|
|
635
|
+
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
|
|
590
636
|
if (moveType === 0) {
|
|
591
637
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
592
638
|
}
|
|
@@ -602,7 +648,8 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
602
648
|
children[i],
|
|
603
649
|
container,
|
|
604
650
|
parentAnchor,
|
|
605
|
-
2
|
|
651
|
+
2,
|
|
652
|
+
parentComponent
|
|
606
653
|
);
|
|
607
654
|
}
|
|
608
655
|
}
|
|
@@ -784,7 +831,7 @@ const BaseTransitionImpl = {
|
|
|
784
831
|
state.isLeaving = true;
|
|
785
832
|
leavingHooks.afterLeave = () => {
|
|
786
833
|
state.isLeaving = false;
|
|
787
|
-
if (!(instance.job.flags &
|
|
834
|
+
if (!(instance.job.flags & 4)) {
|
|
788
835
|
instance.update();
|
|
789
836
|
}
|
|
790
837
|
delete leavingHooks.afterLeave;
|
|
@@ -1056,7 +1103,7 @@ function defineComponent(options, extraOptions) {
|
|
|
1056
1103
|
}
|
|
1057
1104
|
|
|
1058
1105
|
function useId() {
|
|
1059
|
-
const i =
|
|
1106
|
+
const i = getCurrentGenericInstance();
|
|
1060
1107
|
if (i) {
|
|
1061
1108
|
return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
|
|
1062
1109
|
}
|
|
@@ -1067,7 +1114,7 @@ function markAsyncBoundary(instance) {
|
|
|
1067
1114
|
}
|
|
1068
1115
|
|
|
1069
1116
|
function useTemplateRef(key) {
|
|
1070
|
-
const i =
|
|
1117
|
+
const i = getCurrentGenericInstance();
|
|
1071
1118
|
const r = reactivity.shallowRef(null);
|
|
1072
1119
|
if (i) {
|
|
1073
1120
|
const refs = i.refs === shared.EMPTY_OBJ ? i.refs = {} : i.refs;
|
|
@@ -1159,8 +1206,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1159
1206
|
} else ;
|
|
1160
1207
|
};
|
|
1161
1208
|
if (value) {
|
|
1162
|
-
doSet
|
|
1163
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
1209
|
+
queuePostRenderEffect(doSet, -1, parentSuspense);
|
|
1164
1210
|
} else {
|
|
1165
1211
|
doSet();
|
|
1166
1212
|
}
|
|
@@ -1310,6 +1356,9 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1310
1356
|
);
|
|
1311
1357
|
}
|
|
1312
1358
|
} else if (shapeFlag & 6) {
|
|
1359
|
+
if (vnode.type.__vapor) {
|
|
1360
|
+
throw new Error("Vapor component hydration is not supported yet.");
|
|
1361
|
+
}
|
|
1313
1362
|
vnode.slotScopeIds = slotScopeIds;
|
|
1314
1363
|
const container = parentNode(node);
|
|
1315
1364
|
if (isFragmentStart) {
|
|
@@ -1458,11 +1507,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1458
1507
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
1459
1508
|
}
|
|
1460
1509
|
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
1461
|
-
queueEffectWithSuspense(
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1510
|
+
queueEffectWithSuspense(
|
|
1511
|
+
() => {
|
|
1512
|
+
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
1513
|
+
needCallTransitionHooks && transition.enter(el);
|
|
1514
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
1515
|
+
},
|
|
1516
|
+
void 0,
|
|
1517
|
+
parentSuspense
|
|
1518
|
+
);
|
|
1466
1519
|
}
|
|
1467
1520
|
}
|
|
1468
1521
|
return el.nextSibling;
|
|
@@ -1632,7 +1685,7 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
1632
1685
|
if (allowedType === 0 /* TEXT */ && list.includes("children")) {
|
|
1633
1686
|
return true;
|
|
1634
1687
|
}
|
|
1635
|
-
return
|
|
1688
|
+
return list.includes(MismatchTypeString[allowedType]);
|
|
1636
1689
|
}
|
|
1637
1690
|
}
|
|
1638
1691
|
|
|
@@ -1849,7 +1902,7 @@ function defineAsyncComponent(source) {
|
|
|
1849
1902
|
}
|
|
1850
1903
|
load().then(() => {
|
|
1851
1904
|
loaded.value = true;
|
|
1852
|
-
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
1905
|
+
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
|
|
1853
1906
|
instance.parent.update();
|
|
1854
1907
|
}
|
|
1855
1908
|
}).catch((err) => {
|
|
@@ -1892,8 +1945,8 @@ const KeepAliveImpl = {
|
|
|
1892
1945
|
max: [String, Number]
|
|
1893
1946
|
},
|
|
1894
1947
|
setup(props, { slots }) {
|
|
1895
|
-
const
|
|
1896
|
-
const sharedContext =
|
|
1948
|
+
const keepAliveInstance = getCurrentInstance();
|
|
1949
|
+
const sharedContext = keepAliveInstance.ctx;
|
|
1897
1950
|
if (!sharedContext.renderer) {
|
|
1898
1951
|
return () => {
|
|
1899
1952
|
const children = slots.default && slots.default();
|
|
@@ -1903,7 +1956,7 @@ const KeepAliveImpl = {
|
|
|
1903
1956
|
const cache = /* @__PURE__ */ new Map();
|
|
1904
1957
|
const keys = /* @__PURE__ */ new Set();
|
|
1905
1958
|
let current = null;
|
|
1906
|
-
const parentSuspense =
|
|
1959
|
+
const parentSuspense = keepAliveInstance.suspense;
|
|
1907
1960
|
const {
|
|
1908
1961
|
renderer: {
|
|
1909
1962
|
p: patch,
|
|
@@ -1914,49 +1967,71 @@ const KeepAliveImpl = {
|
|
|
1914
1967
|
} = sharedContext;
|
|
1915
1968
|
const storageContainer = createElement("div");
|
|
1916
1969
|
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
1917
|
-
const
|
|
1918
|
-
move(
|
|
1970
|
+
const instance = vnode.component;
|
|
1971
|
+
move(
|
|
1972
|
+
vnode,
|
|
1973
|
+
container,
|
|
1974
|
+
anchor,
|
|
1975
|
+
0,
|
|
1976
|
+
keepAliveInstance,
|
|
1977
|
+
parentSuspense
|
|
1978
|
+
);
|
|
1919
1979
|
patch(
|
|
1920
|
-
|
|
1980
|
+
instance.vnode,
|
|
1921
1981
|
vnode,
|
|
1922
1982
|
container,
|
|
1923
1983
|
anchor,
|
|
1924
|
-
|
|
1984
|
+
instance,
|
|
1925
1985
|
parentSuspense,
|
|
1926
1986
|
namespace,
|
|
1927
1987
|
vnode.slotScopeIds,
|
|
1928
1988
|
optimized
|
|
1929
1989
|
);
|
|
1930
|
-
queuePostRenderEffect(
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1990
|
+
queuePostRenderEffect(
|
|
1991
|
+
() => {
|
|
1992
|
+
instance.isDeactivated = false;
|
|
1993
|
+
if (instance.a) {
|
|
1994
|
+
shared.invokeArrayFns(instance.a);
|
|
1995
|
+
}
|
|
1996
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
1997
|
+
if (vnodeHook) {
|
|
1998
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
1999
|
+
}
|
|
2000
|
+
},
|
|
2001
|
+
void 0,
|
|
2002
|
+
parentSuspense
|
|
2003
|
+
);
|
|
1940
2004
|
};
|
|
1941
2005
|
sharedContext.deactivate = (vnode) => {
|
|
1942
|
-
const
|
|
1943
|
-
invalidateMount(
|
|
1944
|
-
invalidateMount(
|
|
1945
|
-
move(
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
2006
|
+
const instance = vnode.component;
|
|
2007
|
+
invalidateMount(instance.m);
|
|
2008
|
+
invalidateMount(instance.a);
|
|
2009
|
+
move(
|
|
2010
|
+
vnode,
|
|
2011
|
+
storageContainer,
|
|
2012
|
+
null,
|
|
2013
|
+
1,
|
|
2014
|
+
keepAliveInstance,
|
|
2015
|
+
parentSuspense
|
|
2016
|
+
);
|
|
2017
|
+
queuePostRenderEffect(
|
|
2018
|
+
() => {
|
|
2019
|
+
if (instance.da) {
|
|
2020
|
+
shared.invokeArrayFns(instance.da);
|
|
2021
|
+
}
|
|
2022
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
2023
|
+
if (vnodeHook) {
|
|
2024
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
2025
|
+
}
|
|
2026
|
+
instance.isDeactivated = true;
|
|
2027
|
+
},
|
|
2028
|
+
void 0,
|
|
2029
|
+
parentSuspense
|
|
2030
|
+
);
|
|
1956
2031
|
};
|
|
1957
2032
|
function unmount(vnode) {
|
|
1958
2033
|
resetShapeFlag(vnode);
|
|
1959
|
-
_unmount(vnode,
|
|
2034
|
+
_unmount(vnode, keepAliveInstance, parentSuspense, true);
|
|
1960
2035
|
}
|
|
1961
2036
|
function pruneCache(filter) {
|
|
1962
2037
|
cache.forEach((vnode, key) => {
|
|
@@ -1988,12 +2063,19 @@ const KeepAliveImpl = {
|
|
|
1988
2063
|
let pendingCacheKey = null;
|
|
1989
2064
|
const cacheSubtree = () => {
|
|
1990
2065
|
if (pendingCacheKey != null) {
|
|
1991
|
-
if (isSuspense(
|
|
1992
|
-
queuePostRenderEffect(
|
|
1993
|
-
|
|
1994
|
-
|
|
2066
|
+
if (isSuspense(keepAliveInstance.subTree.type)) {
|
|
2067
|
+
queuePostRenderEffect(
|
|
2068
|
+
() => {
|
|
2069
|
+
cache.set(
|
|
2070
|
+
pendingCacheKey,
|
|
2071
|
+
getInnerChild(keepAliveInstance.subTree)
|
|
2072
|
+
);
|
|
2073
|
+
},
|
|
2074
|
+
void 0,
|
|
2075
|
+
keepAliveInstance.subTree.suspense
|
|
2076
|
+
);
|
|
1995
2077
|
} else {
|
|
1996
|
-
cache.set(pendingCacheKey, getInnerChild(
|
|
2078
|
+
cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
1997
2079
|
}
|
|
1998
2080
|
}
|
|
1999
2081
|
};
|
|
@@ -2001,12 +2083,12 @@ const KeepAliveImpl = {
|
|
|
2001
2083
|
onUpdated(cacheSubtree);
|
|
2002
2084
|
onBeforeUnmount(() => {
|
|
2003
2085
|
cache.forEach((cached) => {
|
|
2004
|
-
const { subTree, suspense } =
|
|
2086
|
+
const { subTree, suspense } = keepAliveInstance;
|
|
2005
2087
|
const vnode = getInnerChild(subTree);
|
|
2006
2088
|
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
2007
2089
|
resetShapeFlag(vnode);
|
|
2008
2090
|
const da = vnode.component.da;
|
|
2009
|
-
da && queuePostRenderEffect(da, suspense);
|
|
2091
|
+
da && queuePostRenderEffect(da, void 0, suspense);
|
|
2010
2092
|
return;
|
|
2011
2093
|
}
|
|
2012
2094
|
unmount(cached);
|
|
@@ -2089,7 +2171,7 @@ function onActivated(hook, target) {
|
|
|
2089
2171
|
function onDeactivated(hook, target) {
|
|
2090
2172
|
registerKeepAliveHook(hook, "da", target);
|
|
2091
2173
|
}
|
|
2092
|
-
function registerKeepAliveHook(hook, type, target =
|
|
2174
|
+
function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
|
|
2093
2175
|
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
2094
2176
|
let current = target;
|
|
2095
2177
|
while (current) {
|
|
@@ -2103,7 +2185,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
2103
2185
|
injectHook(type, wrappedHook, target);
|
|
2104
2186
|
if (target) {
|
|
2105
2187
|
let current = target.parent;
|
|
2106
|
-
while (current && current.parent) {
|
|
2188
|
+
while (current && current.parent && current.parent.vnode) {
|
|
2107
2189
|
if (isKeepAlive(current.parent.vnode)) {
|
|
2108
2190
|
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
2109
2191
|
}
|
|
@@ -2135,12 +2217,14 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
2135
2217
|
if (target) {
|
|
2136
2218
|
const hooks = target[type] || (target[type] = []);
|
|
2137
2219
|
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
2138
|
-
reactivity.
|
|
2139
|
-
const
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2220
|
+
const prevSub = reactivity.setActiveSub();
|
|
2221
|
+
const prev = setCurrentInstance(target);
|
|
2222
|
+
try {
|
|
2223
|
+
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
2224
|
+
} finally {
|
|
2225
|
+
setCurrentInstance(...prev);
|
|
2226
|
+
reactivity.setActiveSub(prevSub);
|
|
2227
|
+
}
|
|
2144
2228
|
});
|
|
2145
2229
|
if (prepend) {
|
|
2146
2230
|
hooks.unshift(wrappedHook);
|
|
@@ -2206,7 +2290,11 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
2206
2290
|
const res = (
|
|
2207
2291
|
// local registration
|
|
2208
2292
|
// check instance[type] first which is resolved for options API
|
|
2209
|
-
resolve(
|
|
2293
|
+
resolve(
|
|
2294
|
+
instance[type] || Component[type],
|
|
2295
|
+
name
|
|
2296
|
+
) || // global registration
|
|
2297
|
+
// @ts-expect-error filters only exist in compat mode
|
|
2210
2298
|
resolve(instance.appContext[type], name)
|
|
2211
2299
|
);
|
|
2212
2300
|
if (!res && maybeSelfReference) {
|
|
@@ -2288,7 +2376,13 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2288
2376
|
}
|
|
2289
2377
|
|
|
2290
2378
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
2291
|
-
|
|
2379
|
+
let slot = slots[name];
|
|
2380
|
+
if (slot && slot.__vapor) {
|
|
2381
|
+
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
2382
|
+
ret.vs = { slot, fallback };
|
|
2383
|
+
return ret;
|
|
2384
|
+
}
|
|
2385
|
+
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
2292
2386
|
if (name !== "default") props.name = name;
|
|
2293
2387
|
return openBlock(), createBlock(
|
|
2294
2388
|
Fragment,
|
|
@@ -2297,7 +2391,6 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2297
2391
|
64
|
|
2298
2392
|
);
|
|
2299
2393
|
}
|
|
2300
|
-
let slot = slots[name];
|
|
2301
2394
|
if (slot && slot._c) {
|
|
2302
2395
|
slot._d = false;
|
|
2303
2396
|
}
|
|
@@ -2342,8 +2435,9 @@ function toHandlers(obj, preserveCaseIfNecessary) {
|
|
|
2342
2435
|
}
|
|
2343
2436
|
|
|
2344
2437
|
const getPublicInstance = (i) => {
|
|
2345
|
-
if (!i) return null;
|
|
2346
|
-
if (isStatefulComponent(i))
|
|
2438
|
+
if (!i || i.vapor) return null;
|
|
2439
|
+
if (isStatefulComponent(i))
|
|
2440
|
+
return getComponentPublicInstance(i);
|
|
2347
2441
|
return getPublicInstance(i.parent);
|
|
2348
2442
|
};
|
|
2349
2443
|
const publicPropertiesMap = (
|
|
@@ -2507,8 +2601,13 @@ function useAttrs() {
|
|
|
2507
2601
|
return getContext().attrs;
|
|
2508
2602
|
}
|
|
2509
2603
|
function getContext() {
|
|
2510
|
-
const i =
|
|
2511
|
-
|
|
2604
|
+
const i = getCurrentGenericInstance();
|
|
2605
|
+
if (i.vapor) {
|
|
2606
|
+
return i;
|
|
2607
|
+
} else {
|
|
2608
|
+
const ii = i;
|
|
2609
|
+
return ii.setupContext || (ii.setupContext = createSetupContext(ii));
|
|
2610
|
+
}
|
|
2512
2611
|
}
|
|
2513
2612
|
function normalizePropsOrEmits(props) {
|
|
2514
2613
|
return shared.isArray(props) ? props.reduce(
|
|
@@ -2554,9 +2653,9 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
2554
2653
|
return ret;
|
|
2555
2654
|
}
|
|
2556
2655
|
function withAsyncContext(getAwaitable) {
|
|
2557
|
-
const ctx =
|
|
2656
|
+
const ctx = getCurrentGenericInstance();
|
|
2558
2657
|
let awaitable = getAwaitable();
|
|
2559
|
-
|
|
2658
|
+
setCurrentInstance(null, void 0);
|
|
2560
2659
|
if (shared.isPromise(awaitable)) {
|
|
2561
2660
|
awaitable = awaitable.catch((e) => {
|
|
2562
2661
|
setCurrentInstance(ctx);
|
|
@@ -2925,7 +3024,7 @@ function createAppContext() {
|
|
|
2925
3024
|
};
|
|
2926
3025
|
}
|
|
2927
3026
|
let uid$1 = 0;
|
|
2928
|
-
function createAppAPI(
|
|
3027
|
+
function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
2929
3028
|
return function createApp(rootComponent, rootProps = null) {
|
|
2930
3029
|
if (!shared.isFunction(rootComponent)) {
|
|
2931
3030
|
rootComponent = shared.extend({}, rootComponent);
|
|
@@ -2984,22 +3083,11 @@ function createAppAPI(render, hydrate) {
|
|
|
2984
3083
|
},
|
|
2985
3084
|
mount(rootContainer, isHydrate, namespace) {
|
|
2986
3085
|
if (!isMounted) {
|
|
2987
|
-
const
|
|
2988
|
-
vnode.appContext = context;
|
|
2989
|
-
if (namespace === true) {
|
|
2990
|
-
namespace = "svg";
|
|
2991
|
-
} else if (namespace === false) {
|
|
2992
|
-
namespace = void 0;
|
|
2993
|
-
}
|
|
2994
|
-
if (isHydrate && hydrate) {
|
|
2995
|
-
hydrate(vnode, rootContainer);
|
|
2996
|
-
} else {
|
|
2997
|
-
render(vnode, rootContainer, namespace);
|
|
2998
|
-
}
|
|
3086
|
+
const instance = mount(app, rootContainer, isHydrate, namespace);
|
|
2999
3087
|
isMounted = true;
|
|
3000
3088
|
app._container = rootContainer;
|
|
3001
3089
|
rootContainer.__vue_app__ = app;
|
|
3002
|
-
return
|
|
3090
|
+
return getPublicInstance(instance);
|
|
3003
3091
|
}
|
|
3004
3092
|
},
|
|
3005
3093
|
onUnmount(cleanupFn) {
|
|
@@ -3012,7 +3100,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3012
3100
|
app._instance,
|
|
3013
3101
|
16
|
|
3014
3102
|
);
|
|
3015
|
-
|
|
3103
|
+
unmount(app);
|
|
3016
3104
|
delete app._container.__vue_app__;
|
|
3017
3105
|
}
|
|
3018
3106
|
},
|
|
@@ -3036,6 +3124,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3036
3124
|
let currentApp = null;
|
|
3037
3125
|
|
|
3038
3126
|
function provide(key, value) {
|
|
3127
|
+
const currentInstance = getCurrentGenericInstance();
|
|
3039
3128
|
if (!currentInstance) ; else {
|
|
3040
3129
|
let provides = currentInstance.provides;
|
|
3041
3130
|
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
@@ -3046,9 +3135,9 @@ function provide(key, value) {
|
|
|
3046
3135
|
}
|
|
3047
3136
|
}
|
|
3048
3137
|
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
3049
|
-
const instance =
|
|
3138
|
+
const instance = getCurrentGenericInstance();
|
|
3050
3139
|
if (instance || currentApp) {
|
|
3051
|
-
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.
|
|
3140
|
+
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
3052
3141
|
if (provides && key in provides) {
|
|
3053
3142
|
return provides[key];
|
|
3054
3143
|
} else if (arguments.length > 1) {
|
|
@@ -3057,7 +3146,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
3057
3146
|
}
|
|
3058
3147
|
}
|
|
3059
3148
|
function hasInjectionContext() {
|
|
3060
|
-
return !!(
|
|
3149
|
+
return !!(getCurrentGenericInstance() || currentApp);
|
|
3061
3150
|
}
|
|
3062
3151
|
|
|
3063
3152
|
const internalObjectProto = {};
|
|
@@ -3065,7 +3154,7 @@ const createInternalObject = () => Object.create(internalObjectProto);
|
|
|
3065
3154
|
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
3066
3155
|
|
|
3067
3156
|
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
3068
|
-
const props = {};
|
|
3157
|
+
const props = instance.props = {};
|
|
3069
3158
|
const attrs = createInternalObject();
|
|
3070
3159
|
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
3071
3160
|
setFullProps(instance, rawProps, props, attrs);
|
|
@@ -3118,11 +3207,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3118
3207
|
const camelizedKey = shared.camelize(key);
|
|
3119
3208
|
props[camelizedKey] = resolvePropValue(
|
|
3120
3209
|
options,
|
|
3121
|
-
rawCurrentProps,
|
|
3122
3210
|
camelizedKey,
|
|
3123
3211
|
value,
|
|
3124
3212
|
instance,
|
|
3125
|
-
|
|
3213
|
+
baseResolveDefault
|
|
3126
3214
|
);
|
|
3127
3215
|
}
|
|
3128
3216
|
} else {
|
|
@@ -3149,10 +3237,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3149
3237
|
rawPrevProps[kebabKey] !== void 0)) {
|
|
3150
3238
|
props[key] = resolvePropValue(
|
|
3151
3239
|
options,
|
|
3152
|
-
rawCurrentProps,
|
|
3153
3240
|
key,
|
|
3154
3241
|
void 0,
|
|
3155
3242
|
instance,
|
|
3243
|
+
baseResolveDefault,
|
|
3156
3244
|
true
|
|
3157
3245
|
);
|
|
3158
3246
|
}
|
|
@@ -3200,39 +3288,37 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3200
3288
|
}
|
|
3201
3289
|
}
|
|
3202
3290
|
if (needCastKeys) {
|
|
3203
|
-
const rawCurrentProps = reactivity.toRaw(props);
|
|
3204
3291
|
const castValues = rawCastValues || shared.EMPTY_OBJ;
|
|
3205
3292
|
for (let i = 0; i < needCastKeys.length; i++) {
|
|
3206
3293
|
const key = needCastKeys[i];
|
|
3207
3294
|
props[key] = resolvePropValue(
|
|
3208
3295
|
options,
|
|
3209
|
-
rawCurrentProps,
|
|
3210
3296
|
key,
|
|
3211
3297
|
castValues[key],
|
|
3212
3298
|
instance,
|
|
3299
|
+
baseResolveDefault,
|
|
3213
3300
|
!shared.hasOwn(castValues, key)
|
|
3214
3301
|
);
|
|
3215
3302
|
}
|
|
3216
3303
|
}
|
|
3217
3304
|
return hasAttrsChanged;
|
|
3218
3305
|
}
|
|
3219
|
-
function resolvePropValue(options,
|
|
3306
|
+
function resolvePropValue(options, key, value, instance, resolveDefault, isAbsent = false) {
|
|
3220
3307
|
const opt = options[key];
|
|
3221
3308
|
if (opt != null) {
|
|
3222
3309
|
const hasDefault = shared.hasOwn(opt, "default");
|
|
3223
3310
|
if (hasDefault && value === void 0) {
|
|
3224
3311
|
const defaultValue = opt.default;
|
|
3225
3312
|
if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
|
|
3226
|
-
const
|
|
3227
|
-
if (key
|
|
3228
|
-
value =
|
|
3313
|
+
const cachedDefaults = instance.propsDefaults || (instance.propsDefaults = {});
|
|
3314
|
+
if (shared.hasOwn(cachedDefaults, key)) {
|
|
3315
|
+
value = cachedDefaults[key];
|
|
3229
3316
|
} else {
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3317
|
+
value = cachedDefaults[key] = resolveDefault(
|
|
3318
|
+
defaultValue,
|
|
3319
|
+
instance,
|
|
3320
|
+
key
|
|
3234
3321
|
);
|
|
3235
|
-
reset();
|
|
3236
3322
|
}
|
|
3237
3323
|
} else {
|
|
3238
3324
|
value = defaultValue;
|
|
@@ -3251,6 +3337,17 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
3251
3337
|
}
|
|
3252
3338
|
return value;
|
|
3253
3339
|
}
|
|
3340
|
+
function baseResolveDefault(factory, instance, key) {
|
|
3341
|
+
let value;
|
|
3342
|
+
const prev = setCurrentInstance(instance);
|
|
3343
|
+
const props = reactivity.toRaw(instance.props);
|
|
3344
|
+
value = factory.call(
|
|
3345
|
+
null,
|
|
3346
|
+
props
|
|
3347
|
+
);
|
|
3348
|
+
setCurrentInstance(...prev);
|
|
3349
|
+
return value;
|
|
3350
|
+
}
|
|
3254
3351
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
3255
3352
|
function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
3256
3353
|
const cache = asMixin ? mixinPropsCache : appContext.propsCache;
|
|
@@ -3285,6 +3382,14 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
3285
3382
|
}
|
|
3286
3383
|
return shared.EMPTY_ARR;
|
|
3287
3384
|
}
|
|
3385
|
+
baseNormalizePropsOptions(raw, normalized, needCastKeys);
|
|
3386
|
+
const res = [normalized, needCastKeys];
|
|
3387
|
+
if (shared.isObject(comp)) {
|
|
3388
|
+
cache.set(comp, res);
|
|
3389
|
+
}
|
|
3390
|
+
return res;
|
|
3391
|
+
}
|
|
3392
|
+
function baseNormalizePropsOptions(raw, normalized, needCastKeys) {
|
|
3288
3393
|
if (shared.isArray(raw)) {
|
|
3289
3394
|
for (let i = 0; i < raw.length; i++) {
|
|
3290
3395
|
const normalizedKey = shared.camelize(raw[i]);
|
|
@@ -3323,11 +3428,6 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
3323
3428
|
}
|
|
3324
3429
|
}
|
|
3325
3430
|
}
|
|
3326
|
-
const res = [normalized, needCastKeys];
|
|
3327
|
-
if (shared.isObject(comp)) {
|
|
3328
|
-
cache.set(comp, res);
|
|
3329
|
-
}
|
|
3330
|
-
return res;
|
|
3331
3431
|
}
|
|
3332
3432
|
function validatePropName(key) {
|
|
3333
3433
|
if (key[0] !== "$" && !shared.isReservedProp(key)) {
|
|
@@ -3376,6 +3476,8 @@ const assignSlots = (slots, children, optimized) => {
|
|
|
3376
3476
|
const initSlots = (instance, children, optimized) => {
|
|
3377
3477
|
const slots = instance.slots = createInternalObject();
|
|
3378
3478
|
if (instance.vnode.shapeFlag & 32) {
|
|
3479
|
+
const cacheIndexes = children.__;
|
|
3480
|
+
if (cacheIndexes) shared.def(slots, "__", cacheIndexes, true);
|
|
3379
3481
|
const type = children._;
|
|
3380
3482
|
if (type) {
|
|
3381
3483
|
assignSlots(slots, children, optimized);
|
|
@@ -3482,6 +3584,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3482
3584
|
optimized
|
|
3483
3585
|
);
|
|
3484
3586
|
break;
|
|
3587
|
+
case VaporSlot:
|
|
3588
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
|
|
3589
|
+
break;
|
|
3485
3590
|
default:
|
|
3486
3591
|
if (shapeFlag & 1) {
|
|
3487
3592
|
processElement(
|
|
@@ -3537,6 +3642,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3537
3642
|
}
|
|
3538
3643
|
if (ref != null && parentComponent) {
|
|
3539
3644
|
setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
|
|
3645
|
+
} else if (ref == null && n1 && n1.ref != null) {
|
|
3646
|
+
setRef(n1.ref, null, parentSuspense, n1, true);
|
|
3540
3647
|
}
|
|
3541
3648
|
};
|
|
3542
3649
|
const processText = (n1, n2, container, anchor) => {
|
|
@@ -3671,11 +3778,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3671
3778
|
}
|
|
3672
3779
|
hostInsert(el, container, anchor);
|
|
3673
3780
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
3674
|
-
queuePostRenderEffect(
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3781
|
+
queuePostRenderEffect(
|
|
3782
|
+
() => {
|
|
3783
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3784
|
+
needCallTransitionHooks && transition.enter(el);
|
|
3785
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
3786
|
+
},
|
|
3787
|
+
void 0,
|
|
3788
|
+
parentSuspense
|
|
3789
|
+
);
|
|
3679
3790
|
}
|
|
3680
3791
|
};
|
|
3681
3792
|
const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
|
|
@@ -3687,8 +3798,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3687
3798
|
hostSetScopeId(el, slotScopeIds[i]);
|
|
3688
3799
|
}
|
|
3689
3800
|
}
|
|
3690
|
-
|
|
3691
|
-
|
|
3801
|
+
let subTree = parentComponent && parentComponent.subTree;
|
|
3802
|
+
if (subTree) {
|
|
3692
3803
|
if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
|
|
3693
3804
|
const parentVNode = parentComponent.vnode;
|
|
3694
3805
|
setScopeId(
|
|
@@ -3791,10 +3902,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3791
3902
|
patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
3792
3903
|
}
|
|
3793
3904
|
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
|
|
3794
|
-
queuePostRenderEffect(
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3905
|
+
queuePostRenderEffect(
|
|
3906
|
+
() => {
|
|
3907
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
3908
|
+
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
3909
|
+
},
|
|
3910
|
+
void 0,
|
|
3911
|
+
parentSuspense
|
|
3912
|
+
);
|
|
3798
3913
|
}
|
|
3799
3914
|
};
|
|
3800
3915
|
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
|
|
@@ -3925,7 +4040,22 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3925
4040
|
};
|
|
3926
4041
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
3927
4042
|
n2.slotScopeIds = slotScopeIds;
|
|
3928
|
-
if (
|
|
4043
|
+
if (n2.type.__vapor) {
|
|
4044
|
+
if (n1 == null) {
|
|
4045
|
+
getVaporInterface(parentComponent, n2).mount(
|
|
4046
|
+
n2,
|
|
4047
|
+
container,
|
|
4048
|
+
anchor,
|
|
4049
|
+
parentComponent
|
|
4050
|
+
);
|
|
4051
|
+
} else {
|
|
4052
|
+
getVaporInterface(parentComponent, n2).update(
|
|
4053
|
+
n1,
|
|
4054
|
+
n2,
|
|
4055
|
+
shouldUpdateComponent(n1, n2, optimized)
|
|
4056
|
+
);
|
|
4057
|
+
}
|
|
4058
|
+
} else if (n1 == null) {
|
|
3929
4059
|
if (n2.shapeFlag & 512) {
|
|
3930
4060
|
parentComponent.ctx.activate(
|
|
3931
4061
|
n2,
|
|
@@ -3987,15 +4117,48 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3987
4117
|
return;
|
|
3988
4118
|
} else {
|
|
3989
4119
|
instance.next = n2;
|
|
3990
|
-
instance.
|
|
4120
|
+
instance.effect.run();
|
|
3991
4121
|
}
|
|
3992
4122
|
} else {
|
|
3993
4123
|
n2.el = n1.el;
|
|
3994
4124
|
instance.vnode = n2;
|
|
3995
4125
|
}
|
|
3996
4126
|
};
|
|
3997
|
-
|
|
3998
|
-
|
|
4127
|
+
class SetupRenderEffect extends reactivity.ReactiveEffect {
|
|
4128
|
+
constructor(instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) {
|
|
4129
|
+
const prevScope = reactivity.setCurrentScope(instance.scope);
|
|
4130
|
+
super();
|
|
4131
|
+
this.instance = instance;
|
|
4132
|
+
this.initialVNode = initialVNode;
|
|
4133
|
+
this.container = container;
|
|
4134
|
+
this.anchor = anchor;
|
|
4135
|
+
this.parentSuspense = parentSuspense;
|
|
4136
|
+
this.namespace = namespace;
|
|
4137
|
+
this.optimized = optimized;
|
|
4138
|
+
reactivity.setCurrentScope(prevScope);
|
|
4139
|
+
this.job = instance.job = () => {
|
|
4140
|
+
if (this.dirty) {
|
|
4141
|
+
this.run();
|
|
4142
|
+
}
|
|
4143
|
+
};
|
|
4144
|
+
this.job.i = instance;
|
|
4145
|
+
}
|
|
4146
|
+
notify() {
|
|
4147
|
+
if (!(this.flags & 256)) {
|
|
4148
|
+
const job = this.job;
|
|
4149
|
+
queueJob(job, job.i.uid);
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4152
|
+
fn() {
|
|
4153
|
+
const {
|
|
4154
|
+
instance,
|
|
4155
|
+
initialVNode,
|
|
4156
|
+
container,
|
|
4157
|
+
anchor,
|
|
4158
|
+
parentSuspense,
|
|
4159
|
+
namespace,
|
|
4160
|
+
optimized
|
|
4161
|
+
} = this;
|
|
3999
4162
|
if (!instance.isMounted) {
|
|
4000
4163
|
let vnodeHook;
|
|
4001
4164
|
const { el, props } = initialVNode;
|
|
@@ -4030,7 +4193,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4030
4193
|
hydrateSubTree();
|
|
4031
4194
|
}
|
|
4032
4195
|
} else {
|
|
4033
|
-
if (root.ce
|
|
4196
|
+
if (root.ce && // @ts-expect-error _def is private
|
|
4197
|
+
root.ce._def.shadowRoot !== false) {
|
|
4034
4198
|
root.ce._injectChildStyle(type);
|
|
4035
4199
|
}
|
|
4036
4200
|
const subTree = instance.subTree = renderComponentRoot(instance);
|
|
@@ -4046,20 +4210,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4046
4210
|
initialVNode.el = subTree.el;
|
|
4047
4211
|
}
|
|
4048
4212
|
if (m) {
|
|
4049
|
-
queuePostRenderEffect(m, parentSuspense);
|
|
4213
|
+
queuePostRenderEffect(m, void 0, parentSuspense);
|
|
4050
4214
|
}
|
|
4051
4215
|
if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
|
|
4052
4216
|
const scopedInitialVNode = initialVNode;
|
|
4053
4217
|
queuePostRenderEffect(
|
|
4054
4218
|
() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
|
|
4219
|
+
void 0,
|
|
4055
4220
|
parentSuspense
|
|
4056
4221
|
);
|
|
4057
4222
|
}
|
|
4058
|
-
if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
|
|
4059
|
-
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
4223
|
+
if (initialVNode.shapeFlag & 256 || parent && parent.vnode && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
|
|
4224
|
+
instance.a && queuePostRenderEffect(instance.a, void 0, parentSuspense);
|
|
4060
4225
|
}
|
|
4061
4226
|
instance.isMounted = true;
|
|
4062
|
-
initialVNode = container = anchor = null;
|
|
4227
|
+
this.initialVNode = this.container = this.anchor = null;
|
|
4063
4228
|
} else {
|
|
4064
4229
|
let { next, bu, u, parent, vnode } = instance;
|
|
4065
4230
|
{
|
|
@@ -4071,7 +4236,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4071
4236
|
}
|
|
4072
4237
|
nonHydratedAsyncRoot.asyncDep.then(() => {
|
|
4073
4238
|
if (!instance.isUnmounted) {
|
|
4074
|
-
|
|
4239
|
+
this.fn();
|
|
4075
4240
|
}
|
|
4076
4241
|
});
|
|
4077
4242
|
return;
|
|
@@ -4112,26 +4277,31 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4112
4277
|
updateHOCHostEl(instance, nextTree.el);
|
|
4113
4278
|
}
|
|
4114
4279
|
if (u) {
|
|
4115
|
-
queuePostRenderEffect(u, parentSuspense);
|
|
4280
|
+
queuePostRenderEffect(u, void 0, parentSuspense);
|
|
4116
4281
|
}
|
|
4117
4282
|
if (vnodeHook = next.props && next.props.onVnodeUpdated) {
|
|
4118
4283
|
queuePostRenderEffect(
|
|
4119
4284
|
() => invokeVNodeHook(vnodeHook, parent, next, vnode),
|
|
4285
|
+
void 0,
|
|
4120
4286
|
parentSuspense
|
|
4121
4287
|
);
|
|
4122
4288
|
}
|
|
4123
4289
|
}
|
|
4124
|
-
}
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
instance.
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4290
|
+
}
|
|
4291
|
+
}
|
|
4292
|
+
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
|
|
4293
|
+
const effect = instance.effect = new SetupRenderEffect(
|
|
4294
|
+
instance,
|
|
4295
|
+
initialVNode,
|
|
4296
|
+
container,
|
|
4297
|
+
anchor,
|
|
4298
|
+
parentSuspense,
|
|
4299
|
+
namespace,
|
|
4300
|
+
optimized
|
|
4301
|
+
);
|
|
4302
|
+
instance.update = effect.run.bind(effect);
|
|
4133
4303
|
toggleRecurse(instance, true);
|
|
4134
|
-
|
|
4304
|
+
effect.run();
|
|
4135
4305
|
};
|
|
4136
4306
|
const updateComponentPreRender = (instance, nextVNode, optimized) => {
|
|
4137
4307
|
nextVNode.component = instance;
|
|
@@ -4140,9 +4310,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4140
4310
|
instance.next = null;
|
|
4141
4311
|
updateProps(instance, nextVNode.props, prevProps, optimized);
|
|
4142
4312
|
updateSlots(instance, nextVNode.children, optimized);
|
|
4143
|
-
reactivity.
|
|
4313
|
+
const prevSub = reactivity.setActiveSub();
|
|
4144
4314
|
flushPreFlushCbs(instance);
|
|
4145
|
-
reactivity.
|
|
4315
|
+
reactivity.setActiveSub(prevSub);
|
|
4146
4316
|
};
|
|
4147
4317
|
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
|
|
4148
4318
|
const c1 = n1 && n1.children;
|
|
@@ -4392,7 +4562,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4392
4562
|
patched++;
|
|
4393
4563
|
}
|
|
4394
4564
|
}
|
|
4395
|
-
const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
|
|
4565
|
+
const increasingNewIndexSequence = moved ? shared.getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
|
|
4396
4566
|
j = increasingNewIndexSequence.length - 1;
|
|
4397
4567
|
for (i = toBePatched - 1; i >= 0; i--) {
|
|
4398
4568
|
const nextIndex = s2 + i;
|
|
@@ -4412,7 +4582,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4412
4582
|
);
|
|
4413
4583
|
} else if (moved) {
|
|
4414
4584
|
if (j < 0 || i !== increasingNewIndexSequence[j]) {
|
|
4415
|
-
move(
|
|
4585
|
+
move(
|
|
4586
|
+
nextChild,
|
|
4587
|
+
container,
|
|
4588
|
+
anchor,
|
|
4589
|
+
2,
|
|
4590
|
+
parentComponent
|
|
4591
|
+
);
|
|
4416
4592
|
} else {
|
|
4417
4593
|
j--;
|
|
4418
4594
|
}
|
|
@@ -4420,10 +4596,20 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4420
4596
|
}
|
|
4421
4597
|
}
|
|
4422
4598
|
};
|
|
4423
|
-
const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
|
|
4599
|
+
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
4424
4600
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
4425
4601
|
if (shapeFlag & 6) {
|
|
4426
|
-
|
|
4602
|
+
if (type.__vapor) {
|
|
4603
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
|
|
4604
|
+
} else {
|
|
4605
|
+
move(
|
|
4606
|
+
vnode.component.subTree,
|
|
4607
|
+
container,
|
|
4608
|
+
anchor,
|
|
4609
|
+
moveType,
|
|
4610
|
+
parentComponent
|
|
4611
|
+
);
|
|
4612
|
+
}
|
|
4427
4613
|
return;
|
|
4428
4614
|
}
|
|
4429
4615
|
if (shapeFlag & 128) {
|
|
@@ -4431,13 +4617,25 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4431
4617
|
return;
|
|
4432
4618
|
}
|
|
4433
4619
|
if (shapeFlag & 64) {
|
|
4434
|
-
type.move(
|
|
4620
|
+
type.move(
|
|
4621
|
+
vnode,
|
|
4622
|
+
container,
|
|
4623
|
+
anchor,
|
|
4624
|
+
internals,
|
|
4625
|
+
parentComponent
|
|
4626
|
+
);
|
|
4435
4627
|
return;
|
|
4436
4628
|
}
|
|
4437
4629
|
if (type === Fragment) {
|
|
4438
4630
|
hostInsert(el, container, anchor);
|
|
4439
4631
|
for (let i = 0; i < children.length; i++) {
|
|
4440
|
-
move(
|
|
4632
|
+
move(
|
|
4633
|
+
children[i],
|
|
4634
|
+
container,
|
|
4635
|
+
anchor,
|
|
4636
|
+
moveType,
|
|
4637
|
+
parentComponent
|
|
4638
|
+
);
|
|
4441
4639
|
}
|
|
4442
4640
|
hostInsert(vnode.anchor, container, anchor);
|
|
4443
4641
|
return;
|
|
@@ -4451,7 +4649,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4451
4649
|
if (moveType === 0) {
|
|
4452
4650
|
transition.beforeEnter(el);
|
|
4453
4651
|
hostInsert(el, container, anchor);
|
|
4454
|
-
queuePostRenderEffect(
|
|
4652
|
+
queuePostRenderEffect(
|
|
4653
|
+
() => transition.enter(el),
|
|
4654
|
+
void 0,
|
|
4655
|
+
parentSuspense
|
|
4656
|
+
);
|
|
4455
4657
|
} else {
|
|
4456
4658
|
const { leave, delayLeave, afterLeave } = transition;
|
|
4457
4659
|
const remove2 = () => {
|
|
@@ -4493,9 +4695,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4493
4695
|
optimized = false;
|
|
4494
4696
|
}
|
|
4495
4697
|
if (ref != null) {
|
|
4496
|
-
reactivity.
|
|
4698
|
+
const prevSub = reactivity.setActiveSub();
|
|
4497
4699
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
4498
|
-
reactivity.
|
|
4700
|
+
reactivity.setActiveSub(prevSub);
|
|
4499
4701
|
}
|
|
4500
4702
|
if (cacheIndex != null) {
|
|
4501
4703
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
@@ -4511,7 +4713,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4511
4713
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
4512
4714
|
}
|
|
4513
4715
|
if (shapeFlag & 6) {
|
|
4514
|
-
|
|
4716
|
+
if (type.__vapor) {
|
|
4717
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
4718
|
+
return;
|
|
4719
|
+
} else {
|
|
4720
|
+
unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
4721
|
+
}
|
|
4515
4722
|
} else {
|
|
4516
4723
|
if (shapeFlag & 128) {
|
|
4517
4724
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -4545,15 +4752,23 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4545
4752
|
} else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
|
|
4546
4753
|
unmountChildren(children, parentComponent, parentSuspense);
|
|
4547
4754
|
}
|
|
4755
|
+
if (type === VaporSlot) {
|
|
4756
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
4757
|
+
return;
|
|
4758
|
+
}
|
|
4548
4759
|
if (doRemove) {
|
|
4549
4760
|
remove(vnode);
|
|
4550
4761
|
}
|
|
4551
4762
|
}
|
|
4552
4763
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
|
|
4553
|
-
queuePostRenderEffect(
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4764
|
+
queuePostRenderEffect(
|
|
4765
|
+
() => {
|
|
4766
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
4767
|
+
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
4768
|
+
},
|
|
4769
|
+
void 0,
|
|
4770
|
+
parentSuspense
|
|
4771
|
+
);
|
|
4557
4772
|
}
|
|
4558
4773
|
};
|
|
4559
4774
|
const remove = (vnode) => {
|
|
@@ -4599,7 +4814,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4599
4814
|
const {
|
|
4600
4815
|
bum,
|
|
4601
4816
|
scope,
|
|
4602
|
-
|
|
4817
|
+
effect,
|
|
4603
4818
|
subTree,
|
|
4604
4819
|
um,
|
|
4605
4820
|
m,
|
|
@@ -4618,16 +4833,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4618
4833
|
});
|
|
4619
4834
|
}
|
|
4620
4835
|
scope.stop();
|
|
4621
|
-
if (
|
|
4622
|
-
|
|
4836
|
+
if (effect) {
|
|
4837
|
+
effect.stop();
|
|
4623
4838
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
4624
4839
|
}
|
|
4625
4840
|
if (um) {
|
|
4626
|
-
queuePostRenderEffect(um, parentSuspense);
|
|
4841
|
+
queuePostRenderEffect(um, void 0, parentSuspense);
|
|
4627
4842
|
}
|
|
4628
|
-
queuePostRenderEffect(
|
|
4629
|
-
instance.isUnmounted = true
|
|
4630
|
-
|
|
4843
|
+
queuePostRenderEffect(
|
|
4844
|
+
() => instance.isUnmounted = true,
|
|
4845
|
+
void 0,
|
|
4846
|
+
parentSuspense
|
|
4847
|
+
);
|
|
4631
4848
|
if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
|
|
4632
4849
|
parentSuspense.deps--;
|
|
4633
4850
|
if (parentSuspense.deps === 0) {
|
|
@@ -4642,6 +4859,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4642
4859
|
};
|
|
4643
4860
|
const getNextHostNode = (vnode) => {
|
|
4644
4861
|
if (vnode.shapeFlag & 6) {
|
|
4862
|
+
if (vnode.type.__vapor) {
|
|
4863
|
+
return hostNextSibling(vnode.component.block);
|
|
4864
|
+
}
|
|
4645
4865
|
return getNextHostNode(vnode.component.subTree);
|
|
4646
4866
|
}
|
|
4647
4867
|
if (vnode.shapeFlag & 128) {
|
|
@@ -4651,7 +4871,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4651
4871
|
const teleportEnd = el && el[TeleportEndKey];
|
|
4652
4872
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
4653
4873
|
};
|
|
4654
|
-
let isFlushing = false;
|
|
4655
4874
|
const render = (vnode, container, namespace) => {
|
|
4656
4875
|
if (vnode == null) {
|
|
4657
4876
|
if (container._vnode) {
|
|
@@ -4669,12 +4888,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4669
4888
|
);
|
|
4670
4889
|
}
|
|
4671
4890
|
container._vnode = vnode;
|
|
4672
|
-
|
|
4673
|
-
isFlushing = true;
|
|
4674
|
-
flushPreFlushCbs();
|
|
4675
|
-
flushPostFlushCbs();
|
|
4676
|
-
isFlushing = false;
|
|
4677
|
-
}
|
|
4891
|
+
flushOnAppMount();
|
|
4678
4892
|
};
|
|
4679
4893
|
const internals = {
|
|
4680
4894
|
p: patch,
|
|
@@ -4682,6 +4896,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4682
4896
|
m: move,
|
|
4683
4897
|
r: remove,
|
|
4684
4898
|
mt: mountComponent,
|
|
4899
|
+
umt: unmountComponent,
|
|
4685
4900
|
mc: mountChildren,
|
|
4686
4901
|
pc: patchChildren,
|
|
4687
4902
|
pbc: patchBlockChildren,
|
|
@@ -4695,22 +4910,46 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4695
4910
|
internals
|
|
4696
4911
|
);
|
|
4697
4912
|
}
|
|
4913
|
+
const mountApp = (app, container, isHydrate, namespace) => {
|
|
4914
|
+
const vnode = app._ceVNode || createVNode(app._component, app._props);
|
|
4915
|
+
vnode.appContext = app._context;
|
|
4916
|
+
if (namespace === true) {
|
|
4917
|
+
namespace = "svg";
|
|
4918
|
+
} else if (namespace === false) {
|
|
4919
|
+
namespace = void 0;
|
|
4920
|
+
}
|
|
4921
|
+
if (isHydrate && hydrate) {
|
|
4922
|
+
hydrate(vnode, container);
|
|
4923
|
+
} else {
|
|
4924
|
+
render(vnode, container, namespace);
|
|
4925
|
+
}
|
|
4926
|
+
return vnode.component;
|
|
4927
|
+
};
|
|
4928
|
+
const unmountApp = (app) => {
|
|
4929
|
+
render(null, app._container);
|
|
4930
|
+
};
|
|
4698
4931
|
return {
|
|
4699
4932
|
render,
|
|
4700
4933
|
hydrate,
|
|
4701
|
-
|
|
4934
|
+
internals,
|
|
4935
|
+
createApp: createAppAPI(
|
|
4936
|
+
mountApp,
|
|
4937
|
+
unmountApp,
|
|
4938
|
+
getComponentPublicInstance)
|
|
4702
4939
|
};
|
|
4703
4940
|
}
|
|
4704
4941
|
function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
4705
4942
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
4706
4943
|
}
|
|
4707
|
-
function toggleRecurse({ effect, job }, allowed) {
|
|
4708
|
-
if (
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4944
|
+
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
4945
|
+
if (!vapor) {
|
|
4946
|
+
if (allowed) {
|
|
4947
|
+
effect.flags |= 128;
|
|
4948
|
+
job.flags |= 2;
|
|
4949
|
+
} else {
|
|
4950
|
+
effect.flags &= -129;
|
|
4951
|
+
job.flags &= -3;
|
|
4952
|
+
}
|
|
4714
4953
|
}
|
|
4715
4954
|
}
|
|
4716
4955
|
function needTransition(parentSuspense, transition) {
|
|
@@ -4740,46 +4979,6 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
4740
4979
|
}
|
|
4741
4980
|
}
|
|
4742
4981
|
}
|
|
4743
|
-
function getSequence(arr) {
|
|
4744
|
-
const p = arr.slice();
|
|
4745
|
-
const result = [0];
|
|
4746
|
-
let i, j, u, v, c;
|
|
4747
|
-
const len = arr.length;
|
|
4748
|
-
for (i = 0; i < len; i++) {
|
|
4749
|
-
const arrI = arr[i];
|
|
4750
|
-
if (arrI !== 0) {
|
|
4751
|
-
j = result[result.length - 1];
|
|
4752
|
-
if (arr[j] < arrI) {
|
|
4753
|
-
p[i] = j;
|
|
4754
|
-
result.push(i);
|
|
4755
|
-
continue;
|
|
4756
|
-
}
|
|
4757
|
-
u = 0;
|
|
4758
|
-
v = result.length - 1;
|
|
4759
|
-
while (u < v) {
|
|
4760
|
-
c = u + v >> 1;
|
|
4761
|
-
if (arr[result[c]] < arrI) {
|
|
4762
|
-
u = c + 1;
|
|
4763
|
-
} else {
|
|
4764
|
-
v = c;
|
|
4765
|
-
}
|
|
4766
|
-
}
|
|
4767
|
-
if (arrI < arr[result[u]]) {
|
|
4768
|
-
if (u > 0) {
|
|
4769
|
-
p[i] = result[u - 1];
|
|
4770
|
-
}
|
|
4771
|
-
result[u] = i;
|
|
4772
|
-
}
|
|
4773
|
-
}
|
|
4774
|
-
}
|
|
4775
|
-
u = result.length;
|
|
4776
|
-
v = result[u - 1];
|
|
4777
|
-
while (u-- > 0) {
|
|
4778
|
-
result[u] = v;
|
|
4779
|
-
v = p[v];
|
|
4780
|
-
}
|
|
4781
|
-
return result;
|
|
4782
|
-
}
|
|
4783
4982
|
function locateNonHydratedAsyncRoot(instance) {
|
|
4784
4983
|
const subComponent = instance.subTree.component;
|
|
4785
4984
|
if (subComponent) {
|
|
@@ -4793,9 +4992,14 @@ function locateNonHydratedAsyncRoot(instance) {
|
|
|
4793
4992
|
function invalidateMount(hooks) {
|
|
4794
4993
|
if (hooks) {
|
|
4795
4994
|
for (let i = 0; i < hooks.length; i++)
|
|
4796
|
-
hooks[i].flags |=
|
|
4995
|
+
hooks[i].flags |= 4;
|
|
4797
4996
|
}
|
|
4798
4997
|
}
|
|
4998
|
+
function getVaporInterface(instance, vnode) {
|
|
4999
|
+
const ctx = instance ? instance.appContext : vnode.appContext;
|
|
5000
|
+
const res = ctx && ctx.vapor;
|
|
5001
|
+
return res;
|
|
5002
|
+
}
|
|
4799
5003
|
|
|
4800
5004
|
const ssrContextKey = Symbol.for("v-scx");
|
|
4801
5005
|
const useSSRContext = () => {
|
|
@@ -4825,8 +5029,41 @@ function watchSyncEffect(effect, options) {
|
|
|
4825
5029
|
function watch(source, cb, options) {
|
|
4826
5030
|
return doWatch(source, cb, options);
|
|
4827
5031
|
}
|
|
5032
|
+
class RenderWatcherEffect extends reactivity.WatcherEffect {
|
|
5033
|
+
constructor(instance, source, cb, options, flush) {
|
|
5034
|
+
super(source, cb, options);
|
|
5035
|
+
this.flush = flush;
|
|
5036
|
+
const job = () => {
|
|
5037
|
+
if (this.dirty) {
|
|
5038
|
+
this.run();
|
|
5039
|
+
}
|
|
5040
|
+
};
|
|
5041
|
+
if (cb) {
|
|
5042
|
+
this.flags |= 128;
|
|
5043
|
+
job.flags |= 2;
|
|
5044
|
+
}
|
|
5045
|
+
if (instance) {
|
|
5046
|
+
job.i = instance;
|
|
5047
|
+
}
|
|
5048
|
+
this.job = job;
|
|
5049
|
+
}
|
|
5050
|
+
notify() {
|
|
5051
|
+
const flags = this.flags;
|
|
5052
|
+
if (!(flags & 256)) {
|
|
5053
|
+
const flush = this.flush;
|
|
5054
|
+
const job = this.job;
|
|
5055
|
+
if (flush === "post") {
|
|
5056
|
+
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
5057
|
+
} else if (flush === "pre") {
|
|
5058
|
+
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
5059
|
+
} else {
|
|
5060
|
+
job();
|
|
5061
|
+
}
|
|
5062
|
+
}
|
|
5063
|
+
}
|
|
5064
|
+
}
|
|
4828
5065
|
function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
4829
|
-
const { immediate, deep, flush, once } = options;
|
|
5066
|
+
const { immediate, deep, flush = "pre", once } = options;
|
|
4830
5067
|
const baseWatchOptions = shared.extend({}, options);
|
|
4831
5068
|
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
4832
5069
|
let ssrCleanup;
|
|
@@ -4845,42 +5082,32 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
|
4845
5082
|
}
|
|
4846
5083
|
const instance = currentInstance;
|
|
4847
5084
|
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
};
|
|
5085
|
+
const effect = new RenderWatcherEffect(
|
|
5086
|
+
instance,
|
|
5087
|
+
source,
|
|
5088
|
+
cb,
|
|
5089
|
+
baseWatchOptions,
|
|
5090
|
+
flush
|
|
5091
|
+
);
|
|
5092
|
+
if (cb) {
|
|
5093
|
+
effect.run(true);
|
|
5094
|
+
} else if (flush === "post") {
|
|
5095
|
+
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
5096
|
+
} else {
|
|
5097
|
+
effect.run(true);
|
|
4862
5098
|
}
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
if (isPre) {
|
|
4868
|
-
job.flags |= 2;
|
|
4869
|
-
if (instance) {
|
|
4870
|
-
job.id = instance.uid;
|
|
4871
|
-
job.i = instance;
|
|
4872
|
-
}
|
|
4873
|
-
}
|
|
4874
|
-
};
|
|
4875
|
-
const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
|
|
5099
|
+
const stop = effect.stop.bind(effect);
|
|
5100
|
+
stop.pause = effect.pause.bind(effect);
|
|
5101
|
+
stop.resume = effect.resume.bind(effect);
|
|
5102
|
+
stop.stop = stop;
|
|
4876
5103
|
if (isInSSRComponentSetup) {
|
|
4877
5104
|
if (ssrCleanup) {
|
|
4878
|
-
ssrCleanup.push(
|
|
5105
|
+
ssrCleanup.push(stop);
|
|
4879
5106
|
} else if (runsImmediately) {
|
|
4880
|
-
|
|
5107
|
+
stop();
|
|
4881
5108
|
}
|
|
4882
5109
|
}
|
|
4883
|
-
return
|
|
5110
|
+
return stop;
|
|
4884
5111
|
}
|
|
4885
5112
|
function instanceWatch(source, value, options) {
|
|
4886
5113
|
const publicThis = this.proxy;
|
|
@@ -4892,9 +5119,9 @@ function instanceWatch(source, value, options) {
|
|
|
4892
5119
|
cb = value.handler;
|
|
4893
5120
|
options = value;
|
|
4894
5121
|
}
|
|
4895
|
-
const
|
|
5122
|
+
const prev = setCurrentInstance(this);
|
|
4896
5123
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
4897
|
-
|
|
5124
|
+
setCurrentInstance(...prev);
|
|
4898
5125
|
return res;
|
|
4899
5126
|
}
|
|
4900
5127
|
function createPathGetter(ctx, path) {
|
|
@@ -4909,10 +5136,10 @@ function createPathGetter(ctx, path) {
|
|
|
4909
5136
|
}
|
|
4910
5137
|
|
|
4911
5138
|
function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
4912
|
-
const i =
|
|
5139
|
+
const i = getCurrentGenericInstance();
|
|
4913
5140
|
const camelizedName = shared.camelize(name);
|
|
4914
5141
|
const hyphenatedName = shared.hyphenate(name);
|
|
4915
|
-
const modifiers = getModelModifiers(props, camelizedName);
|
|
5142
|
+
const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
|
|
4916
5143
|
const res = reactivity.customRef((track, trigger) => {
|
|
4917
5144
|
let localValue;
|
|
4918
5145
|
let prevSetValue = shared.EMPTY_OBJ;
|
|
@@ -4934,9 +5161,25 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
4934
5161
|
if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
|
|
4935
5162
|
return;
|
|
4936
5163
|
}
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
5164
|
+
let rawPropKeys;
|
|
5165
|
+
let parentPassedModelValue = false;
|
|
5166
|
+
let parentPassedModelUpdater = false;
|
|
5167
|
+
if (i.rawKeys) {
|
|
5168
|
+
rawPropKeys = i.rawKeys();
|
|
5169
|
+
} else {
|
|
5170
|
+
const rawProps = i.vnode.props;
|
|
5171
|
+
rawPropKeys = rawProps && Object.keys(rawProps);
|
|
5172
|
+
}
|
|
5173
|
+
if (rawPropKeys) {
|
|
5174
|
+
for (const key of rawPropKeys) {
|
|
5175
|
+
if (key === name || key === camelizedName || key === hyphenatedName) {
|
|
5176
|
+
parentPassedModelValue = true;
|
|
5177
|
+
} else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) {
|
|
5178
|
+
parentPassedModelUpdater = true;
|
|
5179
|
+
}
|
|
5180
|
+
}
|
|
5181
|
+
}
|
|
5182
|
+
if (!parentPassedModelValue || !parentPassedModelUpdater) {
|
|
4940
5183
|
localValue = value;
|
|
4941
5184
|
trigger();
|
|
4942
5185
|
}
|
|
@@ -4963,16 +5206,24 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
4963
5206
|
};
|
|
4964
5207
|
return res;
|
|
4965
5208
|
}
|
|
4966
|
-
const getModelModifiers = (props, modelName) => {
|
|
4967
|
-
return modelName === "modelValue" || modelName === "model-value" ? props
|
|
5209
|
+
const getModelModifiers = (props, modelName, getter) => {
|
|
5210
|
+
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`);
|
|
4968
5211
|
};
|
|
4969
5212
|
|
|
4970
5213
|
function emit(instance, event, ...rawArgs) {
|
|
5214
|
+
return baseEmit(
|
|
5215
|
+
instance,
|
|
5216
|
+
instance.vnode.props || shared.EMPTY_OBJ,
|
|
5217
|
+
defaultPropGetter,
|
|
5218
|
+
event,
|
|
5219
|
+
...rawArgs
|
|
5220
|
+
);
|
|
5221
|
+
}
|
|
5222
|
+
function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
4971
5223
|
if (instance.isUnmounted) return;
|
|
4972
|
-
const props = instance.vnode.props || shared.EMPTY_OBJ;
|
|
4973
5224
|
let args = rawArgs;
|
|
4974
5225
|
const isModelListener = event.startsWith("update:");
|
|
4975
|
-
const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
|
|
5226
|
+
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
4976
5227
|
if (modifiers) {
|
|
4977
5228
|
if (modifiers.trim) {
|
|
4978
5229
|
args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a);
|
|
@@ -4982,10 +5233,10 @@ function emit(instance, event, ...rawArgs) {
|
|
|
4982
5233
|
}
|
|
4983
5234
|
}
|
|
4984
5235
|
let handlerName;
|
|
4985
|
-
let handler = props
|
|
4986
|
-
props
|
|
5236
|
+
let handler = getter(props, handlerName = shared.toHandlerKey(event)) || // also try camelCase event handler (#2249)
|
|
5237
|
+
getter(props, handlerName = shared.toHandlerKey(shared.camelize(event)));
|
|
4987
5238
|
if (!handler && isModelListener) {
|
|
4988
|
-
handler = props
|
|
5239
|
+
handler = getter(props, handlerName = shared.toHandlerKey(shared.hyphenate(event)));
|
|
4989
5240
|
}
|
|
4990
5241
|
if (handler) {
|
|
4991
5242
|
callWithAsyncErrorHandling(
|
|
@@ -4995,7 +5246,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
4995
5246
|
args
|
|
4996
5247
|
);
|
|
4997
5248
|
}
|
|
4998
|
-
const onceHandler = props
|
|
5249
|
+
const onceHandler = getter(props, handlerName + `Once`);
|
|
4999
5250
|
if (onceHandler) {
|
|
5000
5251
|
if (!instance.emitted) {
|
|
5001
5252
|
instance.emitted = {};
|
|
@@ -5011,6 +5262,9 @@ function emit(instance, event, ...rawArgs) {
|
|
|
5011
5262
|
);
|
|
5012
5263
|
}
|
|
5013
5264
|
}
|
|
5265
|
+
function defaultPropGetter(props, key) {
|
|
5266
|
+
return props[key];
|
|
5267
|
+
}
|
|
5014
5268
|
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
5015
5269
|
const cache = appContext.emitsCache;
|
|
5016
5270
|
const cached = cache.get(comp);
|
|
@@ -5259,7 +5513,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
5259
5513
|
return false;
|
|
5260
5514
|
}
|
|
5261
5515
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
5262
|
-
while (parent) {
|
|
5516
|
+
while (parent && !parent.vapor) {
|
|
5263
5517
|
const root = parent.subTree;
|
|
5264
5518
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
5265
5519
|
root.el = vnode.el;
|
|
@@ -5588,7 +5842,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5588
5842
|
pendingBranch,
|
|
5589
5843
|
container2,
|
|
5590
5844
|
anchor === initialAnchor ? next(activeBranch) : anchor,
|
|
5591
|
-
0
|
|
5845
|
+
0,
|
|
5846
|
+
parentComponent2
|
|
5592
5847
|
);
|
|
5593
5848
|
queuePostFlushCb(effects);
|
|
5594
5849
|
}
|
|
@@ -5601,7 +5856,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5601
5856
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
5602
5857
|
}
|
|
5603
5858
|
if (!delayEnter) {
|
|
5604
|
-
move(
|
|
5859
|
+
move(
|
|
5860
|
+
pendingBranch,
|
|
5861
|
+
container2,
|
|
5862
|
+
anchor,
|
|
5863
|
+
0,
|
|
5864
|
+
parentComponent2
|
|
5865
|
+
);
|
|
5605
5866
|
}
|
|
5606
5867
|
}
|
|
5607
5868
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -5674,7 +5935,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5674
5935
|
}
|
|
5675
5936
|
},
|
|
5676
5937
|
move(container2, anchor2, type) {
|
|
5677
|
-
suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
|
|
5938
|
+
suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type, parentComponent);
|
|
5678
5939
|
suspense.container = container2;
|
|
5679
5940
|
},
|
|
5680
5941
|
next() {
|
|
@@ -5805,7 +6066,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
5805
6066
|
}
|
|
5806
6067
|
return s;
|
|
5807
6068
|
}
|
|
5808
|
-
function queueEffectWithSuspense(fn, suspense) {
|
|
6069
|
+
function queueEffectWithSuspense(fn, id, suspense) {
|
|
5809
6070
|
if (suspense && suspense.pendingBranch) {
|
|
5810
6071
|
if (shared.isArray(fn)) {
|
|
5811
6072
|
suspense.effects.push(...fn);
|
|
@@ -5813,7 +6074,7 @@ function queueEffectWithSuspense(fn, suspense) {
|
|
|
5813
6074
|
suspense.effects.push(fn);
|
|
5814
6075
|
}
|
|
5815
6076
|
} else {
|
|
5816
|
-
queuePostFlushCb(fn);
|
|
6077
|
+
queuePostFlushCb(fn, id);
|
|
5817
6078
|
}
|
|
5818
6079
|
}
|
|
5819
6080
|
function setActiveBranch(suspense, branch) {
|
|
@@ -5839,6 +6100,7 @@ const Fragment = Symbol.for("v-fgt");
|
|
|
5839
6100
|
const Text = Symbol.for("v-txt");
|
|
5840
6101
|
const Comment = Symbol.for("v-cmt");
|
|
5841
6102
|
const Static = Symbol.for("v-stc");
|
|
6103
|
+
const VaporSlot = Symbol.for("v-vps");
|
|
5842
6104
|
const blockStack = [];
|
|
5843
6105
|
let currentBlock = null;
|
|
5844
6106
|
function openBlock(disableTracking = false) {
|
|
@@ -6175,6 +6437,40 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
6175
6437
|
]);
|
|
6176
6438
|
}
|
|
6177
6439
|
|
|
6440
|
+
let currentInstance = null;
|
|
6441
|
+
const getCurrentGenericInstance = () => currentInstance || currentRenderingInstance;
|
|
6442
|
+
const getCurrentInstance = () => currentInstance && !currentInstance.vapor ? currentInstance : currentRenderingInstance;
|
|
6443
|
+
let isInSSRComponentSetup = false;
|
|
6444
|
+
let setInSSRSetupState;
|
|
6445
|
+
let simpleSetCurrentInstance;
|
|
6446
|
+
{
|
|
6447
|
+
const g = shared.getGlobalThis();
|
|
6448
|
+
const registerGlobalSetter = (key, setter) => {
|
|
6449
|
+
let setters;
|
|
6450
|
+
if (!(setters = g[key])) setters = g[key] = [];
|
|
6451
|
+
setters.push(setter);
|
|
6452
|
+
return (v) => {
|
|
6453
|
+
if (setters.length > 1) setters.forEach((set) => set(v));
|
|
6454
|
+
else setters[0](v);
|
|
6455
|
+
};
|
|
6456
|
+
};
|
|
6457
|
+
simpleSetCurrentInstance = registerGlobalSetter(
|
|
6458
|
+
`__VUE_INSTANCE_SETTERS__`,
|
|
6459
|
+
(v) => currentInstance = v
|
|
6460
|
+
);
|
|
6461
|
+
setInSSRSetupState = registerGlobalSetter(
|
|
6462
|
+
`__VUE_SSR_SETTERS__`,
|
|
6463
|
+
(v) => isInSSRComponentSetup = v
|
|
6464
|
+
);
|
|
6465
|
+
}
|
|
6466
|
+
const setCurrentInstance = (instance, scope = instance !== null ? instance.scope : void 0) => {
|
|
6467
|
+
try {
|
|
6468
|
+
return [currentInstance, reactivity.setCurrentScope(scope)];
|
|
6469
|
+
} finally {
|
|
6470
|
+
simpleSetCurrentInstance(instance);
|
|
6471
|
+
}
|
|
6472
|
+
};
|
|
6473
|
+
|
|
6178
6474
|
const emptyAppContext = createAppContext();
|
|
6179
6475
|
let uid = 0;
|
|
6180
6476
|
function createComponentInstance(vnode, parent, suspense) {
|
|
@@ -6219,7 +6515,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
6219
6515
|
// to be set immediately
|
|
6220
6516
|
emitted: null,
|
|
6221
6517
|
// props default value
|
|
6222
|
-
propsDefaults:
|
|
6518
|
+
propsDefaults: null,
|
|
6223
6519
|
// inheritAttrs
|
|
6224
6520
|
inheritAttrs: type.inheritAttrs,
|
|
6225
6521
|
// state
|
|
@@ -6266,53 +6562,19 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
6266
6562
|
}
|
|
6267
6563
|
return instance;
|
|
6268
6564
|
}
|
|
6269
|
-
let currentInstance = null;
|
|
6270
|
-
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
6271
|
-
let internalSetCurrentInstance;
|
|
6272
|
-
let setInSSRSetupState;
|
|
6273
|
-
{
|
|
6274
|
-
const g = shared.getGlobalThis();
|
|
6275
|
-
const registerGlobalSetter = (key, setter) => {
|
|
6276
|
-
let setters;
|
|
6277
|
-
if (!(setters = g[key])) setters = g[key] = [];
|
|
6278
|
-
setters.push(setter);
|
|
6279
|
-
return (v) => {
|
|
6280
|
-
if (setters.length > 1) setters.forEach((set) => set(v));
|
|
6281
|
-
else setters[0](v);
|
|
6282
|
-
};
|
|
6283
|
-
};
|
|
6284
|
-
internalSetCurrentInstance = registerGlobalSetter(
|
|
6285
|
-
`__VUE_INSTANCE_SETTERS__`,
|
|
6286
|
-
(v) => currentInstance = v
|
|
6287
|
-
);
|
|
6288
|
-
setInSSRSetupState = registerGlobalSetter(
|
|
6289
|
-
`__VUE_SSR_SETTERS__`,
|
|
6290
|
-
(v) => isInSSRComponentSetup = v
|
|
6291
|
-
);
|
|
6292
|
-
}
|
|
6293
|
-
const setCurrentInstance = (instance) => {
|
|
6294
|
-
const prev = currentInstance;
|
|
6295
|
-
internalSetCurrentInstance(instance);
|
|
6296
|
-
instance.scope.on();
|
|
6297
|
-
return () => {
|
|
6298
|
-
instance.scope.off();
|
|
6299
|
-
internalSetCurrentInstance(prev);
|
|
6300
|
-
};
|
|
6301
|
-
};
|
|
6302
|
-
const unsetCurrentInstance = () => {
|
|
6303
|
-
currentInstance && currentInstance.scope.off();
|
|
6304
|
-
internalSetCurrentInstance(null);
|
|
6305
|
-
};
|
|
6306
6565
|
function isStatefulComponent(instance) {
|
|
6307
6566
|
return instance.vnode.shapeFlag & 4;
|
|
6308
6567
|
}
|
|
6309
|
-
let isInSSRComponentSetup = false;
|
|
6310
6568
|
function setupComponent(instance, isSSR = false, optimized = false) {
|
|
6311
6569
|
isSSR && setInSSRSetupState(isSSR);
|
|
6312
|
-
const { props, children } = instance.vnode;
|
|
6570
|
+
const { props, children, vi } = instance.vnode;
|
|
6313
6571
|
const isStateful = isStatefulComponent(instance);
|
|
6314
|
-
|
|
6315
|
-
|
|
6572
|
+
if (vi) {
|
|
6573
|
+
vi(instance);
|
|
6574
|
+
} else {
|
|
6575
|
+
initProps(instance, props, isStateful, isSSR);
|
|
6576
|
+
initSlots(instance, children, optimized || isSSR);
|
|
6577
|
+
}
|
|
6316
6578
|
const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
|
|
6317
6579
|
isSSR && setInSSRSetupState(false);
|
|
6318
6580
|
return setupResult;
|
|
@@ -6323,9 +6585,9 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6323
6585
|
instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
|
|
6324
6586
|
const { setup } = Component;
|
|
6325
6587
|
if (setup) {
|
|
6326
|
-
reactivity.
|
|
6588
|
+
const prevSub = reactivity.setActiveSub();
|
|
6327
6589
|
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
6328
|
-
const
|
|
6590
|
+
const prev = setCurrentInstance(instance);
|
|
6329
6591
|
const setupResult = callWithErrorHandling(
|
|
6330
6592
|
setup,
|
|
6331
6593
|
instance,
|
|
@@ -6336,12 +6598,15 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6336
6598
|
]
|
|
6337
6599
|
);
|
|
6338
6600
|
const isAsyncSetup = shared.isPromise(setupResult);
|
|
6339
|
-
reactivity.
|
|
6340
|
-
|
|
6601
|
+
reactivity.setActiveSub(prevSub);
|
|
6602
|
+
setCurrentInstance(...prev);
|
|
6341
6603
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
6342
6604
|
markAsyncBoundary(instance);
|
|
6343
6605
|
}
|
|
6344
6606
|
if (isAsyncSetup) {
|
|
6607
|
+
const unsetCurrentInstance = () => {
|
|
6608
|
+
setCurrentInstance(null, void 0);
|
|
6609
|
+
};
|
|
6345
6610
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
6346
6611
|
if (isSSR) {
|
|
6347
6612
|
return setupResult.then((resolvedResult) => {
|
|
@@ -6409,13 +6674,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
6409
6674
|
}
|
|
6410
6675
|
}
|
|
6411
6676
|
{
|
|
6412
|
-
const
|
|
6413
|
-
reactivity.
|
|
6677
|
+
const prevInstance = setCurrentInstance(instance);
|
|
6678
|
+
const prevSub = reactivity.setActiveSub();
|
|
6414
6679
|
try {
|
|
6415
6680
|
applyOptions(instance);
|
|
6416
6681
|
} finally {
|
|
6417
|
-
reactivity.
|
|
6418
|
-
|
|
6682
|
+
reactivity.setActiveSub(prevSub);
|
|
6683
|
+
setCurrentInstance(...prevInstance);
|
|
6419
6684
|
}
|
|
6420
6685
|
}
|
|
6421
6686
|
}
|
|
@@ -6426,18 +6691,18 @@ const attrsProxyHandlers = {
|
|
|
6426
6691
|
}
|
|
6427
6692
|
};
|
|
6428
6693
|
function createSetupContext(instance) {
|
|
6429
|
-
const expose = (exposed) => {
|
|
6430
|
-
instance.exposed = exposed || {};
|
|
6431
|
-
};
|
|
6432
6694
|
{
|
|
6433
6695
|
return {
|
|
6434
6696
|
attrs: new Proxy(instance.attrs, attrsProxyHandlers),
|
|
6435
6697
|
slots: instance.slots,
|
|
6436
6698
|
emit: instance.emit,
|
|
6437
|
-
expose
|
|
6699
|
+
expose: (exposed) => expose(instance, exposed)
|
|
6438
6700
|
};
|
|
6439
6701
|
}
|
|
6440
6702
|
}
|
|
6703
|
+
function expose(instance, exposed) {
|
|
6704
|
+
instance.exposed = exposed || {};
|
|
6705
|
+
}
|
|
6441
6706
|
function getComponentPublicInstance(instance) {
|
|
6442
6707
|
if (instance.exposed) {
|
|
6443
6708
|
return instance.exposeProxy || (instance.exposeProxy = new Proxy(reactivity.proxyRefs(reactivity.markRaw(instance.exposed)), {
|
|
@@ -6445,7 +6710,9 @@ function getComponentPublicInstance(instance) {
|
|
|
6445
6710
|
if (key in target) {
|
|
6446
6711
|
return target[key];
|
|
6447
6712
|
} else if (key in publicPropertiesMap) {
|
|
6448
|
-
return publicPropertiesMap[key](
|
|
6713
|
+
return publicPropertiesMap[key](
|
|
6714
|
+
instance
|
|
6715
|
+
);
|
|
6449
6716
|
}
|
|
6450
6717
|
},
|
|
6451
6718
|
has(target, key) {
|
|
@@ -6464,8 +6731,7 @@ function isClassComponent(value) {
|
|
|
6464
6731
|
}
|
|
6465
6732
|
|
|
6466
6733
|
const computed = (getterOrOptions, debugOptions) => {
|
|
6467
|
-
|
|
6468
|
-
return c;
|
|
6734
|
+
return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
6469
6735
|
};
|
|
6470
6736
|
|
|
6471
6737
|
function h(type, propsOrChildren, children) {
|
|
@@ -6521,7 +6787,7 @@ function isMemoSame(cached, memo) {
|
|
|
6521
6787
|
return true;
|
|
6522
6788
|
}
|
|
6523
6789
|
|
|
6524
|
-
const version = "3.
|
|
6790
|
+
const version = "3.6.0-alpha.1";
|
|
6525
6791
|
const warn$1 = shared.NOOP;
|
|
6526
6792
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6527
6793
|
const devtools = void 0;
|