@vue/server-renderer 3.6.0-rc.1 → 3.6.0-rc.11
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 +132 -40
- package/dist/server-renderer.cjs.prod.js +132 -40
- package/dist/server-renderer.d.ts +6 -9
- package/dist/server-renderer.esm-browser.js +874 -451
- package/dist/server-renderer.esm-browser.prod.js +2 -2
- package/dist/server-renderer.esm-bundler.js +132 -40
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/server-renderer v3.6.0-rc.
|
|
2
|
+
* @vue/server-renderer v3.6.0-rc.11
|
|
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];
|
|
@@ -303,13 +303,54 @@ function escapeHtmlComment(src) {
|
|
|
303
303
|
}
|
|
304
304
|
//#endregion
|
|
305
305
|
//#region packages/shared/src/looseEqual.ts
|
|
306
|
-
function looseCompareArrays(a, b) {
|
|
306
|
+
function looseCompareArrays(a, b, seen) {
|
|
307
307
|
if (a.length !== b.length) return false;
|
|
308
308
|
let equal = true;
|
|
309
|
-
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
310
|
return equal;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
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);
|
|
351
|
+
return equal;
|
|
352
|
+
}
|
|
353
|
+
function looseEqual(a, b, seen) {
|
|
313
354
|
if (a === b) return true;
|
|
314
355
|
let aValidType = isDate(a);
|
|
315
356
|
let bValidType = isDate(b);
|
|
@@ -319,17 +360,12 @@ function looseEqual(a, b) {
|
|
|
319
360
|
if (aValidType || bValidType) return a === b;
|
|
320
361
|
aValidType = isArray(a);
|
|
321
362
|
bValidType = isArray(b);
|
|
322
|
-
if (aValidType || bValidType) return aValidType && bValidType ?
|
|
363
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
|
|
323
364
|
aValidType = isObject(a);
|
|
324
365
|
bValidType = isObject(b);
|
|
325
366
|
if (aValidType || bValidType) {
|
|
326
367
|
if (!aValidType || !bValidType) return false;
|
|
327
|
-
|
|
328
|
-
for (const key in a) {
|
|
329
|
-
const aHasKey = a.hasOwnProperty(key);
|
|
330
|
-
const bHasKey = b.hasOwnProperty(key);
|
|
331
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
|
|
332
|
-
}
|
|
368
|
+
return looseCompareNested(a, b, seen, looseCompareObjects);
|
|
333
369
|
}
|
|
334
370
|
return String(a) === String(b);
|
|
335
371
|
}
|
|
@@ -459,6 +495,8 @@ function setupFlagsHandler(target) {
|
|
|
459
495
|
function warn$2(msg, ...args) {
|
|
460
496
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
461
497
|
}
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region packages/reactivity/src/system.ts
|
|
462
500
|
const notifyBuffer = [];
|
|
463
501
|
let batchDepth = 0;
|
|
464
502
|
let activeSub = void 0;
|
|
@@ -597,13 +635,23 @@ function endTracking(sub, prevSub) {
|
|
|
597
635
|
sub.flags &= -5;
|
|
598
636
|
}
|
|
599
637
|
function flush() {
|
|
638
|
+
let hasError = false;
|
|
639
|
+
let error;
|
|
600
640
|
while (notifyIndex < notifyBufferLength) {
|
|
601
641
|
const effect = notifyBuffer[notifyIndex];
|
|
602
642
|
notifyBuffer[notifyIndex++] = void 0;
|
|
603
|
-
|
|
643
|
+
try {
|
|
644
|
+
effect.notify();
|
|
645
|
+
} catch (err) {
|
|
646
|
+
if (!hasError) {
|
|
647
|
+
hasError = true;
|
|
648
|
+
error = err;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
604
651
|
}
|
|
605
652
|
notifyIndex = 0;
|
|
606
653
|
notifyBufferLength = 0;
|
|
654
|
+
if (hasError) throw error;
|
|
607
655
|
}
|
|
608
656
|
function checkDirty(link, sub) {
|
|
609
657
|
let stack;
|
|
@@ -687,7 +735,7 @@ var Dep = class {
|
|
|
687
735
|
}
|
|
688
736
|
set subs(value) {
|
|
689
737
|
this._subs = value;
|
|
690
|
-
if (value === void 0) this.map.delete(this.key);
|
|
738
|
+
if (value === void 0 && this.map) this.map.delete(this.key);
|
|
691
739
|
}
|
|
692
740
|
};
|
|
693
741
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -770,9 +818,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
770
818
|
if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
771
819
|
}
|
|
772
820
|
break;
|
|
773
|
-
case "set":
|
|
774
|
-
if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
775
|
-
break;
|
|
821
|
+
case "set": if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
776
822
|
}
|
|
777
823
|
}
|
|
778
824
|
}
|
|
@@ -783,13 +829,17 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
783
829
|
/**
|
|
784
830
|
* Track array iteration and return:
|
|
785
831
|
* - if input is reactive: a cloned raw array with reactive values
|
|
786
|
-
* - 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
|
|
787
835
|
*/
|
|
788
836
|
function reactiveReadArray(array) {
|
|
789
837
|
const raw = /* @__PURE__ */ toRaw(array);
|
|
790
838
|
if (raw === array) return raw;
|
|
791
839
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
792
|
-
|
|
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);
|
|
793
843
|
}
|
|
794
844
|
/**
|
|
795
845
|
* Track array iteration and return raw array
|
|
@@ -965,8 +1015,8 @@ function noTracking(self, method, args = []) {
|
|
|
965
1015
|
}
|
|
966
1016
|
//#endregion
|
|
967
1017
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
968
|
-
const isNonTrackableKeys =
|
|
969
|
-
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));
|
|
970
1020
|
function hasOwnProperty(key) {
|
|
971
1021
|
if (!isSymbol(key)) key = String(key);
|
|
972
1022
|
const obj = /* @__PURE__ */ toRaw(this);
|
|
@@ -1021,12 +1071,14 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1021
1071
|
oldValue = /* @__PURE__ */ toRaw(oldValue);
|
|
1022
1072
|
value = /* @__PURE__ */ toRaw(value);
|
|
1023
1073
|
}
|
|
1024
|
-
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value))
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
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
|
+
}
|
|
1030
1082
|
}
|
|
1031
1083
|
}
|
|
1032
1084
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
@@ -1067,10 +1119,10 @@ var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1067
1119
|
return true;
|
|
1068
1120
|
}
|
|
1069
1121
|
};
|
|
1070
|
-
const mutableHandlers =
|
|
1071
|
-
const readonlyHandlers =
|
|
1072
|
-
const shallowReactiveHandlers =
|
|
1073
|
-
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);
|
|
1074
1126
|
//#endregion
|
|
1075
1127
|
//#region packages/reactivity/src/collectionHandlers.ts
|
|
1076
1128
|
const toShallow = (value) => value;
|
|
@@ -1221,10 +1273,10 @@ function createInstrumentationGetter(isReadonly, shallow) {
|
|
|
1221
1273
|
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
1222
1274
|
};
|
|
1223
1275
|
}
|
|
1224
|
-
const mutableCollectionHandlers = { get:
|
|
1225
|
-
const shallowCollectionHandlers = { get:
|
|
1226
|
-
const readonlyCollectionHandlers = { get:
|
|
1227
|
-
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) };
|
|
1228
1280
|
function checkIdentityKeys(target, has, key) {
|
|
1229
1281
|
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
1230
1282
|
if (rawKey !== key && has.call(target, rawKey)) {
|
|
@@ -1249,7 +1301,7 @@ function targetTypeMap(rawType) {
|
|
|
1249
1301
|
default: return 0;
|
|
1250
1302
|
}
|
|
1251
1303
|
}
|
|
1252
|
-
|
|
1304
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1253
1305
|
function reactive(target) {
|
|
1254
1306
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
1255
1307
|
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
@@ -1284,7 +1336,7 @@ function reactive(target) {
|
|
|
1284
1336
|
* @param target - The source object.
|
|
1285
1337
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive}
|
|
1286
1338
|
*/
|
|
1287
|
-
|
|
1339
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1288
1340
|
function shallowReactive(target) {
|
|
1289
1341
|
return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
|
|
1290
1342
|
}
|
|
@@ -1317,7 +1369,7 @@ function shallowReactive(target) {
|
|
|
1317
1369
|
* @param target - The source object.
|
|
1318
1370
|
* @see {@link https://vuejs.org/api/reactivity-core.html#readonly}
|
|
1319
1371
|
*/
|
|
1320
|
-
|
|
1372
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1321
1373
|
function readonly(target) {
|
|
1322
1374
|
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
|
|
1323
1375
|
}
|
|
@@ -1351,7 +1403,7 @@ function readonly(target) {
|
|
|
1351
1403
|
* @param target - The source object.
|
|
1352
1404
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly}
|
|
1353
1405
|
*/
|
|
1354
|
-
|
|
1406
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1355
1407
|
function shallowReadonly(target) {
|
|
1356
1408
|
return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
|
|
1357
1409
|
}
|
|
@@ -1388,7 +1440,7 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1388
1440
|
* @param value - The value to check.
|
|
1389
1441
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive}
|
|
1390
1442
|
*/
|
|
1391
|
-
|
|
1443
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1392
1444
|
function isReactive(value) {
|
|
1393
1445
|
if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
|
|
1394
1446
|
return !!(value && value["__v_isReactive"]);
|
|
@@ -1404,11 +1456,11 @@ function isReactive(value) {
|
|
|
1404
1456
|
* @param value - The value to check.
|
|
1405
1457
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly}
|
|
1406
1458
|
*/
|
|
1407
|
-
|
|
1459
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1408
1460
|
function isReadonly(value) {
|
|
1409
1461
|
return !!(value && value["__v_isReadonly"]);
|
|
1410
1462
|
}
|
|
1411
|
-
|
|
1463
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1412
1464
|
function isShallow(value) {
|
|
1413
1465
|
return !!(value && value["__v_isShallow"]);
|
|
1414
1466
|
}
|
|
@@ -1419,7 +1471,7 @@ function isShallow(value) {
|
|
|
1419
1471
|
* @param value - The value to check.
|
|
1420
1472
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy}
|
|
1421
1473
|
*/
|
|
1422
|
-
|
|
1474
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1423
1475
|
function isProxy(value) {
|
|
1424
1476
|
return value ? !!value["__v_raw"] : false;
|
|
1425
1477
|
}
|
|
@@ -1446,7 +1498,7 @@ function isProxy(value) {
|
|
|
1446
1498
|
* @param observed - The object for which the "raw" value is requested.
|
|
1447
1499
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw}
|
|
1448
1500
|
*/
|
|
1449
|
-
|
|
1501
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1450
1502
|
function toRaw(observed) {
|
|
1451
1503
|
const raw = observed && observed["__v_raw"];
|
|
1452
1504
|
return raw ? /* @__PURE__ */ toRaw(raw) : observed;
|
|
@@ -1495,7 +1547,7 @@ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value)
|
|
|
1495
1547
|
const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
1496
1548
|
//#endregion
|
|
1497
1549
|
//#region packages/reactivity/src/ref.ts
|
|
1498
|
-
|
|
1550
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1499
1551
|
function isRef(r) {
|
|
1500
1552
|
return r ? r["__v_isRef"] === true : false;
|
|
1501
1553
|
}
|
|
@@ -1595,10 +1647,12 @@ var ReactiveEffect = class {
|
|
|
1595
1647
|
get dirty() {
|
|
1596
1648
|
const flags = this.flags;
|
|
1597
1649
|
if (flags & 16) return true;
|
|
1598
|
-
if (flags & 32)
|
|
1599
|
-
this.
|
|
1600
|
-
|
|
1601
|
-
|
|
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
|
+
}
|
|
1602
1656
|
return false;
|
|
1603
1657
|
}
|
|
1604
1658
|
};
|
|
@@ -1707,10 +1761,12 @@ var ComputedRefImpl = class {
|
|
|
1707
1761
|
get _dirty() {
|
|
1708
1762
|
const flags = this.flags;
|
|
1709
1763
|
if (flags & 16) return true;
|
|
1710
|
-
if (flags & 32)
|
|
1711
|
-
this.
|
|
1712
|
-
|
|
1713
|
-
|
|
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
|
+
}
|
|
1714
1770
|
return false;
|
|
1715
1771
|
}
|
|
1716
1772
|
/**
|
|
@@ -1771,7 +1827,7 @@ var ComputedRefImpl = class {
|
|
|
1771
1827
|
}
|
|
1772
1828
|
};
|
|
1773
1829
|
setupOnTrigger(ComputedRefImpl);
|
|
1774
|
-
|
|
1830
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1775
1831
|
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1776
1832
|
let getter;
|
|
1777
1833
|
let setter;
|
|
@@ -1830,25 +1886,26 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
1830
1886
|
else if (isFunction(s)) return call ? call(s, 2) : s();
|
|
1831
1887
|
else warnInvalidSource(s, onWarn);
|
|
1832
1888
|
});
|
|
1833
|
-
} else if (isFunction(source))
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
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;
|
|
1837
1902
|
try {
|
|
1838
|
-
|
|
1903
|
+
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
1839
1904
|
} finally {
|
|
1840
|
-
|
|
1905
|
+
activeWatcher = currentEffect;
|
|
1841
1906
|
}
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
activeWatcher = this;
|
|
1845
|
-
try {
|
|
1846
|
-
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
1847
|
-
} finally {
|
|
1848
|
-
activeWatcher = currentEffect;
|
|
1849
|
-
}
|
|
1850
|
-
};
|
|
1851
|
-
else {
|
|
1907
|
+
};
|
|
1908
|
+
} else {
|
|
1852
1909
|
getter = NOOP;
|
|
1853
1910
|
warnInvalidSource(source, onWarn);
|
|
1854
1911
|
}
|
|
@@ -1945,7 +2002,7 @@ function warn$1(msg, ...args) {
|
|
|
1945
2002
|
isWarning = true;
|
|
1946
2003
|
const prevSub = setActiveSub();
|
|
1947
2004
|
const entry = stack.length ? stack[stack.length - 1] : null;
|
|
1948
|
-
const instance = isVNode$
|
|
2005
|
+
const instance = isVNode$3(entry) ? entry.component : entry;
|
|
1949
2006
|
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
1950
2007
|
const trace = getComponentTrace();
|
|
1951
2008
|
if (appWarnHandler) callWithErrorHandling(appWarnHandler, instance, 11, [
|
|
@@ -1978,7 +2035,7 @@ function getComponentTrace() {
|
|
|
1978
2035
|
ctx: currentCtx,
|
|
1979
2036
|
recurseCount: 0
|
|
1980
2037
|
});
|
|
1981
|
-
if (isVNode$
|
|
2038
|
+
if (isVNode$3(currentCtx)) {
|
|
1982
2039
|
const parent = currentCtx.component && currentCtx.component.parent;
|
|
1983
2040
|
currentCtx = parent && parent.vnode || parent;
|
|
1984
2041
|
} else currentCtx = currentCtx.parent;
|
|
@@ -1995,7 +2052,7 @@ function formatTrace(trace) {
|
|
|
1995
2052
|
}
|
|
1996
2053
|
function formatTraceEntry({ ctx, recurseCount }) {
|
|
1997
2054
|
const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
|
|
1998
|
-
const instance = isVNode$
|
|
2055
|
+
const instance = isVNode$3(ctx) ? ctx.component : ctx;
|
|
1999
2056
|
const isRoot = instance ? instance.parent == null : false;
|
|
2000
2057
|
const open = ` at <${formatComponentName(instance, ctx.type, isRoot)}`;
|
|
2001
2058
|
const close = `>` + postfix;
|
|
@@ -2134,7 +2191,7 @@ let currentFlushPromise = null;
|
|
|
2134
2191
|
let jobsLength = 0;
|
|
2135
2192
|
let flushIndex = 0;
|
|
2136
2193
|
let postFlushIndex = 0;
|
|
2137
|
-
const resolvedPromise =
|
|
2194
|
+
const resolvedPromise = /*@__PURE__*/ Promise.resolve();
|
|
2138
2195
|
const RECURSION_LIMIT = 100;
|
|
2139
2196
|
function nextTick(fn) {
|
|
2140
2197
|
const p = currentFlushPromise || resolvedPromise;
|
|
@@ -2173,6 +2230,7 @@ const doFlushJobs = () => {
|
|
|
2173
2230
|
flushJobs();
|
|
2174
2231
|
} catch (e) {
|
|
2175
2232
|
currentFlushPromise = null;
|
|
2233
|
+
if (jobsLength || postJobs.length) queueFlush();
|
|
2176
2234
|
throw e;
|
|
2177
2235
|
}
|
|
2178
2236
|
};
|
|
@@ -2180,9 +2238,10 @@ function queueFlush() {
|
|
|
2180
2238
|
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
2181
2239
|
}
|
|
2182
2240
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
2183
|
-
if (!isArray(jobs))
|
|
2184
|
-
|
|
2185
|
-
|
|
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);
|
|
2186
2245
|
queueFlush();
|
|
2187
2246
|
}
|
|
2188
2247
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -2196,32 +2255,39 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
2196
2255
|
i--;
|
|
2197
2256
|
jobsLength--;
|
|
2198
2257
|
if (cb.flags & 2) cb.flags &= -2;
|
|
2199
|
-
|
|
2200
|
-
|
|
2258
|
+
try {
|
|
2259
|
+
cb();
|
|
2260
|
+
} finally {
|
|
2261
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
2262
|
+
}
|
|
2201
2263
|
}
|
|
2202
2264
|
}
|
|
2203
2265
|
function flushPostFlushCbs(seen) {
|
|
2204
2266
|
if (postJobs.length) {
|
|
2205
2267
|
if (activePostJobs) {
|
|
2206
|
-
activePostJobs.push(
|
|
2268
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
2207
2269
|
postJobs.length = 0;
|
|
2208
2270
|
return;
|
|
2209
2271
|
}
|
|
2210
2272
|
activePostJobs = postJobs;
|
|
2211
2273
|
postJobs = [];
|
|
2212
2274
|
seen = seen || /* @__PURE__ */ new Map();
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
cb
|
|
2219
|
-
|
|
2220
|
-
|
|
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
|
+
}
|
|
2221
2285
|
}
|
|
2286
|
+
} finally {
|
|
2287
|
+
while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
|
|
2288
|
+
activePostJobs = null;
|
|
2289
|
+
postFlushIndex = 0;
|
|
2222
2290
|
}
|
|
2223
|
-
activePostJobs = null;
|
|
2224
|
-
postFlushIndex = 0;
|
|
2225
2291
|
}
|
|
2226
2292
|
}
|
|
2227
2293
|
let isFlushing = false;
|
|
@@ -2231,9 +2297,12 @@ let isFlushing = false;
|
|
|
2231
2297
|
function flushOnAppMount(instance) {
|
|
2232
2298
|
if (!isFlushing) {
|
|
2233
2299
|
isFlushing = true;
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2300
|
+
try {
|
|
2301
|
+
flushPreFlushCbs(instance);
|
|
2302
|
+
flushPostFlushCbs();
|
|
2303
|
+
} finally {
|
|
2304
|
+
isFlushing = false;
|
|
2305
|
+
}
|
|
2237
2306
|
}
|
|
2238
2307
|
}
|
|
2239
2308
|
function flushJobs(seen) {
|
|
@@ -2263,8 +2332,8 @@ function flushJobs(seen) {
|
|
|
2263
2332
|
jobsLength = 0;
|
|
2264
2333
|
jobs.length = 0;
|
|
2265
2334
|
flushPostFlushCbs(seen);
|
|
2266
|
-
currentFlushPromise = null;
|
|
2267
2335
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
2336
|
+
else currentFlushPromise = null;
|
|
2268
2337
|
}
|
|
2269
2338
|
}
|
|
2270
2339
|
function checkRecursiveUpdates(seen, fn) {
|
|
@@ -2295,6 +2364,19 @@ getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
|
2295
2364
|
rerender: tryWrap(rerender),
|
|
2296
2365
|
reload: tryWrap(reload)
|
|
2297
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
|
+
}
|
|
2298
2380
|
const map = /* @__PURE__ */ new Map();
|
|
2299
2381
|
function registerHMR(instance) {
|
|
2300
2382
|
const id = instance.type.__hmrId;
|
|
@@ -2336,18 +2418,16 @@ function rerender(id, newRender) {
|
|
|
2336
2418
|
instance.render = newRender;
|
|
2337
2419
|
normalizeClassComponent(instance.type).render = newRender;
|
|
2338
2420
|
}
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
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
|
+
}
|
|
2347
2430
|
}
|
|
2348
|
-
}
|
|
2349
|
-
nextTick(() => {
|
|
2350
|
-
isHmrUpdating = false;
|
|
2351
2431
|
});
|
|
2352
2432
|
});
|
|
2353
2433
|
}
|
|
@@ -2362,17 +2442,19 @@ function reload(id, newComp) {
|
|
|
2362
2442
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2363
2443
|
const dirtyInstances = new Set(instances);
|
|
2364
2444
|
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2365
|
-
|
|
2366
|
-
const
|
|
2367
|
-
|
|
2368
|
-
if (
|
|
2369
|
-
rerenderedParents.
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
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);
|
|
2454
|
+
}
|
|
2455
|
+
});
|
|
2374
2456
|
} else {
|
|
2375
|
-
const
|
|
2457
|
+
const parents = /* @__PURE__ */ new Set();
|
|
2376
2458
|
const dirtyInstanceSet = new Set(instances);
|
|
2377
2459
|
for (const instance of instances) {
|
|
2378
2460
|
const oldComp = normalizeClassComponent(instance.type);
|
|
@@ -2391,33 +2473,23 @@ function reload(id, newComp) {
|
|
|
2391
2473
|
instance.ceReload(newComp.styles);
|
|
2392
2474
|
dirtyInstances.delete(instance);
|
|
2393
2475
|
} else if (instance.parent) {
|
|
2394
|
-
|
|
2395
|
-
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2396
|
-
let updates = parentUpdates.get(parent);
|
|
2397
|
-
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2398
|
-
updates.push([instance, dirtyInstances]);
|
|
2399
|
-
}
|
|
2476
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
|
|
2400
2477
|
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2401
2478
|
else if (typeof window !== "undefined") window.location.reload();
|
|
2402
2479
|
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2403
2480
|
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2404
2481
|
}
|
|
2405
|
-
|
|
2482
|
+
parents.forEach((parent) => {
|
|
2406
2483
|
queueJob(() => {
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
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
|
+
}
|
|
2414
2492
|
}
|
|
2415
|
-
}
|
|
2416
|
-
nextTick(() => {
|
|
2417
|
-
isHmrUpdating = false;
|
|
2418
|
-
});
|
|
2419
|
-
updates.forEach(([instance, dirtyInstances]) => {
|
|
2420
|
-
dirtyInstances.delete(instance);
|
|
2421
2493
|
});
|
|
2422
2494
|
});
|
|
2423
2495
|
});
|
|
@@ -2487,20 +2559,20 @@ function devtoolsInitApp(app, version) {
|
|
|
2487
2559
|
function devtoolsUnmountApp(app) {
|
|
2488
2560
|
emit$1("app:unmount", app);
|
|
2489
2561
|
}
|
|
2490
|
-
const devtoolsComponentAdded =
|
|
2491
|
-
const devtoolsComponentUpdated =
|
|
2492
|
-
const _devtoolsComponentRemoved =
|
|
2562
|
+
const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
|
|
2563
|
+
const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
|
|
2564
|
+
const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
|
|
2493
2565
|
const devtoolsComponentRemoved = (component) => {
|
|
2494
2566
|
if (devtools && typeof devtools.cleanupBuffer === "function" && !devtools.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
|
|
2495
2567
|
};
|
|
2496
|
-
|
|
2568
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2497
2569
|
function createDevtoolsComponentHook(hook) {
|
|
2498
2570
|
return (component) => {
|
|
2499
2571
|
emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
|
|
2500
2572
|
};
|
|
2501
2573
|
}
|
|
2502
|
-
const devtoolsPerfStart =
|
|
2503
|
-
const devtoolsPerfEnd =
|
|
2574
|
+
const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
|
|
2575
|
+
const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
|
|
2504
2576
|
function createDevtoolsPerformanceHook(hook) {
|
|
2505
2577
|
return (component, type, time) => {
|
|
2506
2578
|
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
@@ -2694,7 +2766,7 @@ function instanceWatch(source, value, options) {
|
|
|
2694
2766
|
}
|
|
2695
2767
|
const prev = setCurrentInstance(this);
|
|
2696
2768
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
2697
|
-
|
|
2769
|
+
restoreCurrentInstance(prev);
|
|
2698
2770
|
return res;
|
|
2699
2771
|
}
|
|
2700
2772
|
function createPathGetter(ctx, path) {
|
|
@@ -2712,16 +2784,47 @@ const isTeleport = (type) => type.__isTeleport;
|
|
|
2712
2784
|
//#endregion
|
|
2713
2785
|
//#region packages/runtime-core/src/components/BaseTransition.ts
|
|
2714
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
|
+
}
|
|
2715
2814
|
function setTransitionHooks(vnode, hooks) {
|
|
2716
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
2717
|
-
else {
|
|
2815
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
2718
2816
|
vnode.transition = hooks;
|
|
2719
|
-
setTransitionHooks(vnode.component
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
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;
|
|
2724
2826
|
} else vnode.transition = hooks;
|
|
2827
|
+
return hooks;
|
|
2725
2828
|
}
|
|
2726
2829
|
//#endregion
|
|
2727
2830
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -2796,15 +2899,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
2796
2899
|
if (rawRef.f) {
|
|
2797
2900
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
2798
2901
|
if (isUnmount) isArray(existing) && remove(existing, refValue);
|
|
2799
|
-
else if (!isArray(existing))
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
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);
|
|
2808
2912
|
} else if (_isString) {
|
|
2809
2913
|
refs[ref] = value;
|
|
2810
2914
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -2891,7 +2995,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
2891
2995
|
try {
|
|
2892
2996
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
2893
2997
|
} finally {
|
|
2894
|
-
|
|
2998
|
+
restoreCurrentInstance(prev);
|
|
2895
2999
|
setActiveSub(prevSub);
|
|
2896
3000
|
}
|
|
2897
3001
|
});
|
|
@@ -2920,9 +3024,87 @@ function onErrorCaptured(hook, target = currentInstance) {
|
|
|
2920
3024
|
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2921
3025
|
//#endregion
|
|
2922
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
|
+
}
|
|
3051
|
+
/**
|
|
3052
|
+
* Compiler runtime helper for rendering `<slot/>`
|
|
3053
|
+
* @private
|
|
3054
|
+
*/
|
|
3055
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
3056
|
+
if (props == null) props = {};
|
|
3057
|
+
let slot = slots[name];
|
|
3058
|
+
const vaporSlot = slot && slot[rawVaporSlotKey$2];
|
|
3059
|
+
if (vaporSlot) {
|
|
3060
|
+
const ret = (openBlock(), createBlock(VaporSlot$1, props));
|
|
3061
|
+
ret.vs = {
|
|
3062
|
+
slot: vaporSlot,
|
|
3063
|
+
outlets: fallback ? [{
|
|
3064
|
+
fallback,
|
|
3065
|
+
owner: currentRenderingInstance
|
|
3066
|
+
}] : void 0
|
|
3067
|
+
};
|
|
3068
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
3069
|
+
return ret;
|
|
3070
|
+
}
|
|
3071
|
+
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
3072
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
3073
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
3074
|
+
if (name !== "default") slotProps.name = name;
|
|
3075
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
3076
|
+
}
|
|
3077
|
+
if (slot && slot.length > 1) {
|
|
3078
|
+
warn$1("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.");
|
|
3079
|
+
slot = () => [];
|
|
3080
|
+
}
|
|
3081
|
+
if (slot && slot._c) slot._d = false;
|
|
3082
|
+
const prevStackSize = blockStack.length;
|
|
3083
|
+
openBlock();
|
|
3084
|
+
let rendered;
|
|
3085
|
+
try {
|
|
3086
|
+
const validSlotContent = slot && ensureValidVNode$1(slot(props));
|
|
3087
|
+
let attached = false;
|
|
3088
|
+
if (fallback && validSlotContent && currentRenderingInstance) {
|
|
3089
|
+
const interop = currentRenderingInstance.appContext.vapor;
|
|
3090
|
+
if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
|
|
3091
|
+
}
|
|
3092
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
3093
|
+
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
3094
|
+
if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
|
|
3095
|
+
if (attached) rendered.vo = true;
|
|
3096
|
+
} catch (err) {
|
|
3097
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
3098
|
+
throw err;
|
|
3099
|
+
} finally {
|
|
3100
|
+
if (slot && slot._c) slot._d = true;
|
|
3101
|
+
}
|
|
3102
|
+
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
3103
|
+
return rendered;
|
|
3104
|
+
}
|
|
2923
3105
|
function ensureValidVNode$1(vnodes) {
|
|
2924
3106
|
return vnodes.some((child) => {
|
|
2925
|
-
if (!isVNode$
|
|
3107
|
+
if (!isVNode$3(child)) return true;
|
|
2926
3108
|
if (child.type === Comment) return false;
|
|
2927
3109
|
if (child.type === Fragment && !ensureValidVNode$1(child.children)) return false;
|
|
2928
3110
|
return true;
|
|
@@ -2940,11 +3122,38 @@ const getPublicInstance = (i) => {
|
|
|
2940
3122
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
2941
3123
|
return getPublicInstance(i.parent);
|
|
2942
3124
|
};
|
|
3125
|
+
const resolveDevRootEl = (vnode) => {
|
|
3126
|
+
let found = false;
|
|
3127
|
+
while (true) {
|
|
3128
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
3129
|
+
const root = filterSingleRoot(vnode.children);
|
|
3130
|
+
if (!root) return;
|
|
3131
|
+
vnode = root;
|
|
3132
|
+
found = true;
|
|
3133
|
+
continue;
|
|
3134
|
+
}
|
|
3135
|
+
const component = vnode.component;
|
|
3136
|
+
if (component && component.subTree) {
|
|
3137
|
+
vnode = component.subTree;
|
|
3138
|
+
continue;
|
|
3139
|
+
}
|
|
3140
|
+
const suspense = vnode.suspense;
|
|
3141
|
+
if (suspense && suspense.activeBranch) {
|
|
3142
|
+
vnode = suspense.activeBranch;
|
|
3143
|
+
continue;
|
|
3144
|
+
}
|
|
3145
|
+
return found ? vnode.el : void 0;
|
|
3146
|
+
}
|
|
3147
|
+
};
|
|
3148
|
+
const getDevRootFragmentEl = (i) => {
|
|
3149
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
3150
|
+
return el === void 0 ? i.vnode.el : el;
|
|
3151
|
+
};
|
|
2943
3152
|
let publicPropertiesMap;
|
|
2944
3153
|
const getPublicPropertiesMap = () => {
|
|
2945
3154
|
if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
|
|
2946
3155
|
$: (i) => i,
|
|
2947
|
-
$el: (i) => i
|
|
3156
|
+
$el: (i) => getDevRootFragmentEl(i),
|
|
2948
3157
|
$data: (i) => i.data,
|
|
2949
3158
|
$props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
|
|
2950
3159
|
$attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
|
|
@@ -3161,11 +3370,12 @@ function applyOptions(instance) {
|
|
|
3161
3370
|
const opt = computedOptions[key];
|
|
3162
3371
|
const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
|
|
3163
3372
|
if (get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
|
|
3373
|
+
const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
|
|
3374
|
+
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3375
|
+
};
|
|
3164
3376
|
const c = computed({
|
|
3165
3377
|
get,
|
|
3166
|
-
set
|
|
3167
|
-
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3168
|
-
}
|
|
3378
|
+
set
|
|
3169
3379
|
});
|
|
3170
3380
|
Object.defineProperty(ctx, key, {
|
|
3171
3381
|
enumerable: true,
|
|
@@ -3222,9 +3432,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
|
|
|
3222
3432
|
for (const key in injectOptions) {
|
|
3223
3433
|
const opt = injectOptions[key];
|
|
3224
3434
|
let injected;
|
|
3225
|
-
if (isObject(opt))
|
|
3226
|
-
|
|
3227
|
-
|
|
3435
|
+
if (isObject(opt)) {
|
|
3436
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
3437
|
+
else injected = inject(opt.from || key);
|
|
3438
|
+
} else injected = inject(opt);
|
|
3228
3439
|
if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
|
|
3229
3440
|
enumerable: true,
|
|
3230
3441
|
configurable: true,
|
|
@@ -3245,13 +3456,14 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3245
3456
|
if (isFunction(handler)) watch(getter, handler);
|
|
3246
3457
|
else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
3247
3458
|
} else if (isFunction(raw)) watch(getter, raw.bind(publicThis));
|
|
3248
|
-
else if (isObject(raw))
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3459
|
+
else if (isObject(raw)) {
|
|
3460
|
+
if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
3461
|
+
else {
|
|
3462
|
+
const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
3463
|
+
if (isFunction(handler)) watch(getter, handler, raw);
|
|
3464
|
+
else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
3465
|
+
}
|
|
3466
|
+
} else warn$1(`Invalid watch option: "${key}"`, raw);
|
|
3255
3467
|
}
|
|
3256
3468
|
/**
|
|
3257
3469
|
* Resolve merged options and cache it on the component.
|
|
@@ -3337,7 +3549,7 @@ function mergeObjectOptions(to, from) {
|
|
|
3337
3549
|
}
|
|
3338
3550
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
3339
3551
|
if (to) {
|
|
3340
|
-
if (isArray(to) && isArray(from)) return [
|
|
3552
|
+
if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
3341
3553
|
return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
3342
3554
|
} else return from;
|
|
3343
3555
|
}
|
|
@@ -3456,8 +3668,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
3456
3668
|
} else warn$1(`Cannot unmount an app that is not mounted.`);
|
|
3457
3669
|
},
|
|
3458
3670
|
provide(key, value) {
|
|
3459
|
-
if (key in context.provides)
|
|
3460
|
-
|
|
3671
|
+
if (key in context.provides) {
|
|
3672
|
+
if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
|
|
3673
|
+
else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
|
|
3674
|
+
}
|
|
3461
3675
|
context.provides[key] = value;
|
|
3462
3676
|
return app;
|
|
3463
3677
|
},
|
|
@@ -3496,12 +3710,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3496
3710
|
if (instance.isUnmounted) return;
|
|
3497
3711
|
{
|
|
3498
3712
|
const { emitsOptions, propsOptions } = instance;
|
|
3499
|
-
if (emitsOptions)
|
|
3500
|
-
if (!
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
if (
|
|
3713
|
+
if (emitsOptions) {
|
|
3714
|
+
if (!(event in emitsOptions) && true) {
|
|
3715
|
+
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.`);
|
|
3716
|
+
} else {
|
|
3717
|
+
const validator = emitsOptions[event];
|
|
3718
|
+
if (isFunction(validator)) {
|
|
3719
|
+
if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
3720
|
+
}
|
|
3505
3721
|
}
|
|
3506
3722
|
}
|
|
3507
3723
|
}
|
|
@@ -3510,7 +3726,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
3510
3726
|
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
3511
3727
|
if (modifiers) {
|
|
3512
3728
|
if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
3513
|
-
if (modifiers.number) args =
|
|
3729
|
+
if (modifiers.number) args = args.map(looseToNumber);
|
|
3514
3730
|
}
|
|
3515
3731
|
devtoolsComponentEmit(instance, event, args);
|
|
3516
3732
|
{
|
|
@@ -3637,8 +3853,9 @@ function renderComponentRoot$1(instance) {
|
|
|
3637
3853
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
3638
3854
|
}
|
|
3639
3855
|
if (vnode.transition) {
|
|
3640
|
-
|
|
3641
|
-
|
|
3856
|
+
const child = isTeleport(root.type) ? getInnerChild(root) || root : root;
|
|
3857
|
+
if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
3858
|
+
setTransitionHooks(child, vnode.transition);
|
|
3642
3859
|
}
|
|
3643
3860
|
if (setRoot) setRoot(root);
|
|
3644
3861
|
else result = root;
|
|
@@ -3688,19 +3905,22 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
3688
3905
|
let singleRoot;
|
|
3689
3906
|
for (let i = 0; i < children.length; i++) {
|
|
3690
3907
|
const child = children[i];
|
|
3691
|
-
if (isVNode$
|
|
3692
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3908
|
+
if (isVNode$3(child)) {
|
|
3909
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
3910
|
+
if (singleRoot) return;
|
|
3911
|
+
else {
|
|
3912
|
+
singleRoot = child;
|
|
3913
|
+
if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
3914
|
+
}
|
|
3696
3915
|
}
|
|
3697
3916
|
} else return;
|
|
3698
3917
|
}
|
|
3699
3918
|
return singleRoot;
|
|
3700
3919
|
}
|
|
3920
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
|
|
3701
3921
|
const getFunctionalFallthrough = (attrs) => {
|
|
3702
3922
|
let res;
|
|
3703
|
-
for (const key in attrs) if (
|
|
3923
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
3704
3924
|
return res;
|
|
3705
3925
|
};
|
|
3706
3926
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -3812,16 +4032,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3812
4032
|
let key = propsToUpdate[i];
|
|
3813
4033
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
3814
4034
|
const value = rawProps[key];
|
|
3815
|
-
if (options)
|
|
3816
|
-
if (
|
|
3817
|
-
attrs[key]
|
|
3818
|
-
|
|
4035
|
+
if (options) {
|
|
4036
|
+
if (hasOwn(attrs, key)) {
|
|
4037
|
+
if (value !== attrs[key]) {
|
|
4038
|
+
attrs[key] = value;
|
|
4039
|
+
hasAttrsChanged = true;
|
|
4040
|
+
}
|
|
4041
|
+
} else {
|
|
4042
|
+
const camelizedKey = camelize(key);
|
|
4043
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3819
4044
|
}
|
|
3820
|
-
} else {
|
|
3821
|
-
const camelizedKey = camelize(key);
|
|
3822
|
-
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3823
|
-
}
|
|
3824
|
-
else if (value !== attrs[key]) {
|
|
4045
|
+
} else if (value !== attrs[key]) {
|
|
3825
4046
|
attrs[key] = value;
|
|
3826
4047
|
hasAttrsChanged = true;
|
|
3827
4048
|
}
|
|
@@ -3830,9 +4051,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3830
4051
|
} else {
|
|
3831
4052
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
3832
4053
|
let kebabKey;
|
|
3833
|
-
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))
|
|
3834
|
-
if (
|
|
3835
|
-
|
|
4054
|
+
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
|
|
4055
|
+
if (options) {
|
|
4056
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
4057
|
+
} else delete props[key];
|
|
4058
|
+
}
|
|
3836
4059
|
if (attrs !== rawCurrentProps) {
|
|
3837
4060
|
for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && true) {
|
|
3838
4061
|
delete attrs[key];
|
|
@@ -3851,9 +4074,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3851
4074
|
if (isReservedProp(key)) continue;
|
|
3852
4075
|
const value = rawProps[key];
|
|
3853
4076
|
let camelKey;
|
|
3854
|
-
if (options && hasOwn(options, camelKey = camelize(key)))
|
|
3855
|
-
|
|
3856
|
-
|
|
4077
|
+
if (options && hasOwn(options, camelKey = camelize(key))) {
|
|
4078
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
4079
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
4080
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3857
4081
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
3858
4082
|
attrs[key] = value;
|
|
3859
4083
|
hasAttrsChanged = true;
|
|
@@ -3900,7 +4124,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
3900
4124
|
const prev = setCurrentInstance(instance);
|
|
3901
4125
|
const props = /* @__PURE__ */ toRaw(instance.props);
|
|
3902
4126
|
value = factory.call(null, props);
|
|
3903
|
-
|
|
4127
|
+
restoreCurrentInstance(prev);
|
|
3904
4128
|
return value;
|
|
3905
4129
|
}
|
|
3906
4130
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -4016,7 +4240,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
|
|
|
4016
4240
|
}
|
|
4017
4241
|
if (validator && !validator(value, /* @__PURE__ */ shallowReadonly(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
|
|
4018
4242
|
}
|
|
4019
|
-
const isSimpleType =
|
|
4243
|
+
const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
|
|
4020
4244
|
/**
|
|
4021
4245
|
* dev only
|
|
4022
4246
|
*/
|
|
@@ -4129,12 +4353,13 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4129
4353
|
let deletionComparisonTarget = EMPTY_OBJ;
|
|
4130
4354
|
if (vnode.shapeFlag & 32) {
|
|
4131
4355
|
const type = children._;
|
|
4132
|
-
if (type)
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4356
|
+
if (type) {
|
|
4357
|
+
if (isHmrUpdating) {
|
|
4358
|
+
assignSlots(slots, children, optimized);
|
|
4359
|
+
trigger(instance, "set", "$slots");
|
|
4360
|
+
} else if (optimized && type === 1) needDeletionCheck = false;
|
|
4361
|
+
else assignSlots(slots, children, optimized);
|
|
4362
|
+
} else {
|
|
4138
4363
|
needDeletionCheck = !children.$stable;
|
|
4139
4364
|
normalizeObjectSlots(children, slots, instance);
|
|
4140
4365
|
}
|
|
@@ -4152,7 +4377,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4152
4377
|
let supported;
|
|
4153
4378
|
let perf;
|
|
4154
4379
|
let cachedNow$1 = 0;
|
|
4155
|
-
const p$1 =
|
|
4380
|
+
const p$1 = /*@__PURE__*/ Promise.resolve();
|
|
4156
4381
|
const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
|
|
4157
4382
|
/**
|
|
4158
4383
|
* @internal
|
|
@@ -4222,6 +4447,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4222
4447
|
optimized = false;
|
|
4223
4448
|
n2.dynamicChildren = null;
|
|
4224
4449
|
}
|
|
4450
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
4451
|
+
if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
|
|
4452
|
+
n2.dynamicChildren.hasOnce = true;
|
|
4453
|
+
}
|
|
4225
4454
|
const { type, ref, shapeFlag } = n2;
|
|
4226
4455
|
switch (type) {
|
|
4227
4456
|
case Text:
|
|
@@ -4237,8 +4466,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4237
4466
|
case Fragment:
|
|
4238
4467
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4239
4468
|
break;
|
|
4240
|
-
case VaporSlot:
|
|
4241
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
4469
|
+
case VaporSlot$1:
|
|
4470
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
4242
4471
|
break;
|
|
4243
4472
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4244
4473
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -4357,7 +4586,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4357
4586
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
4358
4587
|
};
|
|
4359
4588
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
4360
|
-
for (let i = start; i < children.length; i++)
|
|
4589
|
+
for (let i = start; i < children.length; i++) {
|
|
4590
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode$1(children[i]);
|
|
4591
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4592
|
+
}
|
|
4361
4593
|
};
|
|
4362
4594
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4363
4595
|
const el = n2.el = n1.el;
|
|
@@ -4369,6 +4601,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4369
4601
|
let vnodeHook;
|
|
4370
4602
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
4371
4603
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4604
|
+
if (n2.ibu) n2.ibu();
|
|
4372
4605
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4373
4606
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
4374
4607
|
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -4402,8 +4635,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4402
4635
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
4403
4636
|
}
|
|
4404
4637
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
4405
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
4638
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
4406
4639
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4640
|
+
n2.iu && n2.iu();
|
|
4407
4641
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4408
4642
|
}, void 0, parentSuspense);
|
|
4409
4643
|
};
|
|
@@ -4411,7 +4645,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4411
4645
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4412
4646
|
const oldVNode = oldChildren[i];
|
|
4413
4647
|
const newVNode = newChildren[i];
|
|
4414
|
-
|
|
4648
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
4649
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4415
4650
|
}
|
|
4416
4651
|
};
|
|
4417
4652
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -4449,41 +4684,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4449
4684
|
};
|
|
4450
4685
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4451
4686
|
n2.slotScopeIds = slotScopeIds;
|
|
4452
|
-
if (n2.type.__vapor)
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
4462
|
-
});
|
|
4463
|
-
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
4464
|
-
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
4465
|
-
if (vnodeMountedHook) {
|
|
4466
|
-
const scopedVNode = n2;
|
|
4467
|
-
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
4468
|
-
}
|
|
4469
|
-
}
|
|
4470
|
-
else {
|
|
4471
|
-
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
4472
|
-
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
4473
|
-
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4474
|
-
}, () => {
|
|
4475
|
-
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
4476
|
-
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
4477
|
-
});
|
|
4478
|
-
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
4479
|
-
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
4480
|
-
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4481
|
-
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
4482
|
-
}, void 0, parentSuspense);
|
|
4483
|
-
}
|
|
4484
|
-
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
4485
|
-
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
4486
|
-
else updateComponent(n1, n2, optimized);
|
|
4687
|
+
if (n2.type.__vapor) {
|
|
4688
|
+
if (n1 == null) {
|
|
4689
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
4690
|
+
else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
|
|
4691
|
+
} else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
|
|
4692
|
+
} else if (n1 == null) {
|
|
4693
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
4694
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
4695
|
+
} else updateComponent(n1, n2, optimized);
|
|
4487
4696
|
};
|
|
4488
4697
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
4489
4698
|
const instance = initialVNode.component = createComponentInstance$1(initialVNode, parentComponent, parentSuspense);
|
|
@@ -4524,16 +4733,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4524
4733
|
};
|
|
4525
4734
|
const updateComponent = (n1, n2, optimized) => {
|
|
4526
4735
|
const instance = n2.component = n1.component;
|
|
4527
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4736
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
4737
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4738
|
+
pushWarningContext$1(n2);
|
|
4739
|
+
n2.el = n1.el;
|
|
4740
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
4741
|
+
popWarningContext$1();
|
|
4742
|
+
return;
|
|
4743
|
+
} else {
|
|
4744
|
+
instance.next = n2;
|
|
4745
|
+
instance.effect.run();
|
|
4746
|
+
}
|
|
4532
4747
|
} else {
|
|
4533
|
-
instance.next = n2;
|
|
4534
|
-
instance.effect.run();
|
|
4535
|
-
}
|
|
4536
|
-
else {
|
|
4537
4748
|
n2.el = n1.el;
|
|
4538
4749
|
instance.vnode = n2;
|
|
4539
4750
|
}
|
|
@@ -4631,6 +4842,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4631
4842
|
} else next = vnode;
|
|
4632
4843
|
if (bu) invokeArrayFns(bu);
|
|
4633
4844
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4845
|
+
if (next.ibu) next.ibu();
|
|
4634
4846
|
toggleRecurse(instance, true);
|
|
4635
4847
|
startMeasure(instance, `render`);
|
|
4636
4848
|
const nextTree = renderComponentRoot$1(instance);
|
|
@@ -4643,7 +4855,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4643
4855
|
next.el = nextTree.el;
|
|
4644
4856
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
4645
4857
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
4646
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
4858
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
4859
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4860
|
+
next.iu && next.iu();
|
|
4861
|
+
}, void 0, parentSuspense);
|
|
4647
4862
|
devtoolsComponentUpdated(instance);
|
|
4648
4863
|
popWarningContext$1();
|
|
4649
4864
|
}
|
|
@@ -4683,9 +4898,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4683
4898
|
if (shapeFlag & 8) {
|
|
4684
4899
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
4685
4900
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
4686
|
-
} else if (prevShapeFlag & 16)
|
|
4687
|
-
|
|
4688
|
-
|
|
4901
|
+
} else if (prevShapeFlag & 16) {
|
|
4902
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4903
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
4904
|
+
} else {
|
|
4689
4905
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
4690
4906
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4691
4907
|
}
|
|
@@ -4784,15 +5000,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4784
5000
|
const anchorVNode = c2[nextIndex + 1];
|
|
4785
5001
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
4786
5002
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4787
|
-
else if (moved)
|
|
4788
|
-
|
|
5003
|
+
else if (moved) {
|
|
5004
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
5005
|
+
else j--;
|
|
5006
|
+
}
|
|
4789
5007
|
}
|
|
4790
5008
|
}
|
|
4791
5009
|
};
|
|
4792
5010
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
4793
5011
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
4794
|
-
if (isVaporComponent(type) || type === VaporSlot) {
|
|
4795
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
5012
|
+
if (isVaporComponent(type) || type === VaporSlot$1) {
|
|
5013
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
4796
5014
|
return;
|
|
4797
5015
|
}
|
|
4798
5016
|
if (shapeFlag & 6) {
|
|
@@ -4817,54 +5035,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4817
5035
|
moveStaticNode(vnode, container, anchor);
|
|
4818
5036
|
return;
|
|
4819
5037
|
}
|
|
4820
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
const remove = () => {
|
|
5038
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
5039
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
5040
|
+
else performTransitionLeave(el, transition, () => {
|
|
4824
5041
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
4825
5042
|
else hostInsert(el, container, anchor);
|
|
4826
|
-
};
|
|
4827
|
-
|
|
4828
|
-
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
4829
|
-
if (el._isLeaving) el[leaveCbKey](true);
|
|
4830
|
-
if (transition.persisted && !wasLeaving) remove();
|
|
4831
|
-
else leave(el, () => {
|
|
4832
|
-
remove();
|
|
4833
|
-
afterLeave && afterLeave();
|
|
4834
|
-
});
|
|
4835
|
-
};
|
|
4836
|
-
if (delayLeave) delayLeave(el, remove, performLeave);
|
|
4837
|
-
else performLeave();
|
|
4838
|
-
}
|
|
4839
|
-
else hostInsert(el, container, anchor);
|
|
5043
|
+
}, true, true);
|
|
5044
|
+
} else hostInsert(el, container, anchor);
|
|
4840
5045
|
};
|
|
4841
5046
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
4842
5047
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
4843
|
-
if (patchFlag === -2) optimized = false;
|
|
5048
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
4844
5049
|
if (ref != null) {
|
|
4845
5050
|
const prevSub = setActiveSub();
|
|
4846
5051
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
4847
5052
|
setActiveSub(prevSub);
|
|
4848
5053
|
}
|
|
4849
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
5054
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
4850
5055
|
if (shapeFlag & 256) {
|
|
4851
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
5056
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
4852
5057
|
else parentComponent.ctx.deactivate(vnode);
|
|
4853
5058
|
return;
|
|
4854
5059
|
}
|
|
5060
|
+
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
5061
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
5062
|
+
return;
|
|
5063
|
+
}
|
|
4855
5064
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
4856
5065
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
4857
5066
|
let vnodeHook;
|
|
4858
5067
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
4859
|
-
if (shapeFlag & 6)
|
|
4860
|
-
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
4861
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
4862
|
-
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
4863
|
-
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
4864
|
-
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
4865
|
-
}, void 0, parentSuspense);
|
|
4866
|
-
return;
|
|
4867
|
-
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
5068
|
+
if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
4868
5069
|
else {
|
|
4869
5070
|
if (shapeFlag & 128) {
|
|
4870
5071
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -4874,8 +5075,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4874
5075
|
if (shapeFlag & 64) vnode.type.remove(vnode, parentComponent, parentSuspense, internals, doRemove);
|
|
4875
5076
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
4876
5077
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
4877
|
-
if (type === VaporSlot) {
|
|
4878
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
5078
|
+
if (type === VaporSlot$1) {
|
|
5079
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
4879
5080
|
return;
|
|
4880
5081
|
}
|
|
4881
5082
|
if (doRemove) remove(vnode);
|
|
@@ -4899,6 +5100,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4899
5100
|
}
|
|
4900
5101
|
if (type === Static) {
|
|
4901
5102
|
removeStaticNode(vnode);
|
|
5103
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
4902
5104
|
return;
|
|
4903
5105
|
}
|
|
4904
5106
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -4923,7 +5125,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4923
5125
|
if (effect) {
|
|
4924
5126
|
effect.stop();
|
|
4925
5127
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
4926
|
-
} else if (
|
|
5128
|
+
} else if (instance.vnode.el && subTree) {
|
|
5129
|
+
subTree.transition = instance.vnode.transition;
|
|
5130
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5131
|
+
}
|
|
4927
5132
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
4928
5133
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
4929
5134
|
devtoolsComponentRemoved(instance);
|
|
@@ -4997,12 +5202,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
4997
5202
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
4998
5203
|
}
|
|
4999
5204
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
5000
|
-
if (!vapor)
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5205
|
+
if (!vapor) {
|
|
5206
|
+
if (allowed) {
|
|
5207
|
+
effect.flags |= 128;
|
|
5208
|
+
job.flags |= 2;
|
|
5209
|
+
} else {
|
|
5210
|
+
effect.flags &= -129;
|
|
5211
|
+
job.flags &= -3;
|
|
5212
|
+
}
|
|
5006
5213
|
}
|
|
5007
5214
|
}
|
|
5008
5215
|
function needTransition(parentSuspense, transition) {
|
|
@@ -5042,8 +5249,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
5042
5249
|
}
|
|
5043
5250
|
function locateNonHydratedAsyncRoot(instance) {
|
|
5044
5251
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
5045
|
-
if (subComponent)
|
|
5046
|
-
|
|
5252
|
+
if (subComponent) {
|
|
5253
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
5254
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
5255
|
+
}
|
|
5047
5256
|
}
|
|
5048
5257
|
function invalidateMount(hooks) {
|
|
5049
5258
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
@@ -5062,13 +5271,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
5062
5271
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
5063
5272
|
const performRemove = () => {
|
|
5064
5273
|
remove();
|
|
5065
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5274
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
5066
5275
|
};
|
|
5067
5276
|
if (force || isElement && transition && !transition.persisted) {
|
|
5068
5277
|
const { leave, delayLeave } = transition;
|
|
5069
5278
|
const performLeave = () => {
|
|
5279
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
5070
5280
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
5071
|
-
|
|
5281
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
5282
|
+
else leave(el, performRemove);
|
|
5072
5283
|
};
|
|
5073
5284
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
5074
5285
|
else performLeave();
|
|
@@ -5087,7 +5298,7 @@ function isVaporComponent(type) {
|
|
|
5087
5298
|
/**
|
|
5088
5299
|
* shared between vdom and vapor
|
|
5089
5300
|
*/
|
|
5090
|
-
function getInheritedScopeIds(vnode, parentComponent) {
|
|
5301
|
+
function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
|
|
5091
5302
|
const inheritedScopeIds = [];
|
|
5092
5303
|
let currentParent = parentComponent;
|
|
5093
5304
|
let currentVNode = vnode;
|
|
@@ -5103,6 +5314,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
5103
5314
|
currentParent = currentParent.parent;
|
|
5104
5315
|
} else break;
|
|
5105
5316
|
}
|
|
5317
|
+
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
5318
|
+
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
5106
5319
|
return inheritedScopeIds;
|
|
5107
5320
|
}
|
|
5108
5321
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
@@ -5115,9 +5328,10 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
|
5115
5328
|
//#region packages/runtime-core/src/components/Suspense.ts
|
|
5116
5329
|
const isSuspense = (type) => type.__isSuspense;
|
|
5117
5330
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
5118
|
-
if (suspense && suspense.pendingBranch)
|
|
5119
|
-
|
|
5120
|
-
|
|
5331
|
+
if (suspense && suspense.pendingBranch) {
|
|
5332
|
+
if (isArray(fn)) suspense.effects.push(...fn);
|
|
5333
|
+
else suspense.effects.push(fn);
|
|
5334
|
+
} else queuePostFlushCb(fn, id);
|
|
5121
5335
|
}
|
|
5122
5336
|
//#endregion
|
|
5123
5337
|
//#region packages/runtime-core/src/vnode.ts
|
|
@@ -5125,9 +5339,28 @@ const Fragment = Symbol.for("v-fgt");
|
|
|
5125
5339
|
const Text = Symbol.for("v-txt");
|
|
5126
5340
|
const Comment = Symbol.for("v-cmt");
|
|
5127
5341
|
const Static = Symbol.for("v-stc");
|
|
5128
|
-
const VaporSlot = Symbol.for("v-vps");
|
|
5342
|
+
const VaporSlot$1 = Symbol.for("v-vps");
|
|
5129
5343
|
const blockStack = [];
|
|
5130
5344
|
let currentBlock = null;
|
|
5345
|
+
/**
|
|
5346
|
+
* Open a block.
|
|
5347
|
+
* This must be called before `createBlock`. It cannot be part of `createBlock`
|
|
5348
|
+
* because the children of the block are evaluated before `createBlock` itself
|
|
5349
|
+
* is called. The generated code typically looks like this:
|
|
5350
|
+
*
|
|
5351
|
+
* ```js
|
|
5352
|
+
* function render() {
|
|
5353
|
+
* return (openBlock(),createBlock('div', null, [...]))
|
|
5354
|
+
* }
|
|
5355
|
+
* ```
|
|
5356
|
+
* disableTracking is true when creating a v-for fragment block, since a v-for
|
|
5357
|
+
* fragment always diffs its children.
|
|
5358
|
+
*
|
|
5359
|
+
* @private
|
|
5360
|
+
*/
|
|
5361
|
+
function openBlock(disableTracking = false) {
|
|
5362
|
+
blockStack.push(currentBlock = disableTracking ? null : []);
|
|
5363
|
+
}
|
|
5131
5364
|
function closeBlock() {
|
|
5132
5365
|
blockStack.pop();
|
|
5133
5366
|
currentBlock = blockStack[blockStack.length - 1] || null;
|
|
@@ -5153,7 +5386,23 @@ function setBlockTracking(value, inVOnce = false) {
|
|
|
5153
5386
|
isBlockTreeEnabled += value;
|
|
5154
5387
|
if (value < 0 && currentBlock && inVOnce) currentBlock.hasOnce = true;
|
|
5155
5388
|
}
|
|
5156
|
-
function
|
|
5389
|
+
function setupBlock(vnode) {
|
|
5390
|
+
vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
|
|
5391
|
+
closeBlock();
|
|
5392
|
+
if (isBlockTreeEnabled > 0 && currentBlock) currentBlock.push(vnode);
|
|
5393
|
+
return vnode;
|
|
5394
|
+
}
|
|
5395
|
+
/**
|
|
5396
|
+
* Create a block root vnode. Takes the same exact arguments as `createVNode`.
|
|
5397
|
+
* A block root keeps track of dynamic nodes within the block in the
|
|
5398
|
+
* `dynamicChildren` array.
|
|
5399
|
+
*
|
|
5400
|
+
* @private
|
|
5401
|
+
*/
|
|
5402
|
+
function createBlock(type, props, children, patchFlag, dynamicProps) {
|
|
5403
|
+
return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true));
|
|
5404
|
+
}
|
|
5405
|
+
function isVNode$3(value) {
|
|
5157
5406
|
return value ? value.__v_isVNode === true : false;
|
|
5158
5407
|
}
|
|
5159
5408
|
function isSameVNodeType(n1, n2) {
|
|
@@ -5215,20 +5464,37 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
5215
5464
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
5216
5465
|
} else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
5217
5466
|
if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
5467
|
+
if (props && vnode.shapeFlag & 1) {
|
|
5468
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
5469
|
+
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.`);
|
|
5470
|
+
}
|
|
5218
5471
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
5219
5472
|
return vnode;
|
|
5220
5473
|
}
|
|
5474
|
+
/**
|
|
5475
|
+
* dev only
|
|
5476
|
+
* Whether children would actually render something. Empty text and empty
|
|
5477
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
5478
|
+
* for `v-html` / `v-text`.
|
|
5479
|
+
*/
|
|
5480
|
+
function hasContentChildren(children) {
|
|
5481
|
+
if (isString(children)) return children !== "";
|
|
5482
|
+
if (isArray(children)) return children.length > 0;
|
|
5483
|
+
return false;
|
|
5484
|
+
}
|
|
5221
5485
|
const createVNode = createVNodeWithArgsTransform;
|
|
5222
5486
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
5223
5487
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
5224
5488
|
if (!type) warn$1(`Invalid vnode type when creating vnode: ${type}.`);
|
|
5225
5489
|
type = Comment;
|
|
5226
5490
|
}
|
|
5227
|
-
if (isVNode$
|
|
5491
|
+
if (isVNode$3(type)) {
|
|
5228
5492
|
const cloned = cloneVNode(type, props, true);
|
|
5229
5493
|
if (children) normalizeChildren(cloned, children);
|
|
5230
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
5231
|
-
|
|
5494
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
5495
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
5496
|
+
else currentBlock.push(cloned);
|
|
5497
|
+
}
|
|
5232
5498
|
cloned.patchFlag = -2;
|
|
5233
5499
|
return cloned;
|
|
5234
5500
|
}
|
|
@@ -5288,7 +5554,10 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5288
5554
|
ce: vnode.ce,
|
|
5289
5555
|
vi: vnode.vi,
|
|
5290
5556
|
vs: cloneVaporSlotMeta(vnode),
|
|
5291
|
-
vb: vnode.vb
|
|
5557
|
+
vb: vnode.vb,
|
|
5558
|
+
ibu: vnode.ibu,
|
|
5559
|
+
iu: vnode.iu,
|
|
5560
|
+
cacheIndex: vnode.cacheIndex
|
|
5292
5561
|
};
|
|
5293
5562
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5294
5563
|
return cloned;
|
|
@@ -5298,8 +5567,7 @@ function cloneVaporSlotMeta(vnode) {
|
|
|
5298
5567
|
if (!vaporSlot) return vaporSlot;
|
|
5299
5568
|
const cloned = {
|
|
5300
5569
|
slot: vaporSlot.slot,
|
|
5301
|
-
|
|
5302
|
-
outletFallback: vaporSlot.outletFallback
|
|
5570
|
+
outlets: vaporSlot.outlets
|
|
5303
5571
|
};
|
|
5304
5572
|
if (vnode.el) {
|
|
5305
5573
|
cloned.state = vaporSlot.state;
|
|
@@ -5326,7 +5594,7 @@ function createTextVNode(text = " ", flag = 0) {
|
|
|
5326
5594
|
function normalizeVNode$1(child) {
|
|
5327
5595
|
if (child == null || typeof child === "boolean") return createVNode(Comment);
|
|
5328
5596
|
else if (isArray(child)) return createVNode(Fragment, null, child.slice());
|
|
5329
|
-
else if (isVNode$
|
|
5597
|
+
else if (isVNode$3(child)) return cloneIfMounted(child);
|
|
5330
5598
|
else return createVNode(Text, null, String(child));
|
|
5331
5599
|
}
|
|
5332
5600
|
function cloneIfMounted(child) {
|
|
@@ -5337,25 +5605,28 @@ function normalizeChildren(vnode, children) {
|
|
|
5337
5605
|
const { shapeFlag } = vnode;
|
|
5338
5606
|
if (children == null) children = null;
|
|
5339
5607
|
else if (isArray(children)) type = 16;
|
|
5340
|
-
else if (typeof children === "object")
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5608
|
+
else if (typeof children === "object") {
|
|
5609
|
+
if (shapeFlag & 65) {
|
|
5610
|
+
const slot = children.default;
|
|
5611
|
+
if (slot) {
|
|
5612
|
+
slot._c && (slot._d = false);
|
|
5613
|
+
normalizeChildren(vnode, slot());
|
|
5614
|
+
slot._c && (slot._d = true);
|
|
5615
|
+
}
|
|
5616
|
+
return;
|
|
5617
|
+
} else {
|
|
5618
|
+
type = 32;
|
|
5619
|
+
const slotFlag = children._;
|
|
5620
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
5621
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
5622
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
5623
|
+
else {
|
|
5624
|
+
children._ = 2;
|
|
5625
|
+
vnode.patchFlag |= 1024;
|
|
5626
|
+
}
|
|
5627
|
+
}
|
|
5356
5628
|
}
|
|
5357
|
-
}
|
|
5358
|
-
else if (isFunction(children)) {
|
|
5629
|
+
} else if (isFunction(children)) {
|
|
5359
5630
|
if (shapeFlag & 65) {
|
|
5360
5631
|
normalizeChildren(vnode, { default: children });
|
|
5361
5632
|
return;
|
|
@@ -5404,6 +5675,7 @@ let currentInstance = null;
|
|
|
5404
5675
|
* @internal
|
|
5405
5676
|
*/
|
|
5406
5677
|
const getCurrentGenericInstance = () => currentInstance || currentRenderingInstance;
|
|
5678
|
+
const getCurrentInstance = () => currentInstance && !currentInstance.vapor ? currentInstance : currentRenderingInstance;
|
|
5407
5679
|
let isInSSRComponentSetup = false;
|
|
5408
5680
|
let setInSSRSetupState;
|
|
5409
5681
|
/**
|
|
@@ -5431,9 +5703,19 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
5431
5703
|
simpleSetCurrentInstance(instance);
|
|
5432
5704
|
}
|
|
5433
5705
|
};
|
|
5706
|
+
/**
|
|
5707
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
5708
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
5709
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
5710
|
+
* @internal
|
|
5711
|
+
*/
|
|
5712
|
+
const restoreCurrentInstance = (prev) => {
|
|
5713
|
+
setCurrentScope(prev[1]);
|
|
5714
|
+
simpleSetCurrentInstance(prev[0]);
|
|
5715
|
+
};
|
|
5434
5716
|
//#endregion
|
|
5435
5717
|
//#region packages/runtime-core/src/component.ts
|
|
5436
|
-
const emptyAppContext =
|
|
5718
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
5437
5719
|
let uid = 0;
|
|
5438
5720
|
function createComponentInstance$1(vnode, parent, suspense) {
|
|
5439
5721
|
const type = vnode.type;
|
|
@@ -5553,7 +5835,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5553
5835
|
const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
|
|
5554
5836
|
const isAsyncSetup = isPromise(setupResult);
|
|
5555
5837
|
setActiveSub(prevSub);
|
|
5556
|
-
|
|
5838
|
+
restoreCurrentInstance(prev);
|
|
5557
5839
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
5558
5840
|
if (isAsyncSetup) {
|
|
5559
5841
|
const unsetCurrentInstance = () => {
|
|
@@ -5561,7 +5843,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5561
5843
|
};
|
|
5562
5844
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
5563
5845
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
5564
|
-
|
|
5846
|
+
setInSSRSetupState(true);
|
|
5847
|
+
try {
|
|
5848
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
5849
|
+
} finally {
|
|
5850
|
+
setInSSRSetupState(false);
|
|
5851
|
+
}
|
|
5565
5852
|
}).catch((e) => {
|
|
5566
5853
|
handleError(e, instance, 0);
|
|
5567
5854
|
});
|
|
@@ -5573,10 +5860,11 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5573
5860
|
} else finishComponentSetup(instance, isSSR);
|
|
5574
5861
|
}
|
|
5575
5862
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
5576
|
-
if (isFunction(setupResult))
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5863
|
+
if (isFunction(setupResult)) {
|
|
5864
|
+
if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
|
|
5865
|
+
else instance.render = setupResult;
|
|
5866
|
+
} else if (isObject(setupResult)) {
|
|
5867
|
+
if (isVNode$3(setupResult)) warn$1("setup() should not return VNodes directly - return a render function instead.");
|
|
5580
5868
|
instance.devtoolsRawSetupState = setupResult;
|
|
5581
5869
|
instance.setupState = proxyRefs(setupResult);
|
|
5582
5870
|
exposeSetupStateOnRenderContext(instance);
|
|
@@ -5594,13 +5882,15 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
5594
5882
|
applyOptions(instance);
|
|
5595
5883
|
} finally {
|
|
5596
5884
|
setActiveSub(prevSub);
|
|
5597
|
-
|
|
5885
|
+
restoreCurrentInstance(prevInstance);
|
|
5598
5886
|
}
|
|
5599
5887
|
}
|
|
5600
|
-
if (!Component.render && instance.render === NOOP && !isSSR)
|
|
5888
|
+
if (!Component.render && instance.render === NOOP && !isSSR) {
|
|
5889
|
+
if (Component.template)
|
|
5601
5890
|
/* v8 ignore start */
|
|
5602
|
-
|
|
5603
|
-
|
|
5891
|
+
warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
|
|
5892
|
+
else warn$1(`Component is missing template or render function: `, Component);
|
|
5893
|
+
}
|
|
5604
5894
|
}
|
|
5605
5895
|
const attrsProxyHandlers = {
|
|
5606
5896
|
get(target, key) {
|
|
@@ -5663,14 +5953,13 @@ function getComponentPublicInstance(instance) {
|
|
|
5663
5953
|
if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
5664
5954
|
get(target, key) {
|
|
5665
5955
|
if (key in target) return target[key];
|
|
5666
|
-
else {
|
|
5956
|
+
else if (!instance.vapor) {
|
|
5667
5957
|
const publicPropertiesMap = getPublicPropertiesMap();
|
|
5668
5958
|
if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
|
|
5669
5959
|
}
|
|
5670
5960
|
},
|
|
5671
5961
|
has(target, key) {
|
|
5672
|
-
|
|
5673
|
-
return key in target || key in publicPropertiesMap;
|
|
5962
|
+
return key in target || !instance.vapor && key in getPublicPropertiesMap();
|
|
5674
5963
|
}
|
|
5675
5964
|
}));
|
|
5676
5965
|
else return instance.proxy;
|
|
@@ -5704,7 +5993,7 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
5704
5993
|
};
|
|
5705
5994
|
//#endregion
|
|
5706
5995
|
//#region packages/runtime-core/src/index.ts
|
|
5707
|
-
const version = "3.6.0-rc.
|
|
5996
|
+
const version = "3.6.0-rc.11";
|
|
5708
5997
|
const warn = warn$1;
|
|
5709
5998
|
/**
|
|
5710
5999
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
@@ -5715,19 +6004,22 @@ const ssrUtils = {
|
|
|
5715
6004
|
setupComponent: setupComponent$1,
|
|
5716
6005
|
renderComponentRoot: renderComponentRoot$1,
|
|
5717
6006
|
setCurrentRenderingInstance: setCurrentRenderingInstance$1,
|
|
5718
|
-
isVNode: isVNode$
|
|
6007
|
+
isVNode: isVNode$3,
|
|
5719
6008
|
normalizeVNode: normalizeVNode$1,
|
|
5720
6009
|
getComponentPublicInstance,
|
|
5721
6010
|
ensureValidVNode: ensureValidVNode$1,
|
|
5722
6011
|
pushWarningContext: pushWarningContext$1,
|
|
5723
|
-
popWarningContext: popWarningContext$1
|
|
6012
|
+
popWarningContext: popWarningContext$1,
|
|
6013
|
+
VaporSlot: VaporSlot$1,
|
|
6014
|
+
rawVaporSlotKey: rawVaporSlotKey$2,
|
|
6015
|
+
invokeSlotFallback: invokeSlotFallback$1
|
|
5724
6016
|
};
|
|
5725
6017
|
//#endregion
|
|
5726
6018
|
//#region packages/runtime-dom/src/nodeOps.ts
|
|
5727
6019
|
let policy = void 0;
|
|
5728
6020
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
5729
6021
|
if (tt) try {
|
|
5730
|
-
policy =
|
|
6022
|
+
policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
|
|
5731
6023
|
} catch (e) {
|
|
5732
6024
|
warn(`Error creating trusted types policy: ${e}`);
|
|
5733
6025
|
}
|
|
@@ -5735,7 +6027,7 @@ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) =>
|
|
|
5735
6027
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
5736
6028
|
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
5737
6029
|
const doc = typeof document !== "undefined" ? document : null;
|
|
5738
|
-
const templateContainer = doc &&
|
|
6030
|
+
const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
|
|
5739
6031
|
const nodeOps = {
|
|
5740
6032
|
insert: (child, parent, anchor) => {
|
|
5741
6033
|
parent.insertBefore(child, anchor || null);
|
|
@@ -5810,14 +6102,15 @@ const vShow = {
|
|
|
5810
6102
|
},
|
|
5811
6103
|
updated(el, { value, oldValue }, { transition }) {
|
|
5812
6104
|
if (!value === !oldValue) return;
|
|
5813
|
-
if (transition)
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
6105
|
+
if (transition) {
|
|
6106
|
+
if (value) {
|
|
6107
|
+
transition.beforeEnter(el);
|
|
6108
|
+
setDisplay(el, true);
|
|
6109
|
+
transition.enter(el);
|
|
6110
|
+
} else transition.leave(el, () => {
|
|
6111
|
+
setDisplay(el, false);
|
|
6112
|
+
});
|
|
6113
|
+
} else setDisplay(el, value);
|
|
5821
6114
|
},
|
|
5822
6115
|
beforeUnmount(el, { value }) {
|
|
5823
6116
|
setDisplay(el, value);
|
|
@@ -5843,11 +6136,13 @@ function patchStyle(el, prev, next) {
|
|
|
5843
6136
|
const isCssString = isString(next);
|
|
5844
6137
|
let hasControlledDisplay = false;
|
|
5845
6138
|
if (next && !isCssString) {
|
|
5846
|
-
if (prev)
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
6139
|
+
if (prev) {
|
|
6140
|
+
if (!isString(prev)) {
|
|
6141
|
+
for (const key in prev) if (next[key] == null) setStyle(style, key, "");
|
|
6142
|
+
} else for (const prevStyle of prev.split(";")) {
|
|
6143
|
+
const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
|
|
6144
|
+
if (next[key] == null) setStyle(style, key, "");
|
|
6145
|
+
}
|
|
5851
6146
|
}
|
|
5852
6147
|
for (const key in next) {
|
|
5853
6148
|
if (key === "display") hasControlledDisplay = true;
|
|
@@ -5863,7 +6158,11 @@ function patchStyle(el, prev, next) {
|
|
|
5863
6158
|
style.cssText = next;
|
|
5864
6159
|
hasControlledDisplay = displayRE.test(next);
|
|
5865
6160
|
}
|
|
5866
|
-
} else if (prev)
|
|
6161
|
+
} else if (prev) {
|
|
6162
|
+
const cssVarText = style[CSS_VAR_TEXT];
|
|
6163
|
+
if (cssVarText) style.cssText = cssVarText;
|
|
6164
|
+
else el.removeAttribute("style");
|
|
6165
|
+
}
|
|
5867
6166
|
if (vShowOriginalDisplay in el) {
|
|
5868
6167
|
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
5869
6168
|
if (el[vShowHidden]) style.display = "none";
|
|
@@ -5876,8 +6175,10 @@ function setStyle(style, name, rawVal) {
|
|
|
5876
6175
|
else {
|
|
5877
6176
|
const val = rawVal == null ? "" : String(rawVal);
|
|
5878
6177
|
if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
5879
|
-
if (name.startsWith("--"))
|
|
5880
|
-
|
|
6178
|
+
if (name.startsWith("--")) {
|
|
6179
|
+
if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
6180
|
+
else style.setProperty(name, val);
|
|
6181
|
+
} else {
|
|
5881
6182
|
const prefixed = autoPrefix(style, name);
|
|
5882
6183
|
if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
|
|
5883
6184
|
else style[prefixed] = val;
|
|
@@ -5914,9 +6215,10 @@ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
|
5914
6215
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
5915
6216
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
5916
6217
|
function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
|
|
5917
|
-
if (isSVG && key.startsWith("xlink:"))
|
|
5918
|
-
|
|
5919
|
-
|
|
6218
|
+
if (isSVG && key.startsWith("xlink:")) {
|
|
6219
|
+
if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
6220
|
+
else el.setAttributeNS(xlinkNS, key, value);
|
|
6221
|
+
} else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
|
|
5920
6222
|
else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
|
|
5921
6223
|
}
|
|
5922
6224
|
//#endregion
|
|
@@ -5989,7 +6291,7 @@ function parseEventName(name) {
|
|
|
5989
6291
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
5990
6292
|
}
|
|
5991
6293
|
let cachedNow = 0;
|
|
5992
|
-
const p =
|
|
6294
|
+
const p = /*@__PURE__*/ Promise.resolve();
|
|
5993
6295
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
|
|
5994
6296
|
function createInvoker(initialValue, instance) {
|
|
5995
6297
|
const invoker = (e) => {
|
|
@@ -6071,13 +6373,22 @@ function onCompositionEnd(e) {
|
|
|
6071
6373
|
}
|
|
6072
6374
|
}
|
|
6073
6375
|
const assignKey = Symbol("_assign");
|
|
6376
|
+
const initialValueKey = Symbol("_initialValue");
|
|
6074
6377
|
const vModelText = {
|
|
6075
6378
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
6379
|
+
if (el.parentNode) {
|
|
6380
|
+
if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
6381
|
+
else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
6382
|
+
}
|
|
6076
6383
|
el[assignKey] = getModelAssigner(vnode);
|
|
6077
6384
|
vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
|
|
6078
6385
|
},
|
|
6079
|
-
mounted(el, { value }) {
|
|
6080
|
-
|
|
6386
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
6387
|
+
const newValue = value == null ? "" : value;
|
|
6388
|
+
const initialValue = el[initialValueKey];
|
|
6389
|
+
delete el[initialValueKey];
|
|
6390
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
|
|
6391
|
+
else el.value = newValue;
|
|
6081
6392
|
},
|
|
6082
6393
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
6083
6394
|
el[assignKey] = getModelAssigner(vnode);
|
|
@@ -6212,19 +6523,39 @@ const vModelSelectInit = (el, value, number, set) => {
|
|
|
6212
6523
|
el._modelValue = value;
|
|
6213
6524
|
addEventListener(el, "change", () => {
|
|
6214
6525
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
6215
|
-
|
|
6216
|
-
el.
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6526
|
+
const multiple = el.multiple;
|
|
6527
|
+
const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
|
|
6528
|
+
const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
|
|
6529
|
+
try {
|
|
6530
|
+
(set || el[assignKey])(assignedValue);
|
|
6531
|
+
} finally {
|
|
6532
|
+
nextTick(() => {
|
|
6533
|
+
if (el._pendingValue === pending) el._pendingValue = void 0;
|
|
6534
|
+
});
|
|
6535
|
+
}
|
|
6220
6536
|
});
|
|
6221
6537
|
};
|
|
6538
|
+
function isSameSelectValue(value, assignedValue, multiple) {
|
|
6539
|
+
if (!multiple) return looseEqual(value, assignedValue);
|
|
6540
|
+
if (isArray(value)) return looseEqual(value, assignedValue);
|
|
6541
|
+
if (isSet(value)) {
|
|
6542
|
+
if (value.size !== assignedValue.length) return false;
|
|
6543
|
+
for (const item of assignedValue) if (!value.has(item)) return false;
|
|
6544
|
+
return true;
|
|
6545
|
+
}
|
|
6546
|
+
return false;
|
|
6547
|
+
}
|
|
6222
6548
|
/**
|
|
6223
6549
|
* @internal
|
|
6224
6550
|
*/
|
|
6225
6551
|
const vModelSetSelected = (el, value) => {
|
|
6226
6552
|
el._modelValue = value;
|
|
6227
|
-
|
|
6553
|
+
const pending = el._pendingValue;
|
|
6554
|
+
el._pendingValue = void 0;
|
|
6555
|
+
if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
|
|
6556
|
+
setSelected(el, value);
|
|
6557
|
+
};
|
|
6558
|
+
function setSelected(el, value) {
|
|
6228
6559
|
const isMultiple = el.multiple;
|
|
6229
6560
|
const isArrayValue = isArray(value);
|
|
6230
6561
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -6234,18 +6565,19 @@ const vModelSetSelected = (el, value) => {
|
|
|
6234
6565
|
for (let i = 0, l = el.options.length; i < l; i++) {
|
|
6235
6566
|
const option = el.options[i];
|
|
6236
6567
|
const optionValue = getValue(option);
|
|
6237
|
-
if (isMultiple)
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6568
|
+
if (isMultiple) {
|
|
6569
|
+
if (isArrayValue) {
|
|
6570
|
+
const optionType = typeof optionValue;
|
|
6571
|
+
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
6572
|
+
else option.selected = looseIndexOf(value, optionValue) > -1;
|
|
6573
|
+
} else option.selected = value.has(optionValue);
|
|
6574
|
+
} else if (looseEqual(getValue(option), value)) {
|
|
6243
6575
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
6244
6576
|
return;
|
|
6245
6577
|
}
|
|
6246
6578
|
}
|
|
6247
6579
|
if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
|
|
6248
|
-
}
|
|
6580
|
+
}
|
|
6249
6581
|
/**
|
|
6250
6582
|
* @internal retrieve raw value set via :value bindings
|
|
6251
6583
|
*/
|
|
@@ -6308,7 +6640,7 @@ function initVModelForSSR() {
|
|
|
6308
6640
|
}
|
|
6309
6641
|
//#endregion
|
|
6310
6642
|
//#region packages/runtime-dom/src/index.ts
|
|
6311
|
-
const rendererOptions =
|
|
6643
|
+
const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
|
|
6312
6644
|
let renderer;
|
|
6313
6645
|
function ensureRenderer() {
|
|
6314
6646
|
return renderer || (renderer = createRenderer(rendererOptions));
|
|
@@ -6392,7 +6724,7 @@ const initDirectivesForSSR = () => {
|
|
|
6392
6724
|
};
|
|
6393
6725
|
//#endregion
|
|
6394
6726
|
//#region packages/server-renderer/src/helpers/ssrRenderAttrs.ts
|
|
6395
|
-
const shouldIgnoreProp =
|
|
6727
|
+
const shouldIgnoreProp = /*@__PURE__*/ makeMap(`,key,ref,innerHTML,textContent,ref_key,ref_for`);
|
|
6396
6728
|
function ssrRenderAttrs(props, tag) {
|
|
6397
6729
|
let ret = "";
|
|
6398
6730
|
for (let key in props) {
|
|
@@ -6410,7 +6742,7 @@ function ssrRenderAttrs(props, tag) {
|
|
|
6410
6742
|
function ssrRenderDynamicAttr(key, value, tag) {
|
|
6411
6743
|
if (!isRenderableAttrValue(value)) return ``;
|
|
6412
6744
|
const attrKey = tag && (tag.indexOf("-") > 0 || isSVGTag(tag)) ? key : propsToAttrMap[key] || key.toLowerCase();
|
|
6413
|
-
if (isBooleanAttr(attrKey)) return includeBooleanAttr(value) ? ` ${attrKey}` : ``;
|
|
6745
|
+
if (isBooleanAttr(attrKey) || attrKey === "hidden" && (typeof value === "boolean" || typeof value === "number")) return includeBooleanAttr(value) ? ` ${attrKey}` : ``;
|
|
6414
6746
|
else if (isSSRSafeAttrName(attrKey)) return value === "" ? ` ${attrKey}` : ` ${attrKey}="${escapeHtml(value)}"`;
|
|
6415
6747
|
else {
|
|
6416
6748
|
console.warn(`[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}`);
|
|
@@ -6439,58 +6771,76 @@ function ssrResetCssVars(raw) {
|
|
|
6439
6771
|
return raw;
|
|
6440
6772
|
}
|
|
6441
6773
|
//#endregion
|
|
6442
|
-
//#region packages/server-renderer/src/helpers/ssrRenderComponent.ts
|
|
6443
|
-
function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
|
|
6444
|
-
if (isString(comp)) {
|
|
6445
|
-
const { getBuffer, push } = createBuffer();
|
|
6446
|
-
renderVNode(push, createVNode(comp, props, children), parentComponent, slotScopeId);
|
|
6447
|
-
return getBuffer();
|
|
6448
|
-
}
|
|
6449
|
-
return renderComponentVNode(createVNode(comp, props, children), parentComponent, slotScopeId);
|
|
6450
|
-
}
|
|
6451
|
-
//#endregion
|
|
6452
6774
|
//#region packages/server-renderer/src/helpers/ssrRenderSlot.ts
|
|
6453
|
-
const { ensureValidVNode } = ssrUtils;
|
|
6775
|
+
const { ensureValidVNode, rawVaporSlotKey: rawVaporSlotKey$1 } = ssrUtils;
|
|
6776
|
+
let vaporSlots = 0;
|
|
6454
6777
|
function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) {
|
|
6455
|
-
push(`<!--[-->`);
|
|
6456
6778
|
ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId);
|
|
6457
|
-
push(`<!--]-->`);
|
|
6458
6779
|
}
|
|
6459
6780
|
function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) {
|
|
6460
6781
|
const slotFn = slots[slotName];
|
|
6782
|
+
let fallback = false;
|
|
6461
6783
|
if (slotFn) {
|
|
6784
|
+
if (slotFn[rawVaporSlotKey$1]) vaporSlots++;
|
|
6785
|
+
const before = vaporSlots;
|
|
6462
6786
|
const slotBuffer = [];
|
|
6463
6787
|
const bufferedPush = (item) => {
|
|
6464
6788
|
slotBuffer.push(item);
|
|
6465
6789
|
};
|
|
6466
|
-
const ret = slotFn(slotProps, bufferedPush, parentComponent, slotScopeId ? " " + slotScopeId : "");
|
|
6790
|
+
const ret = slotFn(slotProps || {}, bufferedPush, parentComponent, slotScopeId ? " " + slotScopeId : "");
|
|
6791
|
+
let vnodes;
|
|
6467
6792
|
if (isArray(ret)) {
|
|
6468
|
-
|
|
6469
|
-
if (
|
|
6793
|
+
vnodes = ensureValidVNode(ret);
|
|
6794
|
+
if (vnodes && isVaporSlotContent(vnodes)) {
|
|
6795
|
+
renderVNodeChildren(bufferedPush, vnodes, parentComponent, slotScopeId);
|
|
6796
|
+
vnodes = void 0;
|
|
6797
|
+
}
|
|
6798
|
+
}
|
|
6799
|
+
if (vnodes !== void 0) {
|
|
6800
|
+
if (!transition) {
|
|
6801
|
+
fallback = !vnodes && !!fallbackRenderFn;
|
|
6802
|
+
push(fallback ? `<!--(-->` : `<!--[-->`);
|
|
6803
|
+
}
|
|
6804
|
+
if (vnodes) renderVNodeChildren(push, vnodes, parentComponent, slotScopeId);
|
|
6470
6805
|
else if (fallbackRenderFn) fallbackRenderFn();
|
|
6471
6806
|
else if (transition) push(`<!---->`);
|
|
6472
6807
|
} else {
|
|
6473
6808
|
let isEmptySlot = true;
|
|
6474
|
-
|
|
6809
|
+
const owner = getCurrentInstance();
|
|
6810
|
+
if (transition || !(owner && owner.type.__vapor) && !fallbackRenderFn && vaporSlots !== before) isEmptySlot = false;
|
|
6475
6811
|
else for (let i = 0; i < slotBuffer.length; i++) if (!isComment(slotBuffer[i])) {
|
|
6476
6812
|
isEmptySlot = false;
|
|
6477
6813
|
break;
|
|
6478
6814
|
}
|
|
6815
|
+
if (!transition) {
|
|
6816
|
+
fallback = isEmptySlot && !!fallbackRenderFn;
|
|
6817
|
+
push(fallback ? `<!--(-->` : `<!--[-->`);
|
|
6818
|
+
}
|
|
6479
6819
|
if (isEmptySlot) {
|
|
6480
6820
|
if (fallbackRenderFn) fallbackRenderFn();
|
|
6481
6821
|
} else {
|
|
6482
6822
|
let start = 0;
|
|
6483
6823
|
let end = slotBuffer.length;
|
|
6484
|
-
if (transition
|
|
6485
|
-
|
|
6486
|
-
end
|
|
6824
|
+
if (transition) {
|
|
6825
|
+
const first = slotBuffer[0];
|
|
6826
|
+
if ((first === "<!--[-->" || first === "<!--(-->") && slotBuffer[end - 1] === (first === "<!--(-->" ? "<!--)-->" : "<!--]-->")) {
|
|
6827
|
+
start++;
|
|
6828
|
+
end--;
|
|
6829
|
+
}
|
|
6487
6830
|
}
|
|
6488
6831
|
if (start < end) for (let i = start; i < end; i++) push(slotBuffer[i]);
|
|
6489
6832
|
else if (transition) push(`<!---->`);
|
|
6490
6833
|
}
|
|
6491
6834
|
}
|
|
6492
|
-
} else
|
|
6493
|
-
|
|
6835
|
+
} else {
|
|
6836
|
+
if (!transition) {
|
|
6837
|
+
fallback = !!fallbackRenderFn;
|
|
6838
|
+
push(fallback ? `<!--(-->` : `<!--[-->`);
|
|
6839
|
+
}
|
|
6840
|
+
if (fallbackRenderFn) fallbackRenderFn();
|
|
6841
|
+
else if (transition) push(`<!---->`);
|
|
6842
|
+
}
|
|
6843
|
+
if (!transition) push(fallback ? `<!--)-->` : `<!--]-->`);
|
|
6494
6844
|
}
|
|
6495
6845
|
const commentTestRE = /^<!--[\s\S]*-->$/;
|
|
6496
6846
|
const commentRE = /<!--[^]*?-->/gm;
|
|
@@ -6500,6 +6850,16 @@ function isComment(item) {
|
|
|
6500
6850
|
return !item.replace(commentRE, "").trim();
|
|
6501
6851
|
}
|
|
6502
6852
|
//#endregion
|
|
6853
|
+
//#region packages/server-renderer/src/helpers/ssrRenderComponent.ts
|
|
6854
|
+
function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
|
|
6855
|
+
if (isString(comp)) {
|
|
6856
|
+
const { getBuffer, push } = createBuffer();
|
|
6857
|
+
renderVNode(push, createVNode(comp, props, children), parentComponent, slotScopeId);
|
|
6858
|
+
return getBuffer();
|
|
6859
|
+
}
|
|
6860
|
+
return renderComponentVNode(createVNode(comp, props, children), parentComponent, slotScopeId);
|
|
6861
|
+
}
|
|
6862
|
+
//#endregion
|
|
6503
6863
|
//#region packages/server-renderer/src/helpers/ssrRenderTeleport.ts
|
|
6504
6864
|
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
|
|
6505
6865
|
parentPush("<!--teleport start-->");
|
|
@@ -6537,14 +6897,16 @@ function ssrRenderList(source, renderItem) {
|
|
|
6537
6897
|
return;
|
|
6538
6898
|
}
|
|
6539
6899
|
for (let i = 0; i < source; i++) renderItem(i + 1, i);
|
|
6540
|
-
} else if (isObject(source))
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6900
|
+
} else if (isObject(source)) {
|
|
6901
|
+
if (source[Symbol.iterator]) {
|
|
6902
|
+
let i = 0;
|
|
6903
|
+
for (const item of source) renderItem(item, i++);
|
|
6904
|
+
} else {
|
|
6905
|
+
const keys = Object.keys(source);
|
|
6906
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
6907
|
+
const key = keys[i];
|
|
6908
|
+
renderItem(source[key], key, i);
|
|
6909
|
+
}
|
|
6548
6910
|
}
|
|
6549
6911
|
}
|
|
6550
6912
|
}
|
|
@@ -6595,7 +6957,7 @@ function ssrCompile(template, instance) {
|
|
|
6595
6957
|
}
|
|
6596
6958
|
//#endregion
|
|
6597
6959
|
//#region packages/server-renderer/src/render.ts
|
|
6598
|
-
const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, normalizeVNode, pushWarningContext, popWarningContext } = ssrUtils;
|
|
6960
|
+
const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, isVNode: isVNode$2, normalizeVNode, pushWarningContext, popWarningContext, VaporSlot, rawVaporSlotKey, invokeSlotFallback } = ssrUtils;
|
|
6599
6961
|
function cleanupContext(context) {
|
|
6600
6962
|
let firstError;
|
|
6601
6963
|
if (context.__watcherHandles) {
|
|
@@ -6635,7 +6997,49 @@ function createBuffer() {
|
|
|
6635
6997
|
}
|
|
6636
6998
|
};
|
|
6637
6999
|
}
|
|
7000
|
+
const vaporOutlets = /* @__PURE__ */ new WeakMap();
|
|
7001
|
+
const vaporInterface = { attachSlotOutlet(content, fallback, owner) {
|
|
7002
|
+
const lone = isVaporSlotContent(content);
|
|
7003
|
+
if (lone) vaporOutlets.set(content, {
|
|
7004
|
+
fallback,
|
|
7005
|
+
owner
|
|
7006
|
+
});
|
|
7007
|
+
return lone;
|
|
7008
|
+
} };
|
|
7009
|
+
function isVaporSlotContent(children) {
|
|
7010
|
+
const lone = findVaporSlot(children);
|
|
7011
|
+
vaporSlot = null;
|
|
7012
|
+
return lone;
|
|
7013
|
+
}
|
|
7014
|
+
let vaporSlot = null;
|
|
7015
|
+
function findVaporSlot(children) {
|
|
7016
|
+
for (let i = 0; i < children.length; i++) {
|
|
7017
|
+
const child = children[i];
|
|
7018
|
+
if (!isVNode$2(child)) return false;
|
|
7019
|
+
if (child.type === VaporSlot) {
|
|
7020
|
+
if (vaporSlot) return false;
|
|
7021
|
+
vaporSlot = child;
|
|
7022
|
+
} else if (child.type === Fragment) {
|
|
7023
|
+
if (child.patchFlag > 0 && child.patchFlag & 384 || !findVaporSlot(child.children)) return false;
|
|
7024
|
+
} else if (child.type !== Comment) return false;
|
|
7025
|
+
}
|
|
7026
|
+
return true;
|
|
7027
|
+
}
|
|
6638
7028
|
function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
|
|
7029
|
+
const ctx = vnode.ctx;
|
|
7030
|
+
const slots = vnode.children;
|
|
7031
|
+
if (vnode.shapeFlag & 32 && ctx && ctx.type.__vapor && slots._) {
|
|
7032
|
+
for (const name in slots) {
|
|
7033
|
+
const slot = slots[name];
|
|
7034
|
+
if (isFunction(slot) && !slot[rawVaporSlotKey]) {
|
|
7035
|
+
const wrapped = (props, push, parent, scopeId) => push ? slot(props, push, parent, scopeId) : [renderSlot({ [name]: slot }, name, props)];
|
|
7036
|
+
slot[rawVaporSlotKey] = wrapped[rawVaporSlotKey] = slot;
|
|
7037
|
+
wrapped._n = true;
|
|
7038
|
+
slots[name] = wrapped;
|
|
7039
|
+
}
|
|
7040
|
+
}
|
|
7041
|
+
if (!ctx.appContext.vapor) ctx.appContext.vapor = vaporInterface;
|
|
7042
|
+
}
|
|
6639
7043
|
const instance = vnode.component = createComponentInstance(vnode, parentComponent, null);
|
|
6640
7044
|
const context = instance.appContext.provides[ssrContextKey];
|
|
6641
7045
|
if (context) (context.__instanceScopes || (context.__instanceScopes = [])).push(instance.scope);
|
|
@@ -6699,7 +7103,8 @@ function renderComponentSubTree(instance, slotScopeId) {
|
|
|
6699
7103
|
}
|
|
6700
7104
|
} else if (instance.render && instance.render !== NOOP) renderVNode(push, instance.subTree = renderComponentRoot(instance), instance, slotScopeId);
|
|
6701
7105
|
else {
|
|
6702
|
-
|
|
7106
|
+
const componentName = comp.name || comp.__file || `<Anonymous>`;
|
|
7107
|
+
warn(`Component ${componentName} is missing template or render function.`);
|
|
6703
7108
|
push(`<!---->`);
|
|
6704
7109
|
}
|
|
6705
7110
|
}
|
|
@@ -6719,12 +7124,25 @@ function renderVNode(push, vnode, parentComponent, slotScopeId) {
|
|
|
6719
7124
|
case Static:
|
|
6720
7125
|
push(children);
|
|
6721
7126
|
break;
|
|
6722
|
-
case Fragment:
|
|
7127
|
+
case Fragment: {
|
|
6723
7128
|
if (vnode.slotScopeIds) slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
|
|
6724
|
-
|
|
7129
|
+
const outlet = vnode.vo && vaporOutlets.get(children);
|
|
7130
|
+
if (outlet) {
|
|
7131
|
+
renderVaporOutlet(push, (_, push) => renderVNodeChildren(push, children, parentComponent, slotScopeId), null, outlet, parentComponent, slotScopeId);
|
|
7132
|
+
break;
|
|
7133
|
+
}
|
|
7134
|
+
const isFallback = shapeFlag & 1024;
|
|
7135
|
+
push(isFallback ? `<!--(-->` : `<!--[-->`);
|
|
6725
7136
|
renderVNodeChildren(push, children, parentComponent, slotScopeId);
|
|
6726
|
-
push(`<!--]-->`);
|
|
7137
|
+
push(isFallback ? `<!--)-->` : `<!--]-->`);
|
|
6727
7138
|
break;
|
|
7139
|
+
}
|
|
7140
|
+
case VaporSlot: {
|
|
7141
|
+
if (vnode.slotScopeIds) slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
|
|
7142
|
+
const { slot, outlets } = vnode.vs;
|
|
7143
|
+
renderVaporOutlet(push, slot, vnode.props, outlets && outlets[0], parentComponent, slotScopeId);
|
|
7144
|
+
break;
|
|
7145
|
+
}
|
|
6728
7146
|
default: if (shapeFlag & 1) renderElementVNode(push, vnode, parentComponent, slotScopeId);
|
|
6729
7147
|
else if (shapeFlag & 6) push(renderComponentVNode(vnode, parentComponent, slotScopeId));
|
|
6730
7148
|
else if (shapeFlag & 64) renderTeleportVNode(push, vnode, parentComponent, slotScopeId);
|
|
@@ -6732,6 +7150,11 @@ function renderVNode(push, vnode, parentComponent, slotScopeId) {
|
|
|
6732
7150
|
else warn("[@vue/server-renderer] Invalid VNode type:", type, `(${typeof type})`);
|
|
6733
7151
|
}
|
|
6734
7152
|
}
|
|
7153
|
+
function renderVaporOutlet(push, slot, props, outlet, parentComponent, slotScopeId) {
|
|
7154
|
+
const prev = setCurrentRenderingInstance(parentComponent);
|
|
7155
|
+
ssrRenderSlot({ default: slot }, "default", props, outlet ? () => renderVNodeChildren(push, invokeSlotFallback(outlet.fallback, outlet.owner), parentComponent, slotScopeId) : null, push, parentComponent, slotScopeId);
|
|
7156
|
+
setCurrentRenderingInstance(prev);
|
|
7157
|
+
}
|
|
6735
7158
|
function renderVNodeChildren(push, children, parentComponent, slotScopeId) {
|
|
6736
7159
|
for (let i = 0; i < children.length; i++) renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId);
|
|
6737
7160
|
}
|