@vue/compat 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/vue-compat.d.ts +743 -678
- package/dist/vue.cjs.js +1328 -944
- package/dist/vue.cjs.prod.js +1116 -809
- package/dist/vue.esm-browser.js +1240 -895
- package/dist/vue.esm-browser.prod.js +7 -6
- package/dist/vue.esm-bundler.js +1314 -916
- package/dist/vue.global.js +1240 -895
- package/dist/vue.global.prod.js +7 -6
- package/dist/vue.runtime.esm-browser.js +1240 -895
- package/dist/vue.runtime.esm-browser.prod.js +7 -6
- package/dist/vue.runtime.esm-bundler.js +1314 -916
- package/dist/vue.runtime.global.js +1240 -895
- package/dist/vue.runtime.global.prod.js +7 -6
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-rc.
|
|
2
|
+
* @vue/compat v3.6.0-rc.11
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -23,7 +23,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
23
23
|
* \/\*#\_\_PURE\_\_\*\/
|
|
24
24
|
* So that they can be tree-shaken if necessary.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
27
27
|
function makeMap(str) {
|
|
28
28
|
const map = Object.create(null);
|
|
29
29
|
for (const key of str.split(",")) map[key] = 1;
|
|
@@ -67,9 +67,9 @@ const toRawType = (value) => {
|
|
|
67
67
|
};
|
|
68
68
|
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
69
69
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
70
|
-
const isReservedProp =
|
|
71
|
-
const isBuiltInTag =
|
|
72
|
-
const isBuiltInDirective =
|
|
70
|
+
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
71
|
+
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
72
|
+
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
73
73
|
const cacheStringFunction = (fn) => {
|
|
74
74
|
const cache = Object.create(null);
|
|
75
75
|
return ((str) => {
|
|
@@ -177,7 +177,7 @@ const slotFlagsText = {
|
|
|
177
177
|
[2]: "DYNAMIC",
|
|
178
178
|
[3]: "FORWARDED"
|
|
179
179
|
};
|
|
180
|
-
const isGloballyAllowed =
|
|
180
|
+
const isGloballyAllowed = /*@__PURE__*/ makeMap("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");
|
|
181
181
|
//#endregion
|
|
182
182
|
//#region packages/shared/src/codeframe.ts
|
|
183
183
|
const range = 2;
|
|
@@ -231,10 +231,10 @@ function normalizeStyle(value) {
|
|
|
231
231
|
}
|
|
232
232
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
233
233
|
const propertyDelimiterRE = /:([^]+)/;
|
|
234
|
-
const styleCommentRE =
|
|
234
|
+
const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
|
|
235
235
|
function parseStringStyle(cssText) {
|
|
236
236
|
const ret = {};
|
|
237
|
-
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
237
|
+
cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
|
|
238
238
|
if (item) {
|
|
239
239
|
const tmp = item.split(propertyDelimiterRE);
|
|
240
240
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
@@ -284,22 +284,22 @@ const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,tr
|
|
|
284
284
|
* Compiler only.
|
|
285
285
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
286
286
|
*/
|
|
287
|
-
const isHTMLTag =
|
|
287
|
+
const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
|
|
288
288
|
/**
|
|
289
289
|
* Compiler only.
|
|
290
290
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
291
291
|
*/
|
|
292
|
-
const isSVGTag =
|
|
292
|
+
const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
|
|
293
293
|
/**
|
|
294
294
|
* Compiler only.
|
|
295
295
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
296
296
|
*/
|
|
297
|
-
const isMathMLTag =
|
|
297
|
+
const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
298
298
|
/**
|
|
299
299
|
* Compiler only.
|
|
300
300
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
301
301
|
*/
|
|
302
|
-
const isVoidTag =
|
|
302
|
+
const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region packages/shared/src/domAttrConfig.ts
|
|
305
305
|
/**
|
|
@@ -314,11 +314,11 @@ const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
|
|
|
314
314
|
* - readonly -> readOnly
|
|
315
315
|
*/
|
|
316
316
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
317
|
-
const isSpecialBooleanAttr =
|
|
317
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
318
318
|
/**
|
|
319
319
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
320
320
|
*/
|
|
321
|
-
const isBooleanAttr =
|
|
321
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
322
322
|
/**
|
|
323
323
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
324
324
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -332,11 +332,11 @@ function includeBooleanAttr(value) {
|
|
|
332
332
|
* Don't also forget to allow `data-*` and `aria-*`!
|
|
333
333
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
|
|
334
334
|
*/
|
|
335
|
-
const isKnownHtmlAttr =
|
|
335
|
+
const isKnownHtmlAttr = /*@__PURE__*/ makeMap("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");
|
|
336
336
|
/**
|
|
337
337
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
338
338
|
*/
|
|
339
|
-
const isKnownSvgAttr =
|
|
339
|
+
const isKnownSvgAttr = /*@__PURE__*/ makeMap("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");
|
|
340
340
|
/**
|
|
341
341
|
* Shared between server-renderer and runtime-core hydration logic
|
|
342
342
|
*/
|
|
@@ -362,13 +362,54 @@ function getEscapedCssVarName(key, doubleEscape) {
|
|
|
362
362
|
}
|
|
363
363
|
//#endregion
|
|
364
364
|
//#region packages/shared/src/looseEqual.ts
|
|
365
|
-
function looseCompareArrays(a, b) {
|
|
365
|
+
function looseCompareArrays(a, b, seen) {
|
|
366
366
|
if (a.length !== b.length) return false;
|
|
367
367
|
let equal = true;
|
|
368
|
-
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
368
|
+
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
|
|
369
369
|
return equal;
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function looseCompareCollections(a, b, seen) {
|
|
372
|
+
if (a.size !== b.size) return false;
|
|
373
|
+
const candidates = Array.from(b);
|
|
374
|
+
const matched = new Uint8Array(candidates.length);
|
|
375
|
+
for (const item of a) {
|
|
376
|
+
let index = -1;
|
|
377
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
|
|
378
|
+
index = i;
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
if (index < 0) return false;
|
|
382
|
+
matched[index] = 1;
|
|
383
|
+
}
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
386
|
+
function looseCompareObjects(a, b, seen) {
|
|
387
|
+
let aValidType = isMap(a);
|
|
388
|
+
let bValidType = isMap(b);
|
|
389
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
390
|
+
aValidType = isSet(a);
|
|
391
|
+
bValidType = isSet(b);
|
|
392
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
393
|
+
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
394
|
+
for (const key in a) {
|
|
395
|
+
const aHasKey = a.hasOwnProperty(key);
|
|
396
|
+
const bHasKey = b.hasOwnProperty(key);
|
|
397
|
+
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
|
|
398
|
+
}
|
|
399
|
+
return String(a) === String(b);
|
|
400
|
+
}
|
|
401
|
+
function looseCompareNested(a, b, seen, compare) {
|
|
402
|
+
if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
|
|
403
|
+
const [seenA, seenB] = seen;
|
|
404
|
+
if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
|
|
405
|
+
seenA.set(a, b);
|
|
406
|
+
seenB.set(b, a);
|
|
407
|
+
const equal = compare(a, b, seen);
|
|
408
|
+
seenA.delete(a);
|
|
409
|
+
seenB.delete(b);
|
|
410
|
+
return equal;
|
|
411
|
+
}
|
|
412
|
+
function looseEqual(a, b, seen) {
|
|
372
413
|
if (a === b) return true;
|
|
373
414
|
let aValidType = isDate(a);
|
|
374
415
|
let bValidType = isDate(b);
|
|
@@ -378,17 +419,12 @@ function looseEqual(a, b) {
|
|
|
378
419
|
if (aValidType || bValidType) return a === b;
|
|
379
420
|
aValidType = isArray(a);
|
|
380
421
|
bValidType = isArray(b);
|
|
381
|
-
if (aValidType || bValidType) return aValidType && bValidType ?
|
|
422
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
|
|
382
423
|
aValidType = isObject(a);
|
|
383
424
|
bValidType = isObject(b);
|
|
384
425
|
if (aValidType || bValidType) {
|
|
385
426
|
if (!aValidType || !bValidType) return false;
|
|
386
|
-
|
|
387
|
-
for (const key in a) {
|
|
388
|
-
const aHasKey = a.hasOwnProperty(key);
|
|
389
|
-
const bHasKey = b.hasOwnProperty(key);
|
|
390
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
|
|
391
|
-
}
|
|
427
|
+
return looseCompareNested(a, b, seen, looseCompareObjects);
|
|
392
428
|
}
|
|
393
429
|
return String(a) === String(b);
|
|
394
430
|
}
|
|
@@ -518,6 +554,8 @@ function setupFlagsHandler(target) {
|
|
|
518
554
|
function warn$2(msg, ...args) {
|
|
519
555
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
520
556
|
}
|
|
557
|
+
//#endregion
|
|
558
|
+
//#region packages/reactivity/src/system.ts
|
|
521
559
|
const notifyBuffer = [];
|
|
522
560
|
let batchDepth = 0;
|
|
523
561
|
let activeSub = void 0;
|
|
@@ -656,13 +694,23 @@ function endTracking(sub, prevSub) {
|
|
|
656
694
|
sub.flags &= -5;
|
|
657
695
|
}
|
|
658
696
|
function flush() {
|
|
697
|
+
let hasError = false;
|
|
698
|
+
let error;
|
|
659
699
|
while (notifyIndex < notifyBufferLength) {
|
|
660
700
|
const effect = notifyBuffer[notifyIndex];
|
|
661
701
|
notifyBuffer[notifyIndex++] = void 0;
|
|
662
|
-
|
|
702
|
+
try {
|
|
703
|
+
effect.notify();
|
|
704
|
+
} catch (err) {
|
|
705
|
+
if (!hasError) {
|
|
706
|
+
hasError = true;
|
|
707
|
+
error = err;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
663
710
|
}
|
|
664
711
|
notifyIndex = 0;
|
|
665
712
|
notifyBufferLength = 0;
|
|
713
|
+
if (hasError) throw error;
|
|
666
714
|
}
|
|
667
715
|
function checkDirty(link, sub) {
|
|
668
716
|
let stack;
|
|
@@ -746,7 +794,7 @@ var Dep = class {
|
|
|
746
794
|
}
|
|
747
795
|
set subs(value) {
|
|
748
796
|
this._subs = value;
|
|
749
|
-
if (value === void 0) this.map.delete(this.key);
|
|
797
|
+
if (value === void 0 && this.map) this.map.delete(this.key);
|
|
750
798
|
}
|
|
751
799
|
};
|
|
752
800
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -829,9 +877,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
829
877
|
if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
830
878
|
}
|
|
831
879
|
break;
|
|
832
|
-
case "set":
|
|
833
|
-
if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
834
|
-
break;
|
|
880
|
+
case "set": if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
835
881
|
}
|
|
836
882
|
}
|
|
837
883
|
}
|
|
@@ -846,13 +892,17 @@ function getDepFromReactive(object, key) {
|
|
|
846
892
|
/**
|
|
847
893
|
* Track array iteration and return:
|
|
848
894
|
* - if input is reactive: a cloned raw array with reactive values
|
|
849
|
-
* - if input is
|
|
895
|
+
* - if input is readonly: a cloned raw array with readonly values, preserving
|
|
896
|
+
* reactivity
|
|
897
|
+
* - if input is raw or shallow: the original raw array
|
|
850
898
|
*/
|
|
851
899
|
function reactiveReadArray(array) {
|
|
852
900
|
const raw = /* @__PURE__ */ toRaw(array);
|
|
853
901
|
if (raw === array) return raw;
|
|
854
902
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
855
|
-
|
|
903
|
+
if (/* @__PURE__ */ isShallow(array)) return raw;
|
|
904
|
+
if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
|
|
905
|
+
return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
|
|
856
906
|
}
|
|
857
907
|
/**
|
|
858
908
|
* Track array iteration and return raw array
|
|
@@ -1028,8 +1078,8 @@ function noTracking(self, method, args = []) {
|
|
|
1028
1078
|
}
|
|
1029
1079
|
//#endregion
|
|
1030
1080
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
1031
|
-
const isNonTrackableKeys =
|
|
1032
|
-
const builtInSymbols = new Set(
|
|
1081
|
+
const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
1082
|
+
const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1033
1083
|
function hasOwnProperty(key) {
|
|
1034
1084
|
if (!isSymbol(key)) key = String(key);
|
|
1035
1085
|
const obj = /* @__PURE__ */ toRaw(this);
|
|
@@ -1084,12 +1134,14 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1084
1134
|
oldValue = /* @__PURE__ */ toRaw(oldValue);
|
|
1085
1135
|
value = /* @__PURE__ */ toRaw(value);
|
|
1086
1136
|
}
|
|
1087
|
-
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value))
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1137
|
+
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
|
|
1138
|
+
if (isOldValueReadonly) {
|
|
1139
|
+
warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
|
|
1140
|
+
return true;
|
|
1141
|
+
} else {
|
|
1142
|
+
oldValue.value = value;
|
|
1143
|
+
return true;
|
|
1144
|
+
}
|
|
1093
1145
|
}
|
|
1094
1146
|
}
|
|
1095
1147
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
@@ -1130,10 +1182,10 @@ var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1130
1182
|
return true;
|
|
1131
1183
|
}
|
|
1132
1184
|
};
|
|
1133
|
-
const mutableHandlers =
|
|
1134
|
-
const readonlyHandlers =
|
|
1135
|
-
const shallowReactiveHandlers =
|
|
1136
|
-
const shallowReadonlyHandlers =
|
|
1185
|
+
const mutableHandlers = /*@__PURE__*/ new MutableReactiveHandler();
|
|
1186
|
+
const readonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler();
|
|
1187
|
+
const shallowReactiveHandlers = /*@__PURE__*/ new MutableReactiveHandler(true);
|
|
1188
|
+
const shallowReadonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler(true);
|
|
1137
1189
|
//#endregion
|
|
1138
1190
|
//#region packages/reactivity/src/collectionHandlers.ts
|
|
1139
1191
|
const toShallow = (value) => value;
|
|
@@ -1284,10 +1336,10 @@ function createInstrumentationGetter(isReadonly, shallow) {
|
|
|
1284
1336
|
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
1285
1337
|
};
|
|
1286
1338
|
}
|
|
1287
|
-
const mutableCollectionHandlers = { get:
|
|
1288
|
-
const shallowCollectionHandlers = { get:
|
|
1289
|
-
const readonlyCollectionHandlers = { get:
|
|
1290
|
-
const shallowReadonlyCollectionHandlers = { get:
|
|
1339
|
+
const mutableCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, false) };
|
|
1340
|
+
const shallowCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, true) };
|
|
1341
|
+
const readonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, false) };
|
|
1342
|
+
const shallowReadonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, true) };
|
|
1291
1343
|
function checkIdentityKeys(target, has, key) {
|
|
1292
1344
|
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
1293
1345
|
if (rawKey !== key && has.call(target, rawKey)) {
|
|
@@ -1312,7 +1364,7 @@ function targetTypeMap(rawType) {
|
|
|
1312
1364
|
default: return 0;
|
|
1313
1365
|
}
|
|
1314
1366
|
}
|
|
1315
|
-
|
|
1367
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1316
1368
|
function reactive(target) {
|
|
1317
1369
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
1318
1370
|
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
@@ -1347,7 +1399,7 @@ function reactive(target) {
|
|
|
1347
1399
|
* @param target - The source object.
|
|
1348
1400
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive}
|
|
1349
1401
|
*/
|
|
1350
|
-
|
|
1402
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1351
1403
|
function shallowReactive(target) {
|
|
1352
1404
|
return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
|
|
1353
1405
|
}
|
|
@@ -1380,7 +1432,7 @@ function shallowReactive(target) {
|
|
|
1380
1432
|
* @param target - The source object.
|
|
1381
1433
|
* @see {@link https://vuejs.org/api/reactivity-core.html#readonly}
|
|
1382
1434
|
*/
|
|
1383
|
-
|
|
1435
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1384
1436
|
function readonly(target) {
|
|
1385
1437
|
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
|
|
1386
1438
|
}
|
|
@@ -1414,7 +1466,7 @@ function readonly(target) {
|
|
|
1414
1466
|
* @param target - The source object.
|
|
1415
1467
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly}
|
|
1416
1468
|
*/
|
|
1417
|
-
|
|
1469
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1418
1470
|
function shallowReadonly(target) {
|
|
1419
1471
|
return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
|
|
1420
1472
|
}
|
|
@@ -1451,7 +1503,7 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1451
1503
|
* @param value - The value to check.
|
|
1452
1504
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive}
|
|
1453
1505
|
*/
|
|
1454
|
-
|
|
1506
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1455
1507
|
function isReactive(value) {
|
|
1456
1508
|
if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
|
|
1457
1509
|
return !!(value && value["__v_isReactive"]);
|
|
@@ -1467,11 +1519,11 @@ function isReactive(value) {
|
|
|
1467
1519
|
* @param value - The value to check.
|
|
1468
1520
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly}
|
|
1469
1521
|
*/
|
|
1470
|
-
|
|
1522
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1471
1523
|
function isReadonly(value) {
|
|
1472
1524
|
return !!(value && value["__v_isReadonly"]);
|
|
1473
1525
|
}
|
|
1474
|
-
|
|
1526
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1475
1527
|
function isShallow(value) {
|
|
1476
1528
|
return !!(value && value["__v_isShallow"]);
|
|
1477
1529
|
}
|
|
@@ -1482,7 +1534,7 @@ function isShallow(value) {
|
|
|
1482
1534
|
* @param value - The value to check.
|
|
1483
1535
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy}
|
|
1484
1536
|
*/
|
|
1485
|
-
|
|
1537
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1486
1538
|
function isProxy(value) {
|
|
1487
1539
|
return value ? !!value["__v_raw"] : false;
|
|
1488
1540
|
}
|
|
@@ -1509,7 +1561,7 @@ function isProxy(value) {
|
|
|
1509
1561
|
* @param observed - The object for which the "raw" value is requested.
|
|
1510
1562
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw}
|
|
1511
1563
|
*/
|
|
1512
|
-
|
|
1564
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1513
1565
|
function toRaw(observed) {
|
|
1514
1566
|
const raw = observed && observed["__v_raw"];
|
|
1515
1567
|
return raw ? /* @__PURE__ */ toRaw(raw) : observed;
|
|
@@ -1558,15 +1610,15 @@ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value)
|
|
|
1558
1610
|
const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
1559
1611
|
//#endregion
|
|
1560
1612
|
//#region packages/reactivity/src/ref.ts
|
|
1561
|
-
|
|
1613
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1562
1614
|
function isRef(r) {
|
|
1563
1615
|
return r ? r["__v_isRef"] === true : false;
|
|
1564
1616
|
}
|
|
1565
|
-
|
|
1617
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1566
1618
|
function ref(value) {
|
|
1567
1619
|
return createRef(value, toReactive);
|
|
1568
1620
|
}
|
|
1569
|
-
|
|
1621
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1570
1622
|
function shallowRef(value) {
|
|
1571
1623
|
return createRef(value);
|
|
1572
1624
|
}
|
|
@@ -1769,7 +1821,7 @@ function customRef(factory) {
|
|
|
1769
1821
|
* @param object - Reactive object to be made into an object of linked refs.
|
|
1770
1822
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#torefs}
|
|
1771
1823
|
*/
|
|
1772
|
-
|
|
1824
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1773
1825
|
function toRefs(object) {
|
|
1774
1826
|
const ret = isArray(object) ? new Array(object.length) : {};
|
|
1775
1827
|
for (const key in object) ret[key] = propertyToRef(object, key);
|
|
@@ -1820,7 +1872,7 @@ var GetterRefImpl = class {
|
|
|
1820
1872
|
return this._value = this._getter();
|
|
1821
1873
|
}
|
|
1822
1874
|
};
|
|
1823
|
-
|
|
1875
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1824
1876
|
function toRef(source, key, defaultValue) {
|
|
1825
1877
|
if (/* @__PURE__ */ isRef(source)) return source;
|
|
1826
1878
|
else if (isFunction(source)) return new GetterRefImpl(source);
|
|
@@ -1886,10 +1938,12 @@ var ReactiveEffect = class {
|
|
|
1886
1938
|
get dirty() {
|
|
1887
1939
|
const flags = this.flags;
|
|
1888
1940
|
if (flags & 16) return true;
|
|
1889
|
-
if (flags & 32)
|
|
1890
|
-
this.
|
|
1891
|
-
|
|
1892
|
-
|
|
1941
|
+
if (flags & 32) {
|
|
1942
|
+
if (checkDirty(this.deps, this)) {
|
|
1943
|
+
this.flags = flags | 16;
|
|
1944
|
+
return true;
|
|
1945
|
+
} else this.flags = flags & -33;
|
|
1946
|
+
}
|
|
1893
1947
|
return false;
|
|
1894
1948
|
}
|
|
1895
1949
|
};
|
|
@@ -2068,10 +2122,12 @@ var ComputedRefImpl = class {
|
|
|
2068
2122
|
get _dirty() {
|
|
2069
2123
|
const flags = this.flags;
|
|
2070
2124
|
if (flags & 16) return true;
|
|
2071
|
-
if (flags & 32)
|
|
2072
|
-
this.
|
|
2073
|
-
|
|
2074
|
-
|
|
2125
|
+
if (flags & 32) {
|
|
2126
|
+
if (checkDirty(this.deps, this)) {
|
|
2127
|
+
this.flags = flags | 16;
|
|
2128
|
+
return true;
|
|
2129
|
+
} else this.flags = flags & -33;
|
|
2130
|
+
}
|
|
2075
2131
|
return false;
|
|
2076
2132
|
}
|
|
2077
2133
|
/**
|
|
@@ -2132,7 +2188,7 @@ var ComputedRefImpl = class {
|
|
|
2132
2188
|
}
|
|
2133
2189
|
};
|
|
2134
2190
|
setupOnTrigger(ComputedRefImpl);
|
|
2135
|
-
|
|
2191
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2136
2192
|
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
2137
2193
|
let getter;
|
|
2138
2194
|
let setter;
|
|
@@ -2210,25 +2266,26 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2210
2266
|
else if (isFunction(s)) return call ? call(s, 2) : s();
|
|
2211
2267
|
else warnInvalidSource(s, onWarn);
|
|
2212
2268
|
});
|
|
2213
|
-
} else if (isFunction(source))
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2269
|
+
} else if (isFunction(source)) {
|
|
2270
|
+
if (cb) getter = call ? () => call(source, 2) : source;
|
|
2271
|
+
else getter = () => {
|
|
2272
|
+
if (this.cleanupsLength) {
|
|
2273
|
+
const prevSub = setActiveSub();
|
|
2274
|
+
try {
|
|
2275
|
+
cleanup(this);
|
|
2276
|
+
} finally {
|
|
2277
|
+
setActiveSub(prevSub);
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
const currentEffect = activeWatcher;
|
|
2281
|
+
activeWatcher = this;
|
|
2217
2282
|
try {
|
|
2218
|
-
|
|
2283
|
+
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
2219
2284
|
} finally {
|
|
2220
|
-
|
|
2285
|
+
activeWatcher = currentEffect;
|
|
2221
2286
|
}
|
|
2222
|
-
}
|
|
2223
|
-
|
|
2224
|
-
activeWatcher = this;
|
|
2225
|
-
try {
|
|
2226
|
-
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
2227
|
-
} finally {
|
|
2228
|
-
activeWatcher = currentEffect;
|
|
2229
|
-
}
|
|
2230
|
-
};
|
|
2231
|
-
else {
|
|
2287
|
+
};
|
|
2288
|
+
} else {
|
|
2232
2289
|
getter = NOOP;
|
|
2233
2290
|
warnInvalidSource(source, onWarn);
|
|
2234
2291
|
}
|
|
@@ -2552,7 +2609,7 @@ let currentFlushPromise = null;
|
|
|
2552
2609
|
let jobsLength = 0;
|
|
2553
2610
|
let flushIndex = 0;
|
|
2554
2611
|
let postFlushIndex = 0;
|
|
2555
|
-
const resolvedPromise =
|
|
2612
|
+
const resolvedPromise = /*@__PURE__*/ Promise.resolve();
|
|
2556
2613
|
const RECURSION_LIMIT = 100;
|
|
2557
2614
|
function nextTick(fn) {
|
|
2558
2615
|
const p = currentFlushPromise || resolvedPromise;
|
|
@@ -2591,6 +2648,7 @@ const doFlushJobs = () => {
|
|
|
2591
2648
|
flushJobs();
|
|
2592
2649
|
} catch (e) {
|
|
2593
2650
|
currentFlushPromise = null;
|
|
2651
|
+
if (jobsLength || postJobs.length) queueFlush();
|
|
2594
2652
|
throw e;
|
|
2595
2653
|
}
|
|
2596
2654
|
};
|
|
@@ -2598,9 +2656,10 @@ function queueFlush() {
|
|
|
2598
2656
|
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
2599
2657
|
}
|
|
2600
2658
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
2601
|
-
if (!isArray(jobs))
|
|
2602
|
-
|
|
2603
|
-
|
|
2659
|
+
if (!isArray(jobs)) {
|
|
2660
|
+
if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
2661
|
+
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
2662
|
+
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
2604
2663
|
queueFlush();
|
|
2605
2664
|
}
|
|
2606
2665
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -2614,32 +2673,39 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
2614
2673
|
i--;
|
|
2615
2674
|
jobsLength--;
|
|
2616
2675
|
if (cb.flags & 2) cb.flags &= -2;
|
|
2617
|
-
|
|
2618
|
-
|
|
2676
|
+
try {
|
|
2677
|
+
cb();
|
|
2678
|
+
} finally {
|
|
2679
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
2680
|
+
}
|
|
2619
2681
|
}
|
|
2620
2682
|
}
|
|
2621
2683
|
function flushPostFlushCbs(seen) {
|
|
2622
2684
|
if (postJobs.length) {
|
|
2623
2685
|
if (activePostJobs) {
|
|
2624
|
-
activePostJobs.push(
|
|
2686
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
2625
2687
|
postJobs.length = 0;
|
|
2626
2688
|
return;
|
|
2627
2689
|
}
|
|
2628
2690
|
activePostJobs = postJobs;
|
|
2629
2691
|
postJobs = [];
|
|
2630
2692
|
seen = seen || /* @__PURE__ */ new Map();
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
cb
|
|
2637
|
-
|
|
2638
|
-
|
|
2693
|
+
try {
|
|
2694
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
2695
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
2696
|
+
if (checkRecursiveUpdates(seen, cb)) continue;
|
|
2697
|
+
if (cb.flags & 2) cb.flags &= -2;
|
|
2698
|
+
if (!(cb.flags & 4)) try {
|
|
2699
|
+
cb();
|
|
2700
|
+
} finally {
|
|
2701
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
2702
|
+
}
|
|
2639
2703
|
}
|
|
2704
|
+
} finally {
|
|
2705
|
+
while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
|
|
2706
|
+
activePostJobs = null;
|
|
2707
|
+
postFlushIndex = 0;
|
|
2640
2708
|
}
|
|
2641
|
-
activePostJobs = null;
|
|
2642
|
-
postFlushIndex = 0;
|
|
2643
2709
|
}
|
|
2644
2710
|
}
|
|
2645
2711
|
let isFlushing = false;
|
|
@@ -2649,9 +2715,12 @@ let isFlushing = false;
|
|
|
2649
2715
|
function flushOnAppMount(instance) {
|
|
2650
2716
|
if (!isFlushing) {
|
|
2651
2717
|
isFlushing = true;
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2718
|
+
try {
|
|
2719
|
+
flushPreFlushCbs(instance);
|
|
2720
|
+
flushPostFlushCbs();
|
|
2721
|
+
} finally {
|
|
2722
|
+
isFlushing = false;
|
|
2723
|
+
}
|
|
2655
2724
|
}
|
|
2656
2725
|
}
|
|
2657
2726
|
function flushJobs(seen) {
|
|
@@ -2681,8 +2750,8 @@ function flushJobs(seen) {
|
|
|
2681
2750
|
jobsLength = 0;
|
|
2682
2751
|
jobs.length = 0;
|
|
2683
2752
|
flushPostFlushCbs(seen);
|
|
2684
|
-
currentFlushPromise = null;
|
|
2685
2753
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
2754
|
+
else currentFlushPromise = null;
|
|
2686
2755
|
}
|
|
2687
2756
|
}
|
|
2688
2757
|
function checkRecursiveUpdates(seen, fn) {
|
|
@@ -2713,6 +2782,19 @@ getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
|
2713
2782
|
rerender: tryWrap(rerender),
|
|
2714
2783
|
reload: tryWrap(reload)
|
|
2715
2784
|
};
|
|
2785
|
+
function runWithHmrUpdating(fn) {
|
|
2786
|
+
isHmrUpdating = true;
|
|
2787
|
+
let done = false;
|
|
2788
|
+
try {
|
|
2789
|
+
fn();
|
|
2790
|
+
done = true;
|
|
2791
|
+
} finally {
|
|
2792
|
+
if (done) nextTick(() => {
|
|
2793
|
+
isHmrUpdating = false;
|
|
2794
|
+
});
|
|
2795
|
+
else isHmrUpdating = false;
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2716
2798
|
const map = /* @__PURE__ */ new Map();
|
|
2717
2799
|
function registerHMR(instance) {
|
|
2718
2800
|
const id = instance.type.__hmrId;
|
|
@@ -2754,18 +2836,16 @@ function rerender(id, newRender) {
|
|
|
2754
2836
|
instance.render = newRender;
|
|
2755
2837
|
normalizeClassComponent(instance.type).render = newRender;
|
|
2756
2838
|
}
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2839
|
+
runWithHmrUpdating(() => {
|
|
2840
|
+
if (instance.vapor) {
|
|
2841
|
+
if (!instance.isUnmounted) instance.hmrRerender();
|
|
2842
|
+
} else {
|
|
2843
|
+
const i = instance;
|
|
2844
|
+
if (!(i.effect.flags & 1024)) {
|
|
2845
|
+
i.renderCache = [];
|
|
2846
|
+
i.effect.run();
|
|
2847
|
+
}
|
|
2765
2848
|
}
|
|
2766
|
-
}
|
|
2767
|
-
nextTick(() => {
|
|
2768
|
-
isHmrUpdating = false;
|
|
2769
2849
|
});
|
|
2770
2850
|
});
|
|
2771
2851
|
}
|
|
@@ -2780,17 +2860,19 @@ function reload(id, newComp) {
|
|
|
2780
2860
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2781
2861
|
const dirtyInstances = new Set(instances);
|
|
2782
2862
|
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2783
|
-
|
|
2784
|
-
const
|
|
2785
|
-
|
|
2786
|
-
if (
|
|
2787
|
-
rerenderedParents.
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2863
|
+
runWithHmrUpdating(() => {
|
|
2864
|
+
for (const instance of instances) {
|
|
2865
|
+
const parent = instance.parent;
|
|
2866
|
+
if (parent) {
|
|
2867
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2868
|
+
rerenderedParents.add(parent);
|
|
2869
|
+
parent.hmrRerender();
|
|
2870
|
+
}
|
|
2871
|
+
} else instance.hmrReload(newComp);
|
|
2872
|
+
}
|
|
2873
|
+
});
|
|
2792
2874
|
} else {
|
|
2793
|
-
const
|
|
2875
|
+
const parents = /* @__PURE__ */ new Set();
|
|
2794
2876
|
const dirtyInstanceSet = new Set(instances);
|
|
2795
2877
|
for (const instance of instances) {
|
|
2796
2878
|
const oldComp = normalizeClassComponent(instance.type);
|
|
@@ -2809,33 +2891,23 @@ function reload(id, newComp) {
|
|
|
2809
2891
|
instance.ceReload(newComp.styles);
|
|
2810
2892
|
dirtyInstances.delete(instance);
|
|
2811
2893
|
} else if (instance.parent) {
|
|
2812
|
-
|
|
2813
|
-
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2814
|
-
let updates = parentUpdates.get(parent);
|
|
2815
|
-
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2816
|
-
updates.push([instance, dirtyInstances]);
|
|
2817
|
-
}
|
|
2894
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
|
|
2818
2895
|
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2819
2896
|
else if (typeof window !== "undefined") window.location.reload();
|
|
2820
2897
|
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2821
2898
|
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2822
2899
|
}
|
|
2823
|
-
|
|
2900
|
+
parents.forEach((parent) => {
|
|
2824
2901
|
queueJob(() => {
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2902
|
+
runWithHmrUpdating(() => {
|
|
2903
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2904
|
+
else {
|
|
2905
|
+
const i = parent;
|
|
2906
|
+
if (!(i.effect.flags & 1024)) {
|
|
2907
|
+
i.renderCache = [];
|
|
2908
|
+
i.effect.run();
|
|
2909
|
+
}
|
|
2832
2910
|
}
|
|
2833
|
-
}
|
|
2834
|
-
nextTick(() => {
|
|
2835
|
-
isHmrUpdating = false;
|
|
2836
|
-
});
|
|
2837
|
-
updates.forEach(([instance, dirtyInstances]) => {
|
|
2838
|
-
dirtyInstances.delete(instance);
|
|
2839
2911
|
});
|
|
2840
2912
|
});
|
|
2841
2913
|
});
|
|
@@ -2905,20 +2977,20 @@ function devtoolsInitApp(app, version) {
|
|
|
2905
2977
|
function devtoolsUnmountApp(app) {
|
|
2906
2978
|
emit$2("app:unmount", app);
|
|
2907
2979
|
}
|
|
2908
|
-
const devtoolsComponentAdded =
|
|
2909
|
-
const devtoolsComponentUpdated =
|
|
2910
|
-
const _devtoolsComponentRemoved =
|
|
2980
|
+
const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
|
|
2981
|
+
const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
|
|
2982
|
+
const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
|
|
2911
2983
|
const devtoolsComponentRemoved = (component) => {
|
|
2912
2984
|
if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && !devtools$1.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
|
|
2913
2985
|
};
|
|
2914
|
-
|
|
2986
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2915
2987
|
function createDevtoolsComponentHook(hook) {
|
|
2916
2988
|
return (component) => {
|
|
2917
2989
|
emit$2(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
|
|
2918
2990
|
};
|
|
2919
2991
|
}
|
|
2920
|
-
const devtoolsPerfStart =
|
|
2921
|
-
const devtoolsPerfEnd =
|
|
2992
|
+
const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
|
|
2993
|
+
const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
|
|
2922
2994
|
function createDevtoolsPerformanceHook(hook) {
|
|
2923
2995
|
return (component, type, time) => {
|
|
2924
2996
|
emit$2(hook, component.appContext.app, component.uid, component, type, time);
|
|
@@ -3147,7 +3219,7 @@ function configureCompat$1(config) {
|
|
|
3147
3219
|
validateCompatConfig(config);
|
|
3148
3220
|
extend(globalCompatConfig, config);
|
|
3149
3221
|
}
|
|
3150
|
-
const seenConfigObjects =
|
|
3222
|
+
const seenConfigObjects = /*@__PURE__*/ new WeakSet();
|
|
3151
3223
|
const warnedInvalidKeys = {};
|
|
3152
3224
|
function validateCompatConfig(config, instance) {
|
|
3153
3225
|
if (seenConfigObjects.has(config)) return;
|
|
@@ -3199,7 +3271,7 @@ function checkCompatEnabled$1(key, instance, ...args) {
|
|
|
3199
3271
|
}
|
|
3200
3272
|
//#endregion
|
|
3201
3273
|
//#region packages/runtime-core/src/compat/instanceEventEmitter.ts
|
|
3202
|
-
const eventRegistryMap =
|
|
3274
|
+
const eventRegistryMap = /*@__PURE__*/ new WeakMap();
|
|
3203
3275
|
function getRegistry(instance) {
|
|
3204
3276
|
let events = eventRegistryMap.get(instance);
|
|
3205
3277
|
if (!events) eventRegistryMap.set(instance, events = Object.create(null));
|
|
@@ -3333,19 +3405,21 @@ const legacyDirectiveHookMap = {
|
|
|
3333
3405
|
};
|
|
3334
3406
|
function mapCompatDirectiveHook(name, dir, instance) {
|
|
3335
3407
|
const mappedName = legacyDirectiveHookMap[name];
|
|
3336
|
-
if (mappedName)
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3408
|
+
if (mappedName) {
|
|
3409
|
+
if (isArray(mappedName)) {
|
|
3410
|
+
const hook = [];
|
|
3411
|
+
mappedName.forEach((mapped) => {
|
|
3412
|
+
const mappedHook = dir[mapped];
|
|
3413
|
+
if (mappedHook) {
|
|
3414
|
+
softAssertCompatEnabled("CUSTOM_DIR", instance, mapped, name);
|
|
3415
|
+
hook.push(mappedHook);
|
|
3416
|
+
}
|
|
3417
|
+
});
|
|
3418
|
+
return hook.length ? hook : void 0;
|
|
3419
|
+
} else {
|
|
3420
|
+
if (dir[mappedName]) softAssertCompatEnabled("CUSTOM_DIR", instance, mappedName, name);
|
|
3421
|
+
return dir[mappedName];
|
|
3422
|
+
}
|
|
3349
3423
|
}
|
|
3350
3424
|
}
|
|
3351
3425
|
//#endregion
|
|
@@ -3512,7 +3586,7 @@ function instanceWatch(source, value, options) {
|
|
|
3512
3586
|
}
|
|
3513
3587
|
const prev = setCurrentInstance(this);
|
|
3514
3588
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3515
|
-
|
|
3589
|
+
restoreCurrentInstance(prev);
|
|
3516
3590
|
return res;
|
|
3517
3591
|
}
|
|
3518
3592
|
function createPathGetter(ctx, path) {
|
|
@@ -3534,15 +3608,16 @@ const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target inst
|
|
|
3534
3608
|
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
3535
3609
|
const resolveTarget = (props, select) => {
|
|
3536
3610
|
const targetSelector = props && props.to;
|
|
3537
|
-
if (isString(targetSelector))
|
|
3538
|
-
|
|
3539
|
-
|
|
3611
|
+
if (isString(targetSelector)) {
|
|
3612
|
+
if (!select) {
|
|
3613
|
+
warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
|
|
3614
|
+
return null;
|
|
3615
|
+
} else {
|
|
3616
|
+
const target = select(targetSelector);
|
|
3617
|
+
if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
|
|
3618
|
+
return target;
|
|
3619
|
+
}
|
|
3540
3620
|
} else {
|
|
3541
|
-
const target = select(targetSelector);
|
|
3542
|
-
if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
|
|
3543
|
-
return target;
|
|
3544
|
-
}
|
|
3545
|
-
else {
|
|
3546
3621
|
if (!targetSelector && !isTeleportDisabled(props)) warn$1(`Invalid Teleport target: ${targetSelector}`);
|
|
3547
3622
|
return targetSelector;
|
|
3548
3623
|
}
|
|
@@ -3580,7 +3655,8 @@ const TeleportImpl = {
|
|
|
3580
3655
|
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3581
3656
|
pendingMounts.delete(vnode);
|
|
3582
3657
|
if (isTeleportDisabled(vnode.props)) {
|
|
3583
|
-
|
|
3658
|
+
const mountContainer = parentNode(vnode.el) || container;
|
|
3659
|
+
mount(vnode, mountContainer, vnode.anchor);
|
|
3584
3660
|
updateCssVars(vnode, true);
|
|
3585
3661
|
}
|
|
3586
3662
|
mountToTarget(vnode);
|
|
@@ -3689,15 +3765,17 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
3689
3765
|
const disabled = isTeleportDisabled(vnode.props);
|
|
3690
3766
|
if (target) {
|
|
3691
3767
|
const targetNode = target._lpa || target.firstChild;
|
|
3692
|
-
if (vnode.shapeFlag & 16)
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3768
|
+
if (vnode.shapeFlag & 16) {
|
|
3769
|
+
if (disabled) {
|
|
3770
|
+
hydrateDisabledTeleport(node, vnode);
|
|
3771
|
+
hydrateAnchor(target, targetNode);
|
|
3772
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
|
|
3773
|
+
} else {
|
|
3774
|
+
vnode.anchor = nextSibling(node);
|
|
3775
|
+
hydrateAnchor(target, targetNode);
|
|
3776
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
|
|
3777
|
+
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3778
|
+
}
|
|
3701
3779
|
}
|
|
3702
3780
|
updateCssVars(vnode, disabled);
|
|
3703
3781
|
} else if (disabled) {
|
|
@@ -3775,59 +3853,27 @@ const BaseTransitionPropsValidators = {
|
|
|
3775
3853
|
onAfterAppear: TransitionHookValidator,
|
|
3776
3854
|
onAppearCancelled: TransitionHookValidator
|
|
3777
3855
|
};
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3856
|
+
function isEmptyTransitionChild(vnode, instance) {
|
|
3857
|
+
if (vnode.type === Comment) return true;
|
|
3858
|
+
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
3859
|
+
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
3860
|
+
}
|
|
3782
3861
|
const BaseTransitionImpl = {
|
|
3783
3862
|
name: `BaseTransition`,
|
|
3784
3863
|
props: BaseTransitionPropsValidators,
|
|
3785
3864
|
setup(props, { slots }) {
|
|
3786
3865
|
const instance = getCurrentInstance();
|
|
3787
3866
|
const state = useTransitionState();
|
|
3867
|
+
let resumeAfterLeave;
|
|
3788
3868
|
return () => {
|
|
3789
|
-
const
|
|
3790
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3869
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
3791
3870
|
if (!child) return;
|
|
3792
3871
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3793
3872
|
const { mode } = rawProps;
|
|
3794
3873
|
checkTransitionMode(mode);
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
3799
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
3800
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
3801
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
3802
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
3803
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
3804
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
3805
|
-
state.isLeaving = true;
|
|
3806
|
-
leavingHooks.afterLeave = () => {
|
|
3807
|
-
state.isLeaving = false;
|
|
3808
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
3809
|
-
delete leavingHooks.afterLeave;
|
|
3810
|
-
oldInnerChild = void 0;
|
|
3811
|
-
};
|
|
3812
|
-
return emptyPlaceholder(child);
|
|
3813
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3814
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
3815
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
3816
|
-
el[leaveCbKey] = () => {
|
|
3817
|
-
earlyRemove();
|
|
3818
|
-
el[leaveCbKey] = void 0;
|
|
3819
|
-
delete enterHooks.delayedLeave;
|
|
3820
|
-
oldInnerChild = void 0;
|
|
3821
|
-
};
|
|
3822
|
-
enterHooks.delayedLeave = () => {
|
|
3823
|
-
delayedLeave();
|
|
3824
|
-
delete enterHooks.delayedLeave;
|
|
3825
|
-
oldInnerChild = void 0;
|
|
3826
|
-
};
|
|
3827
|
-
};
|
|
3828
|
-
else oldInnerChild = void 0;
|
|
3829
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
3830
|
-
return child;
|
|
3874
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
3875
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
3876
|
+
}) : NOOP);
|
|
3831
3877
|
};
|
|
3832
3878
|
}
|
|
3833
3879
|
};
|
|
@@ -3860,7 +3906,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
3860
3906
|
function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
3861
3907
|
const key = String(vnode.key);
|
|
3862
3908
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3863
|
-
|
|
3909
|
+
const hooks = baseResolveTransitionHooks({
|
|
3864
3910
|
isLeaving: () => leavingVNodesCache[key] === vnode,
|
|
3865
3911
|
setLeavingNodeCache: () => {
|
|
3866
3912
|
leavingVNodesCache[key] = vnode;
|
|
@@ -3878,6 +3924,13 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
3878
3924
|
return hooks;
|
|
3879
3925
|
}
|
|
3880
3926
|
}, props, state, instance);
|
|
3927
|
+
if (vnode.type === VaporSlot) extend(hooks, {
|
|
3928
|
+
__vapor: true,
|
|
3929
|
+
props,
|
|
3930
|
+
state,
|
|
3931
|
+
instance
|
|
3932
|
+
});
|
|
3933
|
+
return hooks;
|
|
3881
3934
|
}
|
|
3882
3935
|
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
3883
3936
|
const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
|
|
@@ -3897,8 +3950,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3897
3950
|
persisted,
|
|
3898
3951
|
beforeEnter(el) {
|
|
3899
3952
|
let hook = onBeforeEnter;
|
|
3900
|
-
if (!state.isMounted)
|
|
3901
|
-
|
|
3953
|
+
if (!state.isMounted) {
|
|
3954
|
+
if (appear) hook = onBeforeAppear || onBeforeEnter;
|
|
3955
|
+
else return;
|
|
3956
|
+
}
|
|
3902
3957
|
if (el[leaveCbKey]) el[leaveCbKey](true);
|
|
3903
3958
|
earlyRemove();
|
|
3904
3959
|
callHook(hook, [el]);
|
|
@@ -3908,11 +3963,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3908
3963
|
let hook = onEnter;
|
|
3909
3964
|
let afterHook = onAfterEnter;
|
|
3910
3965
|
let cancelHook = onEnterCancelled;
|
|
3911
|
-
if (!state.isMounted)
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3966
|
+
if (!state.isMounted) {
|
|
3967
|
+
if (appear) {
|
|
3968
|
+
hook = onAppear || onEnter;
|
|
3969
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
3970
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
3971
|
+
} else return;
|
|
3972
|
+
}
|
|
3916
3973
|
let called = false;
|
|
3917
3974
|
el[enterCbKey$1] = (cancelled) => {
|
|
3918
3975
|
if (called) return;
|
|
@@ -3946,7 +4003,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3946
4003
|
else done();
|
|
3947
4004
|
},
|
|
3948
4005
|
clone(node) {
|
|
3949
|
-
return cloneHooks(node);
|
|
4006
|
+
return cloneHooks ? cloneHooks(node) : hooks;
|
|
3950
4007
|
}
|
|
3951
4008
|
};
|
|
3952
4009
|
return hooks;
|
|
@@ -3970,16 +4027,91 @@ function getInnerChild$1(vnode) {
|
|
|
3970
4027
|
if (shapeFlag & 32 && isFunction(children.default)) return children.default();
|
|
3971
4028
|
}
|
|
3972
4029
|
}
|
|
4030
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
4031
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
4032
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
4033
|
+
}
|
|
4034
|
+
/**
|
|
4035
|
+
* @internal
|
|
4036
|
+
*/
|
|
4037
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
4038
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
4039
|
+
const nextInner = getInnerChild$1(next);
|
|
4040
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
4041
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
4042
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
4043
|
+
enterHooks = hooks;
|
|
4044
|
+
});
|
|
4045
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
4046
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
4047
|
+
const mode = props.mode;
|
|
4048
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
4049
|
+
if (previous && previousInner && !isSameVNodeType(previousInner, nextInner) && !isEmptyTransitionChild(previousInner, instance)) {
|
|
4050
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
4051
|
+
if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
|
|
4052
|
+
}
|
|
4053
|
+
return next;
|
|
4054
|
+
}
|
|
4055
|
+
function forwardDelayedLeave(hooks, source) {
|
|
4056
|
+
const delayedLeave = source && source.delayedLeave;
|
|
4057
|
+
if (!delayedLeave) return;
|
|
4058
|
+
hooks.delayedLeave = () => {
|
|
4059
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
4060
|
+
delete hooks.delayedLeave;
|
|
4061
|
+
};
|
|
4062
|
+
}
|
|
4063
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
4064
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
4065
|
+
}
|
|
4066
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
4067
|
+
if (props.mode === "out-in") {
|
|
4068
|
+
state.isLeaving = true;
|
|
4069
|
+
leavingHooks.afterLeave = () => {
|
|
4070
|
+
state.isLeaving = false;
|
|
4071
|
+
resumeAfterLeave();
|
|
4072
|
+
delete leavingHooks.afterLeave;
|
|
4073
|
+
};
|
|
4074
|
+
return true;
|
|
4075
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
4076
|
+
let delayedLeavingVNode = leavingVNode;
|
|
4077
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
4078
|
+
const enterHooks = getEnterHooks();
|
|
4079
|
+
if (!enterHooks) {
|
|
4080
|
+
delayedLeave();
|
|
4081
|
+
return;
|
|
4082
|
+
}
|
|
4083
|
+
const vnode = delayedLeavingVNode;
|
|
4084
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
4085
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
4086
|
+
el[leaveCbKey] = () => {
|
|
4087
|
+
earlyRemove();
|
|
4088
|
+
el[leaveCbKey] = void 0;
|
|
4089
|
+
delete enterHooks.delayedLeave;
|
|
4090
|
+
delayedLeavingVNode = void 0;
|
|
4091
|
+
};
|
|
4092
|
+
enterHooks.delayedLeave = () => {
|
|
4093
|
+
delayedLeave();
|
|
4094
|
+
delete enterHooks.delayedLeave;
|
|
4095
|
+
delayedLeavingVNode = void 0;
|
|
4096
|
+
};
|
|
4097
|
+
};
|
|
4098
|
+
}
|
|
4099
|
+
return false;
|
|
4100
|
+
}
|
|
3973
4101
|
function setTransitionHooks(vnode, hooks) {
|
|
3974
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
3975
|
-
else {
|
|
4102
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3976
4103
|
vnode.transition = hooks;
|
|
3977
|
-
setTransitionHooks(vnode.component
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
4104
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
4105
|
+
else {
|
|
4106
|
+
const subTree = vnode.component.subTree;
|
|
4107
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
4108
|
+
}
|
|
4109
|
+
} else if (vnode.shapeFlag & 128) {
|
|
4110
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4111
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
4112
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
3982
4113
|
} else vnode.transition = hooks;
|
|
4114
|
+
return hooks;
|
|
3983
4115
|
}
|
|
3984
4116
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
3985
4117
|
let ret = [];
|
|
@@ -4003,9 +4135,9 @@ function checkTransitionMode(mode) {
|
|
|
4003
4135
|
}
|
|
4004
4136
|
//#endregion
|
|
4005
4137
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
4006
|
-
|
|
4138
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
4007
4139
|
function defineComponent(options, extraOptions) {
|
|
4008
|
-
return isFunction(options) ? extend({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
4140
|
+
return isFunction(options) ? /*@__PURE__*/ (() => extend({ name: options.name }, extraOptions, { setup: options }))() : options;
|
|
4009
4141
|
}
|
|
4010
4142
|
//#endregion
|
|
4011
4143
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -4102,15 +4234,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4102
4234
|
if (rawRef.f) {
|
|
4103
4235
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
4104
4236
|
if (isUnmount) isArray(existing) && remove(existing, refValue);
|
|
4105
|
-
else if (!isArray(existing))
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4237
|
+
else if (!isArray(existing)) {
|
|
4238
|
+
if (_isString) {
|
|
4239
|
+
refs[ref] = [refValue];
|
|
4240
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
4241
|
+
} else {
|
|
4242
|
+
const newVal = [refValue];
|
|
4243
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
4244
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
4245
|
+
}
|
|
4246
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
4114
4247
|
} else if (_isString) {
|
|
4115
4248
|
refs[ref] = value;
|
|
4116
4249
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -4162,7 +4295,18 @@ const logMismatchError = () => {
|
|
|
4162
4295
|
hasLoggedMismatchError = true;
|
|
4163
4296
|
};
|
|
4164
4297
|
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
4165
|
-
const isMathMLContainer = (container) =>
|
|
4298
|
+
const isMathMLContainer = (container) => {
|
|
4299
|
+
if (!container.namespaceURI.includes("MathML")) return false;
|
|
4300
|
+
if (container.tagName !== "annotation-xml") return true;
|
|
4301
|
+
const encoding = container.getAttribute("encoding");
|
|
4302
|
+
return !encoding || !encoding.includes("html");
|
|
4303
|
+
};
|
|
4304
|
+
/**
|
|
4305
|
+
* Resolve the element namespace a container's children should be created in.
|
|
4306
|
+
* The live DOM is the source of truth, so this also covers containers that are
|
|
4307
|
+
* only known at runtime (interop boundaries, teleport targets).
|
|
4308
|
+
* @internal
|
|
4309
|
+
*/
|
|
4166
4310
|
const getContainerType = (container) => {
|
|
4167
4311
|
if (container.nodeType !== 1) return void 0;
|
|
4168
4312
|
if (isSVGContainer(container)) return "svg";
|
|
@@ -4186,7 +4330,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4186
4330
|
};
|
|
4187
4331
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
4188
4332
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4189
|
-
const isFragmentStart = isComment(node) && node.data === "[";
|
|
4333
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
|
|
4190
4334
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
4191
4335
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
4192
4336
|
let domType = node.nodeType;
|
|
@@ -4200,11 +4344,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4200
4344
|
let nextNode = null;
|
|
4201
4345
|
switch (type) {
|
|
4202
4346
|
case Text:
|
|
4203
|
-
if (domType !== 3)
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4347
|
+
if (domType !== 3) {
|
|
4348
|
+
if (vnode.children === "") {
|
|
4349
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
4350
|
+
nextNode = node;
|
|
4351
|
+
} else nextNode = onMismatch();
|
|
4352
|
+
} else {
|
|
4208
4353
|
if (node.data !== vnode.children) {
|
|
4209
4354
|
warn$1(`Hydration text mismatch in`, node.parentNode, `\n - rendered on server: ${JSON.stringify(node.data)}\n - expected on client: ${JSON.stringify(vnode.children)}`);
|
|
4210
4355
|
logMismatchError();
|
|
@@ -4241,45 +4386,35 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4241
4386
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4242
4387
|
break;
|
|
4243
4388
|
case VaporSlot:
|
|
4244
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
4389
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
4245
4390
|
break;
|
|
4246
|
-
default: if (shapeFlag & 1)
|
|
4247
|
-
|
|
4248
|
-
|
|
4391
|
+
default: if (shapeFlag & 1) {
|
|
4392
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
|
|
4393
|
+
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4394
|
+
} else if (shapeFlag & 6) {
|
|
4249
4395
|
vnode.slotScopeIds = slotScopeIds;
|
|
4250
4396
|
const container = parentNode(node);
|
|
4251
4397
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
4252
4398
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
4253
4399
|
else nextNode = nextSibling(node);
|
|
4254
|
-
if (vnode.type.__vapor)
|
|
4255
|
-
|
|
4256
|
-
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
4257
|
-
if (vnode.dirs) {
|
|
4258
|
-
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
4259
|
-
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
4260
|
-
}
|
|
4261
|
-
}, () => {
|
|
4262
|
-
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
4263
|
-
});
|
|
4264
|
-
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
4265
|
-
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
4266
|
-
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
4267
|
-
} else {
|
|
4400
|
+
if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
|
|
4401
|
+
else {
|
|
4268
4402
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
4269
4403
|
const component = vnode.component;
|
|
4270
|
-
if (isAsyncWrapper(vnode)
|
|
4404
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
4271
4405
|
let subTree;
|
|
4272
4406
|
if (isFragmentStart) {
|
|
4273
|
-
subTree = createVNode(
|
|
4407
|
+
subTree = createVNode(Static);
|
|
4274
4408
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4275
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
4409
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
4276
4410
|
subTree.el = node;
|
|
4277
4411
|
component.subTree = subTree;
|
|
4278
4412
|
}
|
|
4279
4413
|
}
|
|
4280
|
-
} else if (shapeFlag & 64)
|
|
4281
|
-
|
|
4282
|
-
|
|
4414
|
+
} else if (shapeFlag & 64) {
|
|
4415
|
+
if (domType !== 8) nextNode = onMismatch();
|
|
4416
|
+
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
4417
|
+
} else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
4283
4418
|
else warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
4284
4419
|
}
|
|
4285
4420
|
if (ref != null) setRef(ref, null, parentSuspense, vnode);
|
|
@@ -4331,7 +4466,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4331
4466
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
4332
4467
|
for (const key in props) {
|
|
4333
4468
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
4334
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key))
|
|
4469
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
4470
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
4471
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
4472
|
+
}
|
|
4335
4473
|
}
|
|
4336
4474
|
}
|
|
4337
4475
|
let vnodeHooks;
|
|
@@ -4379,8 +4517,9 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4379
4517
|
const { slotScopeIds: fragmentSlotScopeIds } = vnode;
|
|
4380
4518
|
if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
4381
4519
|
const container = parentNode(node);
|
|
4382
|
-
const
|
|
4383
|
-
|
|
4520
|
+
const first = nextSibling(node);
|
|
4521
|
+
const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4522
|
+
if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
|
|
4384
4523
|
else {
|
|
4385
4524
|
logMismatchError();
|
|
4386
4525
|
insert(vnode.anchor = createComment(`]`), container, next);
|
|
@@ -4389,7 +4528,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4389
4528
|
};
|
|
4390
4529
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
4391
4530
|
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
4392
|
-
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
4531
|
+
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data === "[" || node.data === "(") ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
4393
4532
|
logMismatchError();
|
|
4394
4533
|
}
|
|
4395
4534
|
vnode.el = null;
|
|
@@ -4405,20 +4544,22 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4405
4544
|
const container = parentNode(node);
|
|
4406
4545
|
remove(node);
|
|
4407
4546
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
4408
|
-
if (parentComponent) {
|
|
4547
|
+
if (parentComponent && parentComponent.vnode) {
|
|
4409
4548
|
parentComponent.vnode.el = vnode.el;
|
|
4410
4549
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
4411
4550
|
}
|
|
4412
4551
|
return next;
|
|
4413
4552
|
};
|
|
4414
|
-
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
4553
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
|
|
4415
4554
|
let match = 0;
|
|
4416
4555
|
while (node) {
|
|
4417
4556
|
node = nextSibling(node);
|
|
4418
4557
|
if (node && isComment(node)) {
|
|
4419
4558
|
if (node.data === open) match++;
|
|
4420
|
-
if (node.data === close)
|
|
4421
|
-
|
|
4559
|
+
if (node.data === close) {
|
|
4560
|
+
if (match === 0) return nextSibling(node);
|
|
4561
|
+
else match--;
|
|
4562
|
+
}
|
|
4422
4563
|
}
|
|
4423
4564
|
}
|
|
4424
4565
|
return node;
|
|
@@ -4428,7 +4569,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4428
4569
|
if (parentNode) parentNode.replaceChild(newNode, oldNode);
|
|
4429
4570
|
let parent = parentComponent;
|
|
4430
4571
|
while (parent) {
|
|
4431
|
-
if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
4572
|
+
if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
4432
4573
|
parent = parent.parent;
|
|
4433
4574
|
}
|
|
4434
4575
|
};
|
|
@@ -4437,6 +4578,16 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4437
4578
|
const isTemplateNode$1 = (node) => {
|
|
4438
4579
|
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
4439
4580
|
};
|
|
4581
|
+
const resourceProps = /*@__PURE__*/ new Set([
|
|
4582
|
+
"src",
|
|
4583
|
+
"srcset",
|
|
4584
|
+
"href",
|
|
4585
|
+
"poster"
|
|
4586
|
+
]);
|
|
4587
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
4588
|
+
if (!resourceProps.has(key)) return false;
|
|
4589
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
4590
|
+
}
|
|
4440
4591
|
/**
|
|
4441
4592
|
* Dev only
|
|
4442
4593
|
*/
|
|
@@ -4480,7 +4631,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
4480
4631
|
function getAttributeMismatch(el, key, clientValue) {
|
|
4481
4632
|
let actual;
|
|
4482
4633
|
let expected;
|
|
4483
|
-
if (
|
|
4634
|
+
if (key === "hidden") {
|
|
4635
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
4636
|
+
expected = normalizeHiddenValue(clientValue);
|
|
4637
|
+
} else if (isBooleanAttr(key)) {
|
|
4484
4638
|
actual = el.hasAttribute(key);
|
|
4485
4639
|
expected = includeBooleanAttr(clientValue);
|
|
4486
4640
|
} else if (clientValue == null) {
|
|
@@ -4508,6 +4662,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
|
|
|
4508
4662
|
}
|
|
4509
4663
|
return false;
|
|
4510
4664
|
}
|
|
4665
|
+
function normalizeHiddenValue(value) {
|
|
4666
|
+
if (!isRenderableAttrValue(value)) return false;
|
|
4667
|
+
if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
4668
|
+
return includeBooleanAttr(value) ? "" : false;
|
|
4669
|
+
}
|
|
4511
4670
|
function toClassSet(str) {
|
|
4512
4671
|
return new Set(str.trim().split(/\s+/));
|
|
4513
4672
|
}
|
|
@@ -4646,16 +4805,18 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
4646
4805
|
return teardown;
|
|
4647
4806
|
};
|
|
4648
4807
|
function forEachElement(node, cb) {
|
|
4649
|
-
if (isComment(node) && node.data === "[") {
|
|
4808
|
+
if (isComment(node) && (node.data === "[" || node.data === "(")) {
|
|
4809
|
+
const open = node.data;
|
|
4810
|
+
const close = open === "[" ? "]" : ")";
|
|
4650
4811
|
let depth = 1;
|
|
4651
4812
|
let next = node.nextSibling;
|
|
4652
4813
|
while (next) {
|
|
4653
4814
|
if (next.nodeType === 1) {
|
|
4654
4815
|
if (cb(next) === false) break;
|
|
4655
4816
|
} else if (isComment(next)) {
|
|
4656
|
-
if (next.data ===
|
|
4817
|
+
if (next.data === close) {
|
|
4657
4818
|
if (--depth === 0) break;
|
|
4658
|
-
} else if (next.data ===
|
|
4819
|
+
} else if (next.data === open) depth++;
|
|
4659
4820
|
}
|
|
4660
4821
|
next = next.nextSibling;
|
|
4661
4822
|
}
|
|
@@ -4664,14 +4825,14 @@ function forEachElement(node, cb) {
|
|
|
4664
4825
|
//#endregion
|
|
4665
4826
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
4666
4827
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
4667
|
-
|
|
4828
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
4668
4829
|
function defineAsyncComponent(source) {
|
|
4669
4830
|
const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
|
|
4670
4831
|
return /* @__PURE__ */ defineComponent({
|
|
4671
4832
|
name: "AsyncComponentWrapper",
|
|
4672
4833
|
__asyncLoader: load,
|
|
4673
4834
|
__asyncHydrate(el, instance, hydrate) {
|
|
4674
|
-
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
|
|
4835
|
+
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
|
|
4675
4836
|
},
|
|
4676
4837
|
get __asyncResolved() {
|
|
4677
4838
|
return getResolvedComp();
|
|
@@ -4790,10 +4951,10 @@ const useAsyncComponentState = (delay, timeout, onError, instance = currentInsta
|
|
|
4790
4951
|
* shared between core and vapor
|
|
4791
4952
|
* @internal
|
|
4792
4953
|
*/
|
|
4793
|
-
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
4954
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
|
|
4794
4955
|
const wasConnected = el.isConnected;
|
|
4795
4956
|
let patched = false;
|
|
4796
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4957
|
+
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4797
4958
|
const performHydrate = () => {
|
|
4798
4959
|
if (patched) {
|
|
4799
4960
|
{
|
|
@@ -4879,10 +5040,13 @@ const KeepAliveImpl = {
|
|
|
4879
5040
|
});
|
|
4880
5041
|
let pendingCacheKey = null;
|
|
4881
5042
|
const cacheSubtree = () => {
|
|
4882
|
-
if (pendingCacheKey != null)
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
5043
|
+
if (pendingCacheKey != null) {
|
|
5044
|
+
if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
|
|
5045
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
5046
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
5047
|
+
}, void 0, keepAliveInstance.subTree.suspense);
|
|
5048
|
+
else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
5049
|
+
}
|
|
4886
5050
|
};
|
|
4887
5051
|
onMounted(cacheSubtree);
|
|
4888
5052
|
onUpdated(cacheSubtree);
|
|
@@ -4953,7 +5117,7 @@ const decorate$2 = (t) => {
|
|
|
4953
5117
|
t.__isBuiltIn = true;
|
|
4954
5118
|
return t;
|
|
4955
5119
|
};
|
|
4956
|
-
const KeepAlive =
|
|
5120
|
+
const KeepAlive = /*@__PURE__*/ decorate$2(KeepAliveImpl);
|
|
4957
5121
|
function matches(pattern, name) {
|
|
4958
5122
|
if (isArray(pattern)) return pattern.some((p) => matches(p, name));
|
|
4959
5123
|
else if (isString(pattern)) return pattern.split(",").includes(name);
|
|
@@ -5044,7 +5208,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
5044
5208
|
try {
|
|
5045
5209
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
5046
5210
|
} finally {
|
|
5047
|
-
|
|
5211
|
+
restoreCurrentInstance(prev);
|
|
5048
5212
|
setActiveSub(prevSub);
|
|
5049
5213
|
}
|
|
5050
5214
|
});
|
|
@@ -5169,16 +5333,17 @@ function compatH(type, propsOrChildren, children) {
|
|
|
5169
5333
|
}
|
|
5170
5334
|
const l = arguments.length;
|
|
5171
5335
|
const is2ndArgArrayChildren = isArray(propsOrChildren);
|
|
5172
|
-
if (l === 2 || is2ndArgArrayChildren)
|
|
5173
|
-
if (
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5336
|
+
if (l === 2 || is2ndArgArrayChildren) {
|
|
5337
|
+
if (isObject(propsOrChildren) && !is2ndArgArrayChildren) {
|
|
5338
|
+
if (isVNode(propsOrChildren)) return convertLegacySlots(createVNode(type, null, [propsOrChildren]));
|
|
5339
|
+
return convertLegacySlots(convertLegacyDirectives(createVNode(type, convertLegacyProps(propsOrChildren, type)), propsOrChildren));
|
|
5340
|
+
} else return convertLegacySlots(createVNode(type, null, propsOrChildren));
|
|
5341
|
+
} else {
|
|
5177
5342
|
if (isVNode(children)) children = [children];
|
|
5178
5343
|
return convertLegacySlots(convertLegacyDirectives(createVNode(type, convertLegacyProps(propsOrChildren, type), children), propsOrChildren));
|
|
5179
5344
|
}
|
|
5180
5345
|
}
|
|
5181
|
-
const skipLegacyRootLevelProps =
|
|
5346
|
+
const skipLegacyRootLevelProps = /*@__PURE__*/ makeMap("staticStyle,staticClass,directives,model,hook");
|
|
5182
5347
|
function convertLegacyProps(legacyProps, type) {
|
|
5183
5348
|
if (!legacyProps) return null;
|
|
5184
5349
|
const converted = {};
|
|
@@ -5190,8 +5355,10 @@ function convertLegacyProps(legacyProps, type) {
|
|
|
5190
5355
|
if (key === "nativeOn") handlerKey += `Native`;
|
|
5191
5356
|
const existing = converted[handlerKey];
|
|
5192
5357
|
const incoming = listeners[event];
|
|
5193
|
-
if (existing !== incoming)
|
|
5194
|
-
|
|
5358
|
+
if (existing !== incoming) {
|
|
5359
|
+
if (existing) converted[handlerKey] = [].concat(existing, incoming);
|
|
5360
|
+
else converted[handlerKey] = incoming;
|
|
5361
|
+
}
|
|
5195
5362
|
}
|
|
5196
5363
|
} else if (!skipLegacyRootLevelProps(key)) converted[key] = legacyProps[key];
|
|
5197
5364
|
if (legacyProps.staticClass) converted.class = normalizeClass([legacyProps.staticClass, converted.class]);
|
|
@@ -5290,7 +5457,7 @@ function convertLegacyFunctionalComponent(comp) {
|
|
|
5290
5457
|
const legacyFn = comp.render;
|
|
5291
5458
|
const Func = (props, ctx) => {
|
|
5292
5459
|
const instance = getCurrentInstance();
|
|
5293
|
-
|
|
5460
|
+
const legacyCtx = {
|
|
5294
5461
|
props,
|
|
5295
5462
|
children: instance.vnode.children || [],
|
|
5296
5463
|
data: instance.vnode.props || {},
|
|
@@ -5310,7 +5477,8 @@ function convertLegacyFunctionalComponent(comp) {
|
|
|
5310
5477
|
}
|
|
5311
5478
|
return {};
|
|
5312
5479
|
}
|
|
5313
|
-
}
|
|
5480
|
+
};
|
|
5481
|
+
return legacyFn(compatH, legacyCtx);
|
|
5314
5482
|
};
|
|
5315
5483
|
Func.props = comp.props;
|
|
5316
5484
|
Func.displayName = comp.name;
|
|
@@ -5339,23 +5507,25 @@ function renderList(source, renderItem, cache, index) {
|
|
|
5339
5507
|
}
|
|
5340
5508
|
ret = new Array(source.length);
|
|
5341
5509
|
for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
|
|
5342
|
-
} else if (typeof source === "number")
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
else if (isObject(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
5350
|
-
else {
|
|
5351
|
-
const keys = Object.keys(source);
|
|
5352
|
-
ret = new Array(keys.length);
|
|
5353
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
5354
|
-
const key = keys[i];
|
|
5355
|
-
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
5510
|
+
} else if (typeof source === "number") {
|
|
5511
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
5512
|
+
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
5513
|
+
ret = [];
|
|
5514
|
+
} else {
|
|
5515
|
+
ret = new Array(source);
|
|
5516
|
+
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
5356
5517
|
}
|
|
5357
|
-
}
|
|
5358
|
-
|
|
5518
|
+
} else if (isObject(source)) {
|
|
5519
|
+
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
5520
|
+
else {
|
|
5521
|
+
const keys = Object.keys(source);
|
|
5522
|
+
ret = new Array(keys.length);
|
|
5523
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
5524
|
+
const key = keys[i];
|
|
5525
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
5526
|
+
}
|
|
5527
|
+
}
|
|
5528
|
+
} else ret = [];
|
|
5359
5529
|
if (cache) cache[index] = ret;
|
|
5360
5530
|
return ret;
|
|
5361
5531
|
}
|
|
@@ -5380,18 +5550,28 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5380
5550
|
//#endregion
|
|
5381
5551
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
5382
5552
|
/**
|
|
5553
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
5554
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
5555
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
5556
|
+
* "which one". Internal to vapor interop.
|
|
5557
|
+
*/
|
|
5558
|
+
const rawVaporSlotKey = Symbol(`rawVaporSlot`);
|
|
5559
|
+
/**
|
|
5383
5560
|
* Compiler runtime helper for rendering `<slot/>`
|
|
5384
5561
|
* @private
|
|
5385
5562
|
*/
|
|
5386
|
-
function renderSlot(slots, name, props
|
|
5563
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
5564
|
+
if (props == null) props = {};
|
|
5387
5565
|
let slot = slots[name];
|
|
5388
|
-
|
|
5389
|
-
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
5566
|
+
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
5390
5567
|
if (vaporSlot) {
|
|
5391
5568
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
5392
5569
|
ret.vs = {
|
|
5393
5570
|
slot: vaporSlot,
|
|
5394
|
-
fallback
|
|
5571
|
+
outlets: fallback ? [{
|
|
5572
|
+
fallback,
|
|
5573
|
+
owner: currentRenderingInstance
|
|
5574
|
+
}] : void 0
|
|
5395
5575
|
};
|
|
5396
5576
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
5397
5577
|
return ret;
|
|
@@ -5412,9 +5592,15 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
|
5412
5592
|
let rendered;
|
|
5413
5593
|
try {
|
|
5414
5594
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
5415
|
-
|
|
5595
|
+
let attached = false;
|
|
5596
|
+
if (fallback && validSlotContent && currentRenderingInstance) {
|
|
5597
|
+
const interop = currentRenderingInstance.appContext.vapor;
|
|
5598
|
+
if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
|
|
5599
|
+
}
|
|
5416
5600
|
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
5417
5601
|
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
5602
|
+
if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
|
|
5603
|
+
if (attached) rendered.vo = true;
|
|
5418
5604
|
} catch (err) {
|
|
5419
5605
|
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
5420
5606
|
throw err;
|
|
@@ -5432,10 +5618,6 @@ function ensureValidVNode(vnodes) {
|
|
|
5432
5618
|
return true;
|
|
5433
5619
|
}) ? vnodes : null;
|
|
5434
5620
|
}
|
|
5435
|
-
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
5436
|
-
let vaporSlot;
|
|
5437
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
5438
|
-
}
|
|
5439
5621
|
//#endregion
|
|
5440
5622
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
5441
5623
|
/**
|
|
@@ -5494,12 +5676,14 @@ function legacyResolveScopedSlots(fns, raw, hasDynamicKeys) {
|
|
|
5494
5676
|
function mapKeyToName(slots) {
|
|
5495
5677
|
for (let i = 0; i < slots.length; i++) {
|
|
5496
5678
|
const fn = slots[i];
|
|
5497
|
-
if (fn)
|
|
5498
|
-
|
|
5679
|
+
if (fn) {
|
|
5680
|
+
if (isArray(fn)) mapKeyToName(fn);
|
|
5681
|
+
else fn.name = fn.key || "default";
|
|
5682
|
+
}
|
|
5499
5683
|
}
|
|
5500
5684
|
return slots;
|
|
5501
5685
|
}
|
|
5502
|
-
const staticCacheMap =
|
|
5686
|
+
const staticCacheMap = /*@__PURE__*/ new WeakMap();
|
|
5503
5687
|
function legacyRenderStatic(instance, index) {
|
|
5504
5688
|
let cache = staticCacheMap.get(instance);
|
|
5505
5689
|
if (!cache) staticCacheMap.set(instance, cache = []);
|
|
@@ -5632,11 +5816,38 @@ const getPublicInstance = (i) => {
|
|
|
5632
5816
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
5633
5817
|
return getPublicInstance(i.parent);
|
|
5634
5818
|
};
|
|
5819
|
+
const resolveDevRootEl = (vnode) => {
|
|
5820
|
+
let found = false;
|
|
5821
|
+
while (true) {
|
|
5822
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
5823
|
+
const root = filterSingleRoot(vnode.children);
|
|
5824
|
+
if (!root) return;
|
|
5825
|
+
vnode = root;
|
|
5826
|
+
found = true;
|
|
5827
|
+
continue;
|
|
5828
|
+
}
|
|
5829
|
+
const component = vnode.component;
|
|
5830
|
+
if (component && component.subTree) {
|
|
5831
|
+
vnode = component.subTree;
|
|
5832
|
+
continue;
|
|
5833
|
+
}
|
|
5834
|
+
const suspense = vnode.suspense;
|
|
5835
|
+
if (suspense && suspense.activeBranch) {
|
|
5836
|
+
vnode = suspense.activeBranch;
|
|
5837
|
+
continue;
|
|
5838
|
+
}
|
|
5839
|
+
return found ? vnode.el : void 0;
|
|
5840
|
+
}
|
|
5841
|
+
};
|
|
5842
|
+
const getDevRootFragmentEl = (i) => {
|
|
5843
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
5844
|
+
return el === void 0 ? i.vnode.el : el;
|
|
5845
|
+
};
|
|
5635
5846
|
let publicPropertiesMap;
|
|
5636
5847
|
const getPublicPropertiesMap = () => {
|
|
5637
5848
|
if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
|
|
5638
5849
|
$: (i) => i,
|
|
5639
|
-
$el: (i) => i
|
|
5850
|
+
$el: (i) => getDevRootFragmentEl(i),
|
|
5640
5851
|
$data: (i) => i.data,
|
|
5641
5852
|
$props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
|
|
5642
5853
|
$attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
|
|
@@ -5749,7 +5960,7 @@ PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
|
5749
5960
|
warn$1("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.");
|
|
5750
5961
|
return Reflect.ownKeys(target);
|
|
5751
5962
|
};
|
|
5752
|
-
const RuntimeCompiledPublicInstanceProxyHandlers =
|
|
5963
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ extend({}, PublicInstanceProxyHandlers, {
|
|
5753
5964
|
get(target, key) {
|
|
5754
5965
|
if (key === Symbol.unscopables) return;
|
|
5755
5966
|
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
@@ -5934,12 +6145,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
5934
6145
|
for (const key in defaults) {
|
|
5935
6146
|
if (key.startsWith("__skip")) continue;
|
|
5936
6147
|
let opt = props[key];
|
|
5937
|
-
if (opt)
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
6148
|
+
if (opt) {
|
|
6149
|
+
if (isArray(opt) || isFunction(opt)) opt = props[key] = {
|
|
6150
|
+
type: opt,
|
|
6151
|
+
default: defaults[key]
|
|
6152
|
+
};
|
|
6153
|
+
else opt.default = defaults[key];
|
|
6154
|
+
} else if (opt === null) opt = props[key] = { default: defaults[key] };
|
|
5943
6155
|
else warn$1(`props default key "${key}" has no corresponding declaration.`);
|
|
5944
6156
|
if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
|
|
5945
6157
|
}
|
|
@@ -5989,37 +6201,32 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
5989
6201
|
function withAsyncContext(getAwaitable) {
|
|
5990
6202
|
const ctx = getCurrentGenericInstance();
|
|
5991
6203
|
const inSSRSetup = isInSSRComponentSetup;
|
|
5992
|
-
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
5993
6204
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
5994
6205
|
let awaitable = getAwaitable();
|
|
5995
6206
|
setCurrentInstance(null, void 0);
|
|
5996
6207
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5997
6208
|
const restore = () => {
|
|
5998
|
-
const
|
|
6209
|
+
const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5999
6210
|
setCurrentInstance(ctx);
|
|
6000
6211
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
6001
|
-
|
|
6002
|
-
return () => {
|
|
6003
|
-
if (reset) reset();
|
|
6004
|
-
if (resetStoppedScope) resetStoppedScope.reset();
|
|
6005
|
-
};
|
|
6212
|
+
return stoppedScope;
|
|
6006
6213
|
};
|
|
6007
6214
|
const cleanup = () => {
|
|
6008
6215
|
setCurrentInstance(null, void 0);
|
|
6009
6216
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
6010
6217
|
};
|
|
6011
6218
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
6012
|
-
const
|
|
6219
|
+
const stoppedScope = restore();
|
|
6013
6220
|
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
6014
|
-
if (
|
|
6221
|
+
if (stoppedScope) stoppedScope.reset();
|
|
6015
6222
|
cleanup();
|
|
6016
6223
|
}));
|
|
6017
6224
|
throw e;
|
|
6018
6225
|
});
|
|
6019
6226
|
return [awaitable, () => {
|
|
6020
|
-
const
|
|
6227
|
+
const stoppedScope = restore();
|
|
6021
6228
|
Promise.resolve().then(() => {
|
|
6022
|
-
if (
|
|
6229
|
+
if (stoppedScope) stoppedScope.reset();
|
|
6023
6230
|
cleanup();
|
|
6024
6231
|
});
|
|
6025
6232
|
}];
|
|
@@ -6082,11 +6289,12 @@ function applyOptions(instance) {
|
|
|
6082
6289
|
const opt = computedOptions[key];
|
|
6083
6290
|
const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
|
|
6084
6291
|
if (get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
|
|
6292
|
+
const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
|
|
6293
|
+
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
6294
|
+
};
|
|
6085
6295
|
const c = computed({
|
|
6086
6296
|
get,
|
|
6087
|
-
set
|
|
6088
|
-
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
6089
|
-
}
|
|
6297
|
+
set
|
|
6090
6298
|
});
|
|
6091
6299
|
Object.defineProperty(ctx, key, {
|
|
6092
6300
|
enumerable: true,
|
|
@@ -6145,9 +6353,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
|
|
|
6145
6353
|
for (const key in injectOptions) {
|
|
6146
6354
|
const opt = injectOptions[key];
|
|
6147
6355
|
let injected;
|
|
6148
|
-
if (isObject(opt))
|
|
6149
|
-
|
|
6150
|
-
|
|
6356
|
+
if (isObject(opt)) {
|
|
6357
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
6358
|
+
else injected = inject(opt.from || key);
|
|
6359
|
+
} else injected = inject(opt);
|
|
6151
6360
|
if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
|
|
6152
6361
|
enumerable: true,
|
|
6153
6362
|
configurable: true,
|
|
@@ -6167,7 +6376,8 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6167
6376
|
{
|
|
6168
6377
|
const cur = getCurrentInstance();
|
|
6169
6378
|
const instance = cur && getCurrentScope() === cur.scope ? cur : null;
|
|
6170
|
-
|
|
6379
|
+
const newValue = getter();
|
|
6380
|
+
if (isArray(newValue) && isCompatEnabled$1("WATCH_ARRAY", instance)) options.deep = true;
|
|
6171
6381
|
const baseGetter = getter;
|
|
6172
6382
|
getter = () => {
|
|
6173
6383
|
const val = baseGetter();
|
|
@@ -6180,13 +6390,14 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6180
6390
|
if (isFunction(handler)) watch(getter, handler, options);
|
|
6181
6391
|
else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
6182
6392
|
} else if (isFunction(raw)) watch(getter, raw.bind(publicThis), options);
|
|
6183
|
-
else if (isObject(raw))
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6393
|
+
else if (isObject(raw)) {
|
|
6394
|
+
if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
6395
|
+
else {
|
|
6396
|
+
const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
6397
|
+
if (isFunction(handler)) watch(getter, handler, extend(raw, options));
|
|
6398
|
+
else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
6399
|
+
}
|
|
6400
|
+
} else warn$1(`Invalid watch option: "${key}"`, raw);
|
|
6190
6401
|
}
|
|
6191
6402
|
/**
|
|
6192
6403
|
* Resolve merged options and cache it on the component.
|
|
@@ -6200,12 +6411,13 @@ function resolveMergedOptions(instance) {
|
|
|
6200
6411
|
const cached = cache.get(base);
|
|
6201
6412
|
let resolved;
|
|
6202
6413
|
if (cached) resolved = cached;
|
|
6203
|
-
else if (!globalMixins.length && !mixins && !extendsOptions)
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6414
|
+
else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
6415
|
+
if (isCompatEnabled$1("PRIVATE_APIS", instance)) {
|
|
6416
|
+
resolved = extend({}, base);
|
|
6417
|
+
resolved.parent = instance.parent && instance.parent.proxy;
|
|
6418
|
+
resolved.propsData = instance.vnode.props;
|
|
6419
|
+
} else resolved = base;
|
|
6420
|
+
} else {
|
|
6209
6421
|
resolved = {};
|
|
6210
6422
|
if (globalMixins.length) globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
|
|
6211
6423
|
mergeOptions(resolved, base, optionMergeStrategies);
|
|
@@ -6278,7 +6490,7 @@ function mergeObjectOptions(to, from) {
|
|
|
6278
6490
|
}
|
|
6279
6491
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
6280
6492
|
if (to) {
|
|
6281
|
-
if (isArray(to) && isArray(from)) return [
|
|
6493
|
+
if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
6282
6494
|
return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
6283
6495
|
} else return from;
|
|
6284
6496
|
}
|
|
@@ -6339,7 +6551,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6339
6551
|
if (options.el) return vm.$mount(options.el);
|
|
6340
6552
|
else return vm;
|
|
6341
6553
|
}
|
|
6342
|
-
Vue.version = `2.6.14-compat:3.6.0-rc.
|
|
6554
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.11`;
|
|
6343
6555
|
Vue.config = singletonApp.config;
|
|
6344
6556
|
Vue.use = (plugin, ...options) => {
|
|
6345
6557
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -6729,8 +6941,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
6729
6941
|
} else warn$1(`Cannot unmount an app that is not mounted.`);
|
|
6730
6942
|
},
|
|
6731
6943
|
provide(key, value) {
|
|
6732
|
-
if (key in context.provides)
|
|
6733
|
-
|
|
6944
|
+
if (key in context.provides) {
|
|
6945
|
+
if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
|
|
6946
|
+
else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
|
|
6947
|
+
}
|
|
6734
6948
|
context.provides[key] = value;
|
|
6735
6949
|
return app;
|
|
6736
6950
|
},
|
|
@@ -6812,13 +7026,17 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6812
7026
|
const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
|
|
6813
7027
|
const res = customRef((track, trigger) => {
|
|
6814
7028
|
let localValue;
|
|
7029
|
+
let prevPropValue = EMPTY_OBJ;
|
|
6815
7030
|
let prevSetValue = EMPTY_OBJ;
|
|
6816
7031
|
let prevEmittedValue;
|
|
6817
7032
|
watchSyncEffect(() => {
|
|
6818
7033
|
const propValue = props[camelizedName];
|
|
6819
|
-
if (hasChanged(
|
|
6820
|
-
|
|
6821
|
-
|
|
7034
|
+
if (hasChanged(prevPropValue, propValue)) {
|
|
7035
|
+
prevPropValue = propValue;
|
|
7036
|
+
if (hasChanged(localValue, propValue)) {
|
|
7037
|
+
localValue = propValue;
|
|
7038
|
+
trigger();
|
|
7039
|
+
}
|
|
6822
7040
|
}
|
|
6823
7041
|
});
|
|
6824
7042
|
return {
|
|
@@ -6880,12 +7098,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
6880
7098
|
if (instance.isUnmounted) return;
|
|
6881
7099
|
{
|
|
6882
7100
|
const { emitsOptions, propsOptions } = instance;
|
|
6883
|
-
if (emitsOptions)
|
|
6884
|
-
if (!
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
if (
|
|
7101
|
+
if (emitsOptions) {
|
|
7102
|
+
if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
|
|
7103
|
+
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.`);
|
|
7104
|
+
} else {
|
|
7105
|
+
const validator = emitsOptions[event];
|
|
7106
|
+
if (isFunction(validator)) {
|
|
7107
|
+
if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
7108
|
+
}
|
|
6889
7109
|
}
|
|
6890
7110
|
}
|
|
6891
7111
|
}
|
|
@@ -6895,7 +7115,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
6895
7115
|
const modifiers = isCompatModelListener ? props.modelModifiers : isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
6896
7116
|
if (modifiers) {
|
|
6897
7117
|
if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
6898
|
-
if (modifiers.number) args =
|
|
7118
|
+
if (modifiers.number) args = args.map(looseToNumber);
|
|
6899
7119
|
}
|
|
6900
7120
|
devtoolsComponentEmit(instance, event, args);
|
|
6901
7121
|
{
|
|
@@ -7037,8 +7257,9 @@ function renderComponentRoot(instance) {
|
|
|
7037
7257
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
7038
7258
|
}
|
|
7039
7259
|
if (vnode.transition) {
|
|
7040
|
-
|
|
7041
|
-
|
|
7260
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
7261
|
+
if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
7262
|
+
setTransitionHooks(child, vnode.transition);
|
|
7042
7263
|
}
|
|
7043
7264
|
if (setRoot) setRoot(root);
|
|
7044
7265
|
else result = root;
|
|
@@ -7089,18 +7310,21 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
7089
7310
|
for (let i = 0; i < children.length; i++) {
|
|
7090
7311
|
const child = children[i];
|
|
7091
7312
|
if (isVNode(child)) {
|
|
7092
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7313
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
7314
|
+
if (singleRoot) return;
|
|
7315
|
+
else {
|
|
7316
|
+
singleRoot = child;
|
|
7317
|
+
if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
7318
|
+
}
|
|
7096
7319
|
}
|
|
7097
7320
|
} else return;
|
|
7098
7321
|
}
|
|
7099
7322
|
return singleRoot;
|
|
7100
7323
|
}
|
|
7324
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
|
|
7101
7325
|
const getFunctionalFallthrough = (attrs) => {
|
|
7102
7326
|
let res;
|
|
7103
|
-
for (const key in attrs) if (
|
|
7327
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
7104
7328
|
return res;
|
|
7105
7329
|
};
|
|
7106
7330
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -7236,16 +7460,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
7236
7460
|
let key = propsToUpdate[i];
|
|
7237
7461
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
7238
7462
|
const value = rawProps[key];
|
|
7239
|
-
if (options)
|
|
7240
|
-
if (
|
|
7241
|
-
attrs[key]
|
|
7242
|
-
|
|
7463
|
+
if (options) {
|
|
7464
|
+
if (hasOwn(attrs, key)) {
|
|
7465
|
+
if (value !== attrs[key]) {
|
|
7466
|
+
attrs[key] = value;
|
|
7467
|
+
hasAttrsChanged = true;
|
|
7468
|
+
}
|
|
7469
|
+
} else {
|
|
7470
|
+
const camelizedKey = camelize(key);
|
|
7471
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
7243
7472
|
}
|
|
7244
7473
|
} else {
|
|
7245
|
-
const camelizedKey = camelize(key);
|
|
7246
|
-
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
7247
|
-
}
|
|
7248
|
-
else {
|
|
7249
7474
|
if (isOn(key) && key.endsWith("Native")) key = key.slice(0, -6);
|
|
7250
7475
|
else if (shouldSkipAttr(key, instance)) continue;
|
|
7251
7476
|
if (value !== attrs[key]) {
|
|
@@ -7258,9 +7483,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
7258
7483
|
} else {
|
|
7259
7484
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
7260
7485
|
let kebabKey;
|
|
7261
|
-
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))
|
|
7262
|
-
if (
|
|
7263
|
-
|
|
7486
|
+
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
|
|
7487
|
+
if (options) {
|
|
7488
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
7489
|
+
} else delete props[key];
|
|
7490
|
+
}
|
|
7264
7491
|
if (attrs !== rawCurrentProps) {
|
|
7265
7492
|
for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && !hasOwn(rawProps, key + "Native")) {
|
|
7266
7493
|
delete attrs[key];
|
|
@@ -7281,9 +7508,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
7281
7508
|
if (key === "inline-template") continue;
|
|
7282
7509
|
const value = rawProps[key];
|
|
7283
7510
|
let camelKey;
|
|
7284
|
-
if (options && hasOwn(options, camelKey = camelize(key)))
|
|
7285
|
-
|
|
7286
|
-
|
|
7511
|
+
if (options && hasOwn(options, camelKey = camelize(key))) {
|
|
7512
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
7513
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
7514
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
7287
7515
|
if (isOn(key) && key.endsWith("Native")) key = key.slice(0, -6);
|
|
7288
7516
|
else if (shouldSkipAttr(key, instance)) continue;
|
|
7289
7517
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
@@ -7332,7 +7560,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
7332
7560
|
const prev = setCurrentInstance(instance);
|
|
7333
7561
|
const props = /* @__PURE__ */ toRaw(instance.props);
|
|
7334
7562
|
value = factory.call(isCompatEnabled$1("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null, props);
|
|
7335
|
-
|
|
7563
|
+
restoreCurrentInstance(prev);
|
|
7336
7564
|
return value;
|
|
7337
7565
|
}
|
|
7338
7566
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -7449,7 +7677,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
|
|
|
7449
7677
|
}
|
|
7450
7678
|
if (validator && !validator(value, /* @__PURE__ */ shallowReadonly(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
|
|
7451
7679
|
}
|
|
7452
|
-
const isSimpleType =
|
|
7680
|
+
const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
|
|
7453
7681
|
/**
|
|
7454
7682
|
* dev only
|
|
7455
7683
|
*/
|
|
@@ -7562,12 +7790,13 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
7562
7790
|
let deletionComparisonTarget = EMPTY_OBJ;
|
|
7563
7791
|
if (vnode.shapeFlag & 32) {
|
|
7564
7792
|
const type = children._;
|
|
7565
|
-
if (type)
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7793
|
+
if (type) {
|
|
7794
|
+
if (isHmrUpdating) {
|
|
7795
|
+
assignSlots(slots, children, optimized);
|
|
7796
|
+
trigger(instance, "set", "$slots");
|
|
7797
|
+
} else if (optimized && type === 1) needDeletionCheck = false;
|
|
7798
|
+
else assignSlots(slots, children, optimized);
|
|
7799
|
+
} else {
|
|
7571
7800
|
needDeletionCheck = !children.$stable;
|
|
7572
7801
|
normalizeObjectSlots(children, slots, instance);
|
|
7573
7802
|
}
|
|
@@ -7585,7 +7814,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
7585
7814
|
let supported;
|
|
7586
7815
|
let perf;
|
|
7587
7816
|
let cachedNow$1 = 0;
|
|
7588
|
-
const p$1 =
|
|
7817
|
+
const p$1 = /*@__PURE__*/ Promise.resolve();
|
|
7589
7818
|
const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
|
|
7590
7819
|
/**
|
|
7591
7820
|
* @internal
|
|
@@ -7666,6 +7895,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7666
7895
|
optimized = false;
|
|
7667
7896
|
n2.dynamicChildren = null;
|
|
7668
7897
|
}
|
|
7898
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
7899
|
+
if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
|
|
7900
|
+
n2.dynamicChildren.hasOnce = true;
|
|
7901
|
+
}
|
|
7669
7902
|
const { type, ref, shapeFlag } = n2;
|
|
7670
7903
|
switch (type) {
|
|
7671
7904
|
case Text:
|
|
@@ -7682,7 +7915,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7682
7915
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
7683
7916
|
break;
|
|
7684
7917
|
case VaporSlot:
|
|
7685
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
7918
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
7686
7919
|
break;
|
|
7687
7920
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
7688
7921
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -7801,7 +8034,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7801
8034
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
7802
8035
|
};
|
|
7803
8036
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
7804
|
-
for (let i = start; i < children.length; i++)
|
|
8037
|
+
for (let i = start; i < children.length; i++) {
|
|
8038
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
8039
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
8040
|
+
}
|
|
7805
8041
|
};
|
|
7806
8042
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7807
8043
|
const el = n2.el = n1.el;
|
|
@@ -7813,6 +8049,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7813
8049
|
let vnodeHook;
|
|
7814
8050
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
7815
8051
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
8052
|
+
if (n2.ibu) n2.ibu();
|
|
7816
8053
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7817
8054
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
7818
8055
|
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -7846,8 +8083,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7846
8083
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
7847
8084
|
}
|
|
7848
8085
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
7849
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
8086
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
7850
8087
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
8088
|
+
n2.iu && n2.iu();
|
|
7851
8089
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
7852
8090
|
}, void 0, parentSuspense);
|
|
7853
8091
|
};
|
|
@@ -7855,7 +8093,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7855
8093
|
for (let i = 0; i < newChildren.length; i++) {
|
|
7856
8094
|
const oldVNode = oldChildren[i];
|
|
7857
8095
|
const newVNode = newChildren[i];
|
|
7858
|
-
|
|
8096
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
8097
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
7859
8098
|
}
|
|
7860
8099
|
};
|
|
7861
8100
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -7893,41 +8132,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7893
8132
|
};
|
|
7894
8133
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7895
8134
|
n2.slotScopeIds = slotScopeIds;
|
|
7896
|
-
if (n2.type.__vapor)
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
7906
|
-
});
|
|
7907
|
-
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
7908
|
-
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
7909
|
-
if (vnodeMountedHook) {
|
|
7910
|
-
const scopedVNode = n2;
|
|
7911
|
-
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
7912
|
-
}
|
|
7913
|
-
}
|
|
7914
|
-
else {
|
|
7915
|
-
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
7916
|
-
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
7917
|
-
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7918
|
-
}, () => {
|
|
7919
|
-
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
7920
|
-
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
7921
|
-
});
|
|
7922
|
-
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
7923
|
-
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
7924
|
-
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
7925
|
-
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
7926
|
-
}, void 0, parentSuspense);
|
|
7927
|
-
}
|
|
7928
|
-
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
7929
|
-
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
7930
|
-
else updateComponent(n1, n2, optimized);
|
|
8135
|
+
if (n2.type.__vapor) {
|
|
8136
|
+
if (n1 == null) {
|
|
8137
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
8138
|
+
else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
|
|
8139
|
+
} else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
|
|
8140
|
+
} else if (n1 == null) {
|
|
8141
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
8142
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
8143
|
+
} else updateComponent(n1, n2, optimized);
|
|
7931
8144
|
};
|
|
7932
8145
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
7933
8146
|
const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
|
|
@@ -7971,16 +8184,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7971
8184
|
};
|
|
7972
8185
|
const updateComponent = (n1, n2, optimized) => {
|
|
7973
8186
|
const instance = n2.component = n1.component;
|
|
7974
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
8187
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
8188
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
8189
|
+
pushWarningContext(n2);
|
|
8190
|
+
n2.el = n1.el;
|
|
8191
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
8192
|
+
popWarningContext();
|
|
8193
|
+
return;
|
|
8194
|
+
} else {
|
|
8195
|
+
instance.next = n2;
|
|
8196
|
+
instance.effect.run();
|
|
8197
|
+
}
|
|
7979
8198
|
} else {
|
|
7980
|
-
instance.next = n2;
|
|
7981
|
-
instance.effect.run();
|
|
7982
|
-
}
|
|
7983
|
-
else {
|
|
7984
8199
|
n2.el = n1.el;
|
|
7985
8200
|
instance.vnode = n2;
|
|
7986
8201
|
}
|
|
@@ -8083,6 +8298,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8083
8298
|
} else next = vnode;
|
|
8084
8299
|
if (bu) invokeArrayFns(bu);
|
|
8085
8300
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
8301
|
+
if (next.ibu) next.ibu();
|
|
8086
8302
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) instance.emit("hook:beforeUpdate");
|
|
8087
8303
|
toggleRecurse(instance, true);
|
|
8088
8304
|
startMeasure(instance, `render`);
|
|
@@ -8096,7 +8312,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8096
8312
|
next.el = nextTree.el;
|
|
8097
8313
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
8098
8314
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
8099
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
8315
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
8316
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
8317
|
+
next.iu && next.iu();
|
|
8318
|
+
}, void 0, parentSuspense);
|
|
8100
8319
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:updated"), void 0, parentSuspense);
|
|
8101
8320
|
devtoolsComponentUpdated(instance);
|
|
8102
8321
|
popWarningContext();
|
|
@@ -8137,9 +8356,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8137
8356
|
if (shapeFlag & 8) {
|
|
8138
8357
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
8139
8358
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
8140
|
-
} else if (prevShapeFlag & 16)
|
|
8141
|
-
|
|
8142
|
-
|
|
8359
|
+
} else if (prevShapeFlag & 16) {
|
|
8360
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
8361
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
8362
|
+
} else {
|
|
8143
8363
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
8144
8364
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
8145
8365
|
}
|
|
@@ -8238,15 +8458,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8238
8458
|
const anchorVNode = c2[nextIndex + 1];
|
|
8239
8459
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
8240
8460
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
8241
|
-
else if (moved)
|
|
8242
|
-
|
|
8461
|
+
else if (moved) {
|
|
8462
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
8463
|
+
else j--;
|
|
8464
|
+
}
|
|
8243
8465
|
}
|
|
8244
8466
|
}
|
|
8245
8467
|
};
|
|
8246
8468
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
8247
8469
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
8248
8470
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
8249
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
8471
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
8250
8472
|
return;
|
|
8251
8473
|
}
|
|
8252
8474
|
if (shapeFlag & 6) {
|
|
@@ -8271,54 +8493,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8271
8493
|
moveStaticNode(vnode, container, anchor);
|
|
8272
8494
|
return;
|
|
8273
8495
|
}
|
|
8274
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
const remove = () => {
|
|
8496
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
8497
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
8498
|
+
else performTransitionLeave(el, transition, () => {
|
|
8278
8499
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
8279
8500
|
else hostInsert(el, container, anchor);
|
|
8280
|
-
};
|
|
8281
|
-
|
|
8282
|
-
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
8283
|
-
if (el._isLeaving) el[leaveCbKey](true);
|
|
8284
|
-
if (transition.persisted && !wasLeaving) remove();
|
|
8285
|
-
else leave(el, () => {
|
|
8286
|
-
remove();
|
|
8287
|
-
afterLeave && afterLeave();
|
|
8288
|
-
});
|
|
8289
|
-
};
|
|
8290
|
-
if (delayLeave) delayLeave(el, remove, performLeave);
|
|
8291
|
-
else performLeave();
|
|
8292
|
-
}
|
|
8293
|
-
else hostInsert(el, container, anchor);
|
|
8501
|
+
}, true, true);
|
|
8502
|
+
} else hostInsert(el, container, anchor);
|
|
8294
8503
|
};
|
|
8295
8504
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
8296
8505
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
8297
|
-
if (patchFlag === -2) optimized = false;
|
|
8506
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
8298
8507
|
if (ref != null) {
|
|
8299
8508
|
const prevSub = setActiveSub();
|
|
8300
8509
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
8301
8510
|
setActiveSub(prevSub);
|
|
8302
8511
|
}
|
|
8303
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8512
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8304
8513
|
if (shapeFlag & 256) {
|
|
8305
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
8514
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
8306
8515
|
else parentComponent.ctx.deactivate(vnode);
|
|
8307
8516
|
return;
|
|
8308
8517
|
}
|
|
8518
|
+
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
8519
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
8520
|
+
return;
|
|
8521
|
+
}
|
|
8309
8522
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
8310
8523
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
8311
8524
|
let vnodeHook;
|
|
8312
8525
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8313
|
-
if (shapeFlag & 6)
|
|
8314
|
-
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
8315
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8316
|
-
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
8317
|
-
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
8318
|
-
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8319
|
-
}, void 0, parentSuspense);
|
|
8320
|
-
return;
|
|
8321
|
-
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
8526
|
+
if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
8322
8527
|
else {
|
|
8323
8528
|
if (shapeFlag & 128) {
|
|
8324
8529
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -8329,7 +8534,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8329
8534
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
8330
8535
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
8331
8536
|
if (type === VaporSlot) {
|
|
8332
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8537
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
8333
8538
|
return;
|
|
8334
8539
|
}
|
|
8335
8540
|
if (doRemove) remove(vnode);
|
|
@@ -8353,6 +8558,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8353
8558
|
}
|
|
8354
8559
|
if (type === Static) {
|
|
8355
8560
|
removeStaticNode(vnode);
|
|
8561
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
8356
8562
|
return;
|
|
8357
8563
|
}
|
|
8358
8564
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -8378,7 +8584,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8378
8584
|
if (effect) {
|
|
8379
8585
|
effect.stop();
|
|
8380
8586
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8381
|
-
} else if (
|
|
8587
|
+
} else if (instance.vnode.el && subTree) {
|
|
8588
|
+
subTree.transition = instance.vnode.transition;
|
|
8589
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8590
|
+
}
|
|
8382
8591
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
8383
8592
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
8384
8593
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
@@ -8453,12 +8662,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
8453
8662
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
8454
8663
|
}
|
|
8455
8664
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
8456
|
-
if (!vapor)
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8665
|
+
if (!vapor) {
|
|
8666
|
+
if (allowed) {
|
|
8667
|
+
effect.flags |= 128;
|
|
8668
|
+
job.flags |= 2;
|
|
8669
|
+
} else {
|
|
8670
|
+
effect.flags &= -129;
|
|
8671
|
+
job.flags &= -3;
|
|
8672
|
+
}
|
|
8462
8673
|
}
|
|
8463
8674
|
}
|
|
8464
8675
|
function needTransition(parentSuspense, transition) {
|
|
@@ -8498,8 +8709,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
8498
8709
|
}
|
|
8499
8710
|
function locateNonHydratedAsyncRoot(instance) {
|
|
8500
8711
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
8501
|
-
if (subComponent)
|
|
8502
|
-
|
|
8712
|
+
if (subComponent) {
|
|
8713
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
8714
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
8715
|
+
}
|
|
8503
8716
|
}
|
|
8504
8717
|
function invalidateMount(hooks) {
|
|
8505
8718
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
@@ -8518,13 +8731,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
8518
8731
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
8519
8732
|
const performRemove = () => {
|
|
8520
8733
|
remove();
|
|
8521
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
8734
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
8522
8735
|
};
|
|
8523
8736
|
if (force || isElement && transition && !transition.persisted) {
|
|
8524
8737
|
const { leave, delayLeave } = transition;
|
|
8525
8738
|
const performLeave = () => {
|
|
8739
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
8526
8740
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
8527
|
-
|
|
8741
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
8742
|
+
else leave(el, performRemove);
|
|
8528
8743
|
};
|
|
8529
8744
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
8530
8745
|
else performLeave();
|
|
@@ -8543,7 +8758,7 @@ function isVaporComponent(type) {
|
|
|
8543
8758
|
/**
|
|
8544
8759
|
* shared between vdom and vapor
|
|
8545
8760
|
*/
|
|
8546
|
-
function getInheritedScopeIds(vnode, parentComponent) {
|
|
8761
|
+
function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
|
|
8547
8762
|
const inheritedScopeIds = [];
|
|
8548
8763
|
let currentParent = parentComponent;
|
|
8549
8764
|
let currentVNode = vnode;
|
|
@@ -8559,6 +8774,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
8559
8774
|
currentParent = currentParent.parent;
|
|
8560
8775
|
} else break;
|
|
8561
8776
|
}
|
|
8777
|
+
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
8778
|
+
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
8562
8779
|
return inheritedScopeIds;
|
|
8563
8780
|
}
|
|
8564
8781
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
@@ -8577,7 +8794,7 @@ const Suspense = {
|
|
|
8577
8794
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
8578
8795
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
8579
8796
|
else {
|
|
8580
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
8797
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
8581
8798
|
n2.suspense = n1.suspense;
|
|
8582
8799
|
n2.suspense.vnode = n2;
|
|
8583
8800
|
n2.el = n1.el;
|
|
@@ -8615,10 +8832,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
8615
8832
|
if (pendingBranch) {
|
|
8616
8833
|
suspense.pendingBranch = newBranch;
|
|
8617
8834
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
8618
|
-
|
|
8835
|
+
suspense.deps++;
|
|
8836
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
8837
|
+
suspense.deps--;
|
|
8619
8838
|
if (suspense.deps <= 0) suspense.resolve();
|
|
8620
8839
|
else if (isInFallback) {
|
|
8621
|
-
if (!isHydrating) {
|
|
8840
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
8622
8841
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
8623
8842
|
setActiveBranch(suspense, newFallback);
|
|
8624
8843
|
}
|
|
@@ -8630,12 +8849,16 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
8630
8849
|
suspense.activeBranch = pendingBranch;
|
|
8631
8850
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
8632
8851
|
suspense.deps = 0;
|
|
8852
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
8853
|
+
const effect = suspense.effects[i];
|
|
8854
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
8855
|
+
}
|
|
8633
8856
|
suspense.effects.length = 0;
|
|
8634
8857
|
suspense.hiddenContainer = createElement("div");
|
|
8635
8858
|
if (isInFallback) {
|
|
8636
8859
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
8637
8860
|
if (suspense.deps <= 0) suspense.resolve();
|
|
8638
|
-
else {
|
|
8861
|
+
else if (!suspense.isFallbackMountPending) {
|
|
8639
8862
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
8640
8863
|
setActiveBranch(suspense, newFallback);
|
|
8641
8864
|
}
|
|
@@ -8737,7 +8960,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8737
8960
|
let hasUnresolvedAncestor = false;
|
|
8738
8961
|
while (parent) {
|
|
8739
8962
|
if (parent.pendingBranch) {
|
|
8740
|
-
parent.effects.push(
|
|
8963
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
8741
8964
|
hasUnresolvedAncestor = true;
|
|
8742
8965
|
break;
|
|
8743
8966
|
}
|
|
@@ -8747,6 +8970,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8747
8970
|
suspense.effects = [];
|
|
8748
8971
|
if (isSuspensible) {
|
|
8749
8972
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
8973
|
+
parentSuspenseId = void 0;
|
|
8750
8974
|
parentSuspense.deps--;
|
|
8751
8975
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
8752
8976
|
}
|
|
@@ -8761,8 +8985,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8761
8985
|
const mountFallback = () => {
|
|
8762
8986
|
suspense.isFallbackMountPending = false;
|
|
8763
8987
|
if (!suspense.isInFallback) return;
|
|
8764
|
-
|
|
8765
|
-
|
|
8988
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
8989
|
+
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
8990
|
+
setActiveBranch(suspense, latestFallback);
|
|
8766
8991
|
};
|
|
8767
8992
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
8768
8993
|
if (delayEnter) {
|
|
@@ -8783,11 +9008,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8783
9008
|
registerDep(instance, onResolve) {
|
|
8784
9009
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
8785
9010
|
if (isInPendingSuspense) suspense.deps++;
|
|
9011
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
8786
9012
|
instance.asyncDep.catch((err) => {
|
|
8787
9013
|
handleError(err, instance, 0);
|
|
8788
9014
|
}).then((asyncSetupResult) => {
|
|
8789
9015
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
8790
9016
|
setCurrentInstance(null, void 0);
|
|
9017
|
+
if (hydratedEl && !instance.scope.active) {
|
|
9018
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
9019
|
+
return;
|
|
9020
|
+
}
|
|
8791
9021
|
instance.asyncResolved = true;
|
|
8792
9022
|
onResolve(asyncSetupResult);
|
|
8793
9023
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -8838,9 +9068,10 @@ function normalizeSuspenseSlot(s) {
|
|
|
8838
9068
|
return s;
|
|
8839
9069
|
}
|
|
8840
9070
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
8841
|
-
if (suspense && suspense.pendingBranch)
|
|
8842
|
-
|
|
8843
|
-
|
|
9071
|
+
if (suspense && suspense.pendingBranch) {
|
|
9072
|
+
if (isArray(fn)) suspense.effects.push(...fn);
|
|
9073
|
+
else suspense.effects.push(fn);
|
|
9074
|
+
} else queuePostFlushCb(fn, id);
|
|
8844
9075
|
}
|
|
8845
9076
|
function setActiveBranch(suspense, branch) {
|
|
8846
9077
|
suspense.activeBranch = branch;
|
|
@@ -9047,11 +9278,26 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
9047
9278
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
9048
9279
|
} else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
9049
9280
|
if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
9281
|
+
if (props && vnode.shapeFlag & 1) {
|
|
9282
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
9283
|
+
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.`);
|
|
9284
|
+
}
|
|
9050
9285
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
9051
9286
|
convertLegacyVModelProps(vnode);
|
|
9052
9287
|
defineLegacyVNodeProperties(vnode);
|
|
9053
9288
|
return vnode;
|
|
9054
9289
|
}
|
|
9290
|
+
/**
|
|
9291
|
+
* dev only
|
|
9292
|
+
* Whether children would actually render something. Empty text and empty
|
|
9293
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
9294
|
+
* for `v-html` / `v-text`.
|
|
9295
|
+
*/
|
|
9296
|
+
function hasContentChildren(children) {
|
|
9297
|
+
if (isString(children)) return children !== "";
|
|
9298
|
+
if (isArray(children)) return children.length > 0;
|
|
9299
|
+
return false;
|
|
9300
|
+
}
|
|
9055
9301
|
const createVNode = createVNodeWithArgsTransform;
|
|
9056
9302
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
9057
9303
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -9061,8 +9307,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
9061
9307
|
if (isVNode(type)) {
|
|
9062
9308
|
const cloned = cloneVNode(type, props, true);
|
|
9063
9309
|
if (children) normalizeChildren(cloned, children);
|
|
9064
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
9065
|
-
|
|
9310
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
9311
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
9312
|
+
else currentBlock.push(cloned);
|
|
9313
|
+
}
|
|
9066
9314
|
cloned.patchFlag = -2;
|
|
9067
9315
|
return cloned;
|
|
9068
9316
|
}
|
|
@@ -9123,7 +9371,10 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
9123
9371
|
ce: vnode.ce,
|
|
9124
9372
|
vi: vnode.vi,
|
|
9125
9373
|
vs: cloneVaporSlotMeta(vnode),
|
|
9126
|
-
vb: vnode.vb
|
|
9374
|
+
vb: vnode.vb,
|
|
9375
|
+
ibu: vnode.ibu,
|
|
9376
|
+
iu: vnode.iu,
|
|
9377
|
+
cacheIndex: vnode.cacheIndex
|
|
9127
9378
|
};
|
|
9128
9379
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
9129
9380
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -9134,8 +9385,7 @@ function cloneVaporSlotMeta(vnode) {
|
|
|
9134
9385
|
if (!vaporSlot) return vaporSlot;
|
|
9135
9386
|
const cloned = {
|
|
9136
9387
|
slot: vaporSlot.slot,
|
|
9137
|
-
|
|
9138
|
-
outletFallback: vaporSlot.outletFallback
|
|
9388
|
+
outlets: vaporSlot.outlets
|
|
9139
9389
|
};
|
|
9140
9390
|
if (vnode.el) {
|
|
9141
9391
|
cloned.state = vaporSlot.state;
|
|
@@ -9187,25 +9437,28 @@ function normalizeChildren(vnode, children) {
|
|
|
9187
9437
|
const { shapeFlag } = vnode;
|
|
9188
9438
|
if (children == null) children = null;
|
|
9189
9439
|
else if (isArray(children)) type = 16;
|
|
9190
|
-
else if (typeof children === "object")
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9440
|
+
else if (typeof children === "object") {
|
|
9441
|
+
if (shapeFlag & 65) {
|
|
9442
|
+
const slot = children.default;
|
|
9443
|
+
if (slot) {
|
|
9444
|
+
slot._c && (slot._d = false);
|
|
9445
|
+
normalizeChildren(vnode, slot());
|
|
9446
|
+
slot._c && (slot._d = true);
|
|
9447
|
+
}
|
|
9448
|
+
return;
|
|
9449
|
+
} else {
|
|
9450
|
+
type = 32;
|
|
9451
|
+
const slotFlag = children._;
|
|
9452
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
9453
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
9454
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
9455
|
+
else {
|
|
9456
|
+
children._ = 2;
|
|
9457
|
+
vnode.patchFlag |= 1024;
|
|
9458
|
+
}
|
|
9459
|
+
}
|
|
9206
9460
|
}
|
|
9207
|
-
}
|
|
9208
|
-
else if (isFunction(children)) {
|
|
9461
|
+
} else if (isFunction(children)) {
|
|
9209
9462
|
if (shapeFlag & 65) {
|
|
9210
9463
|
normalizeChildren(vnode, { default: children });
|
|
9211
9464
|
return;
|
|
@@ -9273,6 +9526,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
9273
9526
|
simpleSetCurrentInstance(instance);
|
|
9274
9527
|
}
|
|
9275
9528
|
};
|
|
9529
|
+
/**
|
|
9530
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
9531
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
9532
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
9533
|
+
* @internal
|
|
9534
|
+
*/
|
|
9535
|
+
const restoreCurrentInstance = (prev) => {
|
|
9536
|
+
setCurrentScope(prev[1]);
|
|
9537
|
+
simpleSetCurrentInstance(prev[0]);
|
|
9538
|
+
};
|
|
9276
9539
|
const internalOptions = [
|
|
9277
9540
|
"ce",
|
|
9278
9541
|
"type",
|
|
@@ -9304,7 +9567,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
9304
9567
|
};
|
|
9305
9568
|
//#endregion
|
|
9306
9569
|
//#region packages/runtime-core/src/component.ts
|
|
9307
|
-
const emptyAppContext =
|
|
9570
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
9308
9571
|
let uid = 0;
|
|
9309
9572
|
function createComponentInstance(vnode, parent, suspense) {
|
|
9310
9573
|
const type = vnode.type;
|
|
@@ -9424,7 +9687,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
9424
9687
|
const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
|
|
9425
9688
|
const isAsyncSetup = isPromise(setupResult);
|
|
9426
9689
|
setActiveSub(prevSub);
|
|
9427
|
-
|
|
9690
|
+
restoreCurrentInstance(prev);
|
|
9428
9691
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
9429
9692
|
if (isAsyncSetup) {
|
|
9430
9693
|
const unsetCurrentInstance = () => {
|
|
@@ -9432,7 +9695,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
9432
9695
|
};
|
|
9433
9696
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
9434
9697
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
9435
|
-
|
|
9698
|
+
setInSSRSetupState(true);
|
|
9699
|
+
try {
|
|
9700
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
9701
|
+
} finally {
|
|
9702
|
+
setInSSRSetupState(false);
|
|
9703
|
+
}
|
|
9436
9704
|
}).catch((e) => {
|
|
9437
9705
|
handleError(e, instance, 0);
|
|
9438
9706
|
});
|
|
@@ -9497,13 +9765,15 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
9497
9765
|
applyOptions(instance);
|
|
9498
9766
|
} finally {
|
|
9499
9767
|
setActiveSub(prevSub);
|
|
9500
|
-
|
|
9768
|
+
restoreCurrentInstance(prevInstance);
|
|
9501
9769
|
}
|
|
9502
9770
|
}
|
|
9503
|
-
if (!Component.render && instance.render === NOOP && !isSSR)
|
|
9771
|
+
if (!Component.render && instance.render === NOOP && !isSSR) {
|
|
9772
|
+
if (!compile$1 && Component.template)
|
|
9504
9773
|
/* v8 ignore start */
|
|
9505
|
-
|
|
9506
|
-
|
|
9774
|
+
warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
|
|
9775
|
+
else warn$1(`Component is missing template or render function: `, Component);
|
|
9776
|
+
}
|
|
9507
9777
|
}
|
|
9508
9778
|
const attrsProxyHandlers = {
|
|
9509
9779
|
get(target, key) {
|
|
@@ -9566,14 +9836,13 @@ function getComponentPublicInstance(instance) {
|
|
|
9566
9836
|
if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
9567
9837
|
get(target, key) {
|
|
9568
9838
|
if (key in target) return target[key];
|
|
9569
|
-
else {
|
|
9839
|
+
else if (!instance.vapor) {
|
|
9570
9840
|
const publicPropertiesMap = getPublicPropertiesMap();
|
|
9571
9841
|
if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
|
|
9572
9842
|
}
|
|
9573
9843
|
},
|
|
9574
9844
|
has(target, key) {
|
|
9575
|
-
|
|
9576
|
-
return key in target || key in publicPropertiesMap;
|
|
9845
|
+
return key in target || !instance.vapor && key in getPublicPropertiesMap();
|
|
9577
9846
|
}
|
|
9578
9847
|
}));
|
|
9579
9848
|
else return instance.proxy;
|
|
@@ -9611,11 +9880,12 @@ function h(type, propsOrChildren, children) {
|
|
|
9611
9880
|
try {
|
|
9612
9881
|
setBlockTracking(-1);
|
|
9613
9882
|
const l = arguments.length;
|
|
9614
|
-
if (l === 2)
|
|
9615
|
-
if (
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9883
|
+
if (l === 2) {
|
|
9884
|
+
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
9885
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
9886
|
+
return createVNode(type, propsOrChildren);
|
|
9887
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
9888
|
+
} else {
|
|
9619
9889
|
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
9620
9890
|
else if (l === 3 && isVNode(children)) children = [children];
|
|
9621
9891
|
return createVNode(type, propsOrChildren, children);
|
|
@@ -9807,7 +10077,7 @@ function isMemoSame(cached, memo) {
|
|
|
9807
10077
|
}
|
|
9808
10078
|
//#endregion
|
|
9809
10079
|
//#region packages/runtime-core/src/index.ts
|
|
9810
|
-
const version = "3.6.0-rc.
|
|
10080
|
+
const version = "3.6.0-rc.11";
|
|
9811
10081
|
const warn = warn$1;
|
|
9812
10082
|
/**
|
|
9813
10083
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -9841,7 +10111,7 @@ const DeprecationTypes = DeprecationTypes$1;
|
|
|
9841
10111
|
let policy = void 0;
|
|
9842
10112
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
9843
10113
|
if (tt) try {
|
|
9844
|
-
policy =
|
|
10114
|
+
policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
|
|
9845
10115
|
} catch (e) {
|
|
9846
10116
|
warn(`Error creating trusted types policy: ${e}`);
|
|
9847
10117
|
}
|
|
@@ -9849,7 +10119,7 @@ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) =>
|
|
|
9849
10119
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
9850
10120
|
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
9851
10121
|
const doc = typeof document !== "undefined" ? document : null;
|
|
9852
|
-
const templateContainer = doc &&
|
|
10122
|
+
const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
|
|
9853
10123
|
const nodeOps = {
|
|
9854
10124
|
insert: (child, parent, anchor) => {
|
|
9855
10125
|
parent.insertBefore(child, anchor || null);
|
|
@@ -9923,7 +10193,7 @@ const DOMTransitionPropsValidators = {
|
|
|
9923
10193
|
leaveActiveClass: String,
|
|
9924
10194
|
leaveToClass: String
|
|
9925
10195
|
};
|
|
9926
|
-
const TransitionPropsValidators =
|
|
10196
|
+
const TransitionPropsValidators = /*@__PURE__*/ extend({}, BaseTransitionPropsValidators, DOMTransitionPropsValidators);
|
|
9927
10197
|
/**
|
|
9928
10198
|
* Wrap logic that attaches extra properties to Transition in a function
|
|
9929
10199
|
* so that it can be annotated as pure
|
|
@@ -9938,7 +10208,7 @@ const decorate$1 = (t) => {
|
|
|
9938
10208
|
* DOM Transition is a higher-order-component based on the platform-agnostic
|
|
9939
10209
|
* base Transition component, with DOM-specific logic.
|
|
9940
10210
|
*/
|
|
9941
|
-
const Transition =
|
|
10211
|
+
const Transition = /*@__PURE__*/ decorate$1((props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots));
|
|
9942
10212
|
/**
|
|
9943
10213
|
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
|
9944
10214
|
* with custom HOCs.
|
|
@@ -10178,14 +10448,15 @@ const vShow = {
|
|
|
10178
10448
|
},
|
|
10179
10449
|
updated(el, { value, oldValue }, { transition }) {
|
|
10180
10450
|
if (!value === !oldValue) return;
|
|
10181
|
-
if (transition)
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10451
|
+
if (transition) {
|
|
10452
|
+
if (value) {
|
|
10453
|
+
transition.beforeEnter(el);
|
|
10454
|
+
setDisplay(el, true);
|
|
10455
|
+
transition.enter(el);
|
|
10456
|
+
} else transition.leave(el, () => {
|
|
10457
|
+
setDisplay(el, false);
|
|
10458
|
+
});
|
|
10459
|
+
} else setDisplay(el, value);
|
|
10189
10460
|
},
|
|
10190
10461
|
beforeUnmount(el, { value }) {
|
|
10191
10462
|
setDisplay(el, value);
|
|
@@ -10204,49 +10475,20 @@ const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT");
|
|
|
10204
10475
|
*/
|
|
10205
10476
|
function useCssVars(getter) {
|
|
10206
10477
|
const instance = getCurrentInstance();
|
|
10207
|
-
const getVars = () => getter(instance.proxy);
|
|
10208
|
-
const setVars = (vars) => {
|
|
10209
|
-
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
10210
|
-
else setVarsOnVNode(instance.subTree, vars);
|
|
10211
|
-
};
|
|
10212
|
-
baseUseCssVars(instance, () => instance.subTree.el.parentNode, getVars, setVars);
|
|
10213
|
-
}
|
|
10214
|
-
function setVarsOnVNode(vnode, vars) {
|
|
10215
|
-
if (vnode.shapeFlag & 128) {
|
|
10216
|
-
const suspense = vnode.suspense;
|
|
10217
|
-
vnode = suspense.activeBranch;
|
|
10218
|
-
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
10219
|
-
setVarsOnVNode(suspense.activeBranch, vars);
|
|
10220
|
-
});
|
|
10221
|
-
}
|
|
10222
|
-
while (vnode.component) vnode = vnode.component.subTree;
|
|
10223
|
-
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
10224
|
-
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
10225
|
-
else if (vnode.type === Static) {
|
|
10226
|
-
let { el, anchor } = vnode;
|
|
10227
|
-
while (el) {
|
|
10228
|
-
setVarsOnNode(el, vars);
|
|
10229
|
-
if (el === anchor) break;
|
|
10230
|
-
el = el.nextSibling;
|
|
10231
|
-
}
|
|
10232
|
-
}
|
|
10233
|
-
}
|
|
10234
|
-
/**
|
|
10235
|
-
* @internal
|
|
10236
|
-
* shared between vdom and vapor
|
|
10237
|
-
*/
|
|
10238
|
-
function baseUseCssVars(instance, getParentNode, getVars, setVars) {
|
|
10239
10478
|
/* v8 ignore start */
|
|
10240
10479
|
if (!instance) {
|
|
10241
10480
|
warn(`useCssVars is called without current active component instance.`);
|
|
10242
10481
|
return;
|
|
10243
10482
|
}
|
|
10483
|
+
/* v8 ignore stop */
|
|
10484
|
+
const getVars = () => getter(instance.proxy);
|
|
10244
10485
|
instance.getCssVars = getVars;
|
|
10245
10486
|
const updateTeleports = instance.ut = (vars = getVars()) => {
|
|
10246
10487
|
Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach((node) => setVarsOnNode(node, vars));
|
|
10247
10488
|
};
|
|
10248
10489
|
const applyCssVars = (vars = getVars()) => {
|
|
10249
|
-
|
|
10490
|
+
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
10491
|
+
else setVarsOnVNode(instance.subTree, vars);
|
|
10250
10492
|
updateTeleports(vars);
|
|
10251
10493
|
};
|
|
10252
10494
|
onBeforeUpdate(() => {
|
|
@@ -10259,10 +10501,38 @@ function baseUseCssVars(instance, getParentNode, getVars, setVars) {
|
|
|
10259
10501
|
applyCssVars(vars);
|
|
10260
10502
|
}, NOOP, { flush: "post" });
|
|
10261
10503
|
const ob = new MutationObserver(() => applyCssVars());
|
|
10262
|
-
ob.observe(
|
|
10504
|
+
ob.observe(instance.subTree.el.parentNode, { childList: true });
|
|
10263
10505
|
onUnmounted(() => ob.disconnect());
|
|
10264
10506
|
});
|
|
10265
10507
|
}
|
|
10508
|
+
function setVarsOnVNode(vnode, vars) {
|
|
10509
|
+
if (vnode.shapeFlag & 128) {
|
|
10510
|
+
const suspense = vnode.suspense;
|
|
10511
|
+
vnode = suspense.activeBranch;
|
|
10512
|
+
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
10513
|
+
setVarsOnVNode(suspense.activeBranch, vars);
|
|
10514
|
+
});
|
|
10515
|
+
}
|
|
10516
|
+
while (vnode.component) {
|
|
10517
|
+
const component = vnode.component;
|
|
10518
|
+
if (component.vapor) {
|
|
10519
|
+
component.appContext.vapor.applyCssVars(vnode, vars);
|
|
10520
|
+
return;
|
|
10521
|
+
}
|
|
10522
|
+
vnode = vnode.component.subTree;
|
|
10523
|
+
}
|
|
10524
|
+
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
10525
|
+
else if (vnode.vb) vnode.ctx.appContext.vapor.applyCssVars(vnode, vars);
|
|
10526
|
+
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
10527
|
+
else if (vnode.type === Static) {
|
|
10528
|
+
let { el, anchor } = vnode;
|
|
10529
|
+
while (el) {
|
|
10530
|
+
setVarsOnNode(el, vars);
|
|
10531
|
+
if (el === anchor) break;
|
|
10532
|
+
el = el.nextSibling;
|
|
10533
|
+
}
|
|
10534
|
+
}
|
|
10535
|
+
}
|
|
10266
10536
|
/**
|
|
10267
10537
|
* @internal
|
|
10268
10538
|
* shared between vdom and vapor
|
|
@@ -10287,11 +10557,13 @@ function patchStyle(el, prev, next) {
|
|
|
10287
10557
|
const isCssString = isString(next);
|
|
10288
10558
|
let hasControlledDisplay = false;
|
|
10289
10559
|
if (next && !isCssString) {
|
|
10290
|
-
if (prev)
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10560
|
+
if (prev) {
|
|
10561
|
+
if (!isString(prev)) {
|
|
10562
|
+
for (const key in prev) if (next[key] == null) setStyle(style, key, "");
|
|
10563
|
+
} else for (const prevStyle of prev.split(";")) {
|
|
10564
|
+
const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
|
|
10565
|
+
if (next[key] == null) setStyle(style, key, "");
|
|
10566
|
+
}
|
|
10295
10567
|
}
|
|
10296
10568
|
for (const key in next) {
|
|
10297
10569
|
if (key === "display") hasControlledDisplay = true;
|
|
@@ -10307,7 +10579,11 @@ function patchStyle(el, prev, next) {
|
|
|
10307
10579
|
style.cssText = next;
|
|
10308
10580
|
hasControlledDisplay = displayRE.test(next);
|
|
10309
10581
|
}
|
|
10310
|
-
} else if (prev)
|
|
10582
|
+
} else if (prev) {
|
|
10583
|
+
const cssVarText = style[CSS_VAR_TEXT];
|
|
10584
|
+
if (cssVarText) style.cssText = cssVarText;
|
|
10585
|
+
else el.removeAttribute("style");
|
|
10586
|
+
}
|
|
10311
10587
|
if (vShowOriginalDisplay in el) {
|
|
10312
10588
|
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
10313
10589
|
if (el[vShowHidden]) style.display = "none";
|
|
@@ -10320,8 +10596,10 @@ function setStyle(style, name, rawVal) {
|
|
|
10320
10596
|
else {
|
|
10321
10597
|
const val = rawVal == null ? "" : String(rawVal);
|
|
10322
10598
|
if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
10323
|
-
if (name.startsWith("--"))
|
|
10324
|
-
|
|
10599
|
+
if (name.startsWith("--")) {
|
|
10600
|
+
if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
10601
|
+
else style.setProperty(name, val);
|
|
10602
|
+
} else {
|
|
10325
10603
|
const prefixed = autoPrefix(style, name);
|
|
10326
10604
|
if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
|
|
10327
10605
|
else style[prefixed] = val;
|
|
@@ -10358,15 +10636,16 @@ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
|
10358
10636
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
10359
10637
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
10360
10638
|
function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
|
|
10361
|
-
if (isSVG && key.startsWith("xlink:"))
|
|
10362
|
-
|
|
10363
|
-
|
|
10639
|
+
if (isSVG && key.startsWith("xlink:")) {
|
|
10640
|
+
if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
10641
|
+
else el.setAttributeNS(xlinkNS, key, value);
|
|
10642
|
+
} else {
|
|
10364
10643
|
if (compatCoerceAttr(el, key, value, instance)) return;
|
|
10365
10644
|
if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
|
|
10366
10645
|
else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
|
|
10367
10646
|
}
|
|
10368
10647
|
}
|
|
10369
|
-
const isEnumeratedAttr =
|
|
10648
|
+
const isEnumeratedAttr = /*@__PURE__*/ makeMap("contenteditable,draggable,spellcheck");
|
|
10370
10649
|
function compatCoerceAttr(el, key, value, instance = null) {
|
|
10371
10650
|
if (isEnumeratedAttr(key)) {
|
|
10372
10651
|
const v2CoercedValue = value === void 0 ? null : value === null || value === false || value === "false" ? "false" : "true";
|
|
@@ -10458,7 +10737,7 @@ function parseEventName(name) {
|
|
|
10458
10737
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
10459
10738
|
}
|
|
10460
10739
|
let cachedNow = 0;
|
|
10461
|
-
const p =
|
|
10740
|
+
const p = /*@__PURE__*/ Promise.resolve();
|
|
10462
10741
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
|
|
10463
10742
|
function createInvoker(initialValue, instance) {
|
|
10464
10743
|
const invoker = (e) => {
|
|
@@ -10526,7 +10805,7 @@ function shouldSetAsPropForVueCE(el, key) {
|
|
|
10526
10805
|
//#endregion
|
|
10527
10806
|
//#region packages/runtime-dom/src/apiCustomElement.ts
|
|
10528
10807
|
const REMOVAL = {};
|
|
10529
|
-
|
|
10808
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
10530
10809
|
function defineCustomElement(options, extraOptions, _createApp) {
|
|
10531
10810
|
let Comp = /* @__PURE__ */ defineComponent(options, extraOptions);
|
|
10532
10811
|
if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
|
|
@@ -10575,12 +10854,14 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10575
10854
|
this._parent = parent;
|
|
10576
10855
|
break;
|
|
10577
10856
|
}
|
|
10578
|
-
if (!this._instance)
|
|
10579
|
-
|
|
10580
|
-
this._pendingResolve =
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
|
|
10857
|
+
if (!this._instance) {
|
|
10858
|
+
if (this._resolved) this._mountComponent(this._def);
|
|
10859
|
+
else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
|
|
10860
|
+
this._pendingResolve = void 0;
|
|
10861
|
+
if (this.isConnected) return this._resolveDef();
|
|
10862
|
+
});
|
|
10863
|
+
else this._resolveDef();
|
|
10864
|
+
}
|
|
10584
10865
|
}
|
|
10585
10866
|
disconnectedCallback() {
|
|
10586
10867
|
this._connected = false;
|
|
@@ -10614,7 +10895,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10614
10895
|
* resolve inner component definition (handle possible async component)
|
|
10615
10896
|
*/
|
|
10616
10897
|
_resolveDef() {
|
|
10617
|
-
if (this._pendingResolve) return;
|
|
10898
|
+
if (this._pendingResolve) return this._pendingResolve;
|
|
10618
10899
|
for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
|
|
10619
10900
|
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
10620
10901
|
this._ob.observe(this, { attributes: true });
|
|
@@ -10644,6 +10925,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10644
10925
|
this._def = def;
|
|
10645
10926
|
resolve(def);
|
|
10646
10927
|
});
|
|
10928
|
+
return this._pendingResolve;
|
|
10647
10929
|
} else resolve(this._def);
|
|
10648
10930
|
}
|
|
10649
10931
|
_mountComponent(def) {
|
|
@@ -10682,14 +10964,17 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10682
10964
|
const { props } = def;
|
|
10683
10965
|
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
10684
10966
|
for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
|
|
10685
|
-
for (const key of declaredPropKeys.map(camelize))
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10967
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
10968
|
+
if (key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
|
|
10969
|
+
Object.defineProperty(this, key, {
|
|
10970
|
+
get() {
|
|
10971
|
+
return this._getProp(key);
|
|
10972
|
+
},
|
|
10973
|
+
set(val) {
|
|
10974
|
+
this._setProp(key, val, true, !this._patching);
|
|
10975
|
+
}
|
|
10976
|
+
});
|
|
10977
|
+
}
|
|
10693
10978
|
}
|
|
10694
10979
|
_setAttr(key) {
|
|
10695
10980
|
if (key.startsWith("data-v-")) return;
|
|
@@ -10792,13 +11077,11 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10792
11077
|
_renderSlots() {
|
|
10793
11078
|
const outlets = this._getSlots();
|
|
10794
11079
|
const scopeId = this._instance.type.__scopeId;
|
|
10795
|
-
const slotReplacements = /* @__PURE__ */ new Map();
|
|
10796
11080
|
for (let i = 0; i < outlets.length; i++) {
|
|
10797
11081
|
const o = outlets[i];
|
|
10798
11082
|
const slotName = o.getAttribute("name") || "default";
|
|
10799
11083
|
const content = this._slots[slotName];
|
|
10800
11084
|
const parent = o.parentNode;
|
|
10801
|
-
const replacementNodes = [];
|
|
10802
11085
|
if (content) for (const n of content) {
|
|
10803
11086
|
if (scopeId && n.nodeType === 1) {
|
|
10804
11087
|
const id = scopeId + "-s";
|
|
@@ -10808,20 +11091,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10808
11091
|
while (child = walker.nextNode()) child.setAttribute(id, "");
|
|
10809
11092
|
}
|
|
10810
11093
|
parent.insertBefore(n, o);
|
|
10811
|
-
replacementNodes.push(n);
|
|
10812
|
-
}
|
|
10813
|
-
else while (o.firstChild) {
|
|
10814
|
-
const child = o.firstChild;
|
|
10815
|
-
parent.insertBefore(child, o);
|
|
10816
|
-
replacementNodes.push(child);
|
|
10817
11094
|
}
|
|
11095
|
+
else while (o.firstChild) parent.insertBefore(o.firstChild, o);
|
|
10818
11096
|
parent.removeChild(o);
|
|
10819
|
-
slotReplacements.set(o, {
|
|
10820
|
-
nodes: replacementNodes,
|
|
10821
|
-
usedFallback: !content
|
|
10822
|
-
});
|
|
10823
11097
|
}
|
|
10824
|
-
this._updateSlotNodes(slotReplacements);
|
|
10825
11098
|
}
|
|
10826
11099
|
/**
|
|
10827
11100
|
* @internal
|
|
@@ -10860,7 +11133,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10860
11133
|
* @internal
|
|
10861
11134
|
*/
|
|
10862
11135
|
_hasShadowRoot() {
|
|
10863
|
-
return this.
|
|
11136
|
+
return this._root !== this;
|
|
10864
11137
|
}
|
|
10865
11138
|
/**
|
|
10866
11139
|
* @internal
|
|
@@ -10905,10 +11178,6 @@ var VueElement = class extends VueElementBase {
|
|
|
10905
11178
|
if (this._instance && this._instance.ce) this._instance.ce = void 0;
|
|
10906
11179
|
this._app = this._instance = null;
|
|
10907
11180
|
}
|
|
10908
|
-
/**
|
|
10909
|
-
* Only called when shadowRoot is false
|
|
10910
|
-
*/
|
|
10911
|
-
_updateSlotNodes(replacements) {}
|
|
10912
11181
|
_createVNode() {
|
|
10913
11182
|
const baseProps = {};
|
|
10914
11183
|
if (!this.shadowRoot) baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
|
|
@@ -10975,7 +11244,7 @@ const decorate = (t) => {
|
|
|
10975
11244
|
};
|
|
10976
11245
|
const TransitionGroup = /* @__PURE__ */ decorate({
|
|
10977
11246
|
name: "TransitionGroup",
|
|
10978
|
-
props:
|
|
11247
|
+
props: /*@__PURE__*/ extend({}, TransitionPropsValidators, {
|
|
10979
11248
|
tag: String,
|
|
10980
11249
|
moveClass: String
|
|
10981
11250
|
}),
|
|
@@ -11107,13 +11376,22 @@ function onCompositionEnd(e) {
|
|
|
11107
11376
|
}
|
|
11108
11377
|
}
|
|
11109
11378
|
const assignKey = Symbol("_assign");
|
|
11379
|
+
const initialValueKey = Symbol("_initialValue");
|
|
11110
11380
|
const vModelText = {
|
|
11111
11381
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
11382
|
+
if (el.parentNode) {
|
|
11383
|
+
if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
11384
|
+
else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
11385
|
+
}
|
|
11112
11386
|
el[assignKey] = getModelAssigner(vnode);
|
|
11113
11387
|
vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
|
|
11114
11388
|
},
|
|
11115
|
-
mounted(el, { value }) {
|
|
11116
|
-
|
|
11389
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
11390
|
+
const newValue = value == null ? "" : value;
|
|
11391
|
+
const initialValue = el[initialValueKey];
|
|
11392
|
+
delete el[initialValueKey];
|
|
11393
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
|
|
11394
|
+
else el.value = newValue;
|
|
11117
11395
|
},
|
|
11118
11396
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
11119
11397
|
el[assignKey] = getModelAssigner(vnode);
|
|
@@ -11248,19 +11526,39 @@ const vModelSelectInit = (el, value, number, set) => {
|
|
|
11248
11526
|
el._modelValue = value;
|
|
11249
11527
|
addEventListener(el, "change", () => {
|
|
11250
11528
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
11251
|
-
|
|
11252
|
-
el.
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11529
|
+
const multiple = el.multiple;
|
|
11530
|
+
const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
|
|
11531
|
+
const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
|
|
11532
|
+
try {
|
|
11533
|
+
(set || el[assignKey])(assignedValue);
|
|
11534
|
+
} finally {
|
|
11535
|
+
nextTick(() => {
|
|
11536
|
+
if (el._pendingValue === pending) el._pendingValue = void 0;
|
|
11537
|
+
});
|
|
11538
|
+
}
|
|
11256
11539
|
});
|
|
11257
11540
|
};
|
|
11541
|
+
function isSameSelectValue(value, assignedValue, multiple) {
|
|
11542
|
+
if (!multiple) return looseEqual(value, assignedValue);
|
|
11543
|
+
if (isArray(value)) return looseEqual(value, assignedValue);
|
|
11544
|
+
if (isSet(value)) {
|
|
11545
|
+
if (value.size !== assignedValue.length) return false;
|
|
11546
|
+
for (const item of assignedValue) if (!value.has(item)) return false;
|
|
11547
|
+
return true;
|
|
11548
|
+
}
|
|
11549
|
+
return false;
|
|
11550
|
+
}
|
|
11258
11551
|
/**
|
|
11259
11552
|
* @internal
|
|
11260
11553
|
*/
|
|
11261
11554
|
const vModelSetSelected = (el, value) => {
|
|
11262
11555
|
el._modelValue = value;
|
|
11263
|
-
|
|
11556
|
+
const pending = el._pendingValue;
|
|
11557
|
+
el._pendingValue = void 0;
|
|
11558
|
+
if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
|
|
11559
|
+
setSelected(el, value);
|
|
11560
|
+
};
|
|
11561
|
+
function setSelected(el, value) {
|
|
11264
11562
|
const isMultiple = el.multiple;
|
|
11265
11563
|
const isArrayValue = isArray(value);
|
|
11266
11564
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -11270,18 +11568,19 @@ const vModelSetSelected = (el, value) => {
|
|
|
11270
11568
|
for (let i = 0, l = el.options.length; i < l; i++) {
|
|
11271
11569
|
const option = el.options[i];
|
|
11272
11570
|
const optionValue = getValue(option);
|
|
11273
|
-
if (isMultiple)
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11571
|
+
if (isMultiple) {
|
|
11572
|
+
if (isArrayValue) {
|
|
11573
|
+
const optionType = typeof optionValue;
|
|
11574
|
+
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
11575
|
+
else option.selected = looseIndexOf(value, optionValue) > -1;
|
|
11576
|
+
} else option.selected = value.has(optionValue);
|
|
11577
|
+
} else if (looseEqual(getValue(option), value)) {
|
|
11279
11578
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
11280
11579
|
return;
|
|
11281
11580
|
}
|
|
11282
11581
|
}
|
|
11283
11582
|
if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
|
|
11284
|
-
}
|
|
11583
|
+
}
|
|
11285
11584
|
/**
|
|
11286
11585
|
* @internal retrieve raw value set via :value bindings
|
|
11287
11586
|
*/
|
|
@@ -11577,7 +11876,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11577
11876
|
withModifiers: () => withModifiers,
|
|
11578
11877
|
withScopeId: () => withScopeId
|
|
11579
11878
|
});
|
|
11580
|
-
const rendererOptions =
|
|
11879
|
+
const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
|
|
11581
11880
|
let renderer;
|
|
11582
11881
|
let enabledHydration = false;
|
|
11583
11882
|
function ensureRenderer() {
|
|
@@ -12128,13 +12427,14 @@ var Tokenizer = class {
|
|
|
12128
12427
|
}
|
|
12129
12428
|
}
|
|
12130
12429
|
stateInterpolationOpen(c) {
|
|
12131
|
-
if (c === this.delimiterOpen[this.delimiterIndex])
|
|
12132
|
-
|
|
12133
|
-
|
|
12134
|
-
|
|
12135
|
-
|
|
12136
|
-
|
|
12137
|
-
|
|
12430
|
+
if (c === this.delimiterOpen[this.delimiterIndex]) {
|
|
12431
|
+
if (this.delimiterIndex === this.delimiterOpen.length - 1) {
|
|
12432
|
+
const start = this.index + 1 - this.delimiterOpen.length;
|
|
12433
|
+
if (start > this.sectionStart) this.cbs.ontext(this.sectionStart, start);
|
|
12434
|
+
this.state = 3;
|
|
12435
|
+
this.sectionStart = start;
|
|
12436
|
+
} else this.delimiterIndex++;
|
|
12437
|
+
} else if (this.inRCDATA) {
|
|
12138
12438
|
this.state = 32;
|
|
12139
12439
|
this.stateInRCDATA(c);
|
|
12140
12440
|
} else {
|
|
@@ -12150,13 +12450,14 @@ var Tokenizer = class {
|
|
|
12150
12450
|
}
|
|
12151
12451
|
}
|
|
12152
12452
|
stateInterpolationClose(c) {
|
|
12153
|
-
if (c === this.delimiterClose[this.delimiterIndex])
|
|
12154
|
-
|
|
12155
|
-
|
|
12156
|
-
|
|
12157
|
-
|
|
12158
|
-
|
|
12159
|
-
|
|
12453
|
+
if (c === this.delimiterClose[this.delimiterIndex]) {
|
|
12454
|
+
if (this.delimiterIndex === this.delimiterClose.length - 1) {
|
|
12455
|
+
this.cbs.oninterpolation(this.sectionStart, this.index + 1);
|
|
12456
|
+
if (this.inRCDATA) this.state = 32;
|
|
12457
|
+
else this.state = 1;
|
|
12458
|
+
this.sectionStart = this.index + 1;
|
|
12459
|
+
} else this.delimiterIndex++;
|
|
12460
|
+
} else {
|
|
12160
12461
|
this.state = 3;
|
|
12161
12462
|
this.stateInterpolation(c);
|
|
12162
12463
|
}
|
|
@@ -12271,9 +12572,10 @@ var Tokenizer = class {
|
|
|
12271
12572
|
this.sectionStart = this.index;
|
|
12272
12573
|
if (this.mode === 0) this.state = 6;
|
|
12273
12574
|
else if (this.inSFCRoot) this.state = 34;
|
|
12274
|
-
else if (!this.inXML)
|
|
12275
|
-
|
|
12276
|
-
|
|
12575
|
+
else if (!this.inXML) {
|
|
12576
|
+
if (c === 116) this.state = 30;
|
|
12577
|
+
else this.state = c === 115 ? 29 : 6;
|
|
12578
|
+
} else this.state = 6;
|
|
12277
12579
|
} else if (c === 47) this.state = 8;
|
|
12278
12580
|
else {
|
|
12279
12581
|
this.state = 1;
|
|
@@ -12626,9 +12928,7 @@ var Tokenizer = class {
|
|
|
12626
12928
|
case 24:
|
|
12627
12929
|
this.stateInProcessingInstruction(c);
|
|
12628
12930
|
break;
|
|
12629
|
-
case 33:
|
|
12630
|
-
this.stateInEntity();
|
|
12631
|
-
break;
|
|
12931
|
+
case 33: this.stateInEntity();
|
|
12632
12932
|
}
|
|
12633
12933
|
this.index++;
|
|
12634
12934
|
}
|
|
@@ -12657,9 +12957,10 @@ var Tokenizer = class {
|
|
|
12657
12957
|
handleTrailingData() {
|
|
12658
12958
|
const endIndex = this.buffer.length;
|
|
12659
12959
|
if (this.sectionStart >= endIndex) return;
|
|
12660
|
-
if (this.state === 28)
|
|
12661
|
-
|
|
12662
|
-
|
|
12960
|
+
if (this.state === 28) {
|
|
12961
|
+
if (this.currentSequence === Sequences.CdataEnd) this.cbs.oncdata(this.sectionStart, endIndex);
|
|
12962
|
+
else this.cbs.oncomment(this.sectionStart, endIndex);
|
|
12963
|
+
} else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) {} else this.cbs.ontext(this.sectionStart, endIndex);
|
|
12663
12964
|
}
|
|
12664
12965
|
emitCodePoint(cp, consumed) {}
|
|
12665
12966
|
};
|
|
@@ -12861,12 +13162,10 @@ const isMemberExpressionBrowser = (exp) => {
|
|
|
12861
13162
|
if (!--currentOpenParensCount) state = stateStack.pop();
|
|
12862
13163
|
}
|
|
12863
13164
|
break;
|
|
12864
|
-
case 3:
|
|
12865
|
-
|
|
12866
|
-
|
|
12867
|
-
|
|
12868
|
-
}
|
|
12869
|
-
break;
|
|
13165
|
+
case 3: if (char === currentStringType) {
|
|
13166
|
+
state = stateStack.pop();
|
|
13167
|
+
currentStringType = null;
|
|
13168
|
+
}
|
|
12870
13169
|
}
|
|
12871
13170
|
}
|
|
12872
13171
|
return !currentOpenBracketCount && !currentOpenParensCount;
|
|
@@ -12916,7 +13215,7 @@ function isTemplateNode(node) {
|
|
|
12916
13215
|
function isSlotOutlet(node) {
|
|
12917
13216
|
return node.type === 1 && node.tagType === 2;
|
|
12918
13217
|
}
|
|
12919
|
-
const propsHelperSet = new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
13218
|
+
const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
12920
13219
|
function getUnnormalizedProps(props, callPath = []) {
|
|
12921
13220
|
if (props && !isString(props) && props.type === 14) {
|
|
12922
13221
|
const callee = props.callee;
|
|
@@ -12959,9 +13258,10 @@ function injectProp(node, prop, context) {
|
|
|
12959
13258
|
propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [createObjectExpression([prop]), props]);
|
|
12960
13259
|
if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) parentCall = callPath[callPath.length - 2];
|
|
12961
13260
|
}
|
|
12962
|
-
if (node.type === 13)
|
|
12963
|
-
|
|
12964
|
-
|
|
13261
|
+
if (node.type === 13) {
|
|
13262
|
+
if (parentCall) parentCall.arguments[0] = propsWithInjection;
|
|
13263
|
+
else node.props = propsWithInjection;
|
|
13264
|
+
} else if (parentCall) parentCall.arguments[0] = propsWithInjection;
|
|
12965
13265
|
else node.arguments[2] = propsWithInjection;
|
|
12966
13266
|
}
|
|
12967
13267
|
function injectSlotKey(node, prop) {
|
|
@@ -13236,10 +13536,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
13236
13536
|
case 18:
|
|
13237
13537
|
case 19:
|
|
13238
13538
|
case 20:
|
|
13239
|
-
case 21:
|
|
13240
|
-
emitError(9, end);
|
|
13241
|
-
break;
|
|
13242
|
-
default: break;
|
|
13539
|
+
case 21: emitError(9, end);
|
|
13243
13540
|
}
|
|
13244
13541
|
for (let index = 0; index < stack.length; index++) {
|
|
13245
13542
|
onCloseTag(stack[index], end - 1);
|
|
@@ -13389,7 +13686,7 @@ function backTrack(index, c) {
|
|
|
13389
13686
|
while (currentInput.charCodeAt(i) !== c && i >= 0) i--;
|
|
13390
13687
|
return i;
|
|
13391
13688
|
}
|
|
13392
|
-
const specialTemplateDir = new Set([
|
|
13689
|
+
const specialTemplateDir = /* @__PURE__ */ new Set([
|
|
13393
13690
|
"if",
|
|
13394
13691
|
"else",
|
|
13395
13692
|
"else-if",
|
|
@@ -13425,16 +13722,18 @@ function condenseWhitespace(nodes) {
|
|
|
13425
13722
|
let removedWhitespace = false;
|
|
13426
13723
|
for (let i = 0; i < nodes.length; i++) {
|
|
13427
13724
|
const node = nodes[i];
|
|
13428
|
-
if (node.type === 2)
|
|
13429
|
-
if (
|
|
13430
|
-
|
|
13431
|
-
|
|
13432
|
-
|
|
13433
|
-
|
|
13434
|
-
|
|
13435
|
-
|
|
13436
|
-
|
|
13437
|
-
|
|
13725
|
+
if (node.type === 2) {
|
|
13726
|
+
if (!inPre) {
|
|
13727
|
+
if (isAllWhitespace(node.content)) {
|
|
13728
|
+
const prev = nodes[i - 1] && nodes[i - 1].type;
|
|
13729
|
+
const next = nodes[i + 1] && nodes[i + 1].type;
|
|
13730
|
+
if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
|
|
13731
|
+
removedWhitespace = true;
|
|
13732
|
+
nodes[i] = null;
|
|
13733
|
+
} else node.content = " ";
|
|
13734
|
+
} else if (shouldCondense) node.content = condense(node.content);
|
|
13735
|
+
} else node.content = node.content.replace(windowsNewlineRE, "\n");
|
|
13736
|
+
}
|
|
13438
13737
|
}
|
|
13439
13738
|
return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
|
13440
13739
|
}
|
|
@@ -13695,7 +13994,7 @@ function getConstantType(node, context) {
|
|
|
13695
13994
|
default: return 0;
|
|
13696
13995
|
}
|
|
13697
13996
|
}
|
|
13698
|
-
const allowHoistedHelperSet = new Set([
|
|
13997
|
+
const allowHoistedHelperSet = /* @__PURE__ */ new Set([
|
|
13699
13998
|
NORMALIZE_CLASS,
|
|
13700
13999
|
NORMALIZE_STYLE,
|
|
13701
14000
|
NORMALIZE_PROPS,
|
|
@@ -13739,7 +14038,7 @@ function getSelfName(filename) {
|
|
|
13739
14038
|
const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
|
|
13740
14039
|
return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
|
|
13741
14040
|
}
|
|
13742
|
-
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false,
|
|
14041
|
+
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
13743
14042
|
const context = {
|
|
13744
14043
|
filename,
|
|
13745
14044
|
selfName: getSelfName(filename),
|
|
@@ -13761,7 +14060,6 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
13761
14060
|
bindingMetadata,
|
|
13762
14061
|
inline,
|
|
13763
14062
|
isTS,
|
|
13764
|
-
eventDelegation,
|
|
13765
14063
|
onError,
|
|
13766
14064
|
onWarn,
|
|
13767
14065
|
compatConfig,
|
|
@@ -13854,7 +14152,7 @@ function transform(root, options) {
|
|
|
13854
14152
|
traverseNode(root, context);
|
|
13855
14153
|
if (options.hoistStatic) cacheStatic(root, context);
|
|
13856
14154
|
if (!options.ssr) createRootCodegen(root, context);
|
|
13857
|
-
root.helpers = new Set([...context.helpers.keys()]);
|
|
14155
|
+
root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]);
|
|
13858
14156
|
root.components = [...context.components];
|
|
13859
14157
|
root.directives = [...context.directives];
|
|
13860
14158
|
root.imports = context.imports;
|
|
@@ -13901,8 +14199,10 @@ function traverseNode(node, context) {
|
|
|
13901
14199
|
const exitFns = [];
|
|
13902
14200
|
for (let i = 0; i < nodeTransforms.length; i++) {
|
|
13903
14201
|
const onExit = nodeTransforms[i](node, context);
|
|
13904
|
-
if (onExit)
|
|
13905
|
-
|
|
14202
|
+
if (onExit) {
|
|
14203
|
+
if (isArray(onExit)) exitFns.push(...onExit);
|
|
14204
|
+
else exitFns.push(onExit);
|
|
14205
|
+
}
|
|
13906
14206
|
if (!context.currentNode) return;
|
|
13907
14207
|
else node = context.currentNode;
|
|
13908
14208
|
}
|
|
@@ -13919,9 +14219,7 @@ function traverseNode(node, context) {
|
|
|
13919
14219
|
case 10:
|
|
13920
14220
|
case 11:
|
|
13921
14221
|
case 1:
|
|
13922
|
-
case 0:
|
|
13923
|
-
traverseChildren(node, context);
|
|
13924
|
-
break;
|
|
14222
|
+
case 0: traverseChildren(node, context);
|
|
13925
14223
|
}
|
|
13926
14224
|
context.currentNode = node;
|
|
13927
14225
|
let i = exitFns.length;
|
|
@@ -14117,10 +14415,12 @@ function genNodeList(nodes, context, multilines = false, comma = true) {
|
|
|
14117
14415
|
if (isString(node)) push(node, -3);
|
|
14118
14416
|
else if (isArray(node)) genNodeListAsArray(node, context);
|
|
14119
14417
|
else genNode(node, context);
|
|
14120
|
-
if (i < nodes.length - 1)
|
|
14121
|
-
|
|
14122
|
-
|
|
14123
|
-
|
|
14418
|
+
if (i < nodes.length - 1) {
|
|
14419
|
+
if (multilines) {
|
|
14420
|
+
comma && push(",");
|
|
14421
|
+
newline();
|
|
14422
|
+
} else comma && push(", ");
|
|
14423
|
+
}
|
|
14124
14424
|
}
|
|
14125
14425
|
}
|
|
14126
14426
|
function genNode(node, context) {
|
|
@@ -14232,8 +14532,10 @@ function genVNodeCall(node, context) {
|
|
|
14232
14532
|
const { push, helper, pure } = context;
|
|
14233
14533
|
const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent } = node;
|
|
14234
14534
|
let patchFlagString;
|
|
14235
|
-
if (patchFlag)
|
|
14236
|
-
|
|
14535
|
+
if (patchFlag) {
|
|
14536
|
+
if (patchFlag < 0) patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
|
|
14537
|
+
else patchFlagString = patchFlag + ` /* ${Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `)} */`;
|
|
14538
|
+
}
|
|
14237
14539
|
if (directives) push(helper(WITH_DIRECTIVES) + `(`);
|
|
14238
14540
|
if (isBlock) push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
|
|
14239
14541
|
if (pure) push(PURE_ANNOTATION);
|
|
@@ -14502,16 +14804,17 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
14502
14804
|
const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2));
|
|
14503
14805
|
const { children } = branch;
|
|
14504
14806
|
const firstChild = children[0];
|
|
14505
|
-
if (children.length !== 1 || firstChild.type !== 1)
|
|
14506
|
-
|
|
14507
|
-
|
|
14508
|
-
|
|
14807
|
+
if (children.length !== 1 || firstChild.type !== 1) {
|
|
14808
|
+
if (children.length === 1 && firstChild.type === 11) {
|
|
14809
|
+
const vnodeCall = firstChild.codegenNode;
|
|
14810
|
+
injectProp(vnodeCall, keyProperty, context);
|
|
14811
|
+
return vnodeCall;
|
|
14812
|
+
} else {
|
|
14813
|
+
let patchFlag = 64;
|
|
14814
|
+
if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) patchFlag |= 2048;
|
|
14815
|
+
return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag, void 0, void 0, true, false, false, branch.loc);
|
|
14816
|
+
}
|
|
14509
14817
|
} else {
|
|
14510
|
-
let patchFlag = 64;
|
|
14511
|
-
if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) patchFlag |= 2048;
|
|
14512
|
-
return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag, void 0, void 0, true, false, false, branch.loc);
|
|
14513
|
-
}
|
|
14514
|
-
else {
|
|
14515
14818
|
const ret = firstChild.codegenNode;
|
|
14516
14819
|
const vnodeCall = getMemoedVNodeCall(ret);
|
|
14517
14820
|
if (vnodeCall.type === 13) convertToBlock(vnodeCall, context);
|
|
@@ -14532,9 +14835,10 @@ function isSameKey(a, b) {
|
|
|
14532
14835
|
return true;
|
|
14533
14836
|
}
|
|
14534
14837
|
function getParentCondition(node) {
|
|
14535
|
-
while (true) if (node.type === 19)
|
|
14536
|
-
|
|
14537
|
-
|
|
14838
|
+
while (true) if (node.type === 19) {
|
|
14839
|
+
if (node.alternate.type === 19) node = node.alternate;
|
|
14840
|
+
else return node;
|
|
14841
|
+
} else if (node.type === 20) node = node.value;
|
|
14538
14842
|
}
|
|
14539
14843
|
//#endregion
|
|
14540
14844
|
//#region packages/compiler-core/src/transforms/vFor.ts
|
|
@@ -14572,15 +14876,24 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
14572
14876
|
else {
|
|
14573
14877
|
childBlock = children[0].codegenNode;
|
|
14574
14878
|
if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
|
|
14575
|
-
|
|
14576
|
-
|
|
14577
|
-
|
|
14578
|
-
|
|
14579
|
-
|
|
14879
|
+
const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
|
|
14880
|
+
if (childBlock.isBlock !== shouldUseBlock) {
|
|
14881
|
+
if (childBlock.isBlock) {
|
|
14882
|
+
removeHelper(OPEN_BLOCK);
|
|
14883
|
+
removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
14884
|
+
} else removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
14885
|
+
}
|
|
14886
|
+
childBlock.isBlock = shouldUseBlock;
|
|
14580
14887
|
if (childBlock.isBlock) {
|
|
14581
14888
|
helper(OPEN_BLOCK);
|
|
14582
14889
|
helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
14583
|
-
} else
|
|
14890
|
+
} else {
|
|
14891
|
+
helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
14892
|
+
if (childBlock.needsPatch) {
|
|
14893
|
+
var _childBlock$patchFlag;
|
|
14894
|
+
childBlock.patchFlag = ((_childBlock$patchFlag = childBlock.patchFlag) !== null && _childBlock$patchFlag !== void 0 ? _childBlock$patchFlag : 0) | 512;
|
|
14895
|
+
}
|
|
14896
|
+
}
|
|
14584
14897
|
}
|
|
14585
14898
|
if (memo) {
|
|
14586
14899
|
const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [createSimpleExpression(`_cached`)]));
|
|
@@ -14752,8 +15065,10 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
14752
15065
|
return createObjectProperty(`default`, fn);
|
|
14753
15066
|
};
|
|
14754
15067
|
if (!hasTemplateSlots) slotsProperties.push(buildDefaultSlotProperty(void 0, children));
|
|
14755
|
-
else if (implicitDefaultChildren.length && !implicitDefaultChildren.every(isWhitespaceText))
|
|
14756
|
-
|
|
15068
|
+
else if (implicitDefaultChildren.length && !implicitDefaultChildren.every(isWhitespaceText)) {
|
|
15069
|
+
if (hasNamedDefaultSlot) context.onError(createCompilerError(39, implicitDefaultChildren[0].loc));
|
|
15070
|
+
else slotsProperties.push(buildDefaultSlotProperty(void 0, implicitDefaultChildren));
|
|
15071
|
+
}
|
|
14757
15072
|
}
|
|
14758
15073
|
const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1;
|
|
14759
15074
|
let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`, createSimpleExpression(slotFlag + ` /* ${slotFlagsText[slotFlag]} */`, false))), loc);
|
|
@@ -14779,10 +15094,7 @@ function hasForwardedSlots(children) {
|
|
|
14779
15094
|
if (hasForwardedSlots(child.branches)) return true;
|
|
14780
15095
|
break;
|
|
14781
15096
|
case 10:
|
|
14782
|
-
case 11:
|
|
14783
|
-
if (hasForwardedSlots(child.children)) return true;
|
|
14784
|
-
break;
|
|
14785
|
-
default: break;
|
|
15097
|
+
case 11: if (hasForwardedSlots(child.children)) return true;
|
|
14786
15098
|
}
|
|
14787
15099
|
}
|
|
14788
15100
|
return false;
|
|
@@ -14804,12 +15116,16 @@ const transformElement = (node, context) => {
|
|
|
14804
15116
|
let vnodeDynamicProps;
|
|
14805
15117
|
let dynamicPropNames;
|
|
14806
15118
|
let vnodeDirectives;
|
|
15119
|
+
let needsPatch = false;
|
|
15120
|
+
let isBlockRequired = false;
|
|
14807
15121
|
let shouldUseBlock = isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && (tag === "svg" || tag === "foreignObject" || tag === "math");
|
|
14808
15122
|
if (props.length > 0) {
|
|
14809
15123
|
const propsBuildResult = buildProps(node, context, void 0, isComponent, isDynamicComponent);
|
|
14810
15124
|
vnodeProps = propsBuildResult.props;
|
|
14811
15125
|
patchFlag = propsBuildResult.patchFlag;
|
|
14812
15126
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
15127
|
+
needsPatch = propsBuildResult.needsPatch;
|
|
15128
|
+
isBlockRequired = propsBuildResult.isBlockRequired;
|
|
14813
15129
|
const directives = propsBuildResult.directives;
|
|
14814
15130
|
vnodeDirectives = directives && directives.length ? createArrayExpression(directives.map((dir) => buildDirectiveArgs(dir, context))) : void 0;
|
|
14815
15131
|
if (propsBuildResult.shouldUseBlock) shouldUseBlock = true;
|
|
@@ -14838,7 +15154,10 @@ const transformElement = (node, context) => {
|
|
|
14838
15154
|
} else vnodeChildren = node.children;
|
|
14839
15155
|
}
|
|
14840
15156
|
if (dynamicPropNames && dynamicPropNames.length) vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
|
|
14841
|
-
node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
|
|
15157
|
+
const vnodeCall = node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
|
|
15158
|
+
needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
|
|
15159
|
+
if (needsPatch) vnodeCall.needsPatch = true;
|
|
15160
|
+
if (isBlockRequired) vnodeCall.isBlockRequired = true;
|
|
14842
15161
|
};
|
|
14843
15162
|
};
|
|
14844
15163
|
function resolveComponentType(node, context, ssr = false) {
|
|
@@ -14872,6 +15191,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14872
15191
|
const runtimeDirectives = [];
|
|
14873
15192
|
const hasChildren = children.length > 0;
|
|
14874
15193
|
let shouldUseBlock = false;
|
|
15194
|
+
let isBlockRequired = false;
|
|
14875
15195
|
let patchFlag = 0;
|
|
14876
15196
|
let hasRef = false;
|
|
14877
15197
|
let hasClassBinding = false;
|
|
@@ -14896,12 +15216,12 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14896
15216
|
const isEventHandler = isOn(name);
|
|
14897
15217
|
if (isEventHandler && (!isComponent || isDynamicComponent) && name.toLowerCase() !== "onclick" && name !== "onUpdate:modelValue" && !isReservedProp(name)) hasHydrationEventBinding = true;
|
|
14898
15218
|
if (isEventHandler && isReservedProp(name)) hasVnodeHook = true;
|
|
15219
|
+
if (name === "ref") hasRef = true;
|
|
14899
15220
|
if (isEventHandler && value.type === 14) value = value.arguments[0];
|
|
14900
15221
|
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) return;
|
|
14901
|
-
if (name === "
|
|
14902
|
-
else if (name === "class") hasClassBinding = true;
|
|
15222
|
+
if (name === "class") hasClassBinding = true;
|
|
14903
15223
|
else if (name === "style") hasStyleBinding = true;
|
|
14904
|
-
else if (name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
15224
|
+
else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
14905
15225
|
if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
14906
15226
|
} else hasDynamicKeys = true;
|
|
14907
15227
|
};
|
|
@@ -14927,33 +15247,38 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14927
15247
|
if (name === "once" || name === "memo") continue;
|
|
14928
15248
|
if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled("COMPILER_IS_ON_ELEMENT", context))) continue;
|
|
14929
15249
|
if (isVOn && ssr) continue;
|
|
14930
|
-
if (isVBind && isStaticArgOf(arg, "key")
|
|
15250
|
+
if (isVBind && isStaticArgOf(arg, "key")) shouldUseBlock = true;
|
|
15251
|
+
if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
|
|
15252
|
+
shouldUseBlock = true;
|
|
15253
|
+
isBlockRequired = true;
|
|
15254
|
+
}
|
|
14931
15255
|
if (isVBind && isStaticArgOf(arg, "ref")) pushRefVForMarker();
|
|
14932
15256
|
if (!arg && (isVBind || isVOn)) {
|
|
14933
15257
|
hasDynamicKeys = true;
|
|
14934
|
-
if (exp)
|
|
14935
|
-
|
|
14936
|
-
|
|
14937
|
-
if (
|
|
14938
|
-
if (
|
|
14939
|
-
|
|
14940
|
-
|
|
14941
|
-
|
|
14942
|
-
|
|
14943
|
-
|
|
14944
|
-
|
|
14945
|
-
|
|
14946
|
-
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
14954
|
-
|
|
14955
|
-
|
|
14956
|
-
|
|
15258
|
+
if (exp) {
|
|
15259
|
+
if (isVBind) {
|
|
15260
|
+
pushMergeArg();
|
|
15261
|
+
if (mergeArgs.some((arg) => {
|
|
15262
|
+
if (arg.type === 15) return arg.properties.some(({ key }) => {
|
|
15263
|
+
if (key.type !== 4 || !key.isStatic) return true;
|
|
15264
|
+
return key.content !== "class" && key.content !== "style" && !isOn(key.content);
|
|
15265
|
+
});
|
|
15266
|
+
else return true;
|
|
15267
|
+
})) checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER", context, loc);
|
|
15268
|
+
if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER", context)) {
|
|
15269
|
+
mergeArgs.unshift(exp);
|
|
15270
|
+
continue;
|
|
15271
|
+
}
|
|
15272
|
+
pushRefVForMarker();
|
|
15273
|
+
pushMergeArg();
|
|
15274
|
+
mergeArgs.push(exp);
|
|
15275
|
+
} else pushMergeArg({
|
|
15276
|
+
type: 14,
|
|
15277
|
+
loc,
|
|
15278
|
+
callee: context.helper(TO_HANDLERS),
|
|
15279
|
+
arguments: isComponent ? [exp] : [exp, `true`]
|
|
15280
|
+
});
|
|
15281
|
+
} else context.onError(createCompilerError(isVBind ? 34 : 35, loc));
|
|
14957
15282
|
continue;
|
|
14958
15283
|
}
|
|
14959
15284
|
if (isVBind && modifiers.some((mod) => mod.content === "prop")) patchFlag |= 32;
|
|
@@ -14969,7 +15294,10 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14969
15294
|
}
|
|
14970
15295
|
} else if (!isBuiltInDirective(name)) {
|
|
14971
15296
|
runtimeDirectives.push(prop);
|
|
14972
|
-
if (hasChildren)
|
|
15297
|
+
if (hasChildren) {
|
|
15298
|
+
shouldUseBlock = true;
|
|
15299
|
+
isBlockRequired = true;
|
|
15300
|
+
}
|
|
14973
15301
|
}
|
|
14974
15302
|
}
|
|
14975
15303
|
}
|
|
@@ -14986,7 +15314,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14986
15314
|
if (dynamicPropNames.length) patchFlag |= 8;
|
|
14987
15315
|
if (hasHydrationEventBinding) patchFlag |= 32;
|
|
14988
15316
|
}
|
|
14989
|
-
|
|
15317
|
+
const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
|
|
15318
|
+
if (!shouldUseBlock && needsPatch) patchFlag |= 512;
|
|
14990
15319
|
if (!context.inSSR && propsExpression) switch (propsExpression.type) {
|
|
14991
15320
|
case 15:
|
|
14992
15321
|
let classKeyIndex = -1;
|
|
@@ -15007,16 +15336,16 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15007
15336
|
} else propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);
|
|
15008
15337
|
break;
|
|
15009
15338
|
case 14: break;
|
|
15010
|
-
default:
|
|
15011
|
-
propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [propsExpression])]);
|
|
15012
|
-
break;
|
|
15339
|
+
default: propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [propsExpression])]);
|
|
15013
15340
|
}
|
|
15014
15341
|
return {
|
|
15015
15342
|
props: propsExpression,
|
|
15016
15343
|
directives: runtimeDirectives,
|
|
15017
15344
|
patchFlag,
|
|
15018
15345
|
dynamicPropNames,
|
|
15019
|
-
shouldUseBlock
|
|
15346
|
+
shouldUseBlock,
|
|
15347
|
+
needsPatch,
|
|
15348
|
+
isBlockRequired
|
|
15020
15349
|
};
|
|
15021
15350
|
}
|
|
15022
15351
|
function dedupeProperties(properties) {
|
|
@@ -15113,10 +15442,12 @@ function processSlotOutlet(node, context) {
|
|
|
15113
15442
|
for (let i = 0; i < node.props.length; i++) {
|
|
15114
15443
|
const p = node.props[i];
|
|
15115
15444
|
if (p.type === 6) {
|
|
15116
|
-
if (p.value)
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15445
|
+
if (p.value) {
|
|
15446
|
+
if (p.name === "name") slotName = JSON.stringify(p.value.content);
|
|
15447
|
+
else {
|
|
15448
|
+
p.name = camelize(p.name);
|
|
15449
|
+
nonNameProps.push(p);
|
|
15450
|
+
}
|
|
15120
15451
|
}
|
|
15121
15452
|
} else if (p.name === "bind" && isStaticArgOf(p.arg, "name")) {
|
|
15122
15453
|
if (p.exp) slotName = p.exp;
|
|
@@ -15142,17 +15473,18 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
15142
15473
|
const { loc, modifiers, arg } = dir;
|
|
15143
15474
|
if (!dir.exp && !modifiers.length) context.onError(createCompilerError(35, loc));
|
|
15144
15475
|
let eventName;
|
|
15145
|
-
if (arg.type === 4)
|
|
15146
|
-
|
|
15147
|
-
|
|
15148
|
-
|
|
15149
|
-
|
|
15150
|
-
|
|
15151
|
-
|
|
15152
|
-
|
|
15153
|
-
|
|
15154
|
-
|
|
15155
|
-
|
|
15476
|
+
if (arg.type === 4) {
|
|
15477
|
+
if (arg.isStatic) {
|
|
15478
|
+
let rawName = arg.content;
|
|
15479
|
+
if (rawName.startsWith("vnode")) context.onError(createCompilerError(52, arg.loc));
|
|
15480
|
+
if (rawName.startsWith("vue:")) rawName = `vnode-${rawName.slice(4)}`;
|
|
15481
|
+
eventName = createSimpleExpression(node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? toHandlerKey(camelize(rawName)) : `on:${rawName}`, true, arg.loc);
|
|
15482
|
+
} else eventName = createCompoundExpression([
|
|
15483
|
+
`${context.helperString(TO_HANDLER_KEY)}(`,
|
|
15484
|
+
arg,
|
|
15485
|
+
`)`
|
|
15486
|
+
]);
|
|
15487
|
+
} else {
|
|
15156
15488
|
eventName = arg;
|
|
15157
15489
|
eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
|
|
15158
15490
|
eventName.children.push(`)`);
|
|
@@ -15188,11 +15520,14 @@ const transformBind = (dir, _node, context) => {
|
|
|
15188
15520
|
arg.children.unshift(`(`);
|
|
15189
15521
|
arg.children.push(`) || ""`);
|
|
15190
15522
|
} else if (!arg.isStatic) arg.content = arg.content ? `${arg.content} || ""` : `""`;
|
|
15191
|
-
if (modifiers.some((mod) => mod.content === "camel"))
|
|
15192
|
-
|
|
15193
|
-
|
|
15194
|
-
|
|
15195
|
-
|
|
15523
|
+
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
15524
|
+
if (arg.type === 4) {
|
|
15525
|
+
if (arg.isStatic) arg.content = camelize(arg.content);
|
|
15526
|
+
else arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
|
15527
|
+
} else {
|
|
15528
|
+
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
|
15529
|
+
arg.children.push(`)`);
|
|
15530
|
+
}
|
|
15196
15531
|
}
|
|
15197
15532
|
if (!context.inSSR) {
|
|
15198
15533
|
if (modifiers.some((mod) => mod.content === "prop")) injectPrefix(arg, ".");
|
|
@@ -15201,9 +15536,10 @@ const transformBind = (dir, _node, context) => {
|
|
|
15201
15536
|
return { props: [createObjectProperty(arg, exp)] };
|
|
15202
15537
|
};
|
|
15203
15538
|
const injectPrefix = (arg, prefix) => {
|
|
15204
|
-
if (arg.type === 4)
|
|
15205
|
-
|
|
15206
|
-
|
|
15539
|
+
if (arg.type === 4) {
|
|
15540
|
+
if (arg.isStatic) arg.content = prefix + arg.content;
|
|
15541
|
+
else arg.content = `\`${prefix}\${${arg.content}}\``;
|
|
15542
|
+
} else {
|
|
15207
15543
|
arg.children.unshift(`'${prefix}' + (`);
|
|
15208
15544
|
arg.children.push(`)`);
|
|
15209
15545
|
}
|
|
@@ -15350,11 +15686,12 @@ function parseFilter(node, context) {
|
|
|
15350
15686
|
if (c === 96 && prev !== 92) inTemplateString = false;
|
|
15351
15687
|
} else if (inRegex) {
|
|
15352
15688
|
if (c === 47 && prev !== 92) inRegex = false;
|
|
15353
|
-
} else if (c === 124 && exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren)
|
|
15354
|
-
|
|
15355
|
-
|
|
15356
|
-
|
|
15357
|
-
|
|
15689
|
+
} else if (c === 124 && exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) {
|
|
15690
|
+
if (expression === void 0) {
|
|
15691
|
+
lastFilterIndex = i + 1;
|
|
15692
|
+
expression = exp.slice(0, i).trim();
|
|
15693
|
+
} else pushFilter();
|
|
15694
|
+
} else {
|
|
15358
15695
|
switch (c) {
|
|
15359
15696
|
case 34:
|
|
15360
15697
|
inDouble = true;
|
|
@@ -15380,9 +15717,7 @@ function parseFilter(node, context) {
|
|
|
15380
15717
|
case 123:
|
|
15381
15718
|
curly++;
|
|
15382
15719
|
break;
|
|
15383
|
-
case 125:
|
|
15384
|
-
curly--;
|
|
15385
|
-
break;
|
|
15720
|
+
case 125: curly--;
|
|
15386
15721
|
}
|
|
15387
15722
|
if (c === 47) {
|
|
15388
15723
|
let j = i - 1;
|
|
@@ -15658,9 +15993,7 @@ const transformModel = (dir, node, context) => {
|
|
|
15658
15993
|
isInvalidType = true;
|
|
15659
15994
|
context.onError(createDOMCompilerError(60, dir.loc));
|
|
15660
15995
|
break;
|
|
15661
|
-
default:
|
|
15662
|
-
checkDuplicatedValue();
|
|
15663
|
-
break;
|
|
15996
|
+
default: checkDuplicatedValue();
|
|
15664
15997
|
}
|
|
15665
15998
|
} else if (hasDynamicKeyVBind(node)) directiveToUse = V_MODEL_DYNAMIC;
|
|
15666
15999
|
else checkDuplicatedValue();
|
|
@@ -15673,27 +16006,37 @@ const transformModel = (dir, node, context) => {
|
|
|
15673
16006
|
};
|
|
15674
16007
|
//#endregion
|
|
15675
16008
|
//#region packages/compiler-dom/src/transforms/vOn.ts
|
|
15676
|
-
const isEventOptionModifier =
|
|
15677
|
-
const isNonKeyModifier =
|
|
15678
|
-
const maybeKeyModifier =
|
|
15679
|
-
const isKeyboardEvent =
|
|
16009
|
+
const isEventOptionModifier = /*@__PURE__*/ makeMap(`passive,once,capture`);
|
|
16010
|
+
const isNonKeyModifier = /*@__PURE__*/ makeMap("stop,prevent,self,ctrl,shift,alt,meta,exact,middle");
|
|
16011
|
+
const maybeKeyModifier = /*@__PURE__*/ makeMap("left,right");
|
|
16012
|
+
const isKeyboardEvent = /*@__PURE__*/ makeMap(`onkeyup,onkeydown,onkeypress`);
|
|
15680
16013
|
const resolveModifiers = (key, modifiers, context, loc) => {
|
|
15681
16014
|
const keyModifiers = [];
|
|
15682
16015
|
const nonKeyModifiers = [];
|
|
15683
16016
|
const eventOptionModifiers = [];
|
|
15684
16017
|
for (let i = 0; i < modifiers.length; i++) {
|
|
15685
16018
|
const modifier = modifiers[i].content;
|
|
16019
|
+
if (modifier === "delegate") {
|
|
16020
|
+
if (context) {
|
|
16021
|
+
const error = /* @__PURE__ */ new SyntaxError(`.delegate modifier is only supported in Vapor components.`);
|
|
16022
|
+
error.loc = modifiers[i].loc;
|
|
16023
|
+
context.onWarn(error);
|
|
16024
|
+
}
|
|
16025
|
+
continue;
|
|
16026
|
+
}
|
|
15686
16027
|
if (modifier === "native" && context && checkCompatEnabled("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
|
|
15687
16028
|
else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
|
|
15688
16029
|
else {
|
|
15689
16030
|
const keyString = isString(key) ? key : isStaticExp(key) ? key.content : null;
|
|
15690
|
-
if (maybeKeyModifier(modifier))
|
|
15691
|
-
|
|
15692
|
-
|
|
15693
|
-
|
|
15694
|
-
|
|
15695
|
-
|
|
15696
|
-
|
|
16031
|
+
if (maybeKeyModifier(modifier)) {
|
|
16032
|
+
if (keyString) {
|
|
16033
|
+
if (isKeyboardEvent(keyString.toLowerCase())) keyModifiers.push(modifier);
|
|
16034
|
+
else nonKeyModifiers.push(modifier);
|
|
16035
|
+
} else {
|
|
16036
|
+
keyModifiers.push(modifier);
|
|
16037
|
+
nonKeyModifiers.push(modifier);
|
|
16038
|
+
}
|
|
16039
|
+
} else if (isNonKeyModifier(modifier)) nonKeyModifiers.push(modifier);
|
|
15697
16040
|
else keyModifiers.push(modifier);
|
|
15698
16041
|
}
|
|
15699
16042
|
}
|
|
@@ -15808,7 +16151,7 @@ function isValidHTMLNesting(parent, child) {
|
|
|
15808
16151
|
}
|
|
15809
16152
|
return true;
|
|
15810
16153
|
}
|
|
15811
|
-
const headings = new Set([
|
|
16154
|
+
const headings = /* @__PURE__ */ new Set([
|
|
15812
16155
|
"h1",
|
|
15813
16156
|
"h2",
|
|
15814
16157
|
"h3",
|
|
@@ -15820,7 +16163,7 @@ const emptySet = /* @__PURE__ */ new Set([]);
|
|
|
15820
16163
|
/**
|
|
15821
16164
|
* maps element to set of elements that can be it's children, no other */
|
|
15822
16165
|
const onlyValidChildren = {
|
|
15823
|
-
head: new Set([
|
|
16166
|
+
head: /* @__PURE__ */ new Set([
|
|
15824
16167
|
"base",
|
|
15825
16168
|
"basefront",
|
|
15826
16169
|
"bgsound",
|
|
@@ -15833,24 +16176,24 @@ const onlyValidChildren = {
|
|
|
15833
16176
|
"script",
|
|
15834
16177
|
"template"
|
|
15835
16178
|
]),
|
|
15836
|
-
optgroup: new Set(["option"]),
|
|
15837
|
-
select: new Set([
|
|
16179
|
+
optgroup: /* @__PURE__ */ new Set(["option"]),
|
|
16180
|
+
select: /* @__PURE__ */ new Set([
|
|
15838
16181
|
"optgroup",
|
|
15839
16182
|
"option",
|
|
15840
16183
|
"hr"
|
|
15841
16184
|
]),
|
|
15842
|
-
table: new Set([
|
|
16185
|
+
table: /* @__PURE__ */ new Set([
|
|
15843
16186
|
"caption",
|
|
15844
16187
|
"colgroup",
|
|
15845
16188
|
"tbody",
|
|
15846
16189
|
"tfoot",
|
|
15847
16190
|
"thead"
|
|
15848
16191
|
]),
|
|
15849
|
-
tr: new Set(["td", "th"]),
|
|
15850
|
-
colgroup: new Set(["col"]),
|
|
15851
|
-
tbody: new Set(["tr"]),
|
|
15852
|
-
thead: new Set(["tr"]),
|
|
15853
|
-
tfoot: new Set(["tr"]),
|
|
16192
|
+
tr: /* @__PURE__ */ new Set(["td", "th"]),
|
|
16193
|
+
colgroup: /* @__PURE__ */ new Set(["col"]),
|
|
16194
|
+
tbody: /* @__PURE__ */ new Set(["tr"]),
|
|
16195
|
+
thead: /* @__PURE__ */ new Set(["tr"]),
|
|
16196
|
+
tfoot: /* @__PURE__ */ new Set(["tr"]),
|
|
15854
16197
|
script: emptySet,
|
|
15855
16198
|
iframe: emptySet,
|
|
15856
16199
|
option: emptySet,
|
|
@@ -15861,30 +16204,30 @@ const onlyValidChildren = {
|
|
|
15861
16204
|
/** maps elements to set of elements which can be it's parent, no other */
|
|
15862
16205
|
const onlyValidParents = {
|
|
15863
16206
|
html: emptySet,
|
|
15864
|
-
body: new Set(["html"]),
|
|
15865
|
-
head: new Set(["html"]),
|
|
15866
|
-
td: new Set(["tr"]),
|
|
15867
|
-
colgroup: new Set(["table"]),
|
|
15868
|
-
caption: new Set(["table"]),
|
|
15869
|
-
tbody: new Set(["table"]),
|
|
15870
|
-
tfoot: new Set(["table"]),
|
|
15871
|
-
col: new Set(["colgroup"]),
|
|
15872
|
-
th: new Set(["tr"]),
|
|
15873
|
-
thead: new Set(["table"]),
|
|
15874
|
-
tr: new Set([
|
|
16207
|
+
body: /* @__PURE__ */ new Set(["html"]),
|
|
16208
|
+
head: /* @__PURE__ */ new Set(["html"]),
|
|
16209
|
+
td: /* @__PURE__ */ new Set(["tr"]),
|
|
16210
|
+
colgroup: /* @__PURE__ */ new Set(["table"]),
|
|
16211
|
+
caption: /* @__PURE__ */ new Set(["table"]),
|
|
16212
|
+
tbody: /* @__PURE__ */ new Set(["table"]),
|
|
16213
|
+
tfoot: /* @__PURE__ */ new Set(["table"]),
|
|
16214
|
+
col: /* @__PURE__ */ new Set(["colgroup"]),
|
|
16215
|
+
th: /* @__PURE__ */ new Set(["tr"]),
|
|
16216
|
+
thead: /* @__PURE__ */ new Set(["table"]),
|
|
16217
|
+
tr: /* @__PURE__ */ new Set([
|
|
15875
16218
|
"tbody",
|
|
15876
16219
|
"thead",
|
|
15877
16220
|
"tfoot"
|
|
15878
16221
|
]),
|
|
15879
|
-
dd: new Set(["dl", "div"]),
|
|
15880
|
-
dt: new Set(["dl", "div"]),
|
|
15881
|
-
figcaption: new Set(["figure"]),
|
|
15882
|
-
summary: new Set(["details"]),
|
|
15883
|
-
area: new Set(["map"])
|
|
16222
|
+
dd: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
16223
|
+
dt: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
16224
|
+
figcaption: /* @__PURE__ */ new Set(["figure"]),
|
|
16225
|
+
summary: /* @__PURE__ */ new Set(["details"]),
|
|
16226
|
+
area: /* @__PURE__ */ new Set(["map"])
|
|
15884
16227
|
};
|
|
15885
16228
|
/** maps element to set of elements that can not be it's children, others can */
|
|
15886
16229
|
const knownInvalidChildren = {
|
|
15887
|
-
p: new Set([
|
|
16230
|
+
p: /* @__PURE__ */ new Set([
|
|
15888
16231
|
"address",
|
|
15889
16232
|
"article",
|
|
15890
16233
|
"aside",
|
|
@@ -15919,7 +16262,7 @@ const knownInvalidChildren = {
|
|
|
15919
16262
|
"table",
|
|
15920
16263
|
"ul"
|
|
15921
16264
|
]),
|
|
15922
|
-
svg: new Set([
|
|
16265
|
+
svg: /* @__PURE__ */ new Set([
|
|
15923
16266
|
"b",
|
|
15924
16267
|
"blockquote",
|
|
15925
16268
|
"br",
|
|
@@ -15960,12 +16303,12 @@ const knownInvalidChildren = {
|
|
|
15960
16303
|
};
|
|
15961
16304
|
/** maps element to set of elements that can not be it's parent, others can */
|
|
15962
16305
|
const knownInvalidParents = {
|
|
15963
|
-
a: new Set(["a"]),
|
|
15964
|
-
button: new Set(["button"]),
|
|
15965
|
-
dd: new Set(["dd", "dt"]),
|
|
15966
|
-
dt: new Set(["dd", "dt"]),
|
|
15967
|
-
form: new Set(["form"]),
|
|
15968
|
-
li: new Set(["li"]),
|
|
16306
|
+
a: /* @__PURE__ */ new Set(["a"]),
|
|
16307
|
+
button: /* @__PURE__ */ new Set(["button"]),
|
|
16308
|
+
dd: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
16309
|
+
dt: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
16310
|
+
form: /* @__PURE__ */ new Set(["form"]),
|
|
16311
|
+
li: /* @__PURE__ */ new Set(["li"]),
|
|
15969
16312
|
h1: headings,
|
|
15970
16313
|
h2: headings,
|
|
15971
16314
|
h3: headings,
|
|
@@ -16008,10 +16351,12 @@ function compile(src, options = {}) {
|
|
|
16008
16351
|
//#region packages/vue-compat/src/index.ts
|
|
16009
16352
|
const compileCache = Object.create(null);
|
|
16010
16353
|
function compileToFunction(template, options) {
|
|
16011
|
-
if (!isString(template))
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
|
|
16354
|
+
if (!isString(template)) {
|
|
16355
|
+
if (template.nodeType) template = template.innerHTML;
|
|
16356
|
+
else {
|
|
16357
|
+
warn(`invalid template option: `, template);
|
|
16358
|
+
return NOOP;
|
|
16359
|
+
}
|
|
16015
16360
|
}
|
|
16016
16361
|
const key = genCacheKey(template, options);
|
|
16017
16362
|
const cached = compileCache[key];
|