@vue/server-renderer 3.6.0-beta.9 → 3.6.0-rc.10
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/server-renderer.cjs.js +171 -327
- package/dist/server-renderer.cjs.prod.js +169 -63
- package/dist/server-renderer.d.ts +8 -11
- package/dist/server-renderer.esm-browser.js +956 -481
- package/dist/server-renderer.esm-browser.prod.js +2 -2
- package/dist/server-renderer.esm-bundler.js +149 -820
- package/package.json +4 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/server-renderer v3.6.0-
|
|
2
|
+
* @vue/server-renderer v3.6.0-rc.10
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* \/\*#\_\_PURE\_\_\*\/
|
|
12
12
|
* So that they can be tree-shaken if necessary.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
15
15
|
function makeMap(str) {
|
|
16
16
|
const map = Object.create(null);
|
|
17
17
|
for (const key of str.split(",")) map[key] = 1;
|
|
@@ -54,9 +54,9 @@ const toRawType = (value) => {
|
|
|
54
54
|
};
|
|
55
55
|
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
56
56
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
57
|
-
const isReservedProp =
|
|
58
|
-
const isBuiltInTag =
|
|
59
|
-
const isBuiltInDirective =
|
|
57
|
+
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
58
|
+
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
59
|
+
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
60
60
|
const cacheStringFunction = (fn) => {
|
|
61
61
|
const cache = Object.create(null);
|
|
62
62
|
return ((str) => {
|
|
@@ -137,10 +137,10 @@ function normalizeStyle(value) {
|
|
|
137
137
|
}
|
|
138
138
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
139
139
|
const propertyDelimiterRE = /:([^]+)/;
|
|
140
|
-
const styleCommentRE =
|
|
140
|
+
const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
|
|
141
141
|
function parseStringStyle(cssText) {
|
|
142
142
|
const ret = {};
|
|
143
|
-
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
143
|
+
cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
|
|
144
144
|
if (item) {
|
|
145
145
|
const tmp = item.split(propertyDelimiterRE);
|
|
146
146
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
@@ -183,22 +183,22 @@ const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,tr
|
|
|
183
183
|
* Compiler only.
|
|
184
184
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
185
185
|
*/
|
|
186
|
-
const isHTMLTag =
|
|
186
|
+
const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
|
|
187
187
|
/**
|
|
188
188
|
* Compiler only.
|
|
189
189
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
190
190
|
*/
|
|
191
|
-
const isSVGTag =
|
|
191
|
+
const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
|
|
192
192
|
/**
|
|
193
193
|
* Compiler only.
|
|
194
194
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
195
195
|
*/
|
|
196
|
-
const isMathMLTag =
|
|
196
|
+
const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
197
197
|
/**
|
|
198
198
|
* Compiler only.
|
|
199
199
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
200
200
|
*/
|
|
201
|
-
const isVoidTag =
|
|
201
|
+
const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
|
|
202
202
|
//#endregion
|
|
203
203
|
//#region packages/shared/src/domAttrConfig.ts
|
|
204
204
|
/**
|
|
@@ -213,11 +213,11 @@ const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
|
|
|
213
213
|
* - readonly -> readOnly
|
|
214
214
|
*/
|
|
215
215
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
216
|
-
const isSpecialBooleanAttr =
|
|
216
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
217
217
|
/**
|
|
218
218
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
219
219
|
*/
|
|
220
|
-
const isBooleanAttr =
|
|
220
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
221
221
|
/**
|
|
222
222
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
223
223
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -225,7 +225,7 @@ const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,auto
|
|
|
225
225
|
function includeBooleanAttr(value) {
|
|
226
226
|
return !!value || value === "";
|
|
227
227
|
}
|
|
228
|
-
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
|
|
228
|
+
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u000d\u0020]/;
|
|
229
229
|
const attrValidationCache = {};
|
|
230
230
|
function isSSRSafeAttrName(name) {
|
|
231
231
|
if (attrValidationCache.hasOwnProperty(name)) return attrValidationCache[name];
|
|
@@ -292,19 +292,65 @@ function escapeHtml(string) {
|
|
|
292
292
|
}
|
|
293
293
|
return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
|
|
294
294
|
}
|
|
295
|
-
const commentStripRE =
|
|
295
|
+
const commentStripRE = /^(?:-?>)+|<!--|-->|--!>|<!-$/g;
|
|
296
296
|
function escapeHtmlComment(src) {
|
|
297
|
-
|
|
297
|
+
let prev;
|
|
298
|
+
do {
|
|
299
|
+
prev = src;
|
|
300
|
+
src = src.replace(commentStripRE, "");
|
|
301
|
+
} while (src !== prev);
|
|
302
|
+
return src;
|
|
298
303
|
}
|
|
299
304
|
//#endregion
|
|
300
305
|
//#region packages/shared/src/looseEqual.ts
|
|
301
|
-
function looseCompareArrays(a, b) {
|
|
306
|
+
function looseCompareArrays(a, b, seen) {
|
|
302
307
|
if (a.length !== b.length) return false;
|
|
303
308
|
let equal = true;
|
|
304
|
-
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
309
|
+
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
|
|
310
|
+
return equal;
|
|
311
|
+
}
|
|
312
|
+
function looseCompareCollections(a, b, seen) {
|
|
313
|
+
if (a.size !== b.size) return false;
|
|
314
|
+
const candidates = Array.from(b);
|
|
315
|
+
const matched = new Uint8Array(candidates.length);
|
|
316
|
+
for (const item of a) {
|
|
317
|
+
let index = -1;
|
|
318
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
|
|
319
|
+
index = i;
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
if (index < 0) return false;
|
|
323
|
+
matched[index] = 1;
|
|
324
|
+
}
|
|
325
|
+
return true;
|
|
326
|
+
}
|
|
327
|
+
function looseCompareObjects(a, b, seen) {
|
|
328
|
+
let aValidType = isMap(a);
|
|
329
|
+
let bValidType = isMap(b);
|
|
330
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
331
|
+
aValidType = isSet(a);
|
|
332
|
+
bValidType = isSet(b);
|
|
333
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
334
|
+
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
335
|
+
for (const key in a) {
|
|
336
|
+
const aHasKey = a.hasOwnProperty(key);
|
|
337
|
+
const bHasKey = b.hasOwnProperty(key);
|
|
338
|
+
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
|
|
339
|
+
}
|
|
340
|
+
return String(a) === String(b);
|
|
341
|
+
}
|
|
342
|
+
function looseCompareNested(a, b, seen, compare) {
|
|
343
|
+
if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
|
|
344
|
+
const [seenA, seenB] = seen;
|
|
345
|
+
if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
|
|
346
|
+
seenA.set(a, b);
|
|
347
|
+
seenB.set(b, a);
|
|
348
|
+
const equal = compare(a, b, seen);
|
|
349
|
+
seenA.delete(a);
|
|
350
|
+
seenB.delete(b);
|
|
305
351
|
return equal;
|
|
306
352
|
}
|
|
307
|
-
function looseEqual(a, b) {
|
|
353
|
+
function looseEqual(a, b, seen) {
|
|
308
354
|
if (a === b) return true;
|
|
309
355
|
let aValidType = isDate(a);
|
|
310
356
|
let bValidType = isDate(b);
|
|
@@ -314,17 +360,12 @@ function looseEqual(a, b) {
|
|
|
314
360
|
if (aValidType || bValidType) return a === b;
|
|
315
361
|
aValidType = isArray(a);
|
|
316
362
|
bValidType = isArray(b);
|
|
317
|
-
if (aValidType || bValidType) return aValidType && bValidType ?
|
|
363
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
|
|
318
364
|
aValidType = isObject(a);
|
|
319
365
|
bValidType = isObject(b);
|
|
320
366
|
if (aValidType || bValidType) {
|
|
321
367
|
if (!aValidType || !bValidType) return false;
|
|
322
|
-
|
|
323
|
-
for (const key in a) {
|
|
324
|
-
const aHasKey = a.hasOwnProperty(key);
|
|
325
|
-
const bHasKey = b.hasOwnProperty(key);
|
|
326
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
|
|
327
|
-
}
|
|
368
|
+
return looseCompareNested(a, b, seen, looseCompareObjects);
|
|
328
369
|
}
|
|
329
370
|
return String(a) === String(b);
|
|
330
371
|
}
|
|
@@ -454,9 +495,18 @@ function setupFlagsHandler(target) {
|
|
|
454
495
|
function warn$2(msg, ...args) {
|
|
455
496
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
456
497
|
}
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region packages/reactivity/src/system.ts
|
|
457
500
|
const notifyBuffer = [];
|
|
458
501
|
let batchDepth = 0;
|
|
459
502
|
let activeSub = void 0;
|
|
503
|
+
let runDepth = 0;
|
|
504
|
+
function incRunDepth() {
|
|
505
|
+
++runDepth;
|
|
506
|
+
}
|
|
507
|
+
function decRunDepth() {
|
|
508
|
+
--runDepth;
|
|
509
|
+
}
|
|
460
510
|
let globalVersion = 0;
|
|
461
511
|
let notifyIndex = 0;
|
|
462
512
|
let notifyBufferLength = 0;
|
|
@@ -530,8 +580,10 @@ function propagate(link) {
|
|
|
530
580
|
const sub = link.sub;
|
|
531
581
|
let flags = sub.flags;
|
|
532
582
|
if (flags & 3) {
|
|
533
|
-
if (!(flags & 60))
|
|
534
|
-
|
|
583
|
+
if (!(flags & 60)) {
|
|
584
|
+
sub.flags = flags | 32;
|
|
585
|
+
if (runDepth) sub.flags |= 8;
|
|
586
|
+
} else if (!(flags & 12)) flags = 0;
|
|
535
587
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
536
588
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
537
589
|
sub.flags = flags | 40;
|
|
@@ -583,13 +635,23 @@ function endTracking(sub, prevSub) {
|
|
|
583
635
|
sub.flags &= -5;
|
|
584
636
|
}
|
|
585
637
|
function flush() {
|
|
638
|
+
let hasError = false;
|
|
639
|
+
let error;
|
|
586
640
|
while (notifyIndex < notifyBufferLength) {
|
|
587
641
|
const effect = notifyBuffer[notifyIndex];
|
|
588
642
|
notifyBuffer[notifyIndex++] = void 0;
|
|
589
|
-
|
|
643
|
+
try {
|
|
644
|
+
effect.notify();
|
|
645
|
+
} catch (err) {
|
|
646
|
+
if (!hasError) {
|
|
647
|
+
hasError = true;
|
|
648
|
+
error = err;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
590
651
|
}
|
|
591
652
|
notifyIndex = 0;
|
|
592
653
|
notifyBufferLength = 0;
|
|
654
|
+
if (hasError) throw error;
|
|
593
655
|
}
|
|
594
656
|
function checkDirty(link, sub) {
|
|
595
657
|
let stack;
|
|
@@ -600,13 +662,13 @@ function checkDirty(link, sub) {
|
|
|
600
662
|
let dirty = false;
|
|
601
663
|
if (sub.flags & 16) dirty = true;
|
|
602
664
|
else if ((depFlags & 17) === 17) {
|
|
665
|
+
const subs = dep.subs;
|
|
603
666
|
if (dep.update()) {
|
|
604
|
-
const subs = dep.subs;
|
|
605
667
|
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
606
668
|
dirty = true;
|
|
607
669
|
}
|
|
608
670
|
} else if ((depFlags & 33) === 33) {
|
|
609
|
-
|
|
671
|
+
stack = {
|
|
610
672
|
value: link,
|
|
611
673
|
prev: stack
|
|
612
674
|
};
|
|
@@ -621,15 +683,12 @@ function checkDirty(link, sub) {
|
|
|
621
683
|
}
|
|
622
684
|
while (checkDepth) {
|
|
623
685
|
--checkDepth;
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
if (hasMultipleSubs) {
|
|
627
|
-
link = stack.value;
|
|
628
|
-
stack = stack.prev;
|
|
629
|
-
} else link = firstSub;
|
|
686
|
+
link = stack.value;
|
|
687
|
+
stack = stack.prev;
|
|
630
688
|
if (dirty) {
|
|
689
|
+
const subs = sub.subs;
|
|
631
690
|
if (sub.update()) {
|
|
632
|
-
if (
|
|
691
|
+
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
633
692
|
sub = link.sub;
|
|
634
693
|
continue;
|
|
635
694
|
}
|
|
@@ -641,7 +700,7 @@ function checkDirty(link, sub) {
|
|
|
641
700
|
}
|
|
642
701
|
dirty = false;
|
|
643
702
|
}
|
|
644
|
-
return dirty;
|
|
703
|
+
return dirty && !!sub.flags;
|
|
645
704
|
} while (true);
|
|
646
705
|
}
|
|
647
706
|
function shallowPropagate(link) {
|
|
@@ -676,7 +735,7 @@ var Dep = class {
|
|
|
676
735
|
}
|
|
677
736
|
set subs(value) {
|
|
678
737
|
this._subs = value;
|
|
679
|
-
if (value === void 0) this.map.delete(this.key);
|
|
738
|
+
if (value === void 0 && this.map) this.map.delete(this.key);
|
|
680
739
|
}
|
|
681
740
|
};
|
|
682
741
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -759,9 +818,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
759
818
|
if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
760
819
|
}
|
|
761
820
|
break;
|
|
762
|
-
case "set":
|
|
763
|
-
if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
764
|
-
break;
|
|
821
|
+
case "set": if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
765
822
|
}
|
|
766
823
|
}
|
|
767
824
|
}
|
|
@@ -772,13 +829,17 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
772
829
|
/**
|
|
773
830
|
* Track array iteration and return:
|
|
774
831
|
* - if input is reactive: a cloned raw array with reactive values
|
|
775
|
-
* - if input is
|
|
832
|
+
* - if input is readonly: a cloned raw array with readonly values, preserving
|
|
833
|
+
* reactivity
|
|
834
|
+
* - if input is raw or shallow: the original raw array
|
|
776
835
|
*/
|
|
777
836
|
function reactiveReadArray(array) {
|
|
778
837
|
const raw = /* @__PURE__ */ toRaw(array);
|
|
779
838
|
if (raw === array) return raw;
|
|
780
839
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
781
|
-
|
|
840
|
+
if (/* @__PURE__ */ isShallow(array)) return raw;
|
|
841
|
+
if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
|
|
842
|
+
return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
|
|
782
843
|
}
|
|
783
844
|
/**
|
|
784
845
|
* Track array iteration and return raw array
|
|
@@ -954,8 +1015,8 @@ function noTracking(self, method, args = []) {
|
|
|
954
1015
|
}
|
|
955
1016
|
//#endregion
|
|
956
1017
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
957
|
-
const isNonTrackableKeys =
|
|
958
|
-
const builtInSymbols = new Set(
|
|
1018
|
+
const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
1019
|
+
const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
959
1020
|
function hasOwnProperty(key) {
|
|
960
1021
|
if (!isSymbol(key)) key = String(key);
|
|
961
1022
|
const obj = /* @__PURE__ */ toRaw(this);
|
|
@@ -1010,17 +1071,19 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1010
1071
|
oldValue = /* @__PURE__ */ toRaw(oldValue);
|
|
1011
1072
|
value = /* @__PURE__ */ toRaw(value);
|
|
1012
1073
|
}
|
|
1013
|
-
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value))
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1074
|
+
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
|
|
1075
|
+
if (isOldValueReadonly) {
|
|
1076
|
+
warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
|
|
1077
|
+
return true;
|
|
1078
|
+
} else {
|
|
1079
|
+
oldValue.value = value;
|
|
1080
|
+
return true;
|
|
1081
|
+
}
|
|
1019
1082
|
}
|
|
1020
1083
|
}
|
|
1021
1084
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
1022
1085
|
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
1023
|
-
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
1086
|
+
if (target === /* @__PURE__ */ toRaw(receiver) && result) {
|
|
1024
1087
|
if (!hadKey) trigger(target, "add", key, value);
|
|
1025
1088
|
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
1026
1089
|
}
|
|
@@ -1056,10 +1119,10 @@ var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1056
1119
|
return true;
|
|
1057
1120
|
}
|
|
1058
1121
|
};
|
|
1059
|
-
const mutableHandlers =
|
|
1060
|
-
const readonlyHandlers =
|
|
1061
|
-
const shallowReactiveHandlers =
|
|
1062
|
-
const shallowReadonlyHandlers =
|
|
1122
|
+
const mutableHandlers = /*@__PURE__*/ new MutableReactiveHandler();
|
|
1123
|
+
const readonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler();
|
|
1124
|
+
const shallowReactiveHandlers = /*@__PURE__*/ new MutableReactiveHandler(true);
|
|
1125
|
+
const shallowReadonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler(true);
|
|
1063
1126
|
//#endregion
|
|
1064
1127
|
//#region packages/reactivity/src/collectionHandlers.ts
|
|
1065
1128
|
const toShallow = (value) => value;
|
|
@@ -1210,10 +1273,10 @@ function createInstrumentationGetter(isReadonly, shallow) {
|
|
|
1210
1273
|
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
1211
1274
|
};
|
|
1212
1275
|
}
|
|
1213
|
-
const mutableCollectionHandlers = { get:
|
|
1214
|
-
const shallowCollectionHandlers = { get:
|
|
1215
|
-
const readonlyCollectionHandlers = { get:
|
|
1216
|
-
const shallowReadonlyCollectionHandlers = { get:
|
|
1276
|
+
const mutableCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, false) };
|
|
1277
|
+
const shallowCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, true) };
|
|
1278
|
+
const readonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, false) };
|
|
1279
|
+
const shallowReadonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, true) };
|
|
1217
1280
|
function checkIdentityKeys(target, has, key) {
|
|
1218
1281
|
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
1219
1282
|
if (rawKey !== key && has.call(target, rawKey)) {
|
|
@@ -1238,10 +1301,7 @@ function targetTypeMap(rawType) {
|
|
|
1238
1301
|
default: return 0;
|
|
1239
1302
|
}
|
|
1240
1303
|
}
|
|
1241
|
-
|
|
1242
|
-
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1243
|
-
}
|
|
1244
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
1304
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1245
1305
|
function reactive(target) {
|
|
1246
1306
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
1247
1307
|
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
@@ -1276,7 +1336,7 @@ function reactive(target) {
|
|
|
1276
1336
|
* @param target - The source object.
|
|
1277
1337
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive}
|
|
1278
1338
|
*/
|
|
1279
|
-
|
|
1339
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1280
1340
|
function shallowReactive(target) {
|
|
1281
1341
|
return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
|
|
1282
1342
|
}
|
|
@@ -1309,7 +1369,7 @@ function shallowReactive(target) {
|
|
|
1309
1369
|
* @param target - The source object.
|
|
1310
1370
|
* @see {@link https://vuejs.org/api/reactivity-core.html#readonly}
|
|
1311
1371
|
*/
|
|
1312
|
-
|
|
1372
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1313
1373
|
function readonly(target) {
|
|
1314
1374
|
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
|
|
1315
1375
|
}
|
|
@@ -1343,7 +1403,7 @@ function readonly(target) {
|
|
|
1343
1403
|
* @param target - The source object.
|
|
1344
1404
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly}
|
|
1345
1405
|
*/
|
|
1346
|
-
|
|
1406
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1347
1407
|
function shallowReadonly(target) {
|
|
1348
1408
|
return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
|
|
1349
1409
|
}
|
|
@@ -1353,10 +1413,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1353
1413
|
return target;
|
|
1354
1414
|
}
|
|
1355
1415
|
if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
|
|
1356
|
-
|
|
1357
|
-
if (targetType === 0) return target;
|
|
1416
|
+
if (target["__v_skip"] || !Object.isExtensible(target)) return target;
|
|
1358
1417
|
const existingProxy = proxyMap.get(target);
|
|
1359
1418
|
if (existingProxy) return existingProxy;
|
|
1419
|
+
const targetType = targetTypeMap(toRawType(target));
|
|
1420
|
+
if (targetType === 0) return target;
|
|
1360
1421
|
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
1361
1422
|
proxyMap.set(target, proxy);
|
|
1362
1423
|
return proxy;
|
|
@@ -1379,7 +1440,7 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1379
1440
|
* @param value - The value to check.
|
|
1380
1441
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive}
|
|
1381
1442
|
*/
|
|
1382
|
-
|
|
1443
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1383
1444
|
function isReactive(value) {
|
|
1384
1445
|
if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
|
|
1385
1446
|
return !!(value && value["__v_isReactive"]);
|
|
@@ -1395,11 +1456,11 @@ function isReactive(value) {
|
|
|
1395
1456
|
* @param value - The value to check.
|
|
1396
1457
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly}
|
|
1397
1458
|
*/
|
|
1398
|
-
|
|
1459
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1399
1460
|
function isReadonly(value) {
|
|
1400
1461
|
return !!(value && value["__v_isReadonly"]);
|
|
1401
1462
|
}
|
|
1402
|
-
|
|
1463
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1403
1464
|
function isShallow(value) {
|
|
1404
1465
|
return !!(value && value["__v_isShallow"]);
|
|
1405
1466
|
}
|
|
@@ -1410,7 +1471,7 @@ function isShallow(value) {
|
|
|
1410
1471
|
* @param value - The value to check.
|
|
1411
1472
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy}
|
|
1412
1473
|
*/
|
|
1413
|
-
|
|
1474
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1414
1475
|
function isProxy(value) {
|
|
1415
1476
|
return value ? !!value["__v_raw"] : false;
|
|
1416
1477
|
}
|
|
@@ -1437,7 +1498,7 @@ function isProxy(value) {
|
|
|
1437
1498
|
* @param observed - The object for which the "raw" value is requested.
|
|
1438
1499
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw}
|
|
1439
1500
|
*/
|
|
1440
|
-
|
|
1501
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1441
1502
|
function toRaw(observed) {
|
|
1442
1503
|
const raw = observed && observed["__v_raw"];
|
|
1443
1504
|
return raw ? /* @__PURE__ */ toRaw(raw) : observed;
|
|
@@ -1486,7 +1547,7 @@ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value)
|
|
|
1486
1547
|
const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
1487
1548
|
//#endregion
|
|
1488
1549
|
//#region packages/reactivity/src/ref.ts
|
|
1489
|
-
|
|
1550
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1490
1551
|
function isRef(r) {
|
|
1491
1552
|
return r ? r["__v_isRef"] === true : false;
|
|
1492
1553
|
}
|
|
@@ -1561,9 +1622,11 @@ var ReactiveEffect = class {
|
|
|
1561
1622
|
if (!this.active) return this.fn();
|
|
1562
1623
|
cleanup(this);
|
|
1563
1624
|
const prevSub = startTracking(this);
|
|
1625
|
+
incRunDepth();
|
|
1564
1626
|
try {
|
|
1565
1627
|
return this.fn();
|
|
1566
1628
|
} finally {
|
|
1629
|
+
decRunDepth();
|
|
1567
1630
|
endTracking(this, prevSub);
|
|
1568
1631
|
const flags = this.flags;
|
|
1569
1632
|
if ((flags & 136) === 136) {
|
|
@@ -1584,10 +1647,12 @@ var ReactiveEffect = class {
|
|
|
1584
1647
|
get dirty() {
|
|
1585
1648
|
const flags = this.flags;
|
|
1586
1649
|
if (flags & 16) return true;
|
|
1587
|
-
if (flags & 32)
|
|
1588
|
-
this.
|
|
1589
|
-
|
|
1590
|
-
|
|
1650
|
+
if (flags & 32) {
|
|
1651
|
+
if (checkDirty(this.deps, this)) {
|
|
1652
|
+
this.flags = flags | 16;
|
|
1653
|
+
return true;
|
|
1654
|
+
} else this.flags = flags & -33;
|
|
1655
|
+
}
|
|
1591
1656
|
return false;
|
|
1592
1657
|
}
|
|
1593
1658
|
};
|
|
@@ -1696,10 +1761,12 @@ var ComputedRefImpl = class {
|
|
|
1696
1761
|
get _dirty() {
|
|
1697
1762
|
const flags = this.flags;
|
|
1698
1763
|
if (flags & 16) return true;
|
|
1699
|
-
if (flags & 32)
|
|
1700
|
-
this.
|
|
1701
|
-
|
|
1702
|
-
|
|
1764
|
+
if (flags & 32) {
|
|
1765
|
+
if (checkDirty(this.deps, this)) {
|
|
1766
|
+
this.flags = flags | 16;
|
|
1767
|
+
return true;
|
|
1768
|
+
} else this.flags = flags & -33;
|
|
1769
|
+
}
|
|
1703
1770
|
return false;
|
|
1704
1771
|
}
|
|
1705
1772
|
/**
|
|
@@ -1760,7 +1827,7 @@ var ComputedRefImpl = class {
|
|
|
1760
1827
|
}
|
|
1761
1828
|
};
|
|
1762
1829
|
setupOnTrigger(ComputedRefImpl);
|
|
1763
|
-
|
|
1830
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1764
1831
|
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1765
1832
|
let getter;
|
|
1766
1833
|
let setter;
|
|
@@ -1819,25 +1886,26 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
1819
1886
|
else if (isFunction(s)) return call ? call(s, 2) : s();
|
|
1820
1887
|
else warnInvalidSource(s, onWarn);
|
|
1821
1888
|
});
|
|
1822
|
-
} else if (isFunction(source))
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1889
|
+
} else if (isFunction(source)) {
|
|
1890
|
+
if (cb) getter = call ? () => call(source, 2) : source;
|
|
1891
|
+
else getter = () => {
|
|
1892
|
+
if (this.cleanupsLength) {
|
|
1893
|
+
const prevSub = setActiveSub();
|
|
1894
|
+
try {
|
|
1895
|
+
cleanup(this);
|
|
1896
|
+
} finally {
|
|
1897
|
+
setActiveSub(prevSub);
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
const currentEffect = activeWatcher;
|
|
1901
|
+
activeWatcher = this;
|
|
1826
1902
|
try {
|
|
1827
|
-
|
|
1903
|
+
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
1828
1904
|
} finally {
|
|
1829
|
-
|
|
1905
|
+
activeWatcher = currentEffect;
|
|
1830
1906
|
}
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
activeWatcher = this;
|
|
1834
|
-
try {
|
|
1835
|
-
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
1836
|
-
} finally {
|
|
1837
|
-
activeWatcher = currentEffect;
|
|
1838
|
-
}
|
|
1839
|
-
};
|
|
1840
|
-
else {
|
|
1907
|
+
};
|
|
1908
|
+
} else {
|
|
1841
1909
|
getter = NOOP;
|
|
1842
1910
|
warnInvalidSource(source, onWarn);
|
|
1843
1911
|
}
|
|
@@ -1855,8 +1923,9 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
1855
1923
|
if (once && cb) {
|
|
1856
1924
|
const _cb = cb;
|
|
1857
1925
|
cb = (...args) => {
|
|
1858
|
-
_cb(...args);
|
|
1926
|
+
const res = _cb(...args);
|
|
1859
1927
|
this.stop();
|
|
1928
|
+
return res;
|
|
1860
1929
|
};
|
|
1861
1930
|
}
|
|
1862
1931
|
this.cb = cb;
|
|
@@ -1870,7 +1939,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
1870
1939
|
if (!this.cb) return;
|
|
1871
1940
|
const { immediate, deep, call } = this.options;
|
|
1872
1941
|
if (initialRun && !immediate) return;
|
|
1873
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
1942
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
1874
1943
|
cleanup(this);
|
|
1875
1944
|
const currentWatcher = activeWatcher;
|
|
1876
1945
|
activeWatcher = this;
|
|
@@ -1933,7 +2002,7 @@ function warn$1(msg, ...args) {
|
|
|
1933
2002
|
isWarning = true;
|
|
1934
2003
|
const prevSub = setActiveSub();
|
|
1935
2004
|
const entry = stack.length ? stack[stack.length - 1] : null;
|
|
1936
|
-
const instance = isVNode$
|
|
2005
|
+
const instance = isVNode$3(entry) ? entry.component : entry;
|
|
1937
2006
|
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
1938
2007
|
const trace = getComponentTrace();
|
|
1939
2008
|
if (appWarnHandler) callWithErrorHandling(appWarnHandler, instance, 11, [
|
|
@@ -1966,7 +2035,7 @@ function getComponentTrace() {
|
|
|
1966
2035
|
ctx: currentCtx,
|
|
1967
2036
|
recurseCount: 0
|
|
1968
2037
|
});
|
|
1969
|
-
if (isVNode$
|
|
2038
|
+
if (isVNode$3(currentCtx)) {
|
|
1970
2039
|
const parent = currentCtx.component && currentCtx.component.parent;
|
|
1971
2040
|
currentCtx = parent && parent.vnode || parent;
|
|
1972
2041
|
} else currentCtx = currentCtx.parent;
|
|
@@ -1983,7 +2052,7 @@ function formatTrace(trace) {
|
|
|
1983
2052
|
}
|
|
1984
2053
|
function formatTraceEntry({ ctx, recurseCount }) {
|
|
1985
2054
|
const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
|
|
1986
|
-
const instance = isVNode$
|
|
2055
|
+
const instance = isVNode$3(ctx) ? ctx.component : ctx;
|
|
1987
2056
|
const isRoot = instance ? instance.parent == null : false;
|
|
1988
2057
|
const open = ` at <${formatComponentName(instance, ctx.type, isRoot)}`;
|
|
1989
2058
|
const close = `>` + postfix;
|
|
@@ -2122,7 +2191,7 @@ let currentFlushPromise = null;
|
|
|
2122
2191
|
let jobsLength = 0;
|
|
2123
2192
|
let flushIndex = 0;
|
|
2124
2193
|
let postFlushIndex = 0;
|
|
2125
|
-
const resolvedPromise =
|
|
2194
|
+
const resolvedPromise = /*@__PURE__*/ Promise.resolve();
|
|
2126
2195
|
const RECURSION_LIMIT = 100;
|
|
2127
2196
|
function nextTick(fn) {
|
|
2128
2197
|
const p = currentFlushPromise || resolvedPromise;
|
|
@@ -2139,8 +2208,8 @@ function findInsertionIndex(order, queue, start, end) {
|
|
|
2139
2208
|
/**
|
|
2140
2209
|
* @internal for runtime-vapor only
|
|
2141
2210
|
*/
|
|
2142
|
-
function queueJob(job, id, isPre = false) {
|
|
2143
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2211
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
2212
|
+
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2144
2213
|
jobsLength++;
|
|
2145
2214
|
queueFlush();
|
|
2146
2215
|
}
|
|
@@ -2161,6 +2230,7 @@ const doFlushJobs = () => {
|
|
|
2161
2230
|
flushJobs();
|
|
2162
2231
|
} catch (e) {
|
|
2163
2232
|
currentFlushPromise = null;
|
|
2233
|
+
if (jobsLength || postJobs.length) queueFlush();
|
|
2164
2234
|
throw e;
|
|
2165
2235
|
}
|
|
2166
2236
|
};
|
|
@@ -2168,9 +2238,10 @@ function queueFlush() {
|
|
|
2168
2238
|
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
2169
2239
|
}
|
|
2170
2240
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
2171
|
-
if (!isArray(jobs))
|
|
2172
|
-
|
|
2173
|
-
|
|
2241
|
+
if (!isArray(jobs)) {
|
|
2242
|
+
if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
2243
|
+
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
2244
|
+
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
2174
2245
|
queueFlush();
|
|
2175
2246
|
}
|
|
2176
2247
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -2184,32 +2255,39 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
2184
2255
|
i--;
|
|
2185
2256
|
jobsLength--;
|
|
2186
2257
|
if (cb.flags & 2) cb.flags &= -2;
|
|
2187
|
-
|
|
2188
|
-
|
|
2258
|
+
try {
|
|
2259
|
+
cb();
|
|
2260
|
+
} finally {
|
|
2261
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
2262
|
+
}
|
|
2189
2263
|
}
|
|
2190
2264
|
}
|
|
2191
2265
|
function flushPostFlushCbs(seen) {
|
|
2192
2266
|
if (postJobs.length) {
|
|
2193
2267
|
if (activePostJobs) {
|
|
2194
|
-
activePostJobs.push(
|
|
2268
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
2195
2269
|
postJobs.length = 0;
|
|
2196
2270
|
return;
|
|
2197
2271
|
}
|
|
2198
2272
|
activePostJobs = postJobs;
|
|
2199
2273
|
postJobs = [];
|
|
2200
2274
|
seen = seen || /* @__PURE__ */ new Map();
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
cb
|
|
2207
|
-
|
|
2208
|
-
|
|
2275
|
+
try {
|
|
2276
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
2277
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
2278
|
+
if (checkRecursiveUpdates(seen, cb)) continue;
|
|
2279
|
+
if (cb.flags & 2) cb.flags &= -2;
|
|
2280
|
+
if (!(cb.flags & 4)) try {
|
|
2281
|
+
cb();
|
|
2282
|
+
} finally {
|
|
2283
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
2284
|
+
}
|
|
2209
2285
|
}
|
|
2286
|
+
} finally {
|
|
2287
|
+
while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
|
|
2288
|
+
activePostJobs = null;
|
|
2289
|
+
postFlushIndex = 0;
|
|
2210
2290
|
}
|
|
2211
|
-
activePostJobs = null;
|
|
2212
|
-
postFlushIndex = 0;
|
|
2213
2291
|
}
|
|
2214
2292
|
}
|
|
2215
2293
|
let isFlushing = false;
|
|
@@ -2219,9 +2297,12 @@ let isFlushing = false;
|
|
|
2219
2297
|
function flushOnAppMount(instance) {
|
|
2220
2298
|
if (!isFlushing) {
|
|
2221
2299
|
isFlushing = true;
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2300
|
+
try {
|
|
2301
|
+
flushPreFlushCbs(instance);
|
|
2302
|
+
flushPostFlushCbs();
|
|
2303
|
+
} finally {
|
|
2304
|
+
isFlushing = false;
|
|
2305
|
+
}
|
|
2225
2306
|
}
|
|
2226
2307
|
}
|
|
2227
2308
|
function flushJobs(seen) {
|
|
@@ -2249,9 +2330,10 @@ function flushJobs(seen) {
|
|
|
2249
2330
|
}
|
|
2250
2331
|
flushIndex = 0;
|
|
2251
2332
|
jobsLength = 0;
|
|
2333
|
+
jobs.length = 0;
|
|
2252
2334
|
flushPostFlushCbs(seen);
|
|
2253
|
-
currentFlushPromise = null;
|
|
2254
2335
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
2336
|
+
else currentFlushPromise = null;
|
|
2255
2337
|
}
|
|
2256
2338
|
}
|
|
2257
2339
|
function checkRecursiveUpdates(seen, fn) {
|
|
@@ -2282,6 +2364,19 @@ getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
|
2282
2364
|
rerender: tryWrap(rerender),
|
|
2283
2365
|
reload: tryWrap(reload)
|
|
2284
2366
|
};
|
|
2367
|
+
function runWithHmrUpdating(fn) {
|
|
2368
|
+
isHmrUpdating = true;
|
|
2369
|
+
let done = false;
|
|
2370
|
+
try {
|
|
2371
|
+
fn();
|
|
2372
|
+
done = true;
|
|
2373
|
+
} finally {
|
|
2374
|
+
if (done) nextTick(() => {
|
|
2375
|
+
isHmrUpdating = false;
|
|
2376
|
+
});
|
|
2377
|
+
else isHmrUpdating = false;
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2285
2380
|
const map = /* @__PURE__ */ new Map();
|
|
2286
2381
|
function registerHMR(instance) {
|
|
2287
2382
|
const id = instance.type.__hmrId;
|
|
@@ -2306,6 +2401,14 @@ function createRecord(id, initialDef) {
|
|
|
2306
2401
|
function normalizeClassComponent(component) {
|
|
2307
2402
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2308
2403
|
}
|
|
2404
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
2405
|
+
let parent = instance.parent;
|
|
2406
|
+
while (parent) {
|
|
2407
|
+
if (dirtyInstances.has(parent)) return true;
|
|
2408
|
+
parent = parent.parent;
|
|
2409
|
+
}
|
|
2410
|
+
return false;
|
|
2411
|
+
}
|
|
2309
2412
|
function rerender(id, newRender) {
|
|
2310
2413
|
const record = map.get(id);
|
|
2311
2414
|
if (!record) return;
|
|
@@ -2315,18 +2418,16 @@ function rerender(id, newRender) {
|
|
|
2315
2418
|
instance.render = newRender;
|
|
2316
2419
|
normalizeClassComponent(instance.type).render = newRender;
|
|
2317
2420
|
}
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2421
|
+
runWithHmrUpdating(() => {
|
|
2422
|
+
if (instance.vapor) {
|
|
2423
|
+
if (!instance.isUnmounted) instance.hmrRerender();
|
|
2424
|
+
} else {
|
|
2425
|
+
const i = instance;
|
|
2426
|
+
if (!(i.effect.flags & 1024)) {
|
|
2427
|
+
i.renderCache = [];
|
|
2428
|
+
i.effect.run();
|
|
2429
|
+
}
|
|
2326
2430
|
}
|
|
2327
|
-
}
|
|
2328
|
-
nextTick(() => {
|
|
2329
|
-
isHmrUpdating = false;
|
|
2330
2431
|
});
|
|
2331
2432
|
});
|
|
2332
2433
|
}
|
|
@@ -2337,42 +2438,61 @@ function reload(id, newComp) {
|
|
|
2337
2438
|
const isVapor = record.initialDef.__vapor;
|
|
2338
2439
|
updateComponentDef(record.initialDef, newComp);
|
|
2339
2440
|
const instances = [...record.instances];
|
|
2340
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2441
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2341
2442
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2354
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2355
|
-
if (instance.ceReload) {
|
|
2356
|
-
dirtyInstances.add(instance);
|
|
2357
|
-
instance.ceReload(newComp.styles);
|
|
2358
|
-
dirtyInstances.delete(instance);
|
|
2359
|
-
} else if (instance.parent) queueJob(() => {
|
|
2360
|
-
isHmrUpdating = true;
|
|
2361
|
-
const parent = instance.parent;
|
|
2362
|
-
if (parent.vapor) parent.hmrRerender();
|
|
2363
|
-
else if (!(parent.effect.flags & 1024)) {
|
|
2364
|
-
parent.renderCache = [];
|
|
2365
|
-
parent.effect.run();
|
|
2443
|
+
const dirtyInstances = new Set(instances);
|
|
2444
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2445
|
+
runWithHmrUpdating(() => {
|
|
2446
|
+
for (const instance of instances) {
|
|
2447
|
+
const parent = instance.parent;
|
|
2448
|
+
if (parent) {
|
|
2449
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2450
|
+
rerenderedParents.add(parent);
|
|
2451
|
+
parent.hmrRerender();
|
|
2452
|
+
}
|
|
2453
|
+
} else instance.hmrReload(newComp);
|
|
2366
2454
|
}
|
|
2367
|
-
|
|
2368
|
-
|
|
2455
|
+
});
|
|
2456
|
+
} else {
|
|
2457
|
+
const parents = /* @__PURE__ */ new Set();
|
|
2458
|
+
const dirtyInstanceSet = new Set(instances);
|
|
2459
|
+
for (const instance of instances) {
|
|
2460
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2461
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2462
|
+
if (!dirtyInstances) {
|
|
2463
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2464
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2465
|
+
}
|
|
2466
|
+
dirtyInstances.add(instance);
|
|
2467
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2468
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2469
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2470
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2471
|
+
if (instance.ceReload) {
|
|
2472
|
+
dirtyInstances.add(instance);
|
|
2473
|
+
instance.ceReload(newComp.styles);
|
|
2474
|
+
dirtyInstances.delete(instance);
|
|
2475
|
+
} else if (instance.parent) {
|
|
2476
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
|
|
2477
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2478
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
2479
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2480
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2481
|
+
}
|
|
2482
|
+
parents.forEach((parent) => {
|
|
2483
|
+
queueJob(() => {
|
|
2484
|
+
runWithHmrUpdating(() => {
|
|
2485
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2486
|
+
else {
|
|
2487
|
+
const i = parent;
|
|
2488
|
+
if (!(i.effect.flags & 1024)) {
|
|
2489
|
+
i.renderCache = [];
|
|
2490
|
+
i.effect.run();
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
});
|
|
2369
2494
|
});
|
|
2370
|
-
dirtyInstances.delete(instance);
|
|
2371
2495
|
});
|
|
2372
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
2373
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
2374
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2375
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2376
2496
|
}
|
|
2377
2497
|
queuePostFlushCb(() => {
|
|
2378
2498
|
hmrDirtyComponents.clear();
|
|
@@ -2439,20 +2559,20 @@ function devtoolsInitApp(app, version) {
|
|
|
2439
2559
|
function devtoolsUnmountApp(app) {
|
|
2440
2560
|
emit$1("app:unmount", app);
|
|
2441
2561
|
}
|
|
2442
|
-
const devtoolsComponentAdded =
|
|
2443
|
-
const devtoolsComponentUpdated =
|
|
2444
|
-
const _devtoolsComponentRemoved =
|
|
2562
|
+
const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
|
|
2563
|
+
const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
|
|
2564
|
+
const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
|
|
2445
2565
|
const devtoolsComponentRemoved = (component) => {
|
|
2446
2566
|
if (devtools && typeof devtools.cleanupBuffer === "function" && !devtools.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
|
|
2447
2567
|
};
|
|
2448
|
-
|
|
2568
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2449
2569
|
function createDevtoolsComponentHook(hook) {
|
|
2450
2570
|
return (component) => {
|
|
2451
2571
|
emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
|
|
2452
2572
|
};
|
|
2453
2573
|
}
|
|
2454
|
-
const devtoolsPerfStart =
|
|
2455
|
-
const devtoolsPerfEnd =
|
|
2574
|
+
const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
|
|
2575
|
+
const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
|
|
2456
2576
|
function createDevtoolsPerformanceHook(hook) {
|
|
2457
2577
|
return (component, type, time) => {
|
|
2458
2578
|
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
@@ -2495,10 +2615,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
2495
2615
|
const renderFnWithContext = (...args) => {
|
|
2496
2616
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
2497
2617
|
const prevInstance = setCurrentRenderingInstance$1(ctx);
|
|
2618
|
+
const prevStackSize = blockStack.length;
|
|
2498
2619
|
let res;
|
|
2499
2620
|
try {
|
|
2500
2621
|
res = fn(...args);
|
|
2501
2622
|
} finally {
|
|
2623
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2502
2624
|
setCurrentRenderingInstance$1(prevInstance);
|
|
2503
2625
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
2504
2626
|
}
|
|
@@ -2644,7 +2766,7 @@ function instanceWatch(source, value, options) {
|
|
|
2644
2766
|
}
|
|
2645
2767
|
const prev = setCurrentInstance(this);
|
|
2646
2768
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
2647
|
-
|
|
2769
|
+
restoreCurrentInstance(prev);
|
|
2648
2770
|
return res;
|
|
2649
2771
|
}
|
|
2650
2772
|
function createPathGetter(ctx, path) {
|
|
@@ -2662,16 +2784,47 @@ const isTeleport = (type) => type.__isTeleport;
|
|
|
2662
2784
|
//#endregion
|
|
2663
2785
|
//#region packages/runtime-core/src/components/BaseTransition.ts
|
|
2664
2786
|
const leaveCbKey = Symbol("_leaveCb");
|
|
2787
|
+
function findNonCommentChild(children) {
|
|
2788
|
+
let child = children[0];
|
|
2789
|
+
if (children.length > 1) {
|
|
2790
|
+
let hasFound = false;
|
|
2791
|
+
for (const c of children) if (c.type !== Comment) {
|
|
2792
|
+
if (hasFound) {
|
|
2793
|
+
warn$1("<transition> can only be used on a single element or component. Use <transition-group> for lists.");
|
|
2794
|
+
break;
|
|
2795
|
+
}
|
|
2796
|
+
child = c;
|
|
2797
|
+
hasFound = true;
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
return child;
|
|
2801
|
+
}
|
|
2802
|
+
function getInnerChild(vnode) {
|
|
2803
|
+
if (!isKeepAlive(vnode)) {
|
|
2804
|
+
if (isTeleport(vnode.type) && vnode.children) return findNonCommentChild(vnode.children);
|
|
2805
|
+
return vnode;
|
|
2806
|
+
}
|
|
2807
|
+
if (vnode.component) return vnode.component.subTree;
|
|
2808
|
+
const { shapeFlag, children } = vnode;
|
|
2809
|
+
if (children) {
|
|
2810
|
+
if (shapeFlag & 16) return children[0];
|
|
2811
|
+
if (shapeFlag & 32 && isFunction(children.default)) return children.default();
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2665
2814
|
function setTransitionHooks(vnode, hooks) {
|
|
2666
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
2667
|
-
else {
|
|
2815
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
2668
2816
|
vnode.transition = hooks;
|
|
2669
|
-
setTransitionHooks(vnode.component
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2817
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
2818
|
+
else {
|
|
2819
|
+
const subTree = vnode.component.subTree;
|
|
2820
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild(subTree) || subTree : subTree, hooks);
|
|
2821
|
+
}
|
|
2822
|
+
} else if (vnode.shapeFlag & 128) {
|
|
2823
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
2824
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
2825
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
2674
2826
|
} else vnode.transition = hooks;
|
|
2827
|
+
return hooks;
|
|
2675
2828
|
}
|
|
2676
2829
|
//#endregion
|
|
2677
2830
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -2746,15 +2899,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
2746
2899
|
if (rawRef.f) {
|
|
2747
2900
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
2748
2901
|
if (isUnmount) isArray(existing) && remove(existing, refValue);
|
|
2749
|
-
else if (!isArray(existing))
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2902
|
+
else if (!isArray(existing)) {
|
|
2903
|
+
if (_isString) {
|
|
2904
|
+
refs[ref] = [refValue];
|
|
2905
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
2906
|
+
} else {
|
|
2907
|
+
const newVal = [refValue];
|
|
2908
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
2909
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
2910
|
+
}
|
|
2911
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
2758
2912
|
} else if (_isString) {
|
|
2759
2913
|
refs[ref] = value;
|
|
2760
2914
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -2841,7 +2995,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
2841
2995
|
try {
|
|
2842
2996
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
2843
2997
|
} finally {
|
|
2844
|
-
|
|
2998
|
+
restoreCurrentInstance(prev);
|
|
2845
2999
|
setActiveSub(prevSub);
|
|
2846
3000
|
}
|
|
2847
3001
|
});
|
|
@@ -2870,9 +3024,33 @@ function onErrorCaptured(hook, target = currentInstance) {
|
|
|
2870
3024
|
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2871
3025
|
//#endregion
|
|
2872
3026
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
3027
|
+
/**
|
|
3028
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
3029
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
3030
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
3031
|
+
* "which one". Internal to vapor interop.
|
|
3032
|
+
*/
|
|
3033
|
+
const rawVaporSlotKey$2 = Symbol(`rawVaporSlot`);
|
|
3034
|
+
/**
|
|
3035
|
+
* Invokes a VDOM slot fallback under the outlet owner that produced it, the
|
|
3036
|
+
* way `renderSlot` would have rendered it inline. Vapor interop invokes
|
|
3037
|
+
* fallbacks late, outside any render, so it passes the owner recorded on the
|
|
3038
|
+
* vapor slot vnode. Internal to vapor interop.
|
|
3039
|
+
*/
|
|
3040
|
+
function invokeSlotFallback$1(fallback, owner) {
|
|
3041
|
+
if (!owner) return fallback();
|
|
3042
|
+
const prev = setCurrentRenderingInstance$1(owner);
|
|
3043
|
+
const prevStackSize = blockStack.length;
|
|
3044
|
+
try {
|
|
3045
|
+
return fallback();
|
|
3046
|
+
} finally {
|
|
3047
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
3048
|
+
setCurrentRenderingInstance$1(prev);
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
2873
3051
|
function ensureValidVNode$1(vnodes) {
|
|
2874
3052
|
return vnodes.some((child) => {
|
|
2875
|
-
if (!isVNode$
|
|
3053
|
+
if (!isVNode$3(child)) return true;
|
|
2876
3054
|
if (child.type === Comment) return false;
|
|
2877
3055
|
if (child.type === Fragment && !ensureValidVNode$1(child.children)) return false;
|
|
2878
3056
|
return true;
|
|
@@ -2890,11 +3068,38 @@ const getPublicInstance = (i) => {
|
|
|
2890
3068
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
2891
3069
|
return getPublicInstance(i.parent);
|
|
2892
3070
|
};
|
|
3071
|
+
const resolveDevRootEl = (vnode) => {
|
|
3072
|
+
let found = false;
|
|
3073
|
+
while (true) {
|
|
3074
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
3075
|
+
const root = filterSingleRoot(vnode.children);
|
|
3076
|
+
if (!root) return;
|
|
3077
|
+
vnode = root;
|
|
3078
|
+
found = true;
|
|
3079
|
+
continue;
|
|
3080
|
+
}
|
|
3081
|
+
const component = vnode.component;
|
|
3082
|
+
if (component && component.subTree) {
|
|
3083
|
+
vnode = component.subTree;
|
|
3084
|
+
continue;
|
|
3085
|
+
}
|
|
3086
|
+
const suspense = vnode.suspense;
|
|
3087
|
+
if (suspense && suspense.activeBranch) {
|
|
3088
|
+
vnode = suspense.activeBranch;
|
|
3089
|
+
continue;
|
|
3090
|
+
}
|
|
3091
|
+
return found ? vnode.el : void 0;
|
|
3092
|
+
}
|
|
3093
|
+
};
|
|
3094
|
+
const getDevRootFragmentEl = (i) => {
|
|
3095
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
3096
|
+
return el === void 0 ? i.vnode.el : el;
|
|
3097
|
+
};
|
|
2893
3098
|
let publicPropertiesMap;
|
|
2894
3099
|
const getPublicPropertiesMap = () => {
|
|
2895
3100
|
if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
|
|
2896
3101
|
$: (i) => i,
|
|
2897
|
-
$el: (i) => i
|
|
3102
|
+
$el: (i) => getDevRootFragmentEl(i),
|
|
2898
3103
|
$data: (i) => i.data,
|
|
2899
3104
|
$props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
|
|
2900
3105
|
$attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
|
|
@@ -3111,11 +3316,12 @@ function applyOptions(instance) {
|
|
|
3111
3316
|
const opt = computedOptions[key];
|
|
3112
3317
|
const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
|
|
3113
3318
|
if (get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
|
|
3319
|
+
const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
|
|
3320
|
+
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3321
|
+
};
|
|
3114
3322
|
const c = computed({
|
|
3115
3323
|
get,
|
|
3116
|
-
set
|
|
3117
|
-
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3118
|
-
}
|
|
3324
|
+
set
|
|
3119
3325
|
});
|
|
3120
3326
|
Object.defineProperty(ctx, key, {
|
|
3121
3327
|
enumerable: true,
|
|
@@ -3172,9 +3378,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
|
|
|
3172
3378
|
for (const key in injectOptions) {
|
|
3173
3379
|
const opt = injectOptions[key];
|
|
3174
3380
|
let injected;
|
|
3175
|
-
if (isObject(opt))
|
|
3176
|
-
|
|
3177
|
-
|
|
3381
|
+
if (isObject(opt)) {
|
|
3382
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
3383
|
+
else injected = inject(opt.from || key);
|
|
3384
|
+
} else injected = inject(opt);
|
|
3178
3385
|
if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
|
|
3179
3386
|
enumerable: true,
|
|
3180
3387
|
configurable: true,
|
|
@@ -3195,13 +3402,14 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3195
3402
|
if (isFunction(handler)) watch(getter, handler);
|
|
3196
3403
|
else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
3197
3404
|
} else if (isFunction(raw)) watch(getter, raw.bind(publicThis));
|
|
3198
|
-
else if (isObject(raw))
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3405
|
+
else if (isObject(raw)) {
|
|
3406
|
+
if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
3407
|
+
else {
|
|
3408
|
+
const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
3409
|
+
if (isFunction(handler)) watch(getter, handler, raw);
|
|
3410
|
+
else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
3411
|
+
}
|
|
3412
|
+
} else warn$1(`Invalid watch option: "${key}"`, raw);
|
|
3205
3413
|
}
|
|
3206
3414
|
/**
|
|
3207
3415
|
* Resolve merged options and cache it on the component.
|
|
@@ -3287,7 +3495,7 @@ function mergeObjectOptions(to, from) {
|
|
|
3287
3495
|
}
|
|
3288
3496
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
3289
3497
|
if (to) {
|
|
3290
|
-
if (isArray(to) && isArray(from)) return [
|
|
3498
|
+
if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
3291
3499
|
return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
3292
3500
|
} else return from;
|
|
3293
3501
|
}
|
|
@@ -3406,8 +3614,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
3406
3614
|
} else warn$1(`Cannot unmount an app that is not mounted.`);
|
|
3407
3615
|
},
|
|
3408
3616
|
provide(key, value) {
|
|
3409
|
-
if (key in context.provides)
|
|
3410
|
-
|
|
3617
|
+
if (key in context.provides) {
|
|
3618
|
+
if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
|
|
3619
|
+
else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
|
|
3620
|
+
}
|
|
3411
3621
|
context.provides[key] = value;
|
|
3412
3622
|
return app;
|
|
3413
3623
|
},
|
|
@@ -3446,12 +3656,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3446
3656
|
if (instance.isUnmounted) return;
|
|
3447
3657
|
{
|
|
3448
3658
|
const { emitsOptions, propsOptions } = instance;
|
|
3449
|
-
if (emitsOptions)
|
|
3450
|
-
if (!
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
if (
|
|
3659
|
+
if (emitsOptions) {
|
|
3660
|
+
if (!(event in emitsOptions) && true) {
|
|
3661
|
+
if (!propsOptions || !propsOptions[0] || !(toHandlerKey(camelize(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`);
|
|
3662
|
+
} else {
|
|
3663
|
+
const validator = emitsOptions[event];
|
|
3664
|
+
if (isFunction(validator)) {
|
|
3665
|
+
if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
3666
|
+
}
|
|
3455
3667
|
}
|
|
3456
3668
|
}
|
|
3457
3669
|
}
|
|
@@ -3460,7 +3672,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3460
3672
|
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
3461
3673
|
if (modifiers) {
|
|
3462
3674
|
if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
3463
|
-
if (modifiers.number) args =
|
|
3675
|
+
if (modifiers.number) args = args.map(looseToNumber);
|
|
3464
3676
|
}
|
|
3465
3677
|
devtoolsComponentEmit(instance, event, args);
|
|
3466
3678
|
{
|
|
@@ -3520,7 +3732,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
3520
3732
|
*/
|
|
3521
3733
|
function isEmitListener(options, key) {
|
|
3522
3734
|
if (!options || !isOn(key)) return false;
|
|
3523
|
-
key = key.slice(2)
|
|
3735
|
+
key = key.slice(2);
|
|
3736
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
3524
3737
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
3525
3738
|
}
|
|
3526
3739
|
//#endregion
|
|
@@ -3586,8 +3799,9 @@ function renderComponentRoot$1(instance) {
|
|
|
3586
3799
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
3587
3800
|
}
|
|
3588
3801
|
if (vnode.transition) {
|
|
3589
|
-
|
|
3590
|
-
|
|
3802
|
+
const child = isTeleport(root.type) ? getInnerChild(root) || root : root;
|
|
3803
|
+
if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
3804
|
+
setTransitionHooks(child, vnode.transition);
|
|
3591
3805
|
}
|
|
3592
3806
|
if (setRoot) setRoot(root);
|
|
3593
3807
|
else result = root;
|
|
@@ -3637,19 +3851,22 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
3637
3851
|
let singleRoot;
|
|
3638
3852
|
for (let i = 0; i < children.length; i++) {
|
|
3639
3853
|
const child = children[i];
|
|
3640
|
-
if (isVNode$
|
|
3641
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3854
|
+
if (isVNode$3(child)) {
|
|
3855
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
3856
|
+
if (singleRoot) return;
|
|
3857
|
+
else {
|
|
3858
|
+
singleRoot = child;
|
|
3859
|
+
if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
3860
|
+
}
|
|
3645
3861
|
}
|
|
3646
3862
|
} else return;
|
|
3647
3863
|
}
|
|
3648
3864
|
return singleRoot;
|
|
3649
3865
|
}
|
|
3866
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
|
|
3650
3867
|
const getFunctionalFallthrough = (attrs) => {
|
|
3651
3868
|
let res;
|
|
3652
|
-
for (const key in attrs) if (
|
|
3869
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
3653
3870
|
return res;
|
|
3654
3871
|
};
|
|
3655
3872
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -3761,16 +3978,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3761
3978
|
let key = propsToUpdate[i];
|
|
3762
3979
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
3763
3980
|
const value = rawProps[key];
|
|
3764
|
-
if (options)
|
|
3765
|
-
if (
|
|
3766
|
-
attrs[key]
|
|
3767
|
-
|
|
3981
|
+
if (options) {
|
|
3982
|
+
if (hasOwn(attrs, key)) {
|
|
3983
|
+
if (value !== attrs[key]) {
|
|
3984
|
+
attrs[key] = value;
|
|
3985
|
+
hasAttrsChanged = true;
|
|
3986
|
+
}
|
|
3987
|
+
} else {
|
|
3988
|
+
const camelizedKey = camelize(key);
|
|
3989
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3768
3990
|
}
|
|
3769
|
-
} else {
|
|
3770
|
-
const camelizedKey = camelize(key);
|
|
3771
|
-
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3772
|
-
}
|
|
3773
|
-
else if (value !== attrs[key]) {
|
|
3991
|
+
} else if (value !== attrs[key]) {
|
|
3774
3992
|
attrs[key] = value;
|
|
3775
3993
|
hasAttrsChanged = true;
|
|
3776
3994
|
}
|
|
@@ -3779,9 +3997,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3779
3997
|
} else {
|
|
3780
3998
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
3781
3999
|
let kebabKey;
|
|
3782
|
-
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))
|
|
3783
|
-
if (
|
|
3784
|
-
|
|
4000
|
+
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
|
|
4001
|
+
if (options) {
|
|
4002
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
4003
|
+
} else delete props[key];
|
|
4004
|
+
}
|
|
3785
4005
|
if (attrs !== rawCurrentProps) {
|
|
3786
4006
|
for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && true) {
|
|
3787
4007
|
delete attrs[key];
|
|
@@ -3800,9 +4020,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3800
4020
|
if (isReservedProp(key)) continue;
|
|
3801
4021
|
const value = rawProps[key];
|
|
3802
4022
|
let camelKey;
|
|
3803
|
-
if (options && hasOwn(options, camelKey = camelize(key)))
|
|
3804
|
-
|
|
3805
|
-
|
|
4023
|
+
if (options && hasOwn(options, camelKey = camelize(key))) {
|
|
4024
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
4025
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
4026
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3806
4027
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
3807
4028
|
attrs[key] = value;
|
|
3808
4029
|
hasAttrsChanged = true;
|
|
@@ -3849,7 +4070,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
3849
4070
|
const prev = setCurrentInstance(instance);
|
|
3850
4071
|
const props = /* @__PURE__ */ toRaw(instance.props);
|
|
3851
4072
|
value = factory.call(null, props);
|
|
3852
|
-
|
|
4073
|
+
restoreCurrentInstance(prev);
|
|
3853
4074
|
return value;
|
|
3854
4075
|
}
|
|
3855
4076
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -3965,7 +4186,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
|
|
|
3965
4186
|
}
|
|
3966
4187
|
if (validator && !validator(value, /* @__PURE__ */ shallowReadonly(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
|
|
3967
4188
|
}
|
|
3968
|
-
const isSimpleType =
|
|
4189
|
+
const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
|
|
3969
4190
|
/**
|
|
3970
4191
|
* dev only
|
|
3971
4192
|
*/
|
|
@@ -3995,7 +4216,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
3995
4216
|
const receivedType = toRawType(value);
|
|
3996
4217
|
const expectedValue = styleValue(value, expectedType);
|
|
3997
4218
|
const receivedValue = styleValue(value, receivedType);
|
|
3998
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
4219
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
3999
4220
|
message += `, got ${receivedType} `;
|
|
4000
4221
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
4001
4222
|
return message;
|
|
@@ -4004,7 +4225,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
4004
4225
|
* dev only
|
|
4005
4226
|
*/
|
|
4006
4227
|
function styleValue(value, type) {
|
|
4007
|
-
if (
|
|
4228
|
+
if (isSymbol(value)) return value.toString();
|
|
4229
|
+
else if (type === "String") return `"${value}"`;
|
|
4008
4230
|
else if (type === "Number") return `${Number(value)}`;
|
|
4009
4231
|
else return `${value}`;
|
|
4010
4232
|
}
|
|
@@ -4021,8 +4243,11 @@ function isExplicable(type) {
|
|
|
4021
4243
|
/**
|
|
4022
4244
|
* dev only
|
|
4023
4245
|
*/
|
|
4024
|
-
function
|
|
4025
|
-
return args.
|
|
4246
|
+
function isCoercible(...args) {
|
|
4247
|
+
return args.every((elem) => {
|
|
4248
|
+
const value = elem.toLowerCase();
|
|
4249
|
+
return value !== "boolean" && value !== "symbol";
|
|
4250
|
+
});
|
|
4026
4251
|
}
|
|
4027
4252
|
//#endregion
|
|
4028
4253
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -4074,12 +4299,13 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4074
4299
|
let deletionComparisonTarget = EMPTY_OBJ;
|
|
4075
4300
|
if (vnode.shapeFlag & 32) {
|
|
4076
4301
|
const type = children._;
|
|
4077
|
-
if (type)
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4302
|
+
if (type) {
|
|
4303
|
+
if (isHmrUpdating) {
|
|
4304
|
+
assignSlots(slots, children, optimized);
|
|
4305
|
+
trigger(instance, "set", "$slots");
|
|
4306
|
+
} else if (optimized && type === 1) needDeletionCheck = false;
|
|
4307
|
+
else assignSlots(slots, children, optimized);
|
|
4308
|
+
} else {
|
|
4083
4309
|
needDeletionCheck = !children.$stable;
|
|
4084
4310
|
normalizeObjectSlots(children, slots, instance);
|
|
4085
4311
|
}
|
|
@@ -4097,7 +4323,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4097
4323
|
let supported;
|
|
4098
4324
|
let perf;
|
|
4099
4325
|
let cachedNow$1 = 0;
|
|
4100
|
-
const p$1 =
|
|
4326
|
+
const p$1 = /*@__PURE__*/ Promise.resolve();
|
|
4101
4327
|
const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
|
|
4102
4328
|
/**
|
|
4103
4329
|
* @internal
|
|
@@ -4167,6 +4393,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4167
4393
|
optimized = false;
|
|
4168
4394
|
n2.dynamicChildren = null;
|
|
4169
4395
|
}
|
|
4396
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
4397
|
+
if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
|
|
4398
|
+
n2.dynamicChildren.hasOnce = true;
|
|
4399
|
+
}
|
|
4170
4400
|
const { type, ref, shapeFlag } = n2;
|
|
4171
4401
|
switch (type) {
|
|
4172
4402
|
case Text:
|
|
@@ -4182,8 +4412,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4182
4412
|
case Fragment:
|
|
4183
4413
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4184
4414
|
break;
|
|
4185
|
-
case VaporSlot:
|
|
4186
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
4415
|
+
case VaporSlot$1:
|
|
4416
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
4187
4417
|
break;
|
|
4188
4418
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4189
4419
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -4302,7 +4532,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4302
4532
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
4303
4533
|
};
|
|
4304
4534
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
4305
|
-
for (let i = start; i < children.length; i++)
|
|
4535
|
+
for (let i = start; i < children.length; i++) {
|
|
4536
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode$1(children[i]);
|
|
4537
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4538
|
+
}
|
|
4306
4539
|
};
|
|
4307
4540
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4308
4541
|
const el = n2.el = n1.el;
|
|
@@ -4314,9 +4547,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4314
4547
|
let vnodeHook;
|
|
4315
4548
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
4316
4549
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4550
|
+
if (n2.ibu) n2.ibu();
|
|
4317
4551
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4318
4552
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
4319
|
-
if (isHmrUpdating) {
|
|
4553
|
+
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
4320
4554
|
patchFlag = 0;
|
|
4321
4555
|
optimized = false;
|
|
4322
4556
|
dynamicChildren = null;
|
|
@@ -4347,8 +4581,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4347
4581
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
4348
4582
|
}
|
|
4349
4583
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
4350
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
4584
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
4351
4585
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4586
|
+
n2.iu && n2.iu();
|
|
4352
4587
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4353
4588
|
}, void 0, parentSuspense);
|
|
4354
4589
|
};
|
|
@@ -4356,7 +4591,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4356
4591
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4357
4592
|
const oldVNode = oldChildren[i];
|
|
4358
4593
|
const newVNode = newChildren[i];
|
|
4359
|
-
|
|
4594
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
4595
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4360
4596
|
}
|
|
4361
4597
|
};
|
|
4362
4598
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -4394,25 +4630,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4394
4630
|
};
|
|
4395
4631
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4396
4632
|
n2.slotScopeIds = slotScopeIds;
|
|
4397
|
-
if (n2.type.__vapor)
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
}
|
|
4407
|
-
else {
|
|
4408
|
-
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized), () => {
|
|
4409
|
-
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4410
|
-
});
|
|
4411
|
-
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, n1, parentComponent, "updated"), void 0, parentSuspense);
|
|
4412
|
-
}
|
|
4413
|
-
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
4414
|
-
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
4415
|
-
else updateComponent(n1, n2, optimized);
|
|
4633
|
+
if (n2.type.__vapor) {
|
|
4634
|
+
if (n1 == null) {
|
|
4635
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
4636
|
+
else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
|
|
4637
|
+
} else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
|
|
4638
|
+
} else if (n1 == null) {
|
|
4639
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
4640
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
4641
|
+
} else updateComponent(n1, n2, optimized);
|
|
4416
4642
|
};
|
|
4417
4643
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
4418
4644
|
const instance = initialVNode.component = createComponentInstance$1(initialVNode, parentComponent, parentSuspense);
|
|
@@ -4453,16 +4679,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4453
4679
|
};
|
|
4454
4680
|
const updateComponent = (n1, n2, optimized) => {
|
|
4455
4681
|
const instance = n2.component = n1.component;
|
|
4456
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4682
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
4683
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4684
|
+
pushWarningContext$1(n2);
|
|
4685
|
+
n2.el = n1.el;
|
|
4686
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
4687
|
+
popWarningContext$1();
|
|
4688
|
+
return;
|
|
4689
|
+
} else {
|
|
4690
|
+
instance.next = n2;
|
|
4691
|
+
instance.effect.run();
|
|
4692
|
+
}
|
|
4461
4693
|
} else {
|
|
4462
|
-
instance.next = n2;
|
|
4463
|
-
instance.effect.run();
|
|
4464
|
-
}
|
|
4465
|
-
else {
|
|
4466
4694
|
n2.el = n1.el;
|
|
4467
4695
|
instance.vnode = n2;
|
|
4468
4696
|
}
|
|
@@ -4560,6 +4788,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4560
4788
|
} else next = vnode;
|
|
4561
4789
|
if (bu) invokeArrayFns(bu);
|
|
4562
4790
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4791
|
+
if (next.ibu) next.ibu();
|
|
4563
4792
|
toggleRecurse(instance, true);
|
|
4564
4793
|
startMeasure(instance, `render`);
|
|
4565
4794
|
const nextTree = renderComponentRoot$1(instance);
|
|
@@ -4572,7 +4801,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4572
4801
|
next.el = nextTree.el;
|
|
4573
4802
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
4574
4803
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
4575
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
4804
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
4805
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4806
|
+
next.iu && next.iu();
|
|
4807
|
+
}, void 0, parentSuspense);
|
|
4576
4808
|
devtoolsComponentUpdated(instance);
|
|
4577
4809
|
popWarningContext$1();
|
|
4578
4810
|
}
|
|
@@ -4612,9 +4844,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4612
4844
|
if (shapeFlag & 8) {
|
|
4613
4845
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
4614
4846
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
4615
|
-
} else if (prevShapeFlag & 16)
|
|
4616
|
-
|
|
4617
|
-
|
|
4847
|
+
} else if (prevShapeFlag & 16) {
|
|
4848
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4849
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
4850
|
+
} else {
|
|
4618
4851
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
4619
4852
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4620
4853
|
}
|
|
@@ -4713,15 +4946,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4713
4946
|
const anchorVNode = c2[nextIndex + 1];
|
|
4714
4947
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
4715
4948
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4716
|
-
else if (moved)
|
|
4717
|
-
|
|
4949
|
+
else if (moved) {
|
|
4950
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
4951
|
+
else j--;
|
|
4952
|
+
}
|
|
4718
4953
|
}
|
|
4719
4954
|
}
|
|
4720
4955
|
};
|
|
4721
4956
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
4722
4957
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
4723
|
-
if (isVaporComponent(type) || type === VaporSlot) {
|
|
4724
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
4958
|
+
if (isVaporComponent(type) || type === VaporSlot$1) {
|
|
4959
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
4725
4960
|
return;
|
|
4726
4961
|
}
|
|
4727
4962
|
if (shapeFlag & 6) {
|
|
@@ -4746,49 +4981,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4746
4981
|
moveStaticNode(vnode, container, anchor);
|
|
4747
4982
|
return;
|
|
4748
4983
|
}
|
|
4749
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
const remove = () => {
|
|
4984
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
4985
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
4986
|
+
else performTransitionLeave(el, transition, () => {
|
|
4753
4987
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
4754
4988
|
else hostInsert(el, container, anchor);
|
|
4755
|
-
};
|
|
4756
|
-
|
|
4757
|
-
if (el._isLeaving) el[leaveCbKey](true);
|
|
4758
|
-
leave(el, () => {
|
|
4759
|
-
remove();
|
|
4760
|
-
afterLeave && afterLeave();
|
|
4761
|
-
});
|
|
4762
|
-
};
|
|
4763
|
-
if (delayLeave) delayLeave(el, remove, performLeave);
|
|
4764
|
-
else performLeave();
|
|
4765
|
-
}
|
|
4766
|
-
else hostInsert(el, container, anchor);
|
|
4989
|
+
}, true, true);
|
|
4990
|
+
} else hostInsert(el, container, anchor);
|
|
4767
4991
|
};
|
|
4768
4992
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
4769
4993
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
4770
|
-
if (patchFlag === -2) optimized = false;
|
|
4994
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
4771
4995
|
if (ref != null) {
|
|
4772
4996
|
const prevSub = setActiveSub();
|
|
4773
4997
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
4774
4998
|
setActiveSub(prevSub);
|
|
4775
4999
|
}
|
|
4776
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
5000
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
4777
5001
|
if (shapeFlag & 256) {
|
|
4778
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
5002
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
4779
5003
|
else parentComponent.ctx.deactivate(vnode);
|
|
4780
5004
|
return;
|
|
4781
5005
|
}
|
|
5006
|
+
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
5007
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
5008
|
+
return;
|
|
5009
|
+
}
|
|
4782
5010
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
4783
5011
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
4784
5012
|
let vnodeHook;
|
|
4785
5013
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
4786
|
-
if (shapeFlag & 6)
|
|
4787
|
-
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
4788
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
4789
|
-
if (dirs) queuePostRenderEffect(() => invokeDirectiveHook(vnode, null, parentComponent, "unmounted"), void 0, parentSuspense);
|
|
4790
|
-
return;
|
|
4791
|
-
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
5014
|
+
if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
4792
5015
|
else {
|
|
4793
5016
|
if (shapeFlag & 128) {
|
|
4794
5017
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -4798,8 +5021,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4798
5021
|
if (shapeFlag & 64) vnode.type.remove(vnode, parentComponent, parentSuspense, internals, doRemove);
|
|
4799
5022
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
4800
5023
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
4801
|
-
if (type === VaporSlot) {
|
|
4802
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
5024
|
+
if (type === VaporSlot$1) {
|
|
5025
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
4803
5026
|
return;
|
|
4804
5027
|
}
|
|
4805
5028
|
if (doRemove) remove(vnode);
|
|
@@ -4823,6 +5046,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4823
5046
|
}
|
|
4824
5047
|
if (type === Static) {
|
|
4825
5048
|
removeStaticNode(vnode);
|
|
5049
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
4826
5050
|
return;
|
|
4827
5051
|
}
|
|
4828
5052
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -4847,6 +5071,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4847
5071
|
if (effect) {
|
|
4848
5072
|
effect.stop();
|
|
4849
5073
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5074
|
+
} else if (instance.vnode.el && subTree) {
|
|
5075
|
+
subTree.transition = instance.vnode.transition;
|
|
5076
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
4850
5077
|
}
|
|
4851
5078
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
4852
5079
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
@@ -4921,12 +5148,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
4921
5148
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
4922
5149
|
}
|
|
4923
5150
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
4924
|
-
if (!vapor)
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
5151
|
+
if (!vapor) {
|
|
5152
|
+
if (allowed) {
|
|
5153
|
+
effect.flags |= 128;
|
|
5154
|
+
job.flags |= 2;
|
|
5155
|
+
} else {
|
|
5156
|
+
effect.flags &= -129;
|
|
5157
|
+
job.flags &= -3;
|
|
5158
|
+
}
|
|
4930
5159
|
}
|
|
4931
5160
|
}
|
|
4932
5161
|
function needTransition(parentSuspense, transition) {
|
|
@@ -4966,13 +5195,19 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
4966
5195
|
}
|
|
4967
5196
|
function locateNonHydratedAsyncRoot(instance) {
|
|
4968
5197
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
4969
|
-
if (subComponent)
|
|
4970
|
-
|
|
5198
|
+
if (subComponent) {
|
|
5199
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
5200
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
5201
|
+
}
|
|
4971
5202
|
}
|
|
4972
5203
|
function invalidateMount(hooks) {
|
|
4973
5204
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
4974
5205
|
}
|
|
4975
5206
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
5207
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
5208
|
+
insert();
|
|
5209
|
+
return;
|
|
5210
|
+
}
|
|
4976
5211
|
if (force || needTransition(parentSuspense, transition)) {
|
|
4977
5212
|
transition.beforeEnter(el);
|
|
4978
5213
|
insert();
|
|
@@ -4982,13 +5217,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
4982
5217
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
4983
5218
|
const performRemove = () => {
|
|
4984
5219
|
remove();
|
|
4985
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5220
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
4986
5221
|
};
|
|
4987
5222
|
if (force || isElement && transition && !transition.persisted) {
|
|
4988
5223
|
const { leave, delayLeave } = transition;
|
|
4989
5224
|
const performLeave = () => {
|
|
5225
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
4990
5226
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
4991
|
-
|
|
5227
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
5228
|
+
else leave(el, performRemove);
|
|
4992
5229
|
};
|
|
4993
5230
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
4994
5231
|
else performLeave();
|
|
@@ -5007,7 +5244,7 @@ function isVaporComponent(type) {
|
|
|
5007
5244
|
/**
|
|
5008
5245
|
* shared between vdom and vapor
|
|
5009
5246
|
*/
|
|
5010
|
-
function getInheritedScopeIds(vnode, parentComponent) {
|
|
5247
|
+
function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
|
|
5011
5248
|
const inheritedScopeIds = [];
|
|
5012
5249
|
let currentParent = parentComponent;
|
|
5013
5250
|
let currentVNode = vnode;
|
|
@@ -5023,6 +5260,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
5023
5260
|
currentParent = currentParent.parent;
|
|
5024
5261
|
} else break;
|
|
5025
5262
|
}
|
|
5263
|
+
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
5264
|
+
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
5026
5265
|
return inheritedScopeIds;
|
|
5027
5266
|
}
|
|
5028
5267
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
@@ -5035,9 +5274,10 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
|
5035
5274
|
//#region packages/runtime-core/src/components/Suspense.ts
|
|
5036
5275
|
const isSuspense = (type) => type.__isSuspense;
|
|
5037
5276
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
5038
|
-
if (suspense && suspense.pendingBranch)
|
|
5039
|
-
|
|
5040
|
-
|
|
5277
|
+
if (suspense && suspense.pendingBranch) {
|
|
5278
|
+
if (isArray(fn)) suspense.effects.push(...fn);
|
|
5279
|
+
else suspense.effects.push(fn);
|
|
5280
|
+
} else queuePostFlushCb(fn, id);
|
|
5041
5281
|
}
|
|
5042
5282
|
//#endregion
|
|
5043
5283
|
//#region packages/runtime-core/src/vnode.ts
|
|
@@ -5045,8 +5285,13 @@ const Fragment = Symbol.for("v-fgt");
|
|
|
5045
5285
|
const Text = Symbol.for("v-txt");
|
|
5046
5286
|
const Comment = Symbol.for("v-cmt");
|
|
5047
5287
|
const Static = Symbol.for("v-stc");
|
|
5048
|
-
const VaporSlot = Symbol.for("v-vps");
|
|
5288
|
+
const VaporSlot$1 = Symbol.for("v-vps");
|
|
5049
5289
|
const blockStack = [];
|
|
5290
|
+
let currentBlock = null;
|
|
5291
|
+
function closeBlock() {
|
|
5292
|
+
blockStack.pop();
|
|
5293
|
+
currentBlock = blockStack[blockStack.length - 1] || null;
|
|
5294
|
+
}
|
|
5050
5295
|
let isBlockTreeEnabled = 1;
|
|
5051
5296
|
/**
|
|
5052
5297
|
* Block tracking sometimes needs to be disabled, for example during the
|
|
@@ -5066,8 +5311,9 @@ let isBlockTreeEnabled = 1;
|
|
|
5066
5311
|
*/
|
|
5067
5312
|
function setBlockTracking(value, inVOnce = false) {
|
|
5068
5313
|
isBlockTreeEnabled += value;
|
|
5314
|
+
if (value < 0 && currentBlock && inVOnce) currentBlock.hasOnce = true;
|
|
5069
5315
|
}
|
|
5070
|
-
function isVNode$
|
|
5316
|
+
function isVNode$3(value) {
|
|
5071
5317
|
return value ? value.__v_isVNode === true : false;
|
|
5072
5318
|
}
|
|
5073
5319
|
function isSameVNodeType(n1, n2) {
|
|
@@ -5129,17 +5375,37 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
5129
5375
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
5130
5376
|
} else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
5131
5377
|
if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
5378
|
+
if (props && vnode.shapeFlag & 1) {
|
|
5379
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
5380
|
+
if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
|
|
5381
|
+
}
|
|
5382
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
5132
5383
|
return vnode;
|
|
5133
5384
|
}
|
|
5385
|
+
/**
|
|
5386
|
+
* dev only
|
|
5387
|
+
* Whether children would actually render something. Empty text and empty
|
|
5388
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
5389
|
+
* for `v-html` / `v-text`.
|
|
5390
|
+
*/
|
|
5391
|
+
function hasContentChildren(children) {
|
|
5392
|
+
if (isString(children)) return children !== "";
|
|
5393
|
+
if (isArray(children)) return children.length > 0;
|
|
5394
|
+
return false;
|
|
5395
|
+
}
|
|
5134
5396
|
const createVNode = createVNodeWithArgsTransform;
|
|
5135
5397
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
5136
5398
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
5137
5399
|
if (!type) warn$1(`Invalid vnode type when creating vnode: ${type}.`);
|
|
5138
5400
|
type = Comment;
|
|
5139
5401
|
}
|
|
5140
|
-
if (isVNode$
|
|
5402
|
+
if (isVNode$3(type)) {
|
|
5141
5403
|
const cloned = cloneVNode(type, props, true);
|
|
5142
5404
|
if (children) normalizeChildren(cloned, children);
|
|
5405
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
5406
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
5407
|
+
else currentBlock.push(cloned);
|
|
5408
|
+
}
|
|
5143
5409
|
cloned.patchFlag = -2;
|
|
5144
5410
|
return cloned;
|
|
5145
5411
|
}
|
|
@@ -5196,11 +5462,31 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5196
5462
|
el: vnode.el,
|
|
5197
5463
|
anchor: vnode.anchor,
|
|
5198
5464
|
ctx: vnode.ctx,
|
|
5199
|
-
ce: vnode.ce
|
|
5465
|
+
ce: vnode.ce,
|
|
5466
|
+
vi: vnode.vi,
|
|
5467
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
5468
|
+
vb: vnode.vb,
|
|
5469
|
+
ibu: vnode.ibu,
|
|
5470
|
+
iu: vnode.iu,
|
|
5471
|
+
cacheIndex: vnode.cacheIndex
|
|
5200
5472
|
};
|
|
5201
5473
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5202
5474
|
return cloned;
|
|
5203
5475
|
}
|
|
5476
|
+
function cloneVaporSlotMeta(vnode) {
|
|
5477
|
+
const vaporSlot = vnode.vs;
|
|
5478
|
+
if (!vaporSlot) return vaporSlot;
|
|
5479
|
+
const cloned = {
|
|
5480
|
+
slot: vaporSlot.slot,
|
|
5481
|
+
outlets: vaporSlot.outlets
|
|
5482
|
+
};
|
|
5483
|
+
if (vnode.el) {
|
|
5484
|
+
cloned.state = vaporSlot.state;
|
|
5485
|
+
cloned.ref = vaporSlot.ref;
|
|
5486
|
+
cloned.scope = vaporSlot.scope;
|
|
5487
|
+
}
|
|
5488
|
+
return cloned;
|
|
5489
|
+
}
|
|
5204
5490
|
/**
|
|
5205
5491
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
5206
5492
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -5219,7 +5505,7 @@ function createTextVNode(text = " ", flag = 0) {
|
|
|
5219
5505
|
function normalizeVNode$1(child) {
|
|
5220
5506
|
if (child == null || typeof child === "boolean") return createVNode(Comment);
|
|
5221
5507
|
else if (isArray(child)) return createVNode(Fragment, null, child.slice());
|
|
5222
|
-
else if (isVNode$
|
|
5508
|
+
else if (isVNode$3(child)) return cloneIfMounted(child);
|
|
5223
5509
|
else return createVNode(Text, null, String(child));
|
|
5224
5510
|
}
|
|
5225
5511
|
function cloneIfMounted(child) {
|
|
@@ -5230,25 +5516,32 @@ function normalizeChildren(vnode, children) {
|
|
|
5230
5516
|
const { shapeFlag } = vnode;
|
|
5231
5517
|
if (children == null) children = null;
|
|
5232
5518
|
else if (isArray(children)) type = 16;
|
|
5233
|
-
else if (typeof children === "object")
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5519
|
+
else if (typeof children === "object") {
|
|
5520
|
+
if (shapeFlag & 65) {
|
|
5521
|
+
const slot = children.default;
|
|
5522
|
+
if (slot) {
|
|
5523
|
+
slot._c && (slot._d = false);
|
|
5524
|
+
normalizeChildren(vnode, slot());
|
|
5525
|
+
slot._c && (slot._d = true);
|
|
5526
|
+
}
|
|
5527
|
+
return;
|
|
5528
|
+
} else {
|
|
5529
|
+
type = 32;
|
|
5530
|
+
const slotFlag = children._;
|
|
5531
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
5532
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
5533
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
5534
|
+
else {
|
|
5535
|
+
children._ = 2;
|
|
5536
|
+
vnode.patchFlag |= 1024;
|
|
5537
|
+
}
|
|
5538
|
+
}
|
|
5239
5539
|
}
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
5245
|
-
else if (slotFlag === 3 && currentRenderingInstance) if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
5246
|
-
else {
|
|
5247
|
-
children._ = 2;
|
|
5248
|
-
vnode.patchFlag |= 1024;
|
|
5540
|
+
} else if (isFunction(children)) {
|
|
5541
|
+
if (shapeFlag & 65) {
|
|
5542
|
+
normalizeChildren(vnode, { default: children });
|
|
5543
|
+
return;
|
|
5249
5544
|
}
|
|
5250
|
-
}
|
|
5251
|
-
else if (isFunction(children)) {
|
|
5252
5545
|
children = {
|
|
5253
5546
|
default: children,
|
|
5254
5547
|
_ctx: currentRenderingInstance
|
|
@@ -5293,6 +5586,7 @@ let currentInstance = null;
|
|
|
5293
5586
|
* @internal
|
|
5294
5587
|
*/
|
|
5295
5588
|
const getCurrentGenericInstance = () => currentInstance || currentRenderingInstance;
|
|
5589
|
+
const getCurrentInstance = () => currentInstance && !currentInstance.vapor ? currentInstance : currentRenderingInstance;
|
|
5296
5590
|
let isInSSRComponentSetup = false;
|
|
5297
5591
|
let setInSSRSetupState;
|
|
5298
5592
|
/**
|
|
@@ -5320,9 +5614,19 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
5320
5614
|
simpleSetCurrentInstance(instance);
|
|
5321
5615
|
}
|
|
5322
5616
|
};
|
|
5617
|
+
/**
|
|
5618
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
5619
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
5620
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
5621
|
+
* @internal
|
|
5622
|
+
*/
|
|
5623
|
+
const restoreCurrentInstance = (prev) => {
|
|
5624
|
+
setCurrentScope(prev[1]);
|
|
5625
|
+
simpleSetCurrentInstance(prev[0]);
|
|
5626
|
+
};
|
|
5323
5627
|
//#endregion
|
|
5324
5628
|
//#region packages/runtime-core/src/component.ts
|
|
5325
|
-
const emptyAppContext =
|
|
5629
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
5326
5630
|
let uid = 0;
|
|
5327
5631
|
function createComponentInstance$1(vnode, parent, suspense) {
|
|
5328
5632
|
const type = vnode.type;
|
|
@@ -5442,7 +5746,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5442
5746
|
const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
|
|
5443
5747
|
const isAsyncSetup = isPromise(setupResult);
|
|
5444
5748
|
setActiveSub(prevSub);
|
|
5445
|
-
|
|
5749
|
+
restoreCurrentInstance(prev);
|
|
5446
5750
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
5447
5751
|
if (isAsyncSetup) {
|
|
5448
5752
|
const unsetCurrentInstance = () => {
|
|
@@ -5450,7 +5754,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5450
5754
|
};
|
|
5451
5755
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
5452
5756
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
5453
|
-
|
|
5757
|
+
setInSSRSetupState(true);
|
|
5758
|
+
try {
|
|
5759
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
5760
|
+
} finally {
|
|
5761
|
+
setInSSRSetupState(false);
|
|
5762
|
+
}
|
|
5454
5763
|
}).catch((e) => {
|
|
5455
5764
|
handleError(e, instance, 0);
|
|
5456
5765
|
});
|
|
@@ -5462,10 +5771,11 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5462
5771
|
} else finishComponentSetup(instance, isSSR);
|
|
5463
5772
|
}
|
|
5464
5773
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
5465
|
-
if (isFunction(setupResult))
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5774
|
+
if (isFunction(setupResult)) {
|
|
5775
|
+
if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
|
|
5776
|
+
else instance.render = setupResult;
|
|
5777
|
+
} else if (isObject(setupResult)) {
|
|
5778
|
+
if (isVNode$3(setupResult)) warn$1("setup() should not return VNodes directly - return a render function instead.");
|
|
5469
5779
|
instance.devtoolsRawSetupState = setupResult;
|
|
5470
5780
|
instance.setupState = proxyRefs(setupResult);
|
|
5471
5781
|
exposeSetupStateOnRenderContext(instance);
|
|
@@ -5483,13 +5793,15 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
5483
5793
|
applyOptions(instance);
|
|
5484
5794
|
} finally {
|
|
5485
5795
|
setActiveSub(prevSub);
|
|
5486
|
-
|
|
5796
|
+
restoreCurrentInstance(prevInstance);
|
|
5487
5797
|
}
|
|
5488
5798
|
}
|
|
5489
|
-
if (!Component.render && instance.render === NOOP && !isSSR)
|
|
5799
|
+
if (!Component.render && instance.render === NOOP && !isSSR) {
|
|
5800
|
+
if (Component.template)
|
|
5490
5801
|
/* v8 ignore start */
|
|
5491
|
-
|
|
5492
|
-
|
|
5802
|
+
warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
|
|
5803
|
+
else warn$1(`Component is missing template or render function: `, Component);
|
|
5804
|
+
}
|
|
5493
5805
|
}
|
|
5494
5806
|
const attrsProxyHandlers = {
|
|
5495
5807
|
get(target, key) {
|
|
@@ -5552,14 +5864,13 @@ function getComponentPublicInstance(instance) {
|
|
|
5552
5864
|
if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
5553
5865
|
get(target, key) {
|
|
5554
5866
|
if (key in target) return target[key];
|
|
5555
|
-
else {
|
|
5867
|
+
else if (!instance.vapor) {
|
|
5556
5868
|
const publicPropertiesMap = getPublicPropertiesMap();
|
|
5557
5869
|
if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
|
|
5558
5870
|
}
|
|
5559
5871
|
},
|
|
5560
5872
|
has(target, key) {
|
|
5561
|
-
|
|
5562
|
-
return key in target || key in publicPropertiesMap;
|
|
5873
|
+
return key in target || !instance.vapor && key in getPublicPropertiesMap();
|
|
5563
5874
|
}
|
|
5564
5875
|
}));
|
|
5565
5876
|
else return instance.proxy;
|
|
@@ -5593,7 +5904,7 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
5593
5904
|
};
|
|
5594
5905
|
//#endregion
|
|
5595
5906
|
//#region packages/runtime-core/src/index.ts
|
|
5596
|
-
const version = "3.6.0-
|
|
5907
|
+
const version = "3.6.0-rc.10";
|
|
5597
5908
|
const warn = warn$1;
|
|
5598
5909
|
/**
|
|
5599
5910
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
@@ -5604,19 +5915,22 @@ const ssrUtils = {
|
|
|
5604
5915
|
setupComponent: setupComponent$1,
|
|
5605
5916
|
renderComponentRoot: renderComponentRoot$1,
|
|
5606
5917
|
setCurrentRenderingInstance: setCurrentRenderingInstance$1,
|
|
5607
|
-
isVNode: isVNode$
|
|
5918
|
+
isVNode: isVNode$3,
|
|
5608
5919
|
normalizeVNode: normalizeVNode$1,
|
|
5609
5920
|
getComponentPublicInstance,
|
|
5610
5921
|
ensureValidVNode: ensureValidVNode$1,
|
|
5611
5922
|
pushWarningContext: pushWarningContext$1,
|
|
5612
|
-
popWarningContext: popWarningContext$1
|
|
5923
|
+
popWarningContext: popWarningContext$1,
|
|
5924
|
+
VaporSlot: VaporSlot$1,
|
|
5925
|
+
rawVaporSlotKey: rawVaporSlotKey$2,
|
|
5926
|
+
invokeSlotFallback: invokeSlotFallback$1
|
|
5613
5927
|
};
|
|
5614
5928
|
//#endregion
|
|
5615
5929
|
//#region packages/runtime-dom/src/nodeOps.ts
|
|
5616
5930
|
let policy = void 0;
|
|
5617
5931
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
5618
5932
|
if (tt) try {
|
|
5619
|
-
policy =
|
|
5933
|
+
policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
|
|
5620
5934
|
} catch (e) {
|
|
5621
5935
|
warn(`Error creating trusted types policy: ${e}`);
|
|
5622
5936
|
}
|
|
@@ -5624,7 +5938,7 @@ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) =>
|
|
|
5624
5938
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
5625
5939
|
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
5626
5940
|
const doc = typeof document !== "undefined" ? document : null;
|
|
5627
|
-
const templateContainer = doc &&
|
|
5941
|
+
const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
|
|
5628
5942
|
const nodeOps = {
|
|
5629
5943
|
insert: (child, parent, anchor) => {
|
|
5630
5944
|
parent.insertBefore(child, anchor || null);
|
|
@@ -5699,14 +6013,15 @@ const vShow = {
|
|
|
5699
6013
|
},
|
|
5700
6014
|
updated(el, { value, oldValue }, { transition }) {
|
|
5701
6015
|
if (!value === !oldValue) return;
|
|
5702
|
-
if (transition)
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
6016
|
+
if (transition) {
|
|
6017
|
+
if (value) {
|
|
6018
|
+
transition.beforeEnter(el);
|
|
6019
|
+
setDisplay(el, true);
|
|
6020
|
+
transition.enter(el);
|
|
6021
|
+
} else transition.leave(el, () => {
|
|
6022
|
+
setDisplay(el, false);
|
|
6023
|
+
});
|
|
6024
|
+
} else setDisplay(el, value);
|
|
5710
6025
|
},
|
|
5711
6026
|
beforeUnmount(el, { value }) {
|
|
5712
6027
|
setDisplay(el, value);
|
|
@@ -5732,15 +6047,20 @@ function patchStyle(el, prev, next) {
|
|
|
5732
6047
|
const isCssString = isString(next);
|
|
5733
6048
|
let hasControlledDisplay = false;
|
|
5734
6049
|
if (next && !isCssString) {
|
|
5735
|
-
if (prev)
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
6050
|
+
if (prev) {
|
|
6051
|
+
if (!isString(prev)) {
|
|
6052
|
+
for (const key in prev) if (next[key] == null) setStyle(style, key, "");
|
|
6053
|
+
} else for (const prevStyle of prev.split(";")) {
|
|
6054
|
+
const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
|
|
6055
|
+
if (next[key] == null) setStyle(style, key, "");
|
|
6056
|
+
}
|
|
5740
6057
|
}
|
|
5741
6058
|
for (const key in next) {
|
|
5742
6059
|
if (key === "display") hasControlledDisplay = true;
|
|
5743
|
-
|
|
6060
|
+
const value = next[key];
|
|
6061
|
+
if (value != null) {
|
|
6062
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
6063
|
+
} else setStyle(style, key, "");
|
|
5744
6064
|
}
|
|
5745
6065
|
} else if (isCssString) {
|
|
5746
6066
|
if (prev !== next) {
|
|
@@ -5749,7 +6069,11 @@ function patchStyle(el, prev, next) {
|
|
|
5749
6069
|
style.cssText = next;
|
|
5750
6070
|
hasControlledDisplay = displayRE.test(next);
|
|
5751
6071
|
}
|
|
5752
|
-
} else if (prev)
|
|
6072
|
+
} else if (prev) {
|
|
6073
|
+
const cssVarText = style[CSS_VAR_TEXT];
|
|
6074
|
+
if (cssVarText) style.cssText = cssVarText;
|
|
6075
|
+
else el.removeAttribute("style");
|
|
6076
|
+
}
|
|
5753
6077
|
if (vShowOriginalDisplay in el) {
|
|
5754
6078
|
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
5755
6079
|
if (el[vShowHidden]) style.display = "none";
|
|
@@ -5762,8 +6086,10 @@ function setStyle(style, name, rawVal) {
|
|
|
5762
6086
|
else {
|
|
5763
6087
|
const val = rawVal == null ? "" : String(rawVal);
|
|
5764
6088
|
if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
5765
|
-
if (name.startsWith("--"))
|
|
5766
|
-
|
|
6089
|
+
if (name.startsWith("--")) {
|
|
6090
|
+
if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
6091
|
+
else style.setProperty(name, val);
|
|
6092
|
+
} else {
|
|
5767
6093
|
const prefixed = autoPrefix(style, name);
|
|
5768
6094
|
if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
|
|
5769
6095
|
else style[prefixed] = val;
|
|
@@ -5788,13 +6114,22 @@ function autoPrefix(style, rawName) {
|
|
|
5788
6114
|
}
|
|
5789
6115
|
return rawName;
|
|
5790
6116
|
}
|
|
6117
|
+
/**
|
|
6118
|
+
* Browsers update textarea width/height directly during native resize.
|
|
6119
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
6120
|
+
* still follow normal vnode style patching.
|
|
6121
|
+
*/
|
|
6122
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
6123
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
|
|
6124
|
+
}
|
|
5791
6125
|
//#endregion
|
|
5792
6126
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
5793
6127
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
5794
6128
|
function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
|
|
5795
|
-
if (isSVG && key.startsWith("xlink:"))
|
|
5796
|
-
|
|
5797
|
-
|
|
6129
|
+
if (isSVG && key.startsWith("xlink:")) {
|
|
6130
|
+
if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
6131
|
+
else el.setAttributeNS(xlinkNS, key, value);
|
|
6132
|
+
} else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
|
|
5798
6133
|
else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
|
|
5799
6134
|
}
|
|
5800
6135
|
//#endregion
|
|
@@ -5846,7 +6181,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
5846
6181
|
const existingInvoker = invokers[rawName];
|
|
5847
6182
|
if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
|
|
5848
6183
|
else {
|
|
5849
|
-
const [name, options] =
|
|
6184
|
+
const [name, options] = parseEventName(rawName);
|
|
5850
6185
|
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
|
|
5851
6186
|
else if (existingInvoker) {
|
|
5852
6187
|
removeEventListener(el, name, existingInvoker, options);
|
|
@@ -5854,27 +6189,40 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
5854
6189
|
}
|
|
5855
6190
|
}
|
|
5856
6191
|
}
|
|
5857
|
-
const optionsModifierRE = /(
|
|
5858
|
-
|
|
6192
|
+
const optionsModifierRE = /(Once|Passive|Capture)$/;
|
|
6193
|
+
const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
|
|
6194
|
+
function parseEventName(name) {
|
|
5859
6195
|
let options;
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
options[m[0].toLowerCase()] = true;
|
|
5866
|
-
}
|
|
6196
|
+
let m;
|
|
6197
|
+
while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
|
|
6198
|
+
if (!options) options = {};
|
|
6199
|
+
name = name.slice(0, name.length - m[1].length);
|
|
6200
|
+
options[m[1].toLowerCase()] = true;
|
|
5867
6201
|
}
|
|
5868
6202
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
5869
6203
|
}
|
|
5870
6204
|
let cachedNow = 0;
|
|
5871
|
-
const p =
|
|
6205
|
+
const p = /*@__PURE__*/ Promise.resolve();
|
|
5872
6206
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
|
|
5873
6207
|
function createInvoker(initialValue, instance) {
|
|
5874
6208
|
const invoker = (e) => {
|
|
5875
6209
|
if (!e._vts) e._vts = Date.now();
|
|
5876
6210
|
else if (e._vts <= invoker.attached) return;
|
|
5877
|
-
|
|
6211
|
+
const value = invoker.value;
|
|
6212
|
+
if (isArray(value)) {
|
|
6213
|
+
const originalStop = e.stopImmediatePropagation;
|
|
6214
|
+
e.stopImmediatePropagation = () => {
|
|
6215
|
+
originalStop.call(e);
|
|
6216
|
+
e._stopped = true;
|
|
6217
|
+
};
|
|
6218
|
+
const handlers = value.slice();
|
|
6219
|
+
const args = [e];
|
|
6220
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
6221
|
+
if (e._stopped) break;
|
|
6222
|
+
const handler = handlers[i];
|
|
6223
|
+
if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
|
|
6224
|
+
}
|
|
6225
|
+
} else callWithAsyncErrorHandling(value, instance, 5, [e]);
|
|
5878
6226
|
};
|
|
5879
6227
|
invoker.value = initialValue;
|
|
5880
6228
|
invoker.attached = getNow();
|
|
@@ -5885,16 +6233,6 @@ function sanitizeEventValue(value, propName) {
|
|
|
5885
6233
|
warn(`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?\nExpected function or array of functions, received type ${typeof value}.`);
|
|
5886
6234
|
return NOOP;
|
|
5887
6235
|
}
|
|
5888
|
-
function patchStopImmediatePropagation(e, value) {
|
|
5889
|
-
if (isArray(value)) {
|
|
5890
|
-
const originalStop = e.stopImmediatePropagation;
|
|
5891
|
-
e.stopImmediatePropagation = () => {
|
|
5892
|
-
originalStop.call(e);
|
|
5893
|
-
e._stopped = true;
|
|
5894
|
-
};
|
|
5895
|
-
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
5896
|
-
} else return value;
|
|
5897
|
-
}
|
|
5898
6236
|
//#endregion
|
|
5899
6237
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
5900
6238
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -5946,13 +6284,22 @@ function onCompositionEnd(e) {
|
|
|
5946
6284
|
}
|
|
5947
6285
|
}
|
|
5948
6286
|
const assignKey = Symbol("_assign");
|
|
6287
|
+
const initialValueKey = Symbol("_initialValue");
|
|
5949
6288
|
const vModelText = {
|
|
5950
6289
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
6290
|
+
if (el.parentNode) {
|
|
6291
|
+
if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
6292
|
+
else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
6293
|
+
}
|
|
5951
6294
|
el[assignKey] = getModelAssigner(vnode);
|
|
5952
6295
|
vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
|
|
5953
6296
|
},
|
|
5954
|
-
mounted(el, { value }) {
|
|
5955
|
-
|
|
6297
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
6298
|
+
const newValue = value == null ? "" : value;
|
|
6299
|
+
const initialValue = el[initialValueKey];
|
|
6300
|
+
delete el[initialValueKey];
|
|
6301
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
|
|
6302
|
+
else el.value = newValue;
|
|
5956
6303
|
},
|
|
5957
6304
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
5958
6305
|
el[assignKey] = getModelAssigner(vnode);
|
|
@@ -6072,7 +6419,8 @@ const vModelSelect = {
|
|
|
6072
6419
|
mounted(el, { value }) {
|
|
6073
6420
|
vModelSetSelected(el, value);
|
|
6074
6421
|
},
|
|
6075
|
-
beforeUpdate(el,
|
|
6422
|
+
beforeUpdate(el, { value }, vnode) {
|
|
6423
|
+
el._modelValue = value;
|
|
6076
6424
|
el[assignKey] = getModelAssigner(vnode);
|
|
6077
6425
|
},
|
|
6078
6426
|
updated(el, { value }) {
|
|
@@ -6083,21 +6431,42 @@ const vModelSelect = {
|
|
|
6083
6431
|
* @internal
|
|
6084
6432
|
*/
|
|
6085
6433
|
const vModelSelectInit = (el, value, number, set) => {
|
|
6086
|
-
|
|
6434
|
+
el._modelValue = value;
|
|
6087
6435
|
addEventListener(el, "change", () => {
|
|
6088
6436
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
6089
|
-
|
|
6090
|
-
el.
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6437
|
+
const multiple = el.multiple;
|
|
6438
|
+
const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
|
|
6439
|
+
const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
|
|
6440
|
+
try {
|
|
6441
|
+
(set || el[assignKey])(assignedValue);
|
|
6442
|
+
} finally {
|
|
6443
|
+
nextTick(() => {
|
|
6444
|
+
if (el._pendingValue === pending) el._pendingValue = void 0;
|
|
6445
|
+
});
|
|
6446
|
+
}
|
|
6094
6447
|
});
|
|
6095
6448
|
};
|
|
6449
|
+
function isSameSelectValue(value, assignedValue, multiple) {
|
|
6450
|
+
if (!multiple) return looseEqual(value, assignedValue);
|
|
6451
|
+
if (isArray(value)) return looseEqual(value, assignedValue);
|
|
6452
|
+
if (isSet(value)) {
|
|
6453
|
+
if (value.size !== assignedValue.length) return false;
|
|
6454
|
+
for (const item of assignedValue) if (!value.has(item)) return false;
|
|
6455
|
+
return true;
|
|
6456
|
+
}
|
|
6457
|
+
return false;
|
|
6458
|
+
}
|
|
6096
6459
|
/**
|
|
6097
6460
|
* @internal
|
|
6098
6461
|
*/
|
|
6099
6462
|
const vModelSetSelected = (el, value) => {
|
|
6100
|
-
|
|
6463
|
+
el._modelValue = value;
|
|
6464
|
+
const pending = el._pendingValue;
|
|
6465
|
+
el._pendingValue = void 0;
|
|
6466
|
+
if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
|
|
6467
|
+
setSelected(el, value);
|
|
6468
|
+
};
|
|
6469
|
+
function setSelected(el, value) {
|
|
6101
6470
|
const isMultiple = el.multiple;
|
|
6102
6471
|
const isArrayValue = isArray(value);
|
|
6103
6472
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -6107,18 +6476,19 @@ const vModelSetSelected = (el, value) => {
|
|
|
6107
6476
|
for (let i = 0, l = el.options.length; i < l; i++) {
|
|
6108
6477
|
const option = el.options[i];
|
|
6109
6478
|
const optionValue = getValue(option);
|
|
6110
|
-
if (isMultiple)
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6479
|
+
if (isMultiple) {
|
|
6480
|
+
if (isArrayValue) {
|
|
6481
|
+
const optionType = typeof optionValue;
|
|
6482
|
+
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
6483
|
+
else option.selected = looseIndexOf(value, optionValue) > -1;
|
|
6484
|
+
} else option.selected = value.has(optionValue);
|
|
6485
|
+
} else if (looseEqual(getValue(option), value)) {
|
|
6116
6486
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
6117
6487
|
return;
|
|
6118
6488
|
}
|
|
6119
6489
|
}
|
|
6120
6490
|
if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
|
|
6121
|
-
}
|
|
6491
|
+
}
|
|
6122
6492
|
/**
|
|
6123
6493
|
* @internal retrieve raw value set via :value bindings
|
|
6124
6494
|
*/
|
|
@@ -6181,7 +6551,7 @@ function initVModelForSSR() {
|
|
|
6181
6551
|
}
|
|
6182
6552
|
//#endregion
|
|
6183
6553
|
//#region packages/runtime-dom/src/index.ts
|
|
6184
|
-
const rendererOptions =
|
|
6554
|
+
const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
|
|
6185
6555
|
let renderer;
|
|
6186
6556
|
function ensureRenderer() {
|
|
6187
6557
|
return renderer || (renderer = createRenderer(rendererOptions));
|
|
@@ -6265,7 +6635,7 @@ const initDirectivesForSSR = () => {
|
|
|
6265
6635
|
};
|
|
6266
6636
|
//#endregion
|
|
6267
6637
|
//#region packages/server-renderer/src/helpers/ssrRenderAttrs.ts
|
|
6268
|
-
const shouldIgnoreProp =
|
|
6638
|
+
const shouldIgnoreProp = /*@__PURE__*/ makeMap(`,key,ref,innerHTML,textContent,ref_key,ref_for`);
|
|
6269
6639
|
function ssrRenderAttrs(props, tag) {
|
|
6270
6640
|
let ret = "";
|
|
6271
6641
|
for (let key in props) {
|
|
@@ -6283,7 +6653,7 @@ function ssrRenderAttrs(props, tag) {
|
|
|
6283
6653
|
function ssrRenderDynamicAttr(key, value, tag) {
|
|
6284
6654
|
if (!isRenderableAttrValue(value)) return ``;
|
|
6285
6655
|
const attrKey = tag && (tag.indexOf("-") > 0 || isSVGTag(tag)) ? key : propsToAttrMap[key] || key.toLowerCase();
|
|
6286
|
-
if (isBooleanAttr(attrKey)) return includeBooleanAttr(value) ? ` ${attrKey}` : ``;
|
|
6656
|
+
if (isBooleanAttr(attrKey) || attrKey === "hidden" && (typeof value === "boolean" || typeof value === "number")) return includeBooleanAttr(value) ? ` ${attrKey}` : ``;
|
|
6287
6657
|
else if (isSSRSafeAttrName(attrKey)) return value === "" ? ` ${attrKey}` : ` ${attrKey}="${escapeHtml(value)}"`;
|
|
6288
6658
|
else {
|
|
6289
6659
|
console.warn(`[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}`);
|
|
@@ -6312,53 +6682,76 @@ function ssrResetCssVars(raw) {
|
|
|
6312
6682
|
return raw;
|
|
6313
6683
|
}
|
|
6314
6684
|
//#endregion
|
|
6315
|
-
//#region packages/server-renderer/src/helpers/ssrRenderComponent.ts
|
|
6316
|
-
function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
|
|
6317
|
-
return renderComponentVNode(createVNode(comp, props, children), parentComponent, slotScopeId);
|
|
6318
|
-
}
|
|
6319
|
-
//#endregion
|
|
6320
6685
|
//#region packages/server-renderer/src/helpers/ssrRenderSlot.ts
|
|
6321
|
-
const { ensureValidVNode } = ssrUtils;
|
|
6686
|
+
const { ensureValidVNode, rawVaporSlotKey: rawVaporSlotKey$1 } = ssrUtils;
|
|
6687
|
+
let vaporSlots = 0;
|
|
6322
6688
|
function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) {
|
|
6323
|
-
push(`<!--[-->`);
|
|
6324
6689
|
ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId);
|
|
6325
|
-
push(`<!--]-->`);
|
|
6326
6690
|
}
|
|
6327
6691
|
function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) {
|
|
6328
6692
|
const slotFn = slots[slotName];
|
|
6693
|
+
let fallback = false;
|
|
6329
6694
|
if (slotFn) {
|
|
6695
|
+
if (slotFn[rawVaporSlotKey$1]) vaporSlots++;
|
|
6696
|
+
const before = vaporSlots;
|
|
6330
6697
|
const slotBuffer = [];
|
|
6331
6698
|
const bufferedPush = (item) => {
|
|
6332
6699
|
slotBuffer.push(item);
|
|
6333
6700
|
};
|
|
6334
|
-
const ret = slotFn(slotProps, bufferedPush, parentComponent, slotScopeId ? " " + slotScopeId : "");
|
|
6701
|
+
const ret = slotFn(slotProps || {}, bufferedPush, parentComponent, slotScopeId ? " " + slotScopeId : "");
|
|
6702
|
+
let vnodes;
|
|
6335
6703
|
if (isArray(ret)) {
|
|
6336
|
-
|
|
6337
|
-
if (
|
|
6704
|
+
vnodes = ensureValidVNode(ret);
|
|
6705
|
+
if (vnodes && isVaporSlotContent(vnodes)) {
|
|
6706
|
+
renderVNodeChildren(bufferedPush, vnodes, parentComponent, slotScopeId);
|
|
6707
|
+
vnodes = void 0;
|
|
6708
|
+
}
|
|
6709
|
+
}
|
|
6710
|
+
if (vnodes !== void 0) {
|
|
6711
|
+
if (!transition) {
|
|
6712
|
+
fallback = !vnodes && !!fallbackRenderFn;
|
|
6713
|
+
push(fallback ? `<!--(-->` : `<!--[-->`);
|
|
6714
|
+
}
|
|
6715
|
+
if (vnodes) renderVNodeChildren(push, vnodes, parentComponent, slotScopeId);
|
|
6338
6716
|
else if (fallbackRenderFn) fallbackRenderFn();
|
|
6339
6717
|
else if (transition) push(`<!---->`);
|
|
6340
6718
|
} else {
|
|
6341
6719
|
let isEmptySlot = true;
|
|
6342
|
-
|
|
6720
|
+
const owner = getCurrentInstance();
|
|
6721
|
+
if (transition || !(owner && owner.type.__vapor) && !fallbackRenderFn && vaporSlots !== before) isEmptySlot = false;
|
|
6343
6722
|
else for (let i = 0; i < slotBuffer.length; i++) if (!isComment(slotBuffer[i])) {
|
|
6344
6723
|
isEmptySlot = false;
|
|
6345
6724
|
break;
|
|
6346
6725
|
}
|
|
6726
|
+
if (!transition) {
|
|
6727
|
+
fallback = isEmptySlot && !!fallbackRenderFn;
|
|
6728
|
+
push(fallback ? `<!--(-->` : `<!--[-->`);
|
|
6729
|
+
}
|
|
6347
6730
|
if (isEmptySlot) {
|
|
6348
6731
|
if (fallbackRenderFn) fallbackRenderFn();
|
|
6349
6732
|
} else {
|
|
6350
6733
|
let start = 0;
|
|
6351
6734
|
let end = slotBuffer.length;
|
|
6352
|
-
if (transition
|
|
6353
|
-
|
|
6354
|
-
end
|
|
6735
|
+
if (transition) {
|
|
6736
|
+
const first = slotBuffer[0];
|
|
6737
|
+
if ((first === "<!--[-->" || first === "<!--(-->") && slotBuffer[end - 1] === (first === "<!--(-->" ? "<!--)-->" : "<!--]-->")) {
|
|
6738
|
+
start++;
|
|
6739
|
+
end--;
|
|
6740
|
+
}
|
|
6355
6741
|
}
|
|
6356
6742
|
if (start < end) for (let i = start; i < end; i++) push(slotBuffer[i]);
|
|
6357
6743
|
else if (transition) push(`<!---->`);
|
|
6358
6744
|
}
|
|
6359
6745
|
}
|
|
6360
|
-
} else
|
|
6361
|
-
|
|
6746
|
+
} else {
|
|
6747
|
+
if (!transition) {
|
|
6748
|
+
fallback = !!fallbackRenderFn;
|
|
6749
|
+
push(fallback ? `<!--(-->` : `<!--[-->`);
|
|
6750
|
+
}
|
|
6751
|
+
if (fallbackRenderFn) fallbackRenderFn();
|
|
6752
|
+
else if (transition) push(`<!---->`);
|
|
6753
|
+
}
|
|
6754
|
+
if (!transition) push(fallback ? `<!--)-->` : `<!--]-->`);
|
|
6362
6755
|
}
|
|
6363
6756
|
const commentTestRE = /^<!--[\s\S]*-->$/;
|
|
6364
6757
|
const commentRE = /<!--[^]*?-->/gm;
|
|
@@ -6368,6 +6761,16 @@ function isComment(item) {
|
|
|
6368
6761
|
return !item.replace(commentRE, "").trim();
|
|
6369
6762
|
}
|
|
6370
6763
|
//#endregion
|
|
6764
|
+
//#region packages/server-renderer/src/helpers/ssrRenderComponent.ts
|
|
6765
|
+
function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
|
|
6766
|
+
if (isString(comp)) {
|
|
6767
|
+
const { getBuffer, push } = createBuffer();
|
|
6768
|
+
renderVNode(push, createVNode(comp, props, children), parentComponent, slotScopeId);
|
|
6769
|
+
return getBuffer();
|
|
6770
|
+
}
|
|
6771
|
+
return renderComponentVNode(createVNode(comp, props, children), parentComponent, slotScopeId);
|
|
6772
|
+
}
|
|
6773
|
+
//#endregion
|
|
6371
6774
|
//#region packages/server-renderer/src/helpers/ssrRenderTeleport.ts
|
|
6372
6775
|
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
|
|
6373
6776
|
parentPush("<!--teleport start-->");
|
|
@@ -6387,6 +6790,7 @@ function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parent
|
|
|
6387
6790
|
teleportContent = getBuffer();
|
|
6388
6791
|
}
|
|
6389
6792
|
targetBuffer.splice(bufferIndex, 0, teleportContent);
|
|
6793
|
+
if (isPromise(teleportContent) || isArray(teleportContent) && teleportContent.hasAsync) targetBuffer.hasAsync = true;
|
|
6390
6794
|
parentPush("<!--teleport end-->");
|
|
6391
6795
|
}
|
|
6392
6796
|
//#endregion
|
|
@@ -6404,20 +6808,22 @@ function ssrRenderList(source, renderItem) {
|
|
|
6404
6808
|
return;
|
|
6405
6809
|
}
|
|
6406
6810
|
for (let i = 0; i < source; i++) renderItem(i + 1, i);
|
|
6407
|
-
} else if (isObject(source))
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6811
|
+
} else if (isObject(source)) {
|
|
6812
|
+
if (source[Symbol.iterator]) {
|
|
6813
|
+
let i = 0;
|
|
6814
|
+
for (const item of source) renderItem(item, i++);
|
|
6815
|
+
} else {
|
|
6816
|
+
const keys = Object.keys(source);
|
|
6817
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
6818
|
+
const key = keys[i];
|
|
6819
|
+
renderItem(source[key], key, i);
|
|
6820
|
+
}
|
|
6415
6821
|
}
|
|
6416
6822
|
}
|
|
6417
6823
|
}
|
|
6418
6824
|
//#endregion
|
|
6419
6825
|
//#region packages/server-renderer/src/helpers/ssrRenderSuspense.ts
|
|
6420
|
-
|
|
6826
|
+
function ssrRenderSuspense(push, { default: renderContent }) {
|
|
6421
6827
|
if (renderContent) renderContent();
|
|
6422
6828
|
else push(`<!---->`);
|
|
6423
6829
|
}
|
|
@@ -6462,7 +6868,7 @@ function ssrCompile(template, instance) {
|
|
|
6462
6868
|
}
|
|
6463
6869
|
//#endregion
|
|
6464
6870
|
//#region packages/server-renderer/src/render.ts
|
|
6465
|
-
const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, normalizeVNode, pushWarningContext, popWarningContext } = ssrUtils;
|
|
6871
|
+
const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, isVNode: isVNode$2, normalizeVNode, pushWarningContext, popWarningContext, VaporSlot, rawVaporSlotKey, invokeSlotFallback } = ssrUtils;
|
|
6466
6872
|
function cleanupContext(context) {
|
|
6467
6873
|
let firstError;
|
|
6468
6874
|
if (context.__watcherHandles) {
|
|
@@ -6502,7 +6908,41 @@ function createBuffer() {
|
|
|
6502
6908
|
}
|
|
6503
6909
|
};
|
|
6504
6910
|
}
|
|
6911
|
+
const vaporOutlets = /* @__PURE__ */ new WeakMap();
|
|
6912
|
+
const vaporInterface = { attachSlotOutlet(content, fallback, owner) {
|
|
6913
|
+
const lone = isVaporSlotContent(content);
|
|
6914
|
+
if (lone) vaporOutlets.set(content, {
|
|
6915
|
+
fallback,
|
|
6916
|
+
owner
|
|
6917
|
+
});
|
|
6918
|
+
return lone;
|
|
6919
|
+
} };
|
|
6920
|
+
function isVaporSlotContent(children) {
|
|
6921
|
+
const lone = findVaporSlot(children);
|
|
6922
|
+
vaporSlot = null;
|
|
6923
|
+
return lone;
|
|
6924
|
+
}
|
|
6925
|
+
let vaporSlot = null;
|
|
6926
|
+
function findVaporSlot(children) {
|
|
6927
|
+
for (let i = 0; i < children.length; i++) {
|
|
6928
|
+
const child = children[i];
|
|
6929
|
+
if (!isVNode$2(child)) return false;
|
|
6930
|
+
if (child.type === VaporSlot) {
|
|
6931
|
+
if (vaporSlot) return false;
|
|
6932
|
+
vaporSlot = child;
|
|
6933
|
+
} else if (child.type === Fragment) {
|
|
6934
|
+
if (child.patchFlag > 0 && child.patchFlag & 384 || !findVaporSlot(child.children)) return false;
|
|
6935
|
+
} else if (child.type !== Comment) return false;
|
|
6936
|
+
}
|
|
6937
|
+
return true;
|
|
6938
|
+
}
|
|
6505
6939
|
function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
|
|
6940
|
+
const ctx = vnode.ctx;
|
|
6941
|
+
if (vnode.shapeFlag & 32 && ctx && ctx.type.__vapor) {
|
|
6942
|
+
const slots = vnode.children;
|
|
6943
|
+
for (const name in slots) if (isFunction(slots[name])) slots[name][rawVaporSlotKey] = slots[name];
|
|
6944
|
+
if (!ctx.appContext.vapor) ctx.appContext.vapor = vaporInterface;
|
|
6945
|
+
}
|
|
6506
6946
|
const instance = vnode.component = createComponentInstance(vnode, parentComponent, null);
|
|
6507
6947
|
const context = instance.appContext.provides[ssrContextKey];
|
|
6508
6948
|
if (context) (context.__instanceScopes || (context.__instanceScopes = [])).push(instance.scope);
|
|
@@ -6515,7 +6955,11 @@ function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
|
|
|
6515
6955
|
if (hasAsyncSetup) prefetches = instance.sp;
|
|
6516
6956
|
if (prefetches) return Promise.all(prefetches.map((prefetch) => prefetch.call(instance.proxy)));
|
|
6517
6957
|
}).catch(NOOP).then(() => renderComponentSubTree(instance, slotScopeId));
|
|
6518
|
-
else
|
|
6958
|
+
else try {
|
|
6959
|
+
return renderComponentSubTree(instance, slotScopeId);
|
|
6960
|
+
} catch (err) {
|
|
6961
|
+
return Promise.reject(err);
|
|
6962
|
+
}
|
|
6519
6963
|
}
|
|
6520
6964
|
function renderComponentSubTree(instance, slotScopeId) {
|
|
6521
6965
|
pushWarningContext(instance.vnode);
|
|
@@ -6555,12 +6999,15 @@ function renderComponentSubTree(instance, slotScopeId) {
|
|
|
6555
6999
|
const prev = setCurrentRenderingInstance(instance);
|
|
6556
7000
|
try {
|
|
6557
7001
|
ssrRender(instance.proxy, push, instance, attrs, instance.props, instance.setupState, instance.data, instance.ctx);
|
|
7002
|
+
} catch (err) {
|
|
7003
|
+
handleError(err, instance, 1);
|
|
6558
7004
|
} finally {
|
|
6559
7005
|
setCurrentRenderingInstance(prev);
|
|
6560
7006
|
}
|
|
6561
7007
|
} else if (instance.render && instance.render !== NOOP) renderVNode(push, instance.subTree = renderComponentRoot(instance), instance, slotScopeId);
|
|
6562
7008
|
else {
|
|
6563
|
-
|
|
7009
|
+
const componentName = comp.name || comp.__file || `<Anonymous>`;
|
|
7010
|
+
warn(`Component ${componentName} is missing template or render function.`);
|
|
6564
7011
|
push(`<!---->`);
|
|
6565
7012
|
}
|
|
6566
7013
|
}
|
|
@@ -6580,12 +7027,25 @@ function renderVNode(push, vnode, parentComponent, slotScopeId) {
|
|
|
6580
7027
|
case Static:
|
|
6581
7028
|
push(children);
|
|
6582
7029
|
break;
|
|
6583
|
-
case Fragment:
|
|
7030
|
+
case Fragment: {
|
|
6584
7031
|
if (vnode.slotScopeIds) slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
|
|
6585
|
-
|
|
7032
|
+
const outlet = vnode.vo && vaporOutlets.get(children);
|
|
7033
|
+
if (outlet) {
|
|
7034
|
+
renderVaporOutlet(push, (_, push) => renderVNodeChildren(push, children, parentComponent, slotScopeId), null, outlet, parentComponent, slotScopeId);
|
|
7035
|
+
break;
|
|
7036
|
+
}
|
|
7037
|
+
const isFallback = shapeFlag & 1024;
|
|
7038
|
+
push(isFallback ? `<!--(-->` : `<!--[-->`);
|
|
6586
7039
|
renderVNodeChildren(push, children, parentComponent, slotScopeId);
|
|
6587
|
-
push(`<!--]-->`);
|
|
7040
|
+
push(isFallback ? `<!--)-->` : `<!--]-->`);
|
|
6588
7041
|
break;
|
|
7042
|
+
}
|
|
7043
|
+
case VaporSlot: {
|
|
7044
|
+
if (vnode.slotScopeIds) slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
|
|
7045
|
+
const { slot, outlets } = vnode.vs;
|
|
7046
|
+
renderVaporOutlet(push, slot, vnode.props, outlets && outlets[0], parentComponent, slotScopeId);
|
|
7047
|
+
break;
|
|
7048
|
+
}
|
|
6589
7049
|
default: if (shapeFlag & 1) renderElementVNode(push, vnode, parentComponent, slotScopeId);
|
|
6590
7050
|
else if (shapeFlag & 6) push(renderComponentVNode(vnode, parentComponent, slotScopeId));
|
|
6591
7051
|
else if (shapeFlag & 64) renderTeleportVNode(push, vnode, parentComponent, slotScopeId);
|
|
@@ -6593,6 +7053,11 @@ function renderVNode(push, vnode, parentComponent, slotScopeId) {
|
|
|
6593
7053
|
else warn("[@vue/server-renderer] Invalid VNode type:", type, `(${typeof type})`);
|
|
6594
7054
|
}
|
|
6595
7055
|
}
|
|
7056
|
+
function renderVaporOutlet(push, slot, props, outlet, parentComponent, slotScopeId) {
|
|
7057
|
+
const prev = setCurrentRenderingInstance(parentComponent);
|
|
7058
|
+
ssrRenderSlot({ default: slot }, "default", props, outlet ? () => renderVNodeChildren(push, invokeSlotFallback(outlet.fallback, outlet.owner), parentComponent, slotScopeId) : null, push, parentComponent, slotScopeId);
|
|
7059
|
+
setCurrentRenderingInstance(prev);
|
|
7060
|
+
}
|
|
6596
7061
|
function renderVNodeChildren(push, children, parentComponent, slotScopeId) {
|
|
6597
7062
|
for (let i = 0; i < children.length; i++) renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId);
|
|
6598
7063
|
}
|
|
@@ -6601,15 +7066,25 @@ function renderElementVNode(push, vnode, parentComponent, slotScopeId) {
|
|
|
6601
7066
|
let { props, children, shapeFlag, scopeId } = vnode;
|
|
6602
7067
|
let openTag = `<${tag}`;
|
|
6603
7068
|
if (props) openTag += ssrRenderAttrs(props, tag);
|
|
6604
|
-
|
|
7069
|
+
const renderedScopeIds = [];
|
|
7070
|
+
const appendScopeId = (id) => {
|
|
7071
|
+
if (id && (!props || !hasOwn(props, id)) && !renderedScopeIds.includes(id)) {
|
|
7072
|
+
openTag += ` ${id}`;
|
|
7073
|
+
renderedScopeIds.push(id);
|
|
7074
|
+
}
|
|
7075
|
+
};
|
|
7076
|
+
if (scopeId) appendScopeId(scopeId);
|
|
6605
7077
|
let curParent = parentComponent;
|
|
6606
7078
|
let curVnode = vnode;
|
|
6607
7079
|
while (curParent && curVnode === curParent.subTree) {
|
|
6608
7080
|
curVnode = curParent.vnode;
|
|
6609
|
-
if (curVnode.scopeId)
|
|
7081
|
+
if (curVnode.scopeId) appendScopeId(curVnode.scopeId);
|
|
6610
7082
|
curParent = curParent.parent;
|
|
6611
7083
|
}
|
|
6612
|
-
if (slotScopeId)
|
|
7084
|
+
if (slotScopeId) {
|
|
7085
|
+
const slotScopeIdList = slotScopeId.trim().split(" ");
|
|
7086
|
+
for (let i = 0; i < slotScopeIdList.length; i++) appendScopeId(slotScopeIdList[i]);
|
|
7087
|
+
}
|
|
6613
7088
|
push(openTag + `>`);
|
|
6614
7089
|
if (!isVoidTag(tag)) {
|
|
6615
7090
|
let hasChildrenOverride = false;
|
|
@@ -6712,7 +7187,7 @@ async function renderToString(input, context = {}) {
|
|
|
6712
7187
|
async function resolveTeleports(context) {
|
|
6713
7188
|
if (context.__teleportBuffers) {
|
|
6714
7189
|
context.teleports = context.teleports || {};
|
|
6715
|
-
for (const key in context.__teleportBuffers) context.teleports[key] = await unrollBuffer$1(
|
|
7190
|
+
for (const key in context.__teleportBuffers) context.teleports[key] = await unrollBuffer$1(context.__teleportBuffers[key]);
|
|
6716
7191
|
}
|
|
6717
7192
|
}
|
|
6718
7193
|
//#endregion
|