@vue/compat 3.4.0-alpha.3 → 3.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue.cjs.js +1002 -682
- package/dist/vue.cjs.prod.js +932 -646
- package/dist/vue.esm-browser.js +595 -303
- package/dist/vue.esm-browser.prod.js +5 -5
- package/dist/vue.esm-bundler.js +633 -322
- package/dist/vue.global.js +594 -302
- package/dist/vue.global.prod.js +5 -5
- package/dist/vue.runtime.esm-browser.js +544 -270
- package/dist/vue.runtime.esm-browser.prod.js +5 -5
- package/dist/vue.runtime.esm-bundler.js +582 -289
- package/dist/vue.runtime.global.js +543 -269
- package/dist/vue.runtime.global.prod.js +5 -5
- package/package.json +3 -3
package/dist/vue.cjs.js
CHANGED
|
@@ -15,8 +15,8 @@ const EMPTY_ARR = Object.freeze([]) ;
|
|
|
15
15
|
const NOOP = () => {
|
|
16
16
|
};
|
|
17
17
|
const NO = () => false;
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
|
|
19
|
+
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
|
|
20
20
|
const isModelListener = (key) => key.startsWith("onUpdate:");
|
|
21
21
|
const extend = Object.assign;
|
|
22
22
|
const remove = (arr, el) => {
|
|
@@ -128,7 +128,7 @@ const slotFlagsText = {
|
|
|
128
128
|
[3]: "FORWARDED"
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
const GLOBALS_ALLOWED = "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";
|
|
131
|
+
const GLOBALS_ALLOWED = "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";
|
|
132
132
|
const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
|
|
133
133
|
|
|
134
134
|
const range = 2;
|
|
@@ -250,9 +250,11 @@ function normalizeProps(props) {
|
|
|
250
250
|
|
|
251
251
|
const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
|
|
252
252
|
const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
|
|
253
|
+
const MATH_TAGS = "math,maction,annotation,annotation-xml,menclose,merror,mfenced,mfrac,mi,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,semantics,mspace,msqrt,mstyle,msub,msup,msubsup,mtable,mtd,mtext,mtr,munder,munderover";
|
|
253
254
|
const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
|
|
254
255
|
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
|
255
256
|
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
|
257
|
+
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
256
258
|
const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
|
|
257
259
|
|
|
258
260
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
@@ -267,7 +269,7 @@ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
|
|
|
267
269
|
`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`
|
|
268
270
|
);
|
|
269
271
|
const isKnownSvgAttr = /* @__PURE__ */ makeMap(
|
|
270
|
-
`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,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
|
|
272
|
+
`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`
|
|
271
273
|
);
|
|
272
274
|
|
|
273
275
|
const escapeRE = /["'&<>]/;
|
|
@@ -370,20 +372,29 @@ const replacer = (_key, val) => {
|
|
|
370
372
|
return replacer(_key, val.value);
|
|
371
373
|
} else if (isMap(val)) {
|
|
372
374
|
return {
|
|
373
|
-
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
374
|
-
entries[
|
|
375
|
-
|
|
376
|
-
|
|
375
|
+
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
376
|
+
(entries, [key, val2], i) => {
|
|
377
|
+
entries[stringifySymbol(key, i) + " =>"] = val2;
|
|
378
|
+
return entries;
|
|
379
|
+
},
|
|
380
|
+
{}
|
|
381
|
+
)
|
|
377
382
|
};
|
|
378
383
|
} else if (isSet(val)) {
|
|
379
384
|
return {
|
|
380
|
-
[`Set(${val.size})`]: [...val.values()]
|
|
385
|
+
[`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
|
|
381
386
|
};
|
|
387
|
+
} else if (isSymbol(val)) {
|
|
388
|
+
return stringifySymbol(val);
|
|
382
389
|
} else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
|
|
383
390
|
return String(val);
|
|
384
391
|
}
|
|
385
392
|
return val;
|
|
386
393
|
};
|
|
394
|
+
const stringifySymbol = (v, i = "") => {
|
|
395
|
+
var _a;
|
|
396
|
+
return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
|
|
397
|
+
};
|
|
387
398
|
|
|
388
399
|
function warn$1(msg, ...args) {
|
|
389
400
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
@@ -832,8 +843,13 @@ class BaseReactiveHandler {
|
|
|
832
843
|
return isReadonly2;
|
|
833
844
|
} else if (key === "__v_isShallow") {
|
|
834
845
|
return shallow;
|
|
835
|
-
} else if (key === "__v_raw"
|
|
836
|
-
|
|
846
|
+
} else if (key === "__v_raw") {
|
|
847
|
+
if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
|
|
848
|
+
// this means the reciever is a user proxy of the reactive proxy
|
|
849
|
+
Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
|
|
850
|
+
return target;
|
|
851
|
+
}
|
|
852
|
+
return;
|
|
837
853
|
}
|
|
838
854
|
const targetIsArray = isArray(target);
|
|
839
855
|
if (!isReadonly2) {
|
|
@@ -869,17 +885,19 @@ class MutableReactiveHandler extends BaseReactiveHandler {
|
|
|
869
885
|
}
|
|
870
886
|
set(target, key, value, receiver) {
|
|
871
887
|
let oldValue = target[key];
|
|
872
|
-
if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
|
|
873
|
-
return false;
|
|
874
|
-
}
|
|
875
888
|
if (!this._shallow) {
|
|
889
|
+
const isOldValueReadonly = isReadonly(oldValue);
|
|
876
890
|
if (!isShallow(value) && !isReadonly(value)) {
|
|
877
891
|
oldValue = toRaw(oldValue);
|
|
878
892
|
value = toRaw(value);
|
|
879
893
|
}
|
|
880
894
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
881
|
-
|
|
882
|
-
|
|
895
|
+
if (isOldValueReadonly) {
|
|
896
|
+
return false;
|
|
897
|
+
} else {
|
|
898
|
+
oldValue.value = value;
|
|
899
|
+
return true;
|
|
900
|
+
}
|
|
883
901
|
}
|
|
884
902
|
}
|
|
885
903
|
const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
|
|
@@ -1572,6 +1590,18 @@ function propertyToRef(source, key, defaultValue) {
|
|
|
1572
1590
|
return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
|
|
1573
1591
|
}
|
|
1574
1592
|
|
|
1593
|
+
const TrackOpTypes = {
|
|
1594
|
+
"GET": "get",
|
|
1595
|
+
"HAS": "has",
|
|
1596
|
+
"ITERATE": "iterate"
|
|
1597
|
+
};
|
|
1598
|
+
const TriggerOpTypes = {
|
|
1599
|
+
"SET": "set",
|
|
1600
|
+
"ADD": "add",
|
|
1601
|
+
"DELETE": "delete",
|
|
1602
|
+
"CLEAR": "clear"
|
|
1603
|
+
};
|
|
1604
|
+
|
|
1575
1605
|
const stack$1 = [];
|
|
1576
1606
|
function pushWarningContext(vnode) {
|
|
1577
1607
|
stack$1.push(vnode);
|
|
@@ -1686,6 +1716,38 @@ function assertNumber(val, type) {
|
|
|
1686
1716
|
}
|
|
1687
1717
|
}
|
|
1688
1718
|
|
|
1719
|
+
const ErrorCodes = {
|
|
1720
|
+
"SETUP_FUNCTION": 0,
|
|
1721
|
+
"0": "SETUP_FUNCTION",
|
|
1722
|
+
"RENDER_FUNCTION": 1,
|
|
1723
|
+
"1": "RENDER_FUNCTION",
|
|
1724
|
+
"WATCH_GETTER": 2,
|
|
1725
|
+
"2": "WATCH_GETTER",
|
|
1726
|
+
"WATCH_CALLBACK": 3,
|
|
1727
|
+
"3": "WATCH_CALLBACK",
|
|
1728
|
+
"WATCH_CLEANUP": 4,
|
|
1729
|
+
"4": "WATCH_CLEANUP",
|
|
1730
|
+
"NATIVE_EVENT_HANDLER": 5,
|
|
1731
|
+
"5": "NATIVE_EVENT_HANDLER",
|
|
1732
|
+
"COMPONENT_EVENT_HANDLER": 6,
|
|
1733
|
+
"6": "COMPONENT_EVENT_HANDLER",
|
|
1734
|
+
"VNODE_HOOK": 7,
|
|
1735
|
+
"7": "VNODE_HOOK",
|
|
1736
|
+
"DIRECTIVE_HOOK": 8,
|
|
1737
|
+
"8": "DIRECTIVE_HOOK",
|
|
1738
|
+
"TRANSITION_HOOK": 9,
|
|
1739
|
+
"9": "TRANSITION_HOOK",
|
|
1740
|
+
"APP_ERROR_HANDLER": 10,
|
|
1741
|
+
"10": "APP_ERROR_HANDLER",
|
|
1742
|
+
"APP_WARN_HANDLER": 11,
|
|
1743
|
+
"11": "APP_WARN_HANDLER",
|
|
1744
|
+
"FUNCTION_REF": 12,
|
|
1745
|
+
"12": "FUNCTION_REF",
|
|
1746
|
+
"ASYNC_COMPONENT_LOADER": 13,
|
|
1747
|
+
"13": "ASYNC_COMPONENT_LOADER",
|
|
1748
|
+
"SCHEDULER": 14,
|
|
1749
|
+
"14": "SCHEDULER"
|
|
1750
|
+
};
|
|
1689
1751
|
const ErrorTypeStrings$1 = {
|
|
1690
1752
|
["sp"]: "serverPrefetch hook",
|
|
1691
1753
|
["bc"]: "beforeCreate hook",
|
|
@@ -1857,13 +1919,16 @@ function queuePostFlushCb(cb) {
|
|
|
1857
1919
|
}
|
|
1858
1920
|
queueFlush();
|
|
1859
1921
|
}
|
|
1860
|
-
function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
1922
|
+
function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
1861
1923
|
{
|
|
1862
1924
|
seen = seen || /* @__PURE__ */ new Map();
|
|
1863
1925
|
}
|
|
1864
1926
|
for (; i < queue.length; i++) {
|
|
1865
1927
|
const cb = queue[i];
|
|
1866
1928
|
if (cb && cb.pre) {
|
|
1929
|
+
if (instance && cb.id !== instance.uid) {
|
|
1930
|
+
continue;
|
|
1931
|
+
}
|
|
1867
1932
|
if (checkRecursiveUpdates(seen, cb)) {
|
|
1868
1933
|
continue;
|
|
1869
1934
|
}
|
|
@@ -2168,6 +2233,50 @@ function devtoolsComponentEmit(component, event, params) {
|
|
|
2168
2233
|
);
|
|
2169
2234
|
}
|
|
2170
2235
|
|
|
2236
|
+
const DeprecationTypes$1 = {
|
|
2237
|
+
"GLOBAL_MOUNT": "GLOBAL_MOUNT",
|
|
2238
|
+
"GLOBAL_MOUNT_CONTAINER": "GLOBAL_MOUNT_CONTAINER",
|
|
2239
|
+
"GLOBAL_EXTEND": "GLOBAL_EXTEND",
|
|
2240
|
+
"GLOBAL_PROTOTYPE": "GLOBAL_PROTOTYPE",
|
|
2241
|
+
"GLOBAL_SET": "GLOBAL_SET",
|
|
2242
|
+
"GLOBAL_DELETE": "GLOBAL_DELETE",
|
|
2243
|
+
"GLOBAL_OBSERVABLE": "GLOBAL_OBSERVABLE",
|
|
2244
|
+
"GLOBAL_PRIVATE_UTIL": "GLOBAL_PRIVATE_UTIL",
|
|
2245
|
+
"CONFIG_SILENT": "CONFIG_SILENT",
|
|
2246
|
+
"CONFIG_DEVTOOLS": "CONFIG_DEVTOOLS",
|
|
2247
|
+
"CONFIG_KEY_CODES": "CONFIG_KEY_CODES",
|
|
2248
|
+
"CONFIG_PRODUCTION_TIP": "CONFIG_PRODUCTION_TIP",
|
|
2249
|
+
"CONFIG_IGNORED_ELEMENTS": "CONFIG_IGNORED_ELEMENTS",
|
|
2250
|
+
"CONFIG_WHITESPACE": "CONFIG_WHITESPACE",
|
|
2251
|
+
"CONFIG_OPTION_MERGE_STRATS": "CONFIG_OPTION_MERGE_STRATS",
|
|
2252
|
+
"INSTANCE_SET": "INSTANCE_SET",
|
|
2253
|
+
"INSTANCE_DELETE": "INSTANCE_DELETE",
|
|
2254
|
+
"INSTANCE_DESTROY": "INSTANCE_DESTROY",
|
|
2255
|
+
"INSTANCE_EVENT_EMITTER": "INSTANCE_EVENT_EMITTER",
|
|
2256
|
+
"INSTANCE_EVENT_HOOKS": "INSTANCE_EVENT_HOOKS",
|
|
2257
|
+
"INSTANCE_CHILDREN": "INSTANCE_CHILDREN",
|
|
2258
|
+
"INSTANCE_LISTENERS": "INSTANCE_LISTENERS",
|
|
2259
|
+
"INSTANCE_SCOPED_SLOTS": "INSTANCE_SCOPED_SLOTS",
|
|
2260
|
+
"INSTANCE_ATTRS_CLASS_STYLE": "INSTANCE_ATTRS_CLASS_STYLE",
|
|
2261
|
+
"OPTIONS_DATA_FN": "OPTIONS_DATA_FN",
|
|
2262
|
+
"OPTIONS_DATA_MERGE": "OPTIONS_DATA_MERGE",
|
|
2263
|
+
"OPTIONS_BEFORE_DESTROY": "OPTIONS_BEFORE_DESTROY",
|
|
2264
|
+
"OPTIONS_DESTROYED": "OPTIONS_DESTROYED",
|
|
2265
|
+
"WATCH_ARRAY": "WATCH_ARRAY",
|
|
2266
|
+
"PROPS_DEFAULT_THIS": "PROPS_DEFAULT_THIS",
|
|
2267
|
+
"V_ON_KEYCODE_MODIFIER": "V_ON_KEYCODE_MODIFIER",
|
|
2268
|
+
"CUSTOM_DIR": "CUSTOM_DIR",
|
|
2269
|
+
"ATTR_FALSE_VALUE": "ATTR_FALSE_VALUE",
|
|
2270
|
+
"ATTR_ENUMERATED_COERCION": "ATTR_ENUMERATED_COERCION",
|
|
2271
|
+
"TRANSITION_CLASSES": "TRANSITION_CLASSES",
|
|
2272
|
+
"TRANSITION_GROUP_ROOT": "TRANSITION_GROUP_ROOT",
|
|
2273
|
+
"COMPONENT_ASYNC": "COMPONENT_ASYNC",
|
|
2274
|
+
"COMPONENT_FUNCTIONAL": "COMPONENT_FUNCTIONAL",
|
|
2275
|
+
"COMPONENT_V_MODEL": "COMPONENT_V_MODEL",
|
|
2276
|
+
"RENDER_FUNCTION": "RENDER_FUNCTION",
|
|
2277
|
+
"FILTERS": "FILTERS",
|
|
2278
|
+
"PRIVATE_APIS": "PRIVATE_APIS"
|
|
2279
|
+
};
|
|
2171
2280
|
const deprecationData$1 = {
|
|
2172
2281
|
["GLOBAL_MOUNT"]: {
|
|
2173
2282
|
message: `The global app bootstrapping API has changed: vm.$mount() and the "el" option have been removed. Use createApp(RootComponent).mount() instead.`,
|
|
@@ -3096,9 +3205,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3096
3205
|
return false;
|
|
3097
3206
|
}
|
|
3098
3207
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
3099
|
-
while (parent
|
|
3100
|
-
|
|
3101
|
-
|
|
3208
|
+
while (parent) {
|
|
3209
|
+
const root = parent.subTree;
|
|
3210
|
+
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
3211
|
+
root.el = vnode.el;
|
|
3212
|
+
}
|
|
3213
|
+
if (root === vnode) {
|
|
3214
|
+
(vnode = parent.vnode).el = el;
|
|
3215
|
+
parent = parent.parent;
|
|
3216
|
+
} else {
|
|
3217
|
+
break;
|
|
3218
|
+
}
|
|
3102
3219
|
}
|
|
3103
3220
|
}
|
|
3104
3221
|
|
|
@@ -3162,6 +3279,7 @@ function resolve(registry, name) {
|
|
|
3162
3279
|
}
|
|
3163
3280
|
|
|
3164
3281
|
const isSuspense = (type) => type.__isSuspense;
|
|
3282
|
+
let suspenseId = 0;
|
|
3165
3283
|
const SuspenseImpl = {
|
|
3166
3284
|
name: "Suspense",
|
|
3167
3285
|
// In order to make Suspense tree-shakable, we need to avoid importing it
|
|
@@ -3169,7 +3287,7 @@ const SuspenseImpl = {
|
|
|
3169
3287
|
// on a vnode's type and calls the `process` method, passing in renderer
|
|
3170
3288
|
// internals.
|
|
3171
3289
|
__isSuspense: true,
|
|
3172
|
-
process(n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
3290
|
+
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
3173
3291
|
if (n1 == null) {
|
|
3174
3292
|
mountSuspense(
|
|
3175
3293
|
n2,
|
|
@@ -3177,7 +3295,7 @@ const SuspenseImpl = {
|
|
|
3177
3295
|
anchor,
|
|
3178
3296
|
parentComponent,
|
|
3179
3297
|
parentSuspense,
|
|
3180
|
-
|
|
3298
|
+
namespace,
|
|
3181
3299
|
slotScopeIds,
|
|
3182
3300
|
optimized,
|
|
3183
3301
|
rendererInternals
|
|
@@ -3189,7 +3307,7 @@ const SuspenseImpl = {
|
|
|
3189
3307
|
container,
|
|
3190
3308
|
anchor,
|
|
3191
3309
|
parentComponent,
|
|
3192
|
-
|
|
3310
|
+
namespace,
|
|
3193
3311
|
slotScopeIds,
|
|
3194
3312
|
optimized,
|
|
3195
3313
|
rendererInternals
|
|
@@ -3207,7 +3325,7 @@ function triggerEvent(vnode, name) {
|
|
|
3207
3325
|
eventListener();
|
|
3208
3326
|
}
|
|
3209
3327
|
}
|
|
3210
|
-
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense,
|
|
3328
|
+
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
3211
3329
|
const {
|
|
3212
3330
|
p: patch,
|
|
3213
3331
|
o: { createElement }
|
|
@@ -3220,7 +3338,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
3220
3338
|
container,
|
|
3221
3339
|
hiddenContainer,
|
|
3222
3340
|
anchor,
|
|
3223
|
-
|
|
3341
|
+
namespace,
|
|
3224
3342
|
slotScopeIds,
|
|
3225
3343
|
optimized,
|
|
3226
3344
|
rendererInternals
|
|
@@ -3232,7 +3350,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
3232
3350
|
null,
|
|
3233
3351
|
parentComponent,
|
|
3234
3352
|
suspense,
|
|
3235
|
-
|
|
3353
|
+
namespace,
|
|
3236
3354
|
slotScopeIds
|
|
3237
3355
|
);
|
|
3238
3356
|
if (suspense.deps > 0) {
|
|
@@ -3246,7 +3364,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
3246
3364
|
parentComponent,
|
|
3247
3365
|
null,
|
|
3248
3366
|
// fallback tree will not have suspense context
|
|
3249
|
-
|
|
3367
|
+
namespace,
|
|
3250
3368
|
slotScopeIds
|
|
3251
3369
|
);
|
|
3252
3370
|
setActiveBranch(suspense, vnode.ssFallback);
|
|
@@ -3254,7 +3372,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
3254
3372
|
suspense.resolve(false, true);
|
|
3255
3373
|
}
|
|
3256
3374
|
}
|
|
3257
|
-
function patchSuspense(n1, n2, container, anchor, parentComponent,
|
|
3375
|
+
function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
|
|
3258
3376
|
const suspense = n2.suspense = n1.suspense;
|
|
3259
3377
|
suspense.vnode = n2;
|
|
3260
3378
|
n2.el = n1.el;
|
|
@@ -3271,29 +3389,31 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
3271
3389
|
null,
|
|
3272
3390
|
parentComponent,
|
|
3273
3391
|
suspense,
|
|
3274
|
-
|
|
3392
|
+
namespace,
|
|
3275
3393
|
slotScopeIds,
|
|
3276
3394
|
optimized
|
|
3277
3395
|
);
|
|
3278
3396
|
if (suspense.deps <= 0) {
|
|
3279
3397
|
suspense.resolve();
|
|
3280
3398
|
} else if (isInFallback) {
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3399
|
+
if (!isHydrating) {
|
|
3400
|
+
patch(
|
|
3401
|
+
activeBranch,
|
|
3402
|
+
newFallback,
|
|
3403
|
+
container,
|
|
3404
|
+
anchor,
|
|
3405
|
+
parentComponent,
|
|
3406
|
+
null,
|
|
3407
|
+
// fallback tree will not have suspense context
|
|
3408
|
+
namespace,
|
|
3409
|
+
slotScopeIds,
|
|
3410
|
+
optimized
|
|
3411
|
+
);
|
|
3412
|
+
setActiveBranch(suspense, newFallback);
|
|
3413
|
+
}
|
|
3294
3414
|
}
|
|
3295
3415
|
} else {
|
|
3296
|
-
suspense.pendingId++;
|
|
3416
|
+
suspense.pendingId = suspenseId++;
|
|
3297
3417
|
if (isHydrating) {
|
|
3298
3418
|
suspense.isHydrating = false;
|
|
3299
3419
|
suspense.activeBranch = pendingBranch;
|
|
@@ -3311,7 +3431,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
3311
3431
|
null,
|
|
3312
3432
|
parentComponent,
|
|
3313
3433
|
suspense,
|
|
3314
|
-
|
|
3434
|
+
namespace,
|
|
3315
3435
|
slotScopeIds,
|
|
3316
3436
|
optimized
|
|
3317
3437
|
);
|
|
@@ -3326,7 +3446,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
3326
3446
|
parentComponent,
|
|
3327
3447
|
null,
|
|
3328
3448
|
// fallback tree will not have suspense context
|
|
3329
|
-
|
|
3449
|
+
namespace,
|
|
3330
3450
|
slotScopeIds,
|
|
3331
3451
|
optimized
|
|
3332
3452
|
);
|
|
@@ -3340,7 +3460,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
3340
3460
|
anchor,
|
|
3341
3461
|
parentComponent,
|
|
3342
3462
|
suspense,
|
|
3343
|
-
|
|
3463
|
+
namespace,
|
|
3344
3464
|
slotScopeIds,
|
|
3345
3465
|
optimized
|
|
3346
3466
|
);
|
|
@@ -3353,7 +3473,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
3353
3473
|
null,
|
|
3354
3474
|
parentComponent,
|
|
3355
3475
|
suspense,
|
|
3356
|
-
|
|
3476
|
+
namespace,
|
|
3357
3477
|
slotScopeIds,
|
|
3358
3478
|
optimized
|
|
3359
3479
|
);
|
|
@@ -3371,7 +3491,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
3371
3491
|
anchor,
|
|
3372
3492
|
parentComponent,
|
|
3373
3493
|
suspense,
|
|
3374
|
-
|
|
3494
|
+
namespace,
|
|
3375
3495
|
slotScopeIds,
|
|
3376
3496
|
optimized
|
|
3377
3497
|
);
|
|
@@ -3379,7 +3499,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
3379
3499
|
} else {
|
|
3380
3500
|
triggerEvent(n2, "onPending");
|
|
3381
3501
|
suspense.pendingBranch = newBranch;
|
|
3382
|
-
|
|
3502
|
+
if (newBranch.shapeFlag & 512) {
|
|
3503
|
+
suspense.pendingId = newBranch.component.suspenseId;
|
|
3504
|
+
} else {
|
|
3505
|
+
suspense.pendingId = suspenseId++;
|
|
3506
|
+
}
|
|
3383
3507
|
patch(
|
|
3384
3508
|
null,
|
|
3385
3509
|
newBranch,
|
|
@@ -3387,7 +3511,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
3387
3511
|
null,
|
|
3388
3512
|
parentComponent,
|
|
3389
3513
|
suspense,
|
|
3390
|
-
|
|
3514
|
+
namespace,
|
|
3391
3515
|
slotScopeIds,
|
|
3392
3516
|
optimized
|
|
3393
3517
|
);
|
|
@@ -3409,7 +3533,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
3409
3533
|
}
|
|
3410
3534
|
}
|
|
3411
3535
|
let hasWarned = false;
|
|
3412
|
-
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor,
|
|
3536
|
+
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
|
|
3413
3537
|
if (!hasWarned) {
|
|
3414
3538
|
hasWarned = true;
|
|
3415
3539
|
console[console.info ? "info" : "log"](
|
|
@@ -3439,7 +3563,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3439
3563
|
vnode,
|
|
3440
3564
|
parent: parentSuspense,
|
|
3441
3565
|
parentComponent,
|
|
3442
|
-
|
|
3566
|
+
namespace,
|
|
3443
3567
|
container,
|
|
3444
3568
|
hiddenContainer,
|
|
3445
3569
|
anchor,
|
|
@@ -3448,7 +3572,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3448
3572
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
3449
3573
|
activeBranch: null,
|
|
3450
3574
|
pendingBranch: null,
|
|
3451
|
-
isInFallback:
|
|
3575
|
+
isInFallback: !isHydrating,
|
|
3452
3576
|
isHydrating,
|
|
3453
3577
|
isUnmounted: false,
|
|
3454
3578
|
effects: [],
|
|
@@ -3482,7 +3606,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3482
3606
|
if (delayEnter) {
|
|
3483
3607
|
activeBranch.transition.afterLeave = () => {
|
|
3484
3608
|
if (pendingId === suspense.pendingId) {
|
|
3485
|
-
move(
|
|
3609
|
+
move(
|
|
3610
|
+
pendingBranch,
|
|
3611
|
+
container2,
|
|
3612
|
+
next(activeBranch),
|
|
3613
|
+
0
|
|
3614
|
+
);
|
|
3486
3615
|
queuePostFlushCb(effects);
|
|
3487
3616
|
}
|
|
3488
3617
|
};
|
|
@@ -3527,7 +3656,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3527
3656
|
if (!suspense.pendingBranch) {
|
|
3528
3657
|
return;
|
|
3529
3658
|
}
|
|
3530
|
-
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2,
|
|
3659
|
+
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
|
|
3531
3660
|
triggerEvent(vnode2, "onFallback");
|
|
3532
3661
|
const anchor2 = next(activeBranch);
|
|
3533
3662
|
const mountFallback = () => {
|
|
@@ -3542,7 +3671,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3542
3671
|
parentComponent2,
|
|
3543
3672
|
null,
|
|
3544
3673
|
// fallback tree will not have suspense context
|
|
3545
|
-
|
|
3674
|
+
namespace2,
|
|
3546
3675
|
slotScopeIds,
|
|
3547
3676
|
optimized
|
|
3548
3677
|
);
|
|
@@ -3605,7 +3734,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3605
3734
|
// consider the comment placeholder case.
|
|
3606
3735
|
hydratedEl ? null : next(instance.subTree),
|
|
3607
3736
|
suspense,
|
|
3608
|
-
|
|
3737
|
+
namespace,
|
|
3609
3738
|
optimized
|
|
3610
3739
|
);
|
|
3611
3740
|
if (placeholder) {
|
|
@@ -3642,7 +3771,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3642
3771
|
};
|
|
3643
3772
|
return suspense;
|
|
3644
3773
|
}
|
|
3645
|
-
function hydrateSuspense(node, vnode, parentComponent, parentSuspense,
|
|
3774
|
+
function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
|
|
3646
3775
|
const suspense = vnode.suspense = createSuspenseBoundary(
|
|
3647
3776
|
vnode,
|
|
3648
3777
|
parentSuspense,
|
|
@@ -3650,7 +3779,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
|
|
|
3650
3779
|
node.parentNode,
|
|
3651
3780
|
document.createElement("div"),
|
|
3652
3781
|
null,
|
|
3653
|
-
|
|
3782
|
+
namespace,
|
|
3654
3783
|
slotScopeIds,
|
|
3655
3784
|
optimized,
|
|
3656
3785
|
rendererInternals,
|
|
@@ -4619,7 +4748,7 @@ const KeepAliveImpl = {
|
|
|
4619
4748
|
}
|
|
4620
4749
|
} = sharedContext;
|
|
4621
4750
|
const storageContainer = createElement("div");
|
|
4622
|
-
sharedContext.activate = (vnode, container, anchor,
|
|
4751
|
+
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
4623
4752
|
const instance2 = vnode.component;
|
|
4624
4753
|
move(vnode, container, anchor, 0, parentSuspense);
|
|
4625
4754
|
patch(
|
|
@@ -4629,7 +4758,7 @@ const KeepAliveImpl = {
|
|
|
4629
4758
|
anchor,
|
|
4630
4759
|
instance2,
|
|
4631
4760
|
parentSuspense,
|
|
4632
|
-
|
|
4761
|
+
namespace,
|
|
4633
4762
|
vnode.slotScopeIds,
|
|
4634
4763
|
optimized
|
|
4635
4764
|
);
|
|
@@ -5817,7 +5946,7 @@ function useSlots() {
|
|
|
5817
5946
|
function useAttrs() {
|
|
5818
5947
|
return getContext().attrs;
|
|
5819
5948
|
}
|
|
5820
|
-
function useModel(props, name
|
|
5949
|
+
function useModel(props, name) {
|
|
5821
5950
|
const i = getCurrentInstance();
|
|
5822
5951
|
if (!i) {
|
|
5823
5952
|
warn(`useModel() called without active instance.`);
|
|
@@ -5827,29 +5956,24 @@ function useModel(props, name, options) {
|
|
|
5827
5956
|
warn(`useModel() called with prop "${name}" which is not declared.`);
|
|
5828
5957
|
return ref();
|
|
5829
5958
|
}
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
)
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
__v_isRef: true,
|
|
5845
|
-
get value() {
|
|
5846
|
-
return props[name];
|
|
5847
|
-
},
|
|
5848
|
-
set value(value) {
|
|
5849
|
-
i.emit(`update:${name}`, value);
|
|
5959
|
+
let localValue;
|
|
5960
|
+
watchSyncEffect(() => {
|
|
5961
|
+
localValue = props[name];
|
|
5962
|
+
});
|
|
5963
|
+
return customRef((track, trigger) => ({
|
|
5964
|
+
get() {
|
|
5965
|
+
track();
|
|
5966
|
+
return localValue;
|
|
5967
|
+
},
|
|
5968
|
+
set(value) {
|
|
5969
|
+
const rawProps = i.vnode.props;
|
|
5970
|
+
if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
|
|
5971
|
+
localValue = value;
|
|
5972
|
+
trigger();
|
|
5850
5973
|
}
|
|
5851
|
-
|
|
5852
|
-
|
|
5974
|
+
i.emit(`update:${name}`, value);
|
|
5975
|
+
}
|
|
5976
|
+
}));
|
|
5853
5977
|
}
|
|
5854
5978
|
function getContext() {
|
|
5855
5979
|
const i = getCurrentInstance();
|
|
@@ -6423,7 +6547,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6423
6547
|
return vm;
|
|
6424
6548
|
}
|
|
6425
6549
|
}
|
|
6426
|
-
Vue.version = `2.6.14-compat:${"3.4.0-
|
|
6550
|
+
Vue.version = `2.6.14-compat:${"3.4.0-beta.1"}`;
|
|
6427
6551
|
Vue.config = singletonApp.config;
|
|
6428
6552
|
Vue.use = (p, ...options) => {
|
|
6429
6553
|
if (p && isFunction(p.install)) {
|
|
@@ -6668,12 +6792,16 @@ function installCompatMount(app, context, render) {
|
|
|
6668
6792
|
} else {
|
|
6669
6793
|
container = selectorOrEl || document.createElement("div");
|
|
6670
6794
|
}
|
|
6671
|
-
|
|
6795
|
+
let namespace;
|
|
6796
|
+
if (container instanceof SVGElement)
|
|
6797
|
+
namespace = "svg";
|
|
6798
|
+
else if (typeof MathMLElement === "function" && container instanceof MathMLElement)
|
|
6799
|
+
namespace = "mathml";
|
|
6672
6800
|
{
|
|
6673
6801
|
context.reload = () => {
|
|
6674
6802
|
const cloned = cloneVNode(vnode);
|
|
6675
6803
|
cloned.component = null;
|
|
6676
|
-
render(cloned, container,
|
|
6804
|
+
render(cloned, container, namespace);
|
|
6677
6805
|
};
|
|
6678
6806
|
}
|
|
6679
6807
|
if (hasNoRender && instance.render === emptyRender) {
|
|
@@ -6696,7 +6824,7 @@ function installCompatMount(app, context, render) {
|
|
|
6696
6824
|
);
|
|
6697
6825
|
}
|
|
6698
6826
|
container.innerHTML = "";
|
|
6699
|
-
render(vnode, container,
|
|
6827
|
+
render(vnode, container, namespace);
|
|
6700
6828
|
if (container instanceof Element) {
|
|
6701
6829
|
container.removeAttribute("v-cloak");
|
|
6702
6830
|
container.setAttribute("data-v-app", "");
|
|
@@ -6824,18 +6952,6 @@ function createAppAPI(render, hydrate) {
|
|
|
6824
6952
|
rootProps = null;
|
|
6825
6953
|
}
|
|
6826
6954
|
const context = createAppContext();
|
|
6827
|
-
{
|
|
6828
|
-
Object.defineProperty(context.config, "unwrapInjectedRef", {
|
|
6829
|
-
get() {
|
|
6830
|
-
return true;
|
|
6831
|
-
},
|
|
6832
|
-
set() {
|
|
6833
|
-
warn(
|
|
6834
|
-
`app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
|
|
6835
|
-
);
|
|
6836
|
-
}
|
|
6837
|
-
});
|
|
6838
|
-
}
|
|
6839
6955
|
const installedPlugins = /* @__PURE__ */ new WeakSet();
|
|
6840
6956
|
let isMounted = false;
|
|
6841
6957
|
const app = context.app = {
|
|
@@ -6910,7 +7026,7 @@ function createAppAPI(render, hydrate) {
|
|
|
6910
7026
|
context.directives[name] = directive;
|
|
6911
7027
|
return app;
|
|
6912
7028
|
},
|
|
6913
|
-
mount(rootContainer, isHydrate,
|
|
7029
|
+
mount(rootContainer, isHydrate, namespace) {
|
|
6914
7030
|
if (!isMounted) {
|
|
6915
7031
|
if (rootContainer.__vue_app__) {
|
|
6916
7032
|
warn(
|
|
@@ -6920,15 +7036,24 @@ function createAppAPI(render, hydrate) {
|
|
|
6920
7036
|
}
|
|
6921
7037
|
const vnode = createVNode(rootComponent, rootProps);
|
|
6922
7038
|
vnode.appContext = context;
|
|
7039
|
+
if (namespace === true) {
|
|
7040
|
+
namespace = "svg";
|
|
7041
|
+
} else if (namespace === false) {
|
|
7042
|
+
namespace = void 0;
|
|
7043
|
+
}
|
|
6923
7044
|
{
|
|
6924
7045
|
context.reload = () => {
|
|
6925
|
-
render(
|
|
7046
|
+
render(
|
|
7047
|
+
cloneVNode(vnode),
|
|
7048
|
+
rootContainer,
|
|
7049
|
+
namespace
|
|
7050
|
+
);
|
|
6926
7051
|
};
|
|
6927
7052
|
}
|
|
6928
7053
|
if (isHydrate && hydrate) {
|
|
6929
7054
|
hydrate(vnode, rootContainer);
|
|
6930
7055
|
} else {
|
|
6931
|
-
render(vnode, rootContainer,
|
|
7056
|
+
render(vnode, rootContainer, namespace);
|
|
6932
7057
|
}
|
|
6933
7058
|
isMounted = true;
|
|
6934
7059
|
app._container = rootContainer;
|
|
@@ -7393,11 +7518,12 @@ function validateProps(rawProps, props, instance) {
|
|
|
7393
7518
|
key,
|
|
7394
7519
|
resolvedValues[key],
|
|
7395
7520
|
opt,
|
|
7521
|
+
shallowReadonly(resolvedValues) ,
|
|
7396
7522
|
!hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
|
|
7397
7523
|
);
|
|
7398
7524
|
}
|
|
7399
7525
|
}
|
|
7400
|
-
function validateProp(name, value, prop, isAbsent) {
|
|
7526
|
+
function validateProp(name, value, prop, props, isAbsent) {
|
|
7401
7527
|
const { type, required, validator, skipCheck } = prop;
|
|
7402
7528
|
if (required && isAbsent) {
|
|
7403
7529
|
warn('Missing required prop: "' + name + '"');
|
|
@@ -7420,7 +7546,7 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
7420
7546
|
return;
|
|
7421
7547
|
}
|
|
7422
7548
|
}
|
|
7423
|
-
if (validator && !validator(value)) {
|
|
7549
|
+
if (validator && !validator(value, props)) {
|
|
7424
7550
|
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
7425
7551
|
}
|
|
7426
7552
|
}
|
|
@@ -7678,7 +7804,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7678
7804
|
}
|
|
7679
7805
|
|
|
7680
7806
|
let hasMismatch = false;
|
|
7681
|
-
const isSVGContainer = (container) =>
|
|
7807
|
+
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
7808
|
+
const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
|
|
7809
|
+
const getContainerType = (container) => {
|
|
7810
|
+
if (isSVGContainer(container))
|
|
7811
|
+
return "svg";
|
|
7812
|
+
if (isMathMLContainer(container))
|
|
7813
|
+
return "mathml";
|
|
7814
|
+
return void 0;
|
|
7815
|
+
};
|
|
7682
7816
|
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
7683
7817
|
function createHydrationFunctions(rendererInternals) {
|
|
7684
7818
|
const {
|
|
@@ -7757,11 +7891,13 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7757
7891
|
if (node.data !== vnode.children) {
|
|
7758
7892
|
hasMismatch = true;
|
|
7759
7893
|
warn(
|
|
7760
|
-
`Hydration text mismatch
|
|
7761
|
-
|
|
7894
|
+
`Hydration text mismatch in`,
|
|
7895
|
+
node.parentNode,
|
|
7896
|
+
`
|
|
7897
|
+
- rendered on server: ${JSON.stringify(
|
|
7762
7898
|
node.data
|
|
7763
7899
|
)}
|
|
7764
|
-
-
|
|
7900
|
+
- expected on client: ${JSON.stringify(vnode.children)}`
|
|
7765
7901
|
);
|
|
7766
7902
|
node.data = vnode.children;
|
|
7767
7903
|
}
|
|
@@ -7847,7 +7983,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7847
7983
|
null,
|
|
7848
7984
|
parentComponent,
|
|
7849
7985
|
parentSuspense,
|
|
7850
|
-
|
|
7986
|
+
getContainerType(container),
|
|
7851
7987
|
optimized
|
|
7852
7988
|
);
|
|
7853
7989
|
if (isAsyncWrapper(vnode)) {
|
|
@@ -7882,7 +8018,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7882
8018
|
vnode,
|
|
7883
8019
|
parentComponent,
|
|
7884
8020
|
parentSuspense,
|
|
7885
|
-
|
|
8021
|
+
getContainerType(parentNode(node)),
|
|
7886
8022
|
slotScopeIds,
|
|
7887
8023
|
optimized,
|
|
7888
8024
|
rendererInternals,
|
|
@@ -7905,38 +8041,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7905
8041
|
if (dirs) {
|
|
7906
8042
|
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
7907
8043
|
}
|
|
7908
|
-
if (props) {
|
|
7909
|
-
if (forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
7910
|
-
for (const key in props) {
|
|
7911
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
7912
|
-
key[0] === ".") {
|
|
7913
|
-
patchProp(
|
|
7914
|
-
el,
|
|
7915
|
-
key,
|
|
7916
|
-
null,
|
|
7917
|
-
props[key],
|
|
7918
|
-
false,
|
|
7919
|
-
void 0,
|
|
7920
|
-
parentComponent
|
|
7921
|
-
);
|
|
7922
|
-
}
|
|
7923
|
-
}
|
|
7924
|
-
} else if (props.onClick) {
|
|
7925
|
-
patchProp(
|
|
7926
|
-
el,
|
|
7927
|
-
"onClick",
|
|
7928
|
-
null,
|
|
7929
|
-
props.onClick,
|
|
7930
|
-
false,
|
|
7931
|
-
void 0,
|
|
7932
|
-
parentComponent
|
|
7933
|
-
);
|
|
7934
|
-
}
|
|
7935
|
-
}
|
|
7936
|
-
let vnodeHooks;
|
|
7937
|
-
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
7938
|
-
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
7939
|
-
}
|
|
7940
8044
|
let needCallTransitionHooks = false;
|
|
7941
8045
|
if (isTemplateNode(el)) {
|
|
7942
8046
|
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
@@ -7947,16 +8051,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7947
8051
|
replaceNode(content, el, parentComponent);
|
|
7948
8052
|
vnode.el = el = content;
|
|
7949
8053
|
}
|
|
7950
|
-
if (dirs) {
|
|
7951
|
-
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
7952
|
-
}
|
|
7953
|
-
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
7954
|
-
queueEffectWithSuspense(() => {
|
|
7955
|
-
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
7956
|
-
needCallTransitionHooks && transition.enter(el);
|
|
7957
|
-
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
7958
|
-
}, parentSuspense);
|
|
7959
|
-
}
|
|
7960
8054
|
if (shapeFlag & 16 && // skip if element has innerHTML / textContent
|
|
7961
8055
|
!(props && (props.innerHTML || props.textContent))) {
|
|
7962
8056
|
let next = hydrateChildren(
|
|
@@ -7973,7 +8067,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7973
8067
|
hasMismatch = true;
|
|
7974
8068
|
if (!hasWarned) {
|
|
7975
8069
|
warn(
|
|
7976
|
-
`Hydration children mismatch
|
|
8070
|
+
`Hydration children mismatch on`,
|
|
8071
|
+
el,
|
|
8072
|
+
`
|
|
8073
|
+
Server rendered element contains more child nodes than client vdom.`
|
|
7977
8074
|
);
|
|
7978
8075
|
hasWarned = true;
|
|
7979
8076
|
}
|
|
@@ -7985,13 +8082,50 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7985
8082
|
if (el.textContent !== vnode.children) {
|
|
7986
8083
|
hasMismatch = true;
|
|
7987
8084
|
warn(
|
|
7988
|
-
`Hydration text content mismatch
|
|
7989
|
-
|
|
7990
|
-
|
|
8085
|
+
`Hydration text content mismatch on`,
|
|
8086
|
+
el,
|
|
8087
|
+
`
|
|
8088
|
+
- rendered on server: ${el.textContent}
|
|
8089
|
+
- expected on client: ${vnode.children}`
|
|
7991
8090
|
);
|
|
7992
8091
|
el.textContent = vnode.children;
|
|
7993
8092
|
}
|
|
7994
8093
|
}
|
|
8094
|
+
if (props) {
|
|
8095
|
+
{
|
|
8096
|
+
for (const key in props) {
|
|
8097
|
+
if (propHasMismatch(el, key, props[key])) {
|
|
8098
|
+
hasMismatch = true;
|
|
8099
|
+
}
|
|
8100
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
8101
|
+
key[0] === ".") {
|
|
8102
|
+
patchProp(
|
|
8103
|
+
el,
|
|
8104
|
+
key,
|
|
8105
|
+
null,
|
|
8106
|
+
props[key],
|
|
8107
|
+
void 0,
|
|
8108
|
+
void 0,
|
|
8109
|
+
parentComponent
|
|
8110
|
+
);
|
|
8111
|
+
}
|
|
8112
|
+
}
|
|
8113
|
+
}
|
|
8114
|
+
}
|
|
8115
|
+
let vnodeHooks;
|
|
8116
|
+
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
8117
|
+
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
8118
|
+
}
|
|
8119
|
+
if (dirs) {
|
|
8120
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
8121
|
+
}
|
|
8122
|
+
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
8123
|
+
queueEffectWithSuspense(() => {
|
|
8124
|
+
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
8125
|
+
needCallTransitionHooks && transition.enter(el);
|
|
8126
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
8127
|
+
}, parentSuspense);
|
|
8128
|
+
}
|
|
7995
8129
|
}
|
|
7996
8130
|
return el.nextSibling;
|
|
7997
8131
|
};
|
|
@@ -8017,7 +8151,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8017
8151
|
hasMismatch = true;
|
|
8018
8152
|
if (!hasWarned) {
|
|
8019
8153
|
warn(
|
|
8020
|
-
`Hydration children mismatch
|
|
8154
|
+
`Hydration children mismatch on`,
|
|
8155
|
+
container,
|
|
8156
|
+
`
|
|
8157
|
+
Server rendered element contains fewer child nodes than client vdom.`
|
|
8021
8158
|
);
|
|
8022
8159
|
hasWarned = true;
|
|
8023
8160
|
}
|
|
@@ -8028,7 +8165,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8028
8165
|
null,
|
|
8029
8166
|
parentComponent,
|
|
8030
8167
|
parentSuspense,
|
|
8031
|
-
|
|
8168
|
+
getContainerType(container),
|
|
8032
8169
|
slotScopeIds
|
|
8033
8170
|
);
|
|
8034
8171
|
}
|
|
@@ -8062,12 +8199,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8062
8199
|
hasMismatch = true;
|
|
8063
8200
|
warn(
|
|
8064
8201
|
`Hydration node mismatch:
|
|
8065
|
-
-
|
|
8066
|
-
vnode.type,
|
|
8067
|
-
`
|
|
8068
|
-
- Server rendered DOM:`,
|
|
8202
|
+
- rendered on server:`,
|
|
8069
8203
|
node,
|
|
8070
|
-
node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` :
|
|
8204
|
+
node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
|
|
8205
|
+
`
|
|
8206
|
+
- expected on client:`,
|
|
8207
|
+
vnode.type
|
|
8071
8208
|
);
|
|
8072
8209
|
vnode.el = null;
|
|
8073
8210
|
if (isFragment) {
|
|
@@ -8091,7 +8228,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8091
8228
|
next,
|
|
8092
8229
|
parentComponent,
|
|
8093
8230
|
parentSuspense,
|
|
8094
|
-
|
|
8231
|
+
getContainerType(container),
|
|
8095
8232
|
slotScopeIds
|
|
8096
8233
|
);
|
|
8097
8234
|
return next;
|
|
@@ -8132,6 +8269,46 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8132
8269
|
};
|
|
8133
8270
|
return [hydrate, hydrateNode];
|
|
8134
8271
|
}
|
|
8272
|
+
function propHasMismatch(el, key, clientValue) {
|
|
8273
|
+
let mismatchType;
|
|
8274
|
+
let mismatchKey;
|
|
8275
|
+
let actual;
|
|
8276
|
+
let expected;
|
|
8277
|
+
if (key === "class") {
|
|
8278
|
+
actual = el.className;
|
|
8279
|
+
expected = normalizeClass(clientValue);
|
|
8280
|
+
if (actual !== expected) {
|
|
8281
|
+
mismatchType = mismatchKey = `class`;
|
|
8282
|
+
}
|
|
8283
|
+
} else if (key === "style") {
|
|
8284
|
+
actual = el.getAttribute("style");
|
|
8285
|
+
expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
|
|
8286
|
+
if (actual !== expected) {
|
|
8287
|
+
mismatchType = mismatchKey = "style";
|
|
8288
|
+
}
|
|
8289
|
+
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
8290
|
+
actual = el.hasAttribute(key) && el.getAttribute(key);
|
|
8291
|
+
expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
|
|
8292
|
+
if (actual !== expected) {
|
|
8293
|
+
mismatchType = `attribute`;
|
|
8294
|
+
mismatchKey = key;
|
|
8295
|
+
}
|
|
8296
|
+
}
|
|
8297
|
+
if (mismatchType) {
|
|
8298
|
+
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
8299
|
+
warn(
|
|
8300
|
+
`Hydration ${mismatchType} mismatch on`,
|
|
8301
|
+
el,
|
|
8302
|
+
`
|
|
8303
|
+
- rendered on server: ${format(actual)}
|
|
8304
|
+
- expected on client: ${format(expected)}
|
|
8305
|
+
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
8306
|
+
You should fix the source of the mismatch.`
|
|
8307
|
+
);
|
|
8308
|
+
return true;
|
|
8309
|
+
}
|
|
8310
|
+
return false;
|
|
8311
|
+
}
|
|
8135
8312
|
|
|
8136
8313
|
let supported;
|
|
8137
8314
|
let perf;
|
|
@@ -8200,7 +8377,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8200
8377
|
setScopeId: hostSetScopeId = NOOP,
|
|
8201
8378
|
insertStaticContent: hostInsertStaticContent
|
|
8202
8379
|
} = options;
|
|
8203
|
-
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null,
|
|
8380
|
+
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
|
|
8204
8381
|
if (n1 === n2) {
|
|
8205
8382
|
return;
|
|
8206
8383
|
}
|
|
@@ -8223,9 +8400,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8223
8400
|
break;
|
|
8224
8401
|
case Static:
|
|
8225
8402
|
if (n1 == null) {
|
|
8226
|
-
mountStaticNode(n2, container, anchor,
|
|
8403
|
+
mountStaticNode(n2, container, anchor, namespace);
|
|
8227
8404
|
} else {
|
|
8228
|
-
patchStaticNode(n1, n2, container,
|
|
8405
|
+
patchStaticNode(n1, n2, container, namespace);
|
|
8229
8406
|
}
|
|
8230
8407
|
break;
|
|
8231
8408
|
case Fragment:
|
|
@@ -8236,7 +8413,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8236
8413
|
anchor,
|
|
8237
8414
|
parentComponent,
|
|
8238
8415
|
parentSuspense,
|
|
8239
|
-
|
|
8416
|
+
namespace,
|
|
8240
8417
|
slotScopeIds,
|
|
8241
8418
|
optimized
|
|
8242
8419
|
);
|
|
@@ -8250,7 +8427,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8250
8427
|
anchor,
|
|
8251
8428
|
parentComponent,
|
|
8252
8429
|
parentSuspense,
|
|
8253
|
-
|
|
8430
|
+
namespace,
|
|
8254
8431
|
slotScopeIds,
|
|
8255
8432
|
optimized
|
|
8256
8433
|
);
|
|
@@ -8262,7 +8439,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8262
8439
|
anchor,
|
|
8263
8440
|
parentComponent,
|
|
8264
8441
|
parentSuspense,
|
|
8265
|
-
|
|
8442
|
+
namespace,
|
|
8266
8443
|
slotScopeIds,
|
|
8267
8444
|
optimized
|
|
8268
8445
|
);
|
|
@@ -8274,7 +8451,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8274
8451
|
anchor,
|
|
8275
8452
|
parentComponent,
|
|
8276
8453
|
parentSuspense,
|
|
8277
|
-
|
|
8454
|
+
namespace,
|
|
8278
8455
|
slotScopeIds,
|
|
8279
8456
|
optimized,
|
|
8280
8457
|
internals
|
|
@@ -8287,7 +8464,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8287
8464
|
anchor,
|
|
8288
8465
|
parentComponent,
|
|
8289
8466
|
parentSuspense,
|
|
8290
|
-
|
|
8467
|
+
namespace,
|
|
8291
8468
|
slotScopeIds,
|
|
8292
8469
|
optimized,
|
|
8293
8470
|
internals
|
|
@@ -8325,17 +8502,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8325
8502
|
n2.el = n1.el;
|
|
8326
8503
|
}
|
|
8327
8504
|
};
|
|
8328
|
-
const mountStaticNode = (n2, container, anchor,
|
|
8505
|
+
const mountStaticNode = (n2, container, anchor, namespace) => {
|
|
8329
8506
|
[n2.el, n2.anchor] = hostInsertStaticContent(
|
|
8330
8507
|
n2.children,
|
|
8331
8508
|
container,
|
|
8332
8509
|
anchor,
|
|
8333
|
-
|
|
8510
|
+
namespace,
|
|
8334
8511
|
n2.el,
|
|
8335
8512
|
n2.anchor
|
|
8336
8513
|
);
|
|
8337
8514
|
};
|
|
8338
|
-
const patchStaticNode = (n1, n2, container,
|
|
8515
|
+
const patchStaticNode = (n1, n2, container, namespace) => {
|
|
8339
8516
|
if (n2.children !== n1.children) {
|
|
8340
8517
|
const anchor = hostNextSibling(n1.anchor);
|
|
8341
8518
|
removeStaticNode(n1);
|
|
@@ -8343,7 +8520,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8343
8520
|
n2.children,
|
|
8344
8521
|
container,
|
|
8345
8522
|
anchor,
|
|
8346
|
-
|
|
8523
|
+
namespace
|
|
8347
8524
|
);
|
|
8348
8525
|
} else {
|
|
8349
8526
|
n2.el = n1.el;
|
|
@@ -8368,8 +8545,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8368
8545
|
}
|
|
8369
8546
|
hostRemove(anchor);
|
|
8370
8547
|
};
|
|
8371
|
-
const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
8372
|
-
|
|
8548
|
+
const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
8549
|
+
if (n2.type === "svg") {
|
|
8550
|
+
namespace = "svg";
|
|
8551
|
+
} else if (n2.type === "math") {
|
|
8552
|
+
namespace = "mathml";
|
|
8553
|
+
}
|
|
8373
8554
|
if (n1 == null) {
|
|
8374
8555
|
mountElement(
|
|
8375
8556
|
n2,
|
|
@@ -8377,7 +8558,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8377
8558
|
anchor,
|
|
8378
8559
|
parentComponent,
|
|
8379
8560
|
parentSuspense,
|
|
8380
|
-
|
|
8561
|
+
namespace,
|
|
8381
8562
|
slotScopeIds,
|
|
8382
8563
|
optimized
|
|
8383
8564
|
);
|
|
@@ -8387,19 +8568,19 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8387
8568
|
n2,
|
|
8388
8569
|
parentComponent,
|
|
8389
8570
|
parentSuspense,
|
|
8390
|
-
|
|
8571
|
+
namespace,
|
|
8391
8572
|
slotScopeIds,
|
|
8392
8573
|
optimized
|
|
8393
8574
|
);
|
|
8394
8575
|
}
|
|
8395
8576
|
};
|
|
8396
|
-
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense,
|
|
8577
|
+
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
8397
8578
|
let el;
|
|
8398
8579
|
let vnodeHook;
|
|
8399
|
-
const {
|
|
8580
|
+
const { props, shapeFlag, transition, dirs } = vnode;
|
|
8400
8581
|
el = vnode.el = hostCreateElement(
|
|
8401
8582
|
vnode.type,
|
|
8402
|
-
|
|
8583
|
+
namespace,
|
|
8403
8584
|
props && props.is,
|
|
8404
8585
|
props
|
|
8405
8586
|
);
|
|
@@ -8412,7 +8593,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8412
8593
|
null,
|
|
8413
8594
|
parentComponent,
|
|
8414
8595
|
parentSuspense,
|
|
8415
|
-
|
|
8596
|
+
resolveChildrenNamespace(vnode, namespace),
|
|
8416
8597
|
slotScopeIds,
|
|
8417
8598
|
optimized
|
|
8418
8599
|
);
|
|
@@ -8429,7 +8610,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8429
8610
|
key,
|
|
8430
8611
|
null,
|
|
8431
8612
|
props[key],
|
|
8432
|
-
|
|
8613
|
+
namespace,
|
|
8433
8614
|
vnode.children,
|
|
8434
8615
|
parentComponent,
|
|
8435
8616
|
parentSuspense,
|
|
@@ -8438,7 +8619,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8438
8619
|
}
|
|
8439
8620
|
}
|
|
8440
8621
|
if ("value" in props) {
|
|
8441
|
-
hostPatchProp(el, "value", null, props.value);
|
|
8622
|
+
hostPatchProp(el, "value", null, props.value, namespace);
|
|
8442
8623
|
}
|
|
8443
8624
|
if (vnodeHook = props.onVnodeBeforeMount) {
|
|
8444
8625
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
@@ -8496,7 +8677,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8496
8677
|
}
|
|
8497
8678
|
}
|
|
8498
8679
|
};
|
|
8499
|
-
const mountChildren = (children, container, anchor, parentComponent, parentSuspense,
|
|
8680
|
+
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
8500
8681
|
for (let i = start; i < children.length; i++) {
|
|
8501
8682
|
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
8502
8683
|
patch(
|
|
@@ -8506,13 +8687,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8506
8687
|
anchor,
|
|
8507
8688
|
parentComponent,
|
|
8508
8689
|
parentSuspense,
|
|
8509
|
-
|
|
8690
|
+
namespace,
|
|
8510
8691
|
slotScopeIds,
|
|
8511
8692
|
optimized
|
|
8512
8693
|
);
|
|
8513
8694
|
}
|
|
8514
8695
|
};
|
|
8515
|
-
const patchElement = (n1, n2, parentComponent, parentSuspense,
|
|
8696
|
+
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
8516
8697
|
const el = n2.el = n1.el;
|
|
8517
8698
|
let { patchFlag, dynamicChildren, dirs } = n2;
|
|
8518
8699
|
patchFlag |= n1.patchFlag & 16;
|
|
@@ -8532,7 +8713,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8532
8713
|
optimized = false;
|
|
8533
8714
|
dynamicChildren = null;
|
|
8534
8715
|
}
|
|
8535
|
-
const areChildrenSVG = isSVG && n2.type !== "foreignObject";
|
|
8536
8716
|
if (dynamicChildren) {
|
|
8537
8717
|
patchBlockChildren(
|
|
8538
8718
|
n1.dynamicChildren,
|
|
@@ -8540,7 +8720,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8540
8720
|
el,
|
|
8541
8721
|
parentComponent,
|
|
8542
8722
|
parentSuspense,
|
|
8543
|
-
|
|
8723
|
+
resolveChildrenNamespace(n2, namespace),
|
|
8544
8724
|
slotScopeIds
|
|
8545
8725
|
);
|
|
8546
8726
|
{
|
|
@@ -8554,7 +8734,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8554
8734
|
null,
|
|
8555
8735
|
parentComponent,
|
|
8556
8736
|
parentSuspense,
|
|
8557
|
-
|
|
8737
|
+
resolveChildrenNamespace(n2, namespace),
|
|
8558
8738
|
slotScopeIds,
|
|
8559
8739
|
false
|
|
8560
8740
|
);
|
|
@@ -8568,16 +8748,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8568
8748
|
newProps,
|
|
8569
8749
|
parentComponent,
|
|
8570
8750
|
parentSuspense,
|
|
8571
|
-
|
|
8751
|
+
namespace
|
|
8572
8752
|
);
|
|
8573
8753
|
} else {
|
|
8574
8754
|
if (patchFlag & 2) {
|
|
8575
8755
|
if (oldProps.class !== newProps.class) {
|
|
8576
|
-
hostPatchProp(el, "class", null, newProps.class,
|
|
8756
|
+
hostPatchProp(el, "class", null, newProps.class, namespace);
|
|
8577
8757
|
}
|
|
8578
8758
|
}
|
|
8579
8759
|
if (patchFlag & 4) {
|
|
8580
|
-
hostPatchProp(el, "style", oldProps.style, newProps.style,
|
|
8760
|
+
hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
|
|
8581
8761
|
}
|
|
8582
8762
|
if (patchFlag & 8) {
|
|
8583
8763
|
const propsToUpdate = n2.dynamicProps;
|
|
@@ -8591,7 +8771,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8591
8771
|
key,
|
|
8592
8772
|
prev,
|
|
8593
8773
|
next,
|
|
8594
|
-
|
|
8774
|
+
namespace,
|
|
8595
8775
|
n1.children,
|
|
8596
8776
|
parentComponent,
|
|
8597
8777
|
parentSuspense,
|
|
@@ -8614,7 +8794,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8614
8794
|
newProps,
|
|
8615
8795
|
parentComponent,
|
|
8616
8796
|
parentSuspense,
|
|
8617
|
-
|
|
8797
|
+
namespace
|
|
8618
8798
|
);
|
|
8619
8799
|
}
|
|
8620
8800
|
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
|
|
@@ -8624,7 +8804,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8624
8804
|
}, parentSuspense);
|
|
8625
8805
|
}
|
|
8626
8806
|
};
|
|
8627
|
-
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense,
|
|
8807
|
+
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
|
|
8628
8808
|
for (let i = 0; i < newChildren.length; i++) {
|
|
8629
8809
|
const oldVNode = oldChildren[i];
|
|
8630
8810
|
const newVNode = newChildren[i];
|
|
@@ -8649,13 +8829,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8649
8829
|
null,
|
|
8650
8830
|
parentComponent,
|
|
8651
8831
|
parentSuspense,
|
|
8652
|
-
|
|
8832
|
+
namespace,
|
|
8653
8833
|
slotScopeIds,
|
|
8654
8834
|
true
|
|
8655
8835
|
);
|
|
8656
8836
|
}
|
|
8657
8837
|
};
|
|
8658
|
-
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense,
|
|
8838
|
+
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
|
|
8659
8839
|
if (oldProps !== newProps) {
|
|
8660
8840
|
if (oldProps !== EMPTY_OBJ) {
|
|
8661
8841
|
for (const key in oldProps) {
|
|
@@ -8665,7 +8845,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8665
8845
|
key,
|
|
8666
8846
|
oldProps[key],
|
|
8667
8847
|
null,
|
|
8668
|
-
|
|
8848
|
+
namespace,
|
|
8669
8849
|
vnode.children,
|
|
8670
8850
|
parentComponent,
|
|
8671
8851
|
parentSuspense,
|
|
@@ -8685,7 +8865,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8685
8865
|
key,
|
|
8686
8866
|
prev,
|
|
8687
8867
|
next,
|
|
8688
|
-
|
|
8868
|
+
namespace,
|
|
8689
8869
|
vnode.children,
|
|
8690
8870
|
parentComponent,
|
|
8691
8871
|
parentSuspense,
|
|
@@ -8694,11 +8874,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8694
8874
|
}
|
|
8695
8875
|
}
|
|
8696
8876
|
if ("value" in newProps) {
|
|
8697
|
-
hostPatchProp(el, "value", oldProps.value, newProps.value);
|
|
8877
|
+
hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
|
|
8698
8878
|
}
|
|
8699
8879
|
}
|
|
8700
8880
|
};
|
|
8701
|
-
const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
8881
|
+
const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
8702
8882
|
const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
|
|
8703
8883
|
const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
|
|
8704
8884
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
@@ -8722,7 +8902,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8722
8902
|
fragmentEndAnchor,
|
|
8723
8903
|
parentComponent,
|
|
8724
8904
|
parentSuspense,
|
|
8725
|
-
|
|
8905
|
+
namespace,
|
|
8726
8906
|
slotScopeIds,
|
|
8727
8907
|
optimized
|
|
8728
8908
|
);
|
|
@@ -8736,7 +8916,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8736
8916
|
container,
|
|
8737
8917
|
parentComponent,
|
|
8738
8918
|
parentSuspense,
|
|
8739
|
-
|
|
8919
|
+
namespace,
|
|
8740
8920
|
slotScopeIds
|
|
8741
8921
|
);
|
|
8742
8922
|
{
|
|
@@ -8750,14 +8930,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8750
8930
|
fragmentEndAnchor,
|
|
8751
8931
|
parentComponent,
|
|
8752
8932
|
parentSuspense,
|
|
8753
|
-
|
|
8933
|
+
namespace,
|
|
8754
8934
|
slotScopeIds,
|
|
8755
8935
|
optimized
|
|
8756
8936
|
);
|
|
8757
8937
|
}
|
|
8758
8938
|
}
|
|
8759
8939
|
};
|
|
8760
|
-
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
8940
|
+
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
8761
8941
|
n2.slotScopeIds = slotScopeIds;
|
|
8762
8942
|
if (n1 == null) {
|
|
8763
8943
|
if (n2.shapeFlag & 512) {
|
|
@@ -8765,7 +8945,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8765
8945
|
n2,
|
|
8766
8946
|
container,
|
|
8767
8947
|
anchor,
|
|
8768
|
-
|
|
8948
|
+
namespace,
|
|
8769
8949
|
optimized
|
|
8770
8950
|
);
|
|
8771
8951
|
} else {
|
|
@@ -8775,7 +8955,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8775
8955
|
anchor,
|
|
8776
8956
|
parentComponent,
|
|
8777
8957
|
parentSuspense,
|
|
8778
|
-
|
|
8958
|
+
namespace,
|
|
8779
8959
|
optimized
|
|
8780
8960
|
);
|
|
8781
8961
|
}
|
|
@@ -8783,7 +8963,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8783
8963
|
updateComponent(n1, n2, optimized);
|
|
8784
8964
|
}
|
|
8785
8965
|
};
|
|
8786
|
-
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense,
|
|
8966
|
+
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
8787
8967
|
const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
|
|
8788
8968
|
const instance = compatMountInstance || (initialVNode.component = createComponentInstance(
|
|
8789
8969
|
initialVNode,
|
|
@@ -8815,17 +8995,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8815
8995
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
8816
8996
|
processCommentNode(null, placeholder, container, anchor);
|
|
8817
8997
|
}
|
|
8818
|
-
|
|
8998
|
+
} else {
|
|
8999
|
+
setupRenderEffect(
|
|
9000
|
+
instance,
|
|
9001
|
+
initialVNode,
|
|
9002
|
+
container,
|
|
9003
|
+
anchor,
|
|
9004
|
+
parentSuspense,
|
|
9005
|
+
namespace,
|
|
9006
|
+
optimized
|
|
9007
|
+
);
|
|
8819
9008
|
}
|
|
8820
|
-
setupRenderEffect(
|
|
8821
|
-
instance,
|
|
8822
|
-
initialVNode,
|
|
8823
|
-
container,
|
|
8824
|
-
anchor,
|
|
8825
|
-
parentSuspense,
|
|
8826
|
-
isSVG,
|
|
8827
|
-
optimized
|
|
8828
|
-
);
|
|
8829
9009
|
{
|
|
8830
9010
|
popWarningContext();
|
|
8831
9011
|
endMeasure(instance, `mount`);
|
|
@@ -8854,7 +9034,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8854
9034
|
instance.vnode = n2;
|
|
8855
9035
|
}
|
|
8856
9036
|
};
|
|
8857
|
-
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense,
|
|
9037
|
+
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
|
|
8858
9038
|
const componentUpdateFn = () => {
|
|
8859
9039
|
if (!instance.isMounted) {
|
|
8860
9040
|
let vnodeHook;
|
|
@@ -8924,7 +9104,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8924
9104
|
anchor,
|
|
8925
9105
|
instance,
|
|
8926
9106
|
parentSuspense,
|
|
8927
|
-
|
|
9107
|
+
namespace
|
|
8928
9108
|
);
|
|
8929
9109
|
{
|
|
8930
9110
|
endMeasure(instance, `patch`);
|
|
@@ -8963,6 +9143,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8963
9143
|
initialVNode = container = anchor = null;
|
|
8964
9144
|
} else {
|
|
8965
9145
|
let { next, bu, u, parent, vnode } = instance;
|
|
9146
|
+
{
|
|
9147
|
+
const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
|
|
9148
|
+
if (nonHydratedAsyncRoot) {
|
|
9149
|
+
if (next) {
|
|
9150
|
+
next.el = vnode.el;
|
|
9151
|
+
updateComponentPreRender(instance, next, optimized);
|
|
9152
|
+
}
|
|
9153
|
+
nonHydratedAsyncRoot.asyncDep.then(() => {
|
|
9154
|
+
if (!instance.isUnmounted) {
|
|
9155
|
+
componentUpdateFn();
|
|
9156
|
+
}
|
|
9157
|
+
});
|
|
9158
|
+
return;
|
|
9159
|
+
}
|
|
9160
|
+
}
|
|
8966
9161
|
let originNext = next;
|
|
8967
9162
|
let vnodeHook;
|
|
8968
9163
|
{
|
|
@@ -9006,7 +9201,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9006
9201
|
getNextHostNode(prevTree),
|
|
9007
9202
|
instance,
|
|
9008
9203
|
parentSuspense,
|
|
9009
|
-
|
|
9204
|
+
namespace
|
|
9010
9205
|
);
|
|
9011
9206
|
{
|
|
9012
9207
|
endMeasure(instance, `patch`);
|
|
@@ -9067,10 +9262,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9067
9262
|
updateProps(instance, nextVNode.props, prevProps, optimized);
|
|
9068
9263
|
updateSlots(instance, nextVNode.children, optimized);
|
|
9069
9264
|
pauseTracking();
|
|
9070
|
-
flushPreFlushCbs();
|
|
9265
|
+
flushPreFlushCbs(instance);
|
|
9071
9266
|
resetTracking();
|
|
9072
9267
|
};
|
|
9073
|
-
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
9268
|
+
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
|
|
9074
9269
|
const c1 = n1 && n1.children;
|
|
9075
9270
|
const prevShapeFlag = n1 ? n1.shapeFlag : 0;
|
|
9076
9271
|
const c2 = n2.children;
|
|
@@ -9084,7 +9279,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9084
9279
|
anchor,
|
|
9085
9280
|
parentComponent,
|
|
9086
9281
|
parentSuspense,
|
|
9087
|
-
|
|
9282
|
+
namespace,
|
|
9088
9283
|
slotScopeIds,
|
|
9089
9284
|
optimized
|
|
9090
9285
|
);
|
|
@@ -9097,7 +9292,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9097
9292
|
anchor,
|
|
9098
9293
|
parentComponent,
|
|
9099
9294
|
parentSuspense,
|
|
9100
|
-
|
|
9295
|
+
namespace,
|
|
9101
9296
|
slotScopeIds,
|
|
9102
9297
|
optimized
|
|
9103
9298
|
);
|
|
@@ -9121,7 +9316,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9121
9316
|
anchor,
|
|
9122
9317
|
parentComponent,
|
|
9123
9318
|
parentSuspense,
|
|
9124
|
-
|
|
9319
|
+
namespace,
|
|
9125
9320
|
slotScopeIds,
|
|
9126
9321
|
optimized
|
|
9127
9322
|
);
|
|
@@ -9139,7 +9334,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9139
9334
|
anchor,
|
|
9140
9335
|
parentComponent,
|
|
9141
9336
|
parentSuspense,
|
|
9142
|
-
|
|
9337
|
+
namespace,
|
|
9143
9338
|
slotScopeIds,
|
|
9144
9339
|
optimized
|
|
9145
9340
|
);
|
|
@@ -9147,7 +9342,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9147
9342
|
}
|
|
9148
9343
|
}
|
|
9149
9344
|
};
|
|
9150
|
-
const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense,
|
|
9345
|
+
const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
9151
9346
|
c1 = c1 || EMPTY_ARR;
|
|
9152
9347
|
c2 = c2 || EMPTY_ARR;
|
|
9153
9348
|
const oldLength = c1.length;
|
|
@@ -9163,7 +9358,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9163
9358
|
null,
|
|
9164
9359
|
parentComponent,
|
|
9165
9360
|
parentSuspense,
|
|
9166
|
-
|
|
9361
|
+
namespace,
|
|
9167
9362
|
slotScopeIds,
|
|
9168
9363
|
optimized
|
|
9169
9364
|
);
|
|
@@ -9184,14 +9379,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9184
9379
|
anchor,
|
|
9185
9380
|
parentComponent,
|
|
9186
9381
|
parentSuspense,
|
|
9187
|
-
|
|
9382
|
+
namespace,
|
|
9188
9383
|
slotScopeIds,
|
|
9189
9384
|
optimized,
|
|
9190
9385
|
commonLength
|
|
9191
9386
|
);
|
|
9192
9387
|
}
|
|
9193
9388
|
};
|
|
9194
|
-
const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense,
|
|
9389
|
+
const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
9195
9390
|
let i = 0;
|
|
9196
9391
|
const l2 = c2.length;
|
|
9197
9392
|
let e1 = c1.length - 1;
|
|
@@ -9207,7 +9402,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9207
9402
|
null,
|
|
9208
9403
|
parentComponent,
|
|
9209
9404
|
parentSuspense,
|
|
9210
|
-
|
|
9405
|
+
namespace,
|
|
9211
9406
|
slotScopeIds,
|
|
9212
9407
|
optimized
|
|
9213
9408
|
);
|
|
@@ -9227,7 +9422,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9227
9422
|
null,
|
|
9228
9423
|
parentComponent,
|
|
9229
9424
|
parentSuspense,
|
|
9230
|
-
|
|
9425
|
+
namespace,
|
|
9231
9426
|
slotScopeIds,
|
|
9232
9427
|
optimized
|
|
9233
9428
|
);
|
|
@@ -9249,7 +9444,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9249
9444
|
anchor,
|
|
9250
9445
|
parentComponent,
|
|
9251
9446
|
parentSuspense,
|
|
9252
|
-
|
|
9447
|
+
namespace,
|
|
9253
9448
|
slotScopeIds,
|
|
9254
9449
|
optimized
|
|
9255
9450
|
);
|
|
@@ -9319,7 +9514,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9319
9514
|
null,
|
|
9320
9515
|
parentComponent,
|
|
9321
9516
|
parentSuspense,
|
|
9322
|
-
|
|
9517
|
+
namespace,
|
|
9323
9518
|
slotScopeIds,
|
|
9324
9519
|
optimized
|
|
9325
9520
|
);
|
|
@@ -9340,7 +9535,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9340
9535
|
anchor,
|
|
9341
9536
|
parentComponent,
|
|
9342
9537
|
parentSuspense,
|
|
9343
|
-
|
|
9538
|
+
namespace,
|
|
9344
9539
|
slotScopeIds,
|
|
9345
9540
|
optimized
|
|
9346
9541
|
);
|
|
@@ -9570,13 +9765,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9570
9765
|
}
|
|
9571
9766
|
return hostNextSibling(vnode.anchor || vnode.el);
|
|
9572
9767
|
};
|
|
9573
|
-
const render = (vnode, container,
|
|
9768
|
+
const render = (vnode, container, namespace) => {
|
|
9574
9769
|
if (vnode == null) {
|
|
9575
9770
|
if (container._vnode) {
|
|
9576
9771
|
unmount(container._vnode, null, null, true);
|
|
9577
9772
|
}
|
|
9578
9773
|
} else {
|
|
9579
|
-
patch(
|
|
9774
|
+
patch(
|
|
9775
|
+
container._vnode || null,
|
|
9776
|
+
vnode,
|
|
9777
|
+
container,
|
|
9778
|
+
null,
|
|
9779
|
+
null,
|
|
9780
|
+
null,
|
|
9781
|
+
namespace
|
|
9782
|
+
);
|
|
9580
9783
|
}
|
|
9581
9784
|
flushPreFlushCbs();
|
|
9582
9785
|
flushPostFlushCbs();
|
|
@@ -9607,6 +9810,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9607
9810
|
createApp: createAppAPI(render, hydrate)
|
|
9608
9811
|
};
|
|
9609
9812
|
}
|
|
9813
|
+
function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
9814
|
+
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
9815
|
+
}
|
|
9610
9816
|
function toggleRecurse({ effect, update }, allowed) {
|
|
9611
9817
|
effect.allowRecurse = update.allowRecurse = allowed;
|
|
9612
9818
|
}
|
|
@@ -9677,10 +9883,21 @@ function getSequence(arr) {
|
|
|
9677
9883
|
}
|
|
9678
9884
|
return result;
|
|
9679
9885
|
}
|
|
9886
|
+
function locateNonHydratedAsyncRoot(instance) {
|
|
9887
|
+
const subComponent = instance.subTree.component;
|
|
9888
|
+
if (subComponent) {
|
|
9889
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
9890
|
+
return subComponent;
|
|
9891
|
+
} else {
|
|
9892
|
+
return locateNonHydratedAsyncRoot(subComponent);
|
|
9893
|
+
}
|
|
9894
|
+
}
|
|
9895
|
+
}
|
|
9680
9896
|
|
|
9681
9897
|
const isTeleport = (type) => type.__isTeleport;
|
|
9682
9898
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
9683
9899
|
const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
|
|
9900
|
+
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
9684
9901
|
const resolveTarget = (props, select) => {
|
|
9685
9902
|
const targetSelector = props && props.to;
|
|
9686
9903
|
if (isString(targetSelector)) {
|
|
@@ -9708,7 +9925,7 @@ const resolveTarget = (props, select) => {
|
|
|
9708
9925
|
const TeleportImpl = {
|
|
9709
9926
|
name: "Teleport",
|
|
9710
9927
|
__isTeleport: true,
|
|
9711
|
-
process(n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
9928
|
+
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
9712
9929
|
const {
|
|
9713
9930
|
mc: mountChildren,
|
|
9714
9931
|
pc: patchChildren,
|
|
@@ -9730,7 +9947,11 @@ const TeleportImpl = {
|
|
|
9730
9947
|
const targetAnchor = n2.targetAnchor = createText("");
|
|
9731
9948
|
if (target) {
|
|
9732
9949
|
insert(targetAnchor, target);
|
|
9733
|
-
|
|
9950
|
+
if (namespace === "svg" || isTargetSVG(target)) {
|
|
9951
|
+
namespace = "svg";
|
|
9952
|
+
} else if (namespace === "mathml" || isTargetMathML(target)) {
|
|
9953
|
+
namespace = "mathml";
|
|
9954
|
+
}
|
|
9734
9955
|
} else if (!disabled) {
|
|
9735
9956
|
warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
9736
9957
|
}
|
|
@@ -9742,7 +9963,7 @@ const TeleportImpl = {
|
|
|
9742
9963
|
anchor2,
|
|
9743
9964
|
parentComponent,
|
|
9744
9965
|
parentSuspense,
|
|
9745
|
-
|
|
9966
|
+
namespace,
|
|
9746
9967
|
slotScopeIds,
|
|
9747
9968
|
optimized
|
|
9748
9969
|
);
|
|
@@ -9761,7 +9982,11 @@ const TeleportImpl = {
|
|
|
9761
9982
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
9762
9983
|
const currentContainer = wasDisabled ? container : target;
|
|
9763
9984
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
9764
|
-
|
|
9985
|
+
if (namespace === "svg" || isTargetSVG(target)) {
|
|
9986
|
+
namespace = "svg";
|
|
9987
|
+
} else if (namespace === "mathml" || isTargetMathML(target)) {
|
|
9988
|
+
namespace = "mathml";
|
|
9989
|
+
}
|
|
9765
9990
|
if (dynamicChildren) {
|
|
9766
9991
|
patchBlockChildren(
|
|
9767
9992
|
n1.dynamicChildren,
|
|
@@ -9769,7 +9994,7 @@ const TeleportImpl = {
|
|
|
9769
9994
|
currentContainer,
|
|
9770
9995
|
parentComponent,
|
|
9771
9996
|
parentSuspense,
|
|
9772
|
-
|
|
9997
|
+
namespace,
|
|
9773
9998
|
slotScopeIds
|
|
9774
9999
|
);
|
|
9775
10000
|
traverseStaticChildren(n1, n2, true);
|
|
@@ -9781,7 +10006,7 @@ const TeleportImpl = {
|
|
|
9781
10006
|
currentAnchor,
|
|
9782
10007
|
parentComponent,
|
|
9783
10008
|
parentSuspense,
|
|
9784
|
-
|
|
10009
|
+
namespace,
|
|
9785
10010
|
slotScopeIds,
|
|
9786
10011
|
false
|
|
9787
10012
|
);
|
|
@@ -10465,20 +10690,29 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
10465
10690
|
let currentInstance = null;
|
|
10466
10691
|
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
10467
10692
|
let internalSetCurrentInstance;
|
|
10468
|
-
let
|
|
10469
|
-
let settersKey = "__VUE_INSTANCE_SETTERS__";
|
|
10693
|
+
let setInSSRSetupState;
|
|
10470
10694
|
{
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
|
|
10474
|
-
|
|
10475
|
-
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
|
|
10695
|
+
const g = getGlobalThis();
|
|
10696
|
+
const registerGlobalSetter = (key, setter) => {
|
|
10697
|
+
let setters;
|
|
10698
|
+
if (!(setters = g[key]))
|
|
10699
|
+
setters = g[key] = [];
|
|
10700
|
+
setters.push(setter);
|
|
10701
|
+
return (v) => {
|
|
10702
|
+
if (setters.length > 1)
|
|
10703
|
+
setters.forEach((set) => set(v));
|
|
10704
|
+
else
|
|
10705
|
+
setters[0](v);
|
|
10706
|
+
};
|
|
10481
10707
|
};
|
|
10708
|
+
internalSetCurrentInstance = registerGlobalSetter(
|
|
10709
|
+
`__VUE_INSTANCE_SETTERS__`,
|
|
10710
|
+
(v) => currentInstance = v
|
|
10711
|
+
);
|
|
10712
|
+
setInSSRSetupState = registerGlobalSetter(
|
|
10713
|
+
`__VUE_SSR_SETTERS__`,
|
|
10714
|
+
(v) => isInSSRComponentSetup = v
|
|
10715
|
+
);
|
|
10482
10716
|
}
|
|
10483
10717
|
const setCurrentInstance = (instance) => {
|
|
10484
10718
|
internalSetCurrentInstance(instance);
|
|
@@ -10502,13 +10736,13 @@ function isStatefulComponent(instance) {
|
|
|
10502
10736
|
}
|
|
10503
10737
|
let isInSSRComponentSetup = false;
|
|
10504
10738
|
function setupComponent(instance, isSSR = false) {
|
|
10505
|
-
|
|
10739
|
+
isSSR && setInSSRSetupState(isSSR);
|
|
10506
10740
|
const { props, children } = instance.vnode;
|
|
10507
10741
|
const isStateful = isStatefulComponent(instance);
|
|
10508
10742
|
initProps(instance, props, isStateful, isSSR);
|
|
10509
10743
|
initSlots(instance, children);
|
|
10510
10744
|
const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
|
|
10511
|
-
|
|
10745
|
+
isSSR && setInSSRSetupState(false);
|
|
10512
10746
|
return setupResult;
|
|
10513
10747
|
}
|
|
10514
10748
|
function setupStatefulComponent(instance, isSSR) {
|
|
@@ -10838,9 +11072,9 @@ function initCustomFormatter() {
|
|
|
10838
11072
|
return;
|
|
10839
11073
|
}
|
|
10840
11074
|
const vueStyle = { style: "color:#3ba776" };
|
|
10841
|
-
const numberStyle = { style: "color:#
|
|
10842
|
-
const stringStyle = { style: "color:#
|
|
10843
|
-
const keywordStyle = { style: "color:#
|
|
11075
|
+
const numberStyle = { style: "color:#1677ff" };
|
|
11076
|
+
const stringStyle = { style: "color:#f5222d" };
|
|
11077
|
+
const keywordStyle = { style: "color:#eb2f96" };
|
|
10844
11078
|
const formatter = {
|
|
10845
11079
|
header(obj) {
|
|
10846
11080
|
if (!isObject(obj)) {
|
|
@@ -11034,7 +11268,7 @@ function isMemoSame(cached, memo) {
|
|
|
11034
11268
|
return true;
|
|
11035
11269
|
}
|
|
11036
11270
|
|
|
11037
|
-
const version = "3.4.0-
|
|
11271
|
+
const version = "3.4.0-beta.1";
|
|
11038
11272
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
11039
11273
|
const _ssrUtils = {
|
|
11040
11274
|
createComponentInstance,
|
|
@@ -11054,8 +11288,10 @@ const _compatUtils = {
|
|
|
11054
11288
|
softAssertCompatEnabled
|
|
11055
11289
|
};
|
|
11056
11290
|
const compatUtils = _compatUtils ;
|
|
11291
|
+
const DeprecationTypes = DeprecationTypes$1 ;
|
|
11057
11292
|
|
|
11058
11293
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
11294
|
+
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
11059
11295
|
const doc = typeof document !== "undefined" ? document : null;
|
|
11060
11296
|
const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
|
|
11061
11297
|
const nodeOps = {
|
|
@@ -11068,8 +11304,8 @@ const nodeOps = {
|
|
|
11068
11304
|
parent.removeChild(child);
|
|
11069
11305
|
}
|
|
11070
11306
|
},
|
|
11071
|
-
createElement: (tag,
|
|
11072
|
-
const el =
|
|
11307
|
+
createElement: (tag, namespace, is, props) => {
|
|
11308
|
+
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
|
|
11073
11309
|
if (tag === "select" && props && props.multiple != null) {
|
|
11074
11310
|
el.setAttribute("multiple", props.multiple);
|
|
11075
11311
|
}
|
|
@@ -11093,7 +11329,7 @@ const nodeOps = {
|
|
|
11093
11329
|
// Reason: innerHTML.
|
|
11094
11330
|
// Static content here can only come from compiled templates.
|
|
11095
11331
|
// As long as the user only uses trusted templates, this is safe.
|
|
11096
|
-
insertStaticContent(content, parent, anchor,
|
|
11332
|
+
insertStaticContent(content, parent, anchor, namespace, start, end) {
|
|
11097
11333
|
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
11098
11334
|
if (start && (start === end || start.nextSibling)) {
|
|
11099
11335
|
while (true) {
|
|
@@ -11102,9 +11338,9 @@ const nodeOps = {
|
|
|
11102
11338
|
break;
|
|
11103
11339
|
}
|
|
11104
11340
|
} else {
|
|
11105
|
-
templateContainer.innerHTML =
|
|
11341
|
+
templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
|
|
11106
11342
|
const template = templateContainer.content;
|
|
11107
|
-
if (
|
|
11343
|
+
if (namespace === "svg" || namespace === "mathml") {
|
|
11108
11344
|
const wrapper = template.firstChild;
|
|
11109
11345
|
while (wrapper.firstChild) {
|
|
11110
11346
|
template.appendChild(wrapper.firstChild);
|
|
@@ -11749,8 +11985,10 @@ function patchStopImmediatePropagation(e, value) {
|
|
|
11749
11985
|
}
|
|
11750
11986
|
}
|
|
11751
11987
|
|
|
11752
|
-
const
|
|
11753
|
-
|
|
11988
|
+
const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
|
|
11989
|
+
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
|
|
11990
|
+
const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
|
|
11991
|
+
const isSVG = namespace === "svg";
|
|
11754
11992
|
if (key === "class") {
|
|
11755
11993
|
patchClass(el, nextValue, isSVG);
|
|
11756
11994
|
} else if (key === "style") {
|
|
@@ -11783,7 +12021,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
11783
12021
|
if (key === "innerHTML" || key === "textContent") {
|
|
11784
12022
|
return true;
|
|
11785
12023
|
}
|
|
11786
|
-
if (key in el &&
|
|
12024
|
+
if (key in el && isNativeOn(key) && isFunction(value)) {
|
|
11787
12025
|
return true;
|
|
11788
12026
|
}
|
|
11789
12027
|
return false;
|
|
@@ -11800,7 +12038,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
11800
12038
|
if (key === "type" && el.tagName === "TEXTAREA") {
|
|
11801
12039
|
return false;
|
|
11802
12040
|
}
|
|
11803
|
-
if (
|
|
12041
|
+
if (key === "width" || key === "height") {
|
|
12042
|
+
const tag = el.tagName;
|
|
12043
|
+
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
|
|
12044
|
+
return false;
|
|
12045
|
+
}
|
|
12046
|
+
}
|
|
12047
|
+
if (isNativeOn(key) && isString(value)) {
|
|
11804
12048
|
return false;
|
|
11805
12049
|
}
|
|
11806
12050
|
return key in el;
|
|
@@ -12469,14 +12713,14 @@ const modifierGuards = {
|
|
|
12469
12713
|
exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
|
|
12470
12714
|
};
|
|
12471
12715
|
const withModifiers = (fn, modifiers) => {
|
|
12472
|
-
return (event, ...args) => {
|
|
12716
|
+
return fn._withMods || (fn._withMods = (event, ...args) => {
|
|
12473
12717
|
for (let i = 0; i < modifiers.length; i++) {
|
|
12474
12718
|
const guard = modifierGuards[modifiers[i]];
|
|
12475
12719
|
if (guard && guard(event, modifiers))
|
|
12476
12720
|
return;
|
|
12477
12721
|
}
|
|
12478
12722
|
return fn(event, ...args);
|
|
12479
|
-
};
|
|
12723
|
+
});
|
|
12480
12724
|
};
|
|
12481
12725
|
const keyNames = {
|
|
12482
12726
|
esc: "escape",
|
|
@@ -12504,7 +12748,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
12504
12748
|
);
|
|
12505
12749
|
}
|
|
12506
12750
|
}
|
|
12507
|
-
return (event) => {
|
|
12751
|
+
return fn._withKeys || (fn._withKeys = (event) => {
|
|
12508
12752
|
if (!("key" in event)) {
|
|
12509
12753
|
return;
|
|
12510
12754
|
}
|
|
@@ -12532,7 +12776,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
12532
12776
|
}
|
|
12533
12777
|
}
|
|
12534
12778
|
}
|
|
12535
|
-
};
|
|
12779
|
+
});
|
|
12536
12780
|
};
|
|
12537
12781
|
|
|
12538
12782
|
const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
|
|
@@ -12580,7 +12824,7 @@ const createApp = (...args) => {
|
|
|
12580
12824
|
}
|
|
12581
12825
|
}
|
|
12582
12826
|
container.innerHTML = "";
|
|
12583
|
-
const proxy = mount(container, false, container
|
|
12827
|
+
const proxy = mount(container, false, resolveRootNamespace(container));
|
|
12584
12828
|
if (container instanceof Element) {
|
|
12585
12829
|
container.removeAttribute("v-cloak");
|
|
12586
12830
|
container.setAttribute("data-v-app", "");
|
|
@@ -12599,14 +12843,22 @@ const createSSRApp = (...args) => {
|
|
|
12599
12843
|
app.mount = (containerOrSelector) => {
|
|
12600
12844
|
const container = normalizeContainer(containerOrSelector);
|
|
12601
12845
|
if (container) {
|
|
12602
|
-
return mount(container, true, container
|
|
12846
|
+
return mount(container, true, resolveRootNamespace(container));
|
|
12603
12847
|
}
|
|
12604
12848
|
};
|
|
12605
12849
|
return app;
|
|
12606
12850
|
};
|
|
12851
|
+
function resolveRootNamespace(container) {
|
|
12852
|
+
if (container instanceof SVGElement) {
|
|
12853
|
+
return "svg";
|
|
12854
|
+
}
|
|
12855
|
+
if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
|
|
12856
|
+
return "mathml";
|
|
12857
|
+
}
|
|
12858
|
+
}
|
|
12607
12859
|
function injectNativeTagCheck(app) {
|
|
12608
12860
|
Object.defineProperty(app.config, "isNativeTag", {
|
|
12609
|
-
value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
|
|
12861
|
+
value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
|
|
12610
12862
|
writable: false
|
|
12611
12863
|
});
|
|
12612
12864
|
}
|
|
@@ -12670,7 +12922,9 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12670
12922
|
BaseTransition: BaseTransition,
|
|
12671
12923
|
BaseTransitionPropsValidators: BaseTransitionPropsValidators,
|
|
12672
12924
|
Comment: Comment,
|
|
12925
|
+
DeprecationTypes: DeprecationTypes,
|
|
12673
12926
|
EffectScope: EffectScope,
|
|
12927
|
+
ErrorCodes: ErrorCodes,
|
|
12674
12928
|
ErrorTypeStrings: ErrorTypeStrings,
|
|
12675
12929
|
Fragment: Fragment,
|
|
12676
12930
|
KeepAlive: KeepAlive,
|
|
@@ -12679,8 +12933,10 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12679
12933
|
Suspense: Suspense,
|
|
12680
12934
|
Teleport: Teleport,
|
|
12681
12935
|
Text: Text,
|
|
12936
|
+
TrackOpTypes: TrackOpTypes,
|
|
12682
12937
|
Transition: Transition,
|
|
12683
12938
|
TransitionGroup: TransitionGroup,
|
|
12939
|
+
TriggerOpTypes: TriggerOpTypes,
|
|
12684
12940
|
VueElement: VueElement,
|
|
12685
12941
|
assertNumber: assertNumber,
|
|
12686
12942
|
callWithAsyncErrorHandling: callWithAsyncErrorHandling,
|
|
@@ -13137,7 +13393,9 @@ class Tokenizer {
|
|
|
13137
13393
|
this.inRCDATA = false;
|
|
13138
13394
|
/** For disabling RCDATA tags handling */
|
|
13139
13395
|
this.inXML = false;
|
|
13140
|
-
/**
|
|
13396
|
+
/** For disabling interpolation parsing in v-pre */
|
|
13397
|
+
this.inVPre = false;
|
|
13398
|
+
/** Record newline positions for fast line / column calculation */
|
|
13141
13399
|
this.newlines = [];
|
|
13142
13400
|
this.mode = 0;
|
|
13143
13401
|
this.delimiterOpen = defaultDelimitersOpen;
|
|
@@ -13162,6 +13420,7 @@ class Tokenizer {
|
|
|
13162
13420
|
this.sectionStart = 0;
|
|
13163
13421
|
this.index = 0;
|
|
13164
13422
|
this.baseState = 1;
|
|
13423
|
+
this.inRCDATA = false;
|
|
13165
13424
|
this.currentSequence = void 0;
|
|
13166
13425
|
this.newlines.length = 0;
|
|
13167
13426
|
this.delimiterOpen = defaultDelimitersOpen;
|
|
@@ -13202,7 +13461,7 @@ class Tokenizer {
|
|
|
13202
13461
|
this.sectionStart = this.index;
|
|
13203
13462
|
} else if (c === 38) {
|
|
13204
13463
|
this.startEntity();
|
|
13205
|
-
} else if (c === this.delimiterOpen[0]) {
|
|
13464
|
+
} else if (!this.inVPre && c === this.delimiterOpen[0]) {
|
|
13206
13465
|
this.state = 2;
|
|
13207
13466
|
this.delimiterIndex = 0;
|
|
13208
13467
|
this.stateInterpolationOpen(c);
|
|
@@ -14071,50 +14330,311 @@ const errorMessages = {
|
|
|
14071
14330
|
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
14072
14331
|
[45]: `Error parsing JavaScript expression: `,
|
|
14073
14332
|
[46]: `<KeepAlive> expects exactly one child component.`,
|
|
14333
|
+
[51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
|
|
14074
14334
|
// generic errors
|
|
14075
14335
|
[47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
14076
14336
|
[48]: `ES module mode is not supported in this build of compiler.`,
|
|
14077
14337
|
[49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
14078
14338
|
[50]: `"scopeId" option is only supported in module mode.`,
|
|
14079
|
-
// deprecations
|
|
14080
|
-
[51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
|
|
14081
|
-
[52]: `v-is="component-name" has been deprecated. Use is="vue:component-name" instead. v-is support will be removed in 3.4.`,
|
|
14082
14339
|
// just to fulfill types
|
|
14083
|
-
[
|
|
14340
|
+
[52]: ``
|
|
14084
14341
|
};
|
|
14085
14342
|
|
|
14086
|
-
|
|
14087
|
-
|
|
14088
|
-
|
|
14089
|
-
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
|
|
14095
|
-
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
|
|
14099
|
-
|
|
14100
|
-
|
|
14101
|
-
|
|
14102
|
-
}
|
|
14103
|
-
|
|
14104
|
-
|
|
14105
|
-
|
|
14106
|
-
|
|
14107
|
-
|
|
14108
|
-
|
|
14109
|
-
|
|
14110
|
-
|
|
14111
|
-
|
|
14112
|
-
|
|
14113
|
-
|
|
14114
|
-
|
|
14115
|
-
|
|
14116
|
-
|
|
14117
|
-
|
|
14343
|
+
function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
|
|
14344
|
+
const rootExp = root.type === "Program" ? root.body[0].type === "ExpressionStatement" && root.body[0].expression : root;
|
|
14345
|
+
estreeWalker.walk(root, {
|
|
14346
|
+
enter(node, parent) {
|
|
14347
|
+
parent && parentStack.push(parent);
|
|
14348
|
+
if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) {
|
|
14349
|
+
return this.skip();
|
|
14350
|
+
}
|
|
14351
|
+
if (node.type === "Identifier") {
|
|
14352
|
+
const isLocal = !!knownIds[node.name];
|
|
14353
|
+
const isRefed = isReferencedIdentifier(node, parent, parentStack);
|
|
14354
|
+
if (includeAll || isRefed && !isLocal) {
|
|
14355
|
+
onIdentifier(node, parent, parentStack, isRefed, isLocal);
|
|
14356
|
+
}
|
|
14357
|
+
} else if (node.type === "ObjectProperty" && parent.type === "ObjectPattern") {
|
|
14358
|
+
node.inPattern = true;
|
|
14359
|
+
} else if (isFunctionType(node)) {
|
|
14360
|
+
walkFunctionParams(node, (id) => markScopeIdentifier(node, id, knownIds));
|
|
14361
|
+
} else if (node.type === "BlockStatement") {
|
|
14362
|
+
walkBlockDeclarations(
|
|
14363
|
+
node,
|
|
14364
|
+
(id) => markScopeIdentifier(node, id, knownIds)
|
|
14365
|
+
);
|
|
14366
|
+
}
|
|
14367
|
+
},
|
|
14368
|
+
leave(node, parent) {
|
|
14369
|
+
parent && parentStack.pop();
|
|
14370
|
+
if (node !== rootExp && node.scopeIds) {
|
|
14371
|
+
for (const id of node.scopeIds) {
|
|
14372
|
+
knownIds[id]--;
|
|
14373
|
+
if (knownIds[id] === 0) {
|
|
14374
|
+
delete knownIds[id];
|
|
14375
|
+
}
|
|
14376
|
+
}
|
|
14377
|
+
}
|
|
14378
|
+
}
|
|
14379
|
+
});
|
|
14380
|
+
}
|
|
14381
|
+
function isReferencedIdentifier(id, parent, parentStack) {
|
|
14382
|
+
if (!parent) {
|
|
14383
|
+
return true;
|
|
14384
|
+
}
|
|
14385
|
+
if (id.name === "arguments") {
|
|
14386
|
+
return false;
|
|
14387
|
+
}
|
|
14388
|
+
if (isReferenced(id, parent)) {
|
|
14389
|
+
return true;
|
|
14390
|
+
}
|
|
14391
|
+
switch (parent.type) {
|
|
14392
|
+
case "AssignmentExpression":
|
|
14393
|
+
case "AssignmentPattern":
|
|
14394
|
+
return true;
|
|
14395
|
+
case "ObjectPattern":
|
|
14396
|
+
case "ArrayPattern":
|
|
14397
|
+
return isInDestructureAssignment(parent, parentStack);
|
|
14398
|
+
}
|
|
14399
|
+
return false;
|
|
14400
|
+
}
|
|
14401
|
+
function isInDestructureAssignment(parent, parentStack) {
|
|
14402
|
+
if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) {
|
|
14403
|
+
let i = parentStack.length;
|
|
14404
|
+
while (i--) {
|
|
14405
|
+
const p = parentStack[i];
|
|
14406
|
+
if (p.type === "AssignmentExpression") {
|
|
14407
|
+
return true;
|
|
14408
|
+
} else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) {
|
|
14409
|
+
break;
|
|
14410
|
+
}
|
|
14411
|
+
}
|
|
14412
|
+
}
|
|
14413
|
+
return false;
|
|
14414
|
+
}
|
|
14415
|
+
function walkFunctionParams(node, onIdent) {
|
|
14416
|
+
for (const p of node.params) {
|
|
14417
|
+
for (const id of extractIdentifiers(p)) {
|
|
14418
|
+
onIdent(id);
|
|
14419
|
+
}
|
|
14420
|
+
}
|
|
14421
|
+
}
|
|
14422
|
+
function walkBlockDeclarations(block, onIdent) {
|
|
14423
|
+
for (const stmt of block.body) {
|
|
14424
|
+
if (stmt.type === "VariableDeclaration") {
|
|
14425
|
+
if (stmt.declare)
|
|
14426
|
+
continue;
|
|
14427
|
+
for (const decl of stmt.declarations) {
|
|
14428
|
+
for (const id of extractIdentifiers(decl.id)) {
|
|
14429
|
+
onIdent(id);
|
|
14430
|
+
}
|
|
14431
|
+
}
|
|
14432
|
+
} else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
|
|
14433
|
+
if (stmt.declare || !stmt.id)
|
|
14434
|
+
continue;
|
|
14435
|
+
onIdent(stmt.id);
|
|
14436
|
+
} else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") {
|
|
14437
|
+
const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
|
|
14438
|
+
if (variable && variable.type === "VariableDeclaration") {
|
|
14439
|
+
for (const decl of variable.declarations) {
|
|
14440
|
+
for (const id of extractIdentifiers(decl.id)) {
|
|
14441
|
+
onIdent(id);
|
|
14442
|
+
}
|
|
14443
|
+
}
|
|
14444
|
+
}
|
|
14445
|
+
}
|
|
14446
|
+
}
|
|
14447
|
+
}
|
|
14448
|
+
function extractIdentifiers(param, nodes = []) {
|
|
14449
|
+
switch (param.type) {
|
|
14450
|
+
case "Identifier":
|
|
14451
|
+
nodes.push(param);
|
|
14452
|
+
break;
|
|
14453
|
+
case "MemberExpression":
|
|
14454
|
+
let object = param;
|
|
14455
|
+
while (object.type === "MemberExpression") {
|
|
14456
|
+
object = object.object;
|
|
14457
|
+
}
|
|
14458
|
+
nodes.push(object);
|
|
14459
|
+
break;
|
|
14460
|
+
case "ObjectPattern":
|
|
14461
|
+
for (const prop of param.properties) {
|
|
14462
|
+
if (prop.type === "RestElement") {
|
|
14463
|
+
extractIdentifiers(prop.argument, nodes);
|
|
14464
|
+
} else {
|
|
14465
|
+
extractIdentifiers(prop.value, nodes);
|
|
14466
|
+
}
|
|
14467
|
+
}
|
|
14468
|
+
break;
|
|
14469
|
+
case "ArrayPattern":
|
|
14470
|
+
param.elements.forEach((element) => {
|
|
14471
|
+
if (element)
|
|
14472
|
+
extractIdentifiers(element, nodes);
|
|
14473
|
+
});
|
|
14474
|
+
break;
|
|
14475
|
+
case "RestElement":
|
|
14476
|
+
extractIdentifiers(param.argument, nodes);
|
|
14477
|
+
break;
|
|
14478
|
+
case "AssignmentPattern":
|
|
14479
|
+
extractIdentifiers(param.left, nodes);
|
|
14480
|
+
break;
|
|
14481
|
+
}
|
|
14482
|
+
return nodes;
|
|
14483
|
+
}
|
|
14484
|
+
function markScopeIdentifier(node, child, knownIds) {
|
|
14485
|
+
const { name } = child;
|
|
14486
|
+
if (node.scopeIds && node.scopeIds.has(name)) {
|
|
14487
|
+
return;
|
|
14488
|
+
}
|
|
14489
|
+
if (name in knownIds) {
|
|
14490
|
+
knownIds[name]++;
|
|
14491
|
+
} else {
|
|
14492
|
+
knownIds[name] = 1;
|
|
14493
|
+
}
|
|
14494
|
+
(node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name);
|
|
14495
|
+
}
|
|
14496
|
+
const isFunctionType = (node) => {
|
|
14497
|
+
return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
|
|
14498
|
+
};
|
|
14499
|
+
const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
|
|
14500
|
+
const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
|
|
14501
|
+
function isReferenced(node, parent, grandparent) {
|
|
14502
|
+
switch (parent.type) {
|
|
14503
|
+
case "MemberExpression":
|
|
14504
|
+
case "OptionalMemberExpression":
|
|
14505
|
+
if (parent.property === node) {
|
|
14506
|
+
return !!parent.computed;
|
|
14507
|
+
}
|
|
14508
|
+
return parent.object === node;
|
|
14509
|
+
case "JSXMemberExpression":
|
|
14510
|
+
return parent.object === node;
|
|
14511
|
+
case "VariableDeclarator":
|
|
14512
|
+
return parent.init === node;
|
|
14513
|
+
case "ArrowFunctionExpression":
|
|
14514
|
+
return parent.body === node;
|
|
14515
|
+
case "PrivateName":
|
|
14516
|
+
return false;
|
|
14517
|
+
case "ClassMethod":
|
|
14518
|
+
case "ClassPrivateMethod":
|
|
14519
|
+
case "ObjectMethod":
|
|
14520
|
+
if (parent.key === node) {
|
|
14521
|
+
return !!parent.computed;
|
|
14522
|
+
}
|
|
14523
|
+
return false;
|
|
14524
|
+
case "ObjectProperty":
|
|
14525
|
+
if (parent.key === node) {
|
|
14526
|
+
return !!parent.computed;
|
|
14527
|
+
}
|
|
14528
|
+
return !grandparent || grandparent.type !== "ObjectPattern";
|
|
14529
|
+
case "ClassProperty":
|
|
14530
|
+
if (parent.key === node) {
|
|
14531
|
+
return !!parent.computed;
|
|
14532
|
+
}
|
|
14533
|
+
return true;
|
|
14534
|
+
case "ClassPrivateProperty":
|
|
14535
|
+
return parent.key !== node;
|
|
14536
|
+
case "ClassDeclaration":
|
|
14537
|
+
case "ClassExpression":
|
|
14538
|
+
return parent.superClass === node;
|
|
14539
|
+
case "AssignmentExpression":
|
|
14540
|
+
return parent.right === node;
|
|
14541
|
+
case "AssignmentPattern":
|
|
14542
|
+
return parent.right === node;
|
|
14543
|
+
case "LabeledStatement":
|
|
14544
|
+
return false;
|
|
14545
|
+
case "CatchClause":
|
|
14546
|
+
return false;
|
|
14547
|
+
case "RestElement":
|
|
14548
|
+
return false;
|
|
14549
|
+
case "BreakStatement":
|
|
14550
|
+
case "ContinueStatement":
|
|
14551
|
+
return false;
|
|
14552
|
+
case "FunctionDeclaration":
|
|
14553
|
+
case "FunctionExpression":
|
|
14554
|
+
return false;
|
|
14555
|
+
case "ExportNamespaceSpecifier":
|
|
14556
|
+
case "ExportDefaultSpecifier":
|
|
14557
|
+
return false;
|
|
14558
|
+
case "ExportSpecifier":
|
|
14559
|
+
if (grandparent == null ? void 0 : grandparent.source) {
|
|
14560
|
+
return false;
|
|
14561
|
+
}
|
|
14562
|
+
return parent.local === node;
|
|
14563
|
+
case "ImportDefaultSpecifier":
|
|
14564
|
+
case "ImportNamespaceSpecifier":
|
|
14565
|
+
case "ImportSpecifier":
|
|
14566
|
+
return false;
|
|
14567
|
+
case "ImportAttribute":
|
|
14568
|
+
return false;
|
|
14569
|
+
case "JSXAttribute":
|
|
14570
|
+
return false;
|
|
14571
|
+
case "ObjectPattern":
|
|
14572
|
+
case "ArrayPattern":
|
|
14573
|
+
return false;
|
|
14574
|
+
case "MetaProperty":
|
|
14575
|
+
return false;
|
|
14576
|
+
case "ObjectTypeProperty":
|
|
14577
|
+
return parent.key !== node;
|
|
14578
|
+
case "TSEnumMember":
|
|
14579
|
+
return parent.id !== node;
|
|
14580
|
+
case "TSPropertySignature":
|
|
14581
|
+
if (parent.key === node) {
|
|
14582
|
+
return !!parent.computed;
|
|
14583
|
+
}
|
|
14584
|
+
return true;
|
|
14585
|
+
}
|
|
14586
|
+
return true;
|
|
14587
|
+
}
|
|
14588
|
+
const TS_NODE_TYPES = [
|
|
14589
|
+
"TSAsExpression",
|
|
14590
|
+
// foo as number
|
|
14591
|
+
"TSTypeAssertion",
|
|
14592
|
+
// (<number>foo)
|
|
14593
|
+
"TSNonNullExpression",
|
|
14594
|
+
// foo!
|
|
14595
|
+
"TSInstantiationExpression",
|
|
14596
|
+
// foo<string>
|
|
14597
|
+
"TSSatisfiesExpression"
|
|
14598
|
+
// foo satisfies T
|
|
14599
|
+
];
|
|
14600
|
+
function unwrapTSNode(node) {
|
|
14601
|
+
if (TS_NODE_TYPES.includes(node.type)) {
|
|
14602
|
+
return unwrapTSNode(node.expression);
|
|
14603
|
+
} else {
|
|
14604
|
+
return node;
|
|
14605
|
+
}
|
|
14606
|
+
}
|
|
14607
|
+
|
|
14608
|
+
const isStaticExp = (p) => p.type === 4 && p.isStatic;
|
|
14609
|
+
function isCoreComponent(tag) {
|
|
14610
|
+
switch (tag) {
|
|
14611
|
+
case "Teleport":
|
|
14612
|
+
case "teleport":
|
|
14613
|
+
return TELEPORT;
|
|
14614
|
+
case "Suspense":
|
|
14615
|
+
case "suspense":
|
|
14616
|
+
return SUSPENSE;
|
|
14617
|
+
case "KeepAlive":
|
|
14618
|
+
case "keep-alive":
|
|
14619
|
+
return KEEP_ALIVE;
|
|
14620
|
+
case "BaseTransition":
|
|
14621
|
+
case "base-transition":
|
|
14622
|
+
return BASE_TRANSITION;
|
|
14623
|
+
}
|
|
14624
|
+
}
|
|
14625
|
+
const nonIdentifierRE = /^\d|[^\$\w]/;
|
|
14626
|
+
const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
|
|
14627
|
+
const isMemberExpressionNode = (path, context) => {
|
|
14628
|
+
try {
|
|
14629
|
+
let ret = parser.parseExpression(path, {
|
|
14630
|
+
plugins: context.expressionPlugins
|
|
14631
|
+
});
|
|
14632
|
+
ret = unwrapTSNode(ret);
|
|
14633
|
+
return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier";
|
|
14634
|
+
} catch (e) {
|
|
14635
|
+
return false;
|
|
14636
|
+
}
|
|
14637
|
+
};
|
|
14118
14638
|
const isMemberExpression = isMemberExpressionNode;
|
|
14119
14639
|
function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
|
|
14120
14640
|
return advancePositionWithMutation(
|
|
@@ -14335,7 +14855,8 @@ const defaultParserOptions = {
|
|
|
14335
14855
|
isCustomElement: NO,
|
|
14336
14856
|
onError: defaultOnError,
|
|
14337
14857
|
onWarn: defaultOnWarn,
|
|
14338
|
-
comments: true
|
|
14858
|
+
comments: true,
|
|
14859
|
+
prefixIdentifiers: false
|
|
14339
14860
|
};
|
|
14340
14861
|
let currentOptions = defaultParserOptions;
|
|
14341
14862
|
let currentRoot = null;
|
|
@@ -14377,7 +14898,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
14377
14898
|
}
|
|
14378
14899
|
addNode({
|
|
14379
14900
|
type: 5,
|
|
14380
|
-
content:
|
|
14901
|
+
content: createExp(exp, false, getLoc(innerStart, innerEnd)),
|
|
14381
14902
|
loc: getLoc(start, end)
|
|
14382
14903
|
});
|
|
14383
14904
|
},
|
|
@@ -14470,7 +14991,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
14470
14991
|
loc: getLoc(start)
|
|
14471
14992
|
};
|
|
14472
14993
|
if (name === "pre") {
|
|
14473
|
-
inVPre = true;
|
|
14994
|
+
inVPre = tokenizer.inVPre = true;
|
|
14474
14995
|
currentVPreBoundary = currentOpenTag;
|
|
14475
14996
|
const props = currentOpenTag.props;
|
|
14476
14997
|
for (let i = 0; i < props.length; i++) {
|
|
@@ -14490,7 +15011,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
14490
15011
|
setLocEnd(currentProp.nameLoc, end);
|
|
14491
15012
|
} else {
|
|
14492
15013
|
const isStatic = arg[0] !== `[`;
|
|
14493
|
-
currentProp.arg =
|
|
15014
|
+
currentProp.arg = createExp(
|
|
14494
15015
|
isStatic ? arg : arg.slice(1, -1),
|
|
14495
15016
|
isStatic,
|
|
14496
15017
|
getLoc(start, end),
|
|
@@ -14557,10 +15078,22 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
14557
15078
|
tokenizer.enterRCDATA(toCharCodes(`</template`), 0);
|
|
14558
15079
|
}
|
|
14559
15080
|
} else {
|
|
14560
|
-
|
|
15081
|
+
let expParseMode = 0 /* Normal */;
|
|
15082
|
+
{
|
|
15083
|
+
if (currentProp.name === "for") {
|
|
15084
|
+
expParseMode = 3 /* Skip */;
|
|
15085
|
+
} else if (currentProp.name === "slot") {
|
|
15086
|
+
expParseMode = 1 /* Params */;
|
|
15087
|
+
} else if (currentProp.name === "on" && currentAttrValue.includes(";")) {
|
|
15088
|
+
expParseMode = 2 /* Statements */;
|
|
15089
|
+
}
|
|
15090
|
+
}
|
|
15091
|
+
currentProp.exp = createExp(
|
|
14561
15092
|
currentAttrValue,
|
|
14562
15093
|
false,
|
|
14563
|
-
getLoc(currentAttrStartIndex, currentAttrEndIndex)
|
|
15094
|
+
getLoc(currentAttrStartIndex, currentAttrEndIndex),
|
|
15095
|
+
0,
|
|
15096
|
+
expParseMode
|
|
14564
15097
|
);
|
|
14565
15098
|
if (currentProp.name === "for") {
|
|
14566
15099
|
currentProp.forParseResult = parseForExpression(currentProp.exp);
|
|
@@ -14663,10 +15196,16 @@ function parseForExpression(input) {
|
|
|
14663
15196
|
if (!inMatch)
|
|
14664
15197
|
return;
|
|
14665
15198
|
const [, LHS, RHS] = inMatch;
|
|
14666
|
-
const createAliasExpression = (content, offset) => {
|
|
15199
|
+
const createAliasExpression = (content, offset, asParam = false) => {
|
|
14667
15200
|
const start = loc.start.offset + offset;
|
|
14668
15201
|
const end = start + content.length;
|
|
14669
|
-
return
|
|
15202
|
+
return createExp(
|
|
15203
|
+
content,
|
|
15204
|
+
false,
|
|
15205
|
+
getLoc(start, end),
|
|
15206
|
+
0,
|
|
15207
|
+
asParam ? 1 /* Params */ : 0 /* Normal */
|
|
15208
|
+
);
|
|
14670
15209
|
};
|
|
14671
15210
|
const result = {
|
|
14672
15211
|
source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),
|
|
@@ -14684,7 +15223,7 @@ function parseForExpression(input) {
|
|
|
14684
15223
|
let keyOffset;
|
|
14685
15224
|
if (keyContent) {
|
|
14686
15225
|
keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
|
|
14687
|
-
result.key = createAliasExpression(keyContent, keyOffset);
|
|
15226
|
+
result.key = createAliasExpression(keyContent, keyOffset, true);
|
|
14688
15227
|
}
|
|
14689
15228
|
if (iteratorMatch[2]) {
|
|
14690
15229
|
const indexContent = iteratorMatch[2].trim();
|
|
@@ -14694,13 +15233,14 @@ function parseForExpression(input) {
|
|
|
14694
15233
|
exp.indexOf(
|
|
14695
15234
|
indexContent,
|
|
14696
15235
|
result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
|
|
14697
|
-
)
|
|
15236
|
+
),
|
|
15237
|
+
true
|
|
14698
15238
|
);
|
|
14699
15239
|
}
|
|
14700
15240
|
}
|
|
14701
15241
|
}
|
|
14702
15242
|
if (valueContent) {
|
|
14703
|
-
result.value = createAliasExpression(valueContent, trimmedOffset);
|
|
15243
|
+
result.value = createAliasExpression(valueContent, trimmedOffset, true);
|
|
14704
15244
|
}
|
|
14705
15245
|
return result;
|
|
14706
15246
|
}
|
|
@@ -14771,7 +15311,7 @@ function onCloseTag(el, end, isImplied = false) {
|
|
|
14771
15311
|
inPre--;
|
|
14772
15312
|
}
|
|
14773
15313
|
if (currentVPreBoundary === el) {
|
|
14774
|
-
inVPre = false;
|
|
15314
|
+
inVPre = tokenizer.inVPre = false;
|
|
14775
15315
|
currentVPreBoundary = null;
|
|
14776
15316
|
}
|
|
14777
15317
|
if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
|
|
@@ -15006,8 +15546,36 @@ function dirToAttr(dir) {
|
|
|
15006
15546
|
}
|
|
15007
15547
|
return attr;
|
|
15008
15548
|
}
|
|
15009
|
-
function
|
|
15010
|
-
|
|
15549
|
+
function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) {
|
|
15550
|
+
const exp = createSimpleExpression(content, isStatic, loc, constType);
|
|
15551
|
+
if (!isStatic && currentOptions.prefixIdentifiers && parseMode !== 3 /* Skip */ && content.trim()) {
|
|
15552
|
+
if (isSimpleIdentifier(content)) {
|
|
15553
|
+
exp.ast = null;
|
|
15554
|
+
return exp;
|
|
15555
|
+
}
|
|
15556
|
+
try {
|
|
15557
|
+
const plugins = currentOptions.expressionPlugins;
|
|
15558
|
+
const options = {
|
|
15559
|
+
plugins: plugins ? [...plugins, "typescript"] : ["typescript"]
|
|
15560
|
+
};
|
|
15561
|
+
if (parseMode === 2 /* Statements */) {
|
|
15562
|
+
exp.ast = parser.parse(` ${content} `, options).program;
|
|
15563
|
+
} else if (parseMode === 1 /* Params */) {
|
|
15564
|
+
exp.ast = parser.parseExpression(`(${content})=>{}`, options);
|
|
15565
|
+
} else {
|
|
15566
|
+
exp.ast = parser.parseExpression(`(${content})`, options);
|
|
15567
|
+
}
|
|
15568
|
+
} catch (e) {
|
|
15569
|
+
exp.ast = false;
|
|
15570
|
+
emitError(45, loc.start.offset, e.message);
|
|
15571
|
+
}
|
|
15572
|
+
}
|
|
15573
|
+
return exp;
|
|
15574
|
+
}
|
|
15575
|
+
function emitError(code, index, message) {
|
|
15576
|
+
currentOptions.onError(
|
|
15577
|
+
createCompilerError(code, getLoc(index, index), void 0, message)
|
|
15578
|
+
);
|
|
15011
15579
|
}
|
|
15012
15580
|
function reset() {
|
|
15013
15581
|
tokenizer.reset();
|
|
@@ -15038,6 +15606,7 @@ function baseParse(input, options) {
|
|
|
15038
15606
|
}
|
|
15039
15607
|
}
|
|
15040
15608
|
tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
|
|
15609
|
+
tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
|
|
15041
15610
|
const delimiters = options == null ? void 0 : options.delimiters;
|
|
15042
15611
|
if (delimiters) {
|
|
15043
15612
|
tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
|
|
@@ -15322,6 +15891,7 @@ function createTransformContext(root, {
|
|
|
15322
15891
|
const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
|
|
15323
15892
|
const context = {
|
|
15324
15893
|
// options
|
|
15894
|
+
filename,
|
|
15325
15895
|
selfName: nameMatch && capitalize(camelize(nameMatch[1])),
|
|
15326
15896
|
prefixIdentifiers,
|
|
15327
15897
|
hoistStatic: hoistStatic2,
|
|
@@ -16326,332 +16896,74 @@ function genCacheExpression(node, context) {
|
|
|
16326
16896
|
push(`,`);
|
|
16327
16897
|
newline();
|
|
16328
16898
|
push(`${helper(SET_BLOCK_TRACKING)}(1),`);
|
|
16329
|
-
newline();
|
|
16330
|
-
push(`_cache[${node.index}]`);
|
|
16331
|
-
deindent();
|
|
16332
|
-
}
|
|
16333
|
-
push(`)`);
|
|
16334
|
-
}
|
|
16335
|
-
function genTemplateLiteral(node, context) {
|
|
16336
|
-
const { push, indent, deindent } = context;
|
|
16337
|
-
push("`");
|
|
16338
|
-
const l = node.elements.length;
|
|
16339
|
-
const multilines = l > 3;
|
|
16340
|
-
for (let i = 0; i < l; i++) {
|
|
16341
|
-
const e = node.elements[i];
|
|
16342
|
-
if (isString(e)) {
|
|
16343
|
-
push(e.replace(/(`|\$|\\)/g, "\\$1"), -3 /* Unknown */);
|
|
16344
|
-
} else {
|
|
16345
|
-
push("${");
|
|
16346
|
-
if (multilines)
|
|
16347
|
-
indent();
|
|
16348
|
-
genNode(e, context);
|
|
16349
|
-
if (multilines)
|
|
16350
|
-
deindent();
|
|
16351
|
-
push("}");
|
|
16352
|
-
}
|
|
16353
|
-
}
|
|
16354
|
-
push("`");
|
|
16355
|
-
}
|
|
16356
|
-
function genIfStatement(node, context) {
|
|
16357
|
-
const { push, indent, deindent } = context;
|
|
16358
|
-
const { test, consequent, alternate } = node;
|
|
16359
|
-
push(`if (`);
|
|
16360
|
-
genNode(test, context);
|
|
16361
|
-
push(`) {`);
|
|
16362
|
-
indent();
|
|
16363
|
-
genNode(consequent, context);
|
|
16364
|
-
deindent();
|
|
16365
|
-
push(`}`);
|
|
16366
|
-
if (alternate) {
|
|
16367
|
-
push(` else `);
|
|
16368
|
-
if (alternate.type === 23) {
|
|
16369
|
-
genIfStatement(alternate, context);
|
|
16370
|
-
} else {
|
|
16371
|
-
push(`{`);
|
|
16372
|
-
indent();
|
|
16373
|
-
genNode(alternate, context);
|
|
16374
|
-
deindent();
|
|
16375
|
-
push(`}`);
|
|
16376
|
-
}
|
|
16377
|
-
}
|
|
16378
|
-
}
|
|
16379
|
-
function genAssignmentExpression(node, context) {
|
|
16380
|
-
genNode(node.left, context);
|
|
16381
|
-
context.push(` = `);
|
|
16382
|
-
genNode(node.right, context);
|
|
16383
|
-
}
|
|
16384
|
-
function genSequenceExpression(node, context) {
|
|
16385
|
-
context.push(`(`);
|
|
16386
|
-
genNodeList(node.expressions, context);
|
|
16387
|
-
context.push(`)`);
|
|
16388
|
-
}
|
|
16389
|
-
function genReturnStatement({ returns }, context) {
|
|
16390
|
-
context.push(`return `);
|
|
16391
|
-
if (isArray(returns)) {
|
|
16392
|
-
genNodeListAsArray(returns, context);
|
|
16393
|
-
} else {
|
|
16394
|
-
genNode(returns, context);
|
|
16395
|
-
}
|
|
16396
|
-
}
|
|
16397
|
-
|
|
16398
|
-
function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
|
|
16399
|
-
const rootExp = root.type === "Program" && root.body[0].type === "ExpressionStatement" && root.body[0].expression;
|
|
16400
|
-
estreeWalker.walk(root, {
|
|
16401
|
-
enter(node, parent) {
|
|
16402
|
-
parent && parentStack.push(parent);
|
|
16403
|
-
if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) {
|
|
16404
|
-
return this.skip();
|
|
16405
|
-
}
|
|
16406
|
-
if (node.type === "Identifier") {
|
|
16407
|
-
const isLocal = !!knownIds[node.name];
|
|
16408
|
-
const isRefed = isReferencedIdentifier(node, parent, parentStack);
|
|
16409
|
-
if (includeAll || isRefed && !isLocal) {
|
|
16410
|
-
onIdentifier(node, parent, parentStack, isRefed, isLocal);
|
|
16411
|
-
}
|
|
16412
|
-
} else if (node.type === "ObjectProperty" && parent.type === "ObjectPattern") {
|
|
16413
|
-
node.inPattern = true;
|
|
16414
|
-
} else if (isFunctionType(node)) {
|
|
16415
|
-
walkFunctionParams(node, (id) => markScopeIdentifier(node, id, knownIds));
|
|
16416
|
-
} else if (node.type === "BlockStatement") {
|
|
16417
|
-
walkBlockDeclarations(
|
|
16418
|
-
node,
|
|
16419
|
-
(id) => markScopeIdentifier(node, id, knownIds)
|
|
16420
|
-
);
|
|
16421
|
-
}
|
|
16422
|
-
},
|
|
16423
|
-
leave(node, parent) {
|
|
16424
|
-
parent && parentStack.pop();
|
|
16425
|
-
if (node !== rootExp && node.scopeIds) {
|
|
16426
|
-
for (const id of node.scopeIds) {
|
|
16427
|
-
knownIds[id]--;
|
|
16428
|
-
if (knownIds[id] === 0) {
|
|
16429
|
-
delete knownIds[id];
|
|
16430
|
-
}
|
|
16431
|
-
}
|
|
16432
|
-
}
|
|
16433
|
-
}
|
|
16434
|
-
});
|
|
16435
|
-
}
|
|
16436
|
-
function isReferencedIdentifier(id, parent, parentStack) {
|
|
16437
|
-
if (!parent) {
|
|
16438
|
-
return true;
|
|
16439
|
-
}
|
|
16440
|
-
if (id.name === "arguments") {
|
|
16441
|
-
return false;
|
|
16442
|
-
}
|
|
16443
|
-
if (isReferenced(id, parent)) {
|
|
16444
|
-
return true;
|
|
16445
|
-
}
|
|
16446
|
-
switch (parent.type) {
|
|
16447
|
-
case "AssignmentExpression":
|
|
16448
|
-
case "AssignmentPattern":
|
|
16449
|
-
return true;
|
|
16450
|
-
case "ObjectPattern":
|
|
16451
|
-
case "ArrayPattern":
|
|
16452
|
-
return isInDestructureAssignment(parent, parentStack);
|
|
16453
|
-
}
|
|
16454
|
-
return false;
|
|
16455
|
-
}
|
|
16456
|
-
function isInDestructureAssignment(parent, parentStack) {
|
|
16457
|
-
if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) {
|
|
16458
|
-
let i = parentStack.length;
|
|
16459
|
-
while (i--) {
|
|
16460
|
-
const p = parentStack[i];
|
|
16461
|
-
if (p.type === "AssignmentExpression") {
|
|
16462
|
-
return true;
|
|
16463
|
-
} else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) {
|
|
16464
|
-
break;
|
|
16465
|
-
}
|
|
16466
|
-
}
|
|
16899
|
+
newline();
|
|
16900
|
+
push(`_cache[${node.index}]`);
|
|
16901
|
+
deindent();
|
|
16467
16902
|
}
|
|
16468
|
-
|
|
16903
|
+
push(`)`);
|
|
16469
16904
|
}
|
|
16470
|
-
function
|
|
16471
|
-
|
|
16472
|
-
|
|
16473
|
-
|
|
16905
|
+
function genTemplateLiteral(node, context) {
|
|
16906
|
+
const { push, indent, deindent } = context;
|
|
16907
|
+
push("`");
|
|
16908
|
+
const l = node.elements.length;
|
|
16909
|
+
const multilines = l > 3;
|
|
16910
|
+
for (let i = 0; i < l; i++) {
|
|
16911
|
+
const e = node.elements[i];
|
|
16912
|
+
if (isString(e)) {
|
|
16913
|
+
push(e.replace(/(`|\$|\\)/g, "\\$1"), -3 /* Unknown */);
|
|
16914
|
+
} else {
|
|
16915
|
+
push("${");
|
|
16916
|
+
if (multilines)
|
|
16917
|
+
indent();
|
|
16918
|
+
genNode(e, context);
|
|
16919
|
+
if (multilines)
|
|
16920
|
+
deindent();
|
|
16921
|
+
push("}");
|
|
16474
16922
|
}
|
|
16475
16923
|
}
|
|
16924
|
+
push("`");
|
|
16476
16925
|
}
|
|
16477
|
-
function
|
|
16478
|
-
|
|
16479
|
-
|
|
16480
|
-
|
|
16481
|
-
|
|
16482
|
-
|
|
16483
|
-
|
|
16484
|
-
|
|
16485
|
-
|
|
16486
|
-
|
|
16487
|
-
|
|
16488
|
-
|
|
16489
|
-
|
|
16490
|
-
|
|
16491
|
-
} else
|
|
16492
|
-
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
|
|
16497
|
-
}
|
|
16498
|
-
}
|
|
16499
|
-
}
|
|
16926
|
+
function genIfStatement(node, context) {
|
|
16927
|
+
const { push, indent, deindent } = context;
|
|
16928
|
+
const { test, consequent, alternate } = node;
|
|
16929
|
+
push(`if (`);
|
|
16930
|
+
genNode(test, context);
|
|
16931
|
+
push(`) {`);
|
|
16932
|
+
indent();
|
|
16933
|
+
genNode(consequent, context);
|
|
16934
|
+
deindent();
|
|
16935
|
+
push(`}`);
|
|
16936
|
+
if (alternate) {
|
|
16937
|
+
push(` else `);
|
|
16938
|
+
if (alternate.type === 23) {
|
|
16939
|
+
genIfStatement(alternate, context);
|
|
16940
|
+
} else {
|
|
16941
|
+
push(`{`);
|
|
16942
|
+
indent();
|
|
16943
|
+
genNode(alternate, context);
|
|
16944
|
+
deindent();
|
|
16945
|
+
push(`}`);
|
|
16500
16946
|
}
|
|
16501
16947
|
}
|
|
16502
16948
|
}
|
|
16503
|
-
function
|
|
16504
|
-
|
|
16505
|
-
|
|
16506
|
-
|
|
16507
|
-
break;
|
|
16508
|
-
case "MemberExpression":
|
|
16509
|
-
let object = param;
|
|
16510
|
-
while (object.type === "MemberExpression") {
|
|
16511
|
-
object = object.object;
|
|
16512
|
-
}
|
|
16513
|
-
nodes.push(object);
|
|
16514
|
-
break;
|
|
16515
|
-
case "ObjectPattern":
|
|
16516
|
-
for (const prop of param.properties) {
|
|
16517
|
-
if (prop.type === "RestElement") {
|
|
16518
|
-
extractIdentifiers(prop.argument, nodes);
|
|
16519
|
-
} else {
|
|
16520
|
-
extractIdentifiers(prop.value, nodes);
|
|
16521
|
-
}
|
|
16522
|
-
}
|
|
16523
|
-
break;
|
|
16524
|
-
case "ArrayPattern":
|
|
16525
|
-
param.elements.forEach((element) => {
|
|
16526
|
-
if (element)
|
|
16527
|
-
extractIdentifiers(element, nodes);
|
|
16528
|
-
});
|
|
16529
|
-
break;
|
|
16530
|
-
case "RestElement":
|
|
16531
|
-
extractIdentifiers(param.argument, nodes);
|
|
16532
|
-
break;
|
|
16533
|
-
case "AssignmentPattern":
|
|
16534
|
-
extractIdentifiers(param.left, nodes);
|
|
16535
|
-
break;
|
|
16536
|
-
}
|
|
16537
|
-
return nodes;
|
|
16949
|
+
function genAssignmentExpression(node, context) {
|
|
16950
|
+
genNode(node.left, context);
|
|
16951
|
+
context.push(` = `);
|
|
16952
|
+
genNode(node.right, context);
|
|
16538
16953
|
}
|
|
16539
|
-
function
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
}
|
|
16544
|
-
if (name in knownIds) {
|
|
16545
|
-
knownIds[name]++;
|
|
16546
|
-
} else {
|
|
16547
|
-
knownIds[name] = 1;
|
|
16548
|
-
}
|
|
16549
|
-
(node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name);
|
|
16954
|
+
function genSequenceExpression(node, context) {
|
|
16955
|
+
context.push(`(`);
|
|
16956
|
+
genNodeList(node.expressions, context);
|
|
16957
|
+
context.push(`)`);
|
|
16550
16958
|
}
|
|
16551
|
-
|
|
16552
|
-
return
|
|
16553
|
-
|
|
16554
|
-
|
|
16555
|
-
|
|
16556
|
-
|
|
16557
|
-
switch (parent.type) {
|
|
16558
|
-
case "MemberExpression":
|
|
16559
|
-
case "OptionalMemberExpression":
|
|
16560
|
-
if (parent.property === node) {
|
|
16561
|
-
return !!parent.computed;
|
|
16562
|
-
}
|
|
16563
|
-
return parent.object === node;
|
|
16564
|
-
case "JSXMemberExpression":
|
|
16565
|
-
return parent.object === node;
|
|
16566
|
-
case "VariableDeclarator":
|
|
16567
|
-
return parent.init === node;
|
|
16568
|
-
case "ArrowFunctionExpression":
|
|
16569
|
-
return parent.body === node;
|
|
16570
|
-
case "PrivateName":
|
|
16571
|
-
return false;
|
|
16572
|
-
case "ClassMethod":
|
|
16573
|
-
case "ClassPrivateMethod":
|
|
16574
|
-
case "ObjectMethod":
|
|
16575
|
-
if (parent.key === node) {
|
|
16576
|
-
return !!parent.computed;
|
|
16577
|
-
}
|
|
16578
|
-
return false;
|
|
16579
|
-
case "ObjectProperty":
|
|
16580
|
-
if (parent.key === node) {
|
|
16581
|
-
return !!parent.computed;
|
|
16582
|
-
}
|
|
16583
|
-
return !grandparent || grandparent.type !== "ObjectPattern";
|
|
16584
|
-
case "ClassProperty":
|
|
16585
|
-
if (parent.key === node) {
|
|
16586
|
-
return !!parent.computed;
|
|
16587
|
-
}
|
|
16588
|
-
return true;
|
|
16589
|
-
case "ClassPrivateProperty":
|
|
16590
|
-
return parent.key !== node;
|
|
16591
|
-
case "ClassDeclaration":
|
|
16592
|
-
case "ClassExpression":
|
|
16593
|
-
return parent.superClass === node;
|
|
16594
|
-
case "AssignmentExpression":
|
|
16595
|
-
return parent.right === node;
|
|
16596
|
-
case "AssignmentPattern":
|
|
16597
|
-
return parent.right === node;
|
|
16598
|
-
case "LabeledStatement":
|
|
16599
|
-
return false;
|
|
16600
|
-
case "CatchClause":
|
|
16601
|
-
return false;
|
|
16602
|
-
case "RestElement":
|
|
16603
|
-
return false;
|
|
16604
|
-
case "BreakStatement":
|
|
16605
|
-
case "ContinueStatement":
|
|
16606
|
-
return false;
|
|
16607
|
-
case "FunctionDeclaration":
|
|
16608
|
-
case "FunctionExpression":
|
|
16609
|
-
return false;
|
|
16610
|
-
case "ExportNamespaceSpecifier":
|
|
16611
|
-
case "ExportDefaultSpecifier":
|
|
16612
|
-
return false;
|
|
16613
|
-
case "ExportSpecifier":
|
|
16614
|
-
if (grandparent == null ? void 0 : grandparent.source) {
|
|
16615
|
-
return false;
|
|
16616
|
-
}
|
|
16617
|
-
return parent.local === node;
|
|
16618
|
-
case "ImportDefaultSpecifier":
|
|
16619
|
-
case "ImportNamespaceSpecifier":
|
|
16620
|
-
case "ImportSpecifier":
|
|
16621
|
-
return false;
|
|
16622
|
-
case "ImportAttribute":
|
|
16623
|
-
return false;
|
|
16624
|
-
case "JSXAttribute":
|
|
16625
|
-
return false;
|
|
16626
|
-
case "ObjectPattern":
|
|
16627
|
-
case "ArrayPattern":
|
|
16628
|
-
return false;
|
|
16629
|
-
case "MetaProperty":
|
|
16630
|
-
return false;
|
|
16631
|
-
case "ObjectTypeProperty":
|
|
16632
|
-
return parent.key !== node;
|
|
16633
|
-
case "TSEnumMember":
|
|
16634
|
-
return parent.id !== node;
|
|
16635
|
-
case "TSPropertySignature":
|
|
16636
|
-
if (parent.key === node) {
|
|
16637
|
-
return !!parent.computed;
|
|
16638
|
-
}
|
|
16639
|
-
return true;
|
|
16959
|
+
function genReturnStatement({ returns }, context) {
|
|
16960
|
+
context.push(`return `);
|
|
16961
|
+
if (isArray(returns)) {
|
|
16962
|
+
genNodeListAsArray(returns, context);
|
|
16963
|
+
} else {
|
|
16964
|
+
genNode(returns, context);
|
|
16640
16965
|
}
|
|
16641
|
-
return true;
|
|
16642
16966
|
}
|
|
16643
|
-
const TS_NODE_TYPES = [
|
|
16644
|
-
"TSAsExpression",
|
|
16645
|
-
// foo as number
|
|
16646
|
-
"TSTypeAssertion",
|
|
16647
|
-
// (<number>foo)
|
|
16648
|
-
"TSNonNullExpression",
|
|
16649
|
-
// foo!
|
|
16650
|
-
"TSInstantiationExpression",
|
|
16651
|
-
// foo<string>
|
|
16652
|
-
"TSSatisfiesExpression"
|
|
16653
|
-
// foo satisfies T
|
|
16654
|
-
];
|
|
16655
16967
|
|
|
16656
16968
|
const isLiteralWhitelisted = /* @__PURE__ */ makeMap("true,false,null,this");
|
|
16657
16969
|
const constantBailRE = /\w\s*\(|\.[^\d]/;
|
|
@@ -16745,7 +17057,11 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
16745
17057
|
};
|
|
16746
17058
|
const rawExp = node.content;
|
|
16747
17059
|
const bailConstant = constantBailRE.test(rawExp);
|
|
16748
|
-
|
|
17060
|
+
let ast = node.ast;
|
|
17061
|
+
if (ast === false) {
|
|
17062
|
+
return node;
|
|
17063
|
+
}
|
|
17064
|
+
if (ast === null || !ast && isSimpleIdentifier(rawExp)) {
|
|
16749
17065
|
const isScopeVarReference = context.identifiers[rawExp];
|
|
16750
17066
|
const isAllowedGlobal = isGloballyAllowed(rawExp);
|
|
16751
17067
|
const isLiteral = isLiteralWhitelisted(rawExp);
|
|
@@ -16763,22 +17079,23 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
16763
17079
|
}
|
|
16764
17080
|
return node;
|
|
16765
17081
|
}
|
|
16766
|
-
|
|
16767
|
-
|
|
16768
|
-
|
|
16769
|
-
|
|
16770
|
-
|
|
16771
|
-
|
|
16772
|
-
|
|
16773
|
-
|
|
16774
|
-
|
|
16775
|
-
|
|
16776
|
-
|
|
16777
|
-
|
|
16778
|
-
|
|
16779
|
-
|
|
16780
|
-
|
|
16781
|
-
|
|
17082
|
+
if (!ast) {
|
|
17083
|
+
const source = asRawStatements ? ` ${rawExp} ` : `(${rawExp})${asParams ? `=>{}` : ``}`;
|
|
17084
|
+
try {
|
|
17085
|
+
ast = parser.parse(source, {
|
|
17086
|
+
plugins: context.expressionPlugins
|
|
17087
|
+
}).program;
|
|
17088
|
+
} catch (e) {
|
|
17089
|
+
context.onError(
|
|
17090
|
+
createCompilerError(
|
|
17091
|
+
45,
|
|
17092
|
+
node.loc,
|
|
17093
|
+
void 0,
|
|
17094
|
+
e.message
|
|
17095
|
+
)
|
|
17096
|
+
);
|
|
17097
|
+
return node;
|
|
17098
|
+
}
|
|
16782
17099
|
}
|
|
16783
17100
|
const ids = [];
|
|
16784
17101
|
const parentStack = [];
|
|
@@ -16821,15 +17138,15 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
16821
17138
|
if (leadingText.length || id.prefix) {
|
|
16822
17139
|
children.push(leadingText + (id.prefix || ``));
|
|
16823
17140
|
}
|
|
16824
|
-
const
|
|
17141
|
+
const source = rawExp.slice(start, end);
|
|
16825
17142
|
children.push(
|
|
16826
17143
|
createSimpleExpression(
|
|
16827
17144
|
id.name,
|
|
16828
17145
|
false,
|
|
16829
17146
|
{
|
|
16830
|
-
start: advancePositionWithClone(node.loc.start,
|
|
16831
|
-
end: advancePositionWithClone(node.loc.start,
|
|
16832
|
-
source
|
|
17147
|
+
start: advancePositionWithClone(node.loc.start, source, start),
|
|
17148
|
+
end: advancePositionWithClone(node.loc.start, source, end),
|
|
17149
|
+
source
|
|
16833
17150
|
},
|
|
16834
17151
|
id.isConstant ? 3 : 0
|
|
16835
17152
|
)
|
|
@@ -16841,6 +17158,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
16841
17158
|
let ret;
|
|
16842
17159
|
if (children.length) {
|
|
16843
17160
|
ret = createCompoundExpression(children, node.loc);
|
|
17161
|
+
ret.ast = ast;
|
|
16844
17162
|
} else {
|
|
16845
17163
|
ret = node;
|
|
16846
17164
|
ret.constType = bailConstant ? 0 : 3;
|
|
@@ -17800,6 +18118,10 @@ function resolveSetupReference(name, context) {
|
|
|
17800
18118
|
`${context.helperString(UNREF)}(${fromMaybeRef})`
|
|
17801
18119
|
) : `$setup[${JSON.stringify(fromMaybeRef)}]`;
|
|
17802
18120
|
}
|
|
18121
|
+
const fromProps = checkType("props");
|
|
18122
|
+
if (fromProps) {
|
|
18123
|
+
return `${context.helperString(UNREF)}(${context.inline ? "__props" : "$props"}[${JSON.stringify(fromProps)}])`;
|
|
18124
|
+
}
|
|
17803
18125
|
}
|
|
17804
18126
|
function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
|
|
17805
18127
|
const { tag, loc: elementLoc, children } = node;
|
|
@@ -17840,6 +18162,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
17840
18162
|
if (isEventHandler && isReservedProp(name)) {
|
|
17841
18163
|
hasVnodeHook = true;
|
|
17842
18164
|
}
|
|
18165
|
+
if (isEventHandler && value.type === 14) {
|
|
18166
|
+
value = value.arguments[0];
|
|
18167
|
+
}
|
|
17843
18168
|
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
|
|
17844
18169
|
return;
|
|
17845
18170
|
}
|
|
@@ -18307,9 +18632,7 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
18307
18632
|
if (arg.isStatic) {
|
|
18308
18633
|
let rawName = arg.content;
|
|
18309
18634
|
if (rawName.startsWith("vnode")) {
|
|
18310
|
-
context.
|
|
18311
|
-
createCompilerError(51, arg.loc)
|
|
18312
|
-
);
|
|
18635
|
+
context.onError(createCompilerError(51, arg.loc));
|
|
18313
18636
|
}
|
|
18314
18637
|
if (rawName.startsWith("vue:")) {
|
|
18315
18638
|
rawName = `vnode-${rawName.slice(4)}`;
|
|
@@ -18848,7 +19171,10 @@ function baseCompile(source, options = {}) {
|
|
|
18848
19171
|
if (options.scopeId && !isModuleMode) {
|
|
18849
19172
|
onError(createCompilerError(50));
|
|
18850
19173
|
}
|
|
18851
|
-
const
|
|
19174
|
+
const resolvedOptions = extend({}, options, {
|
|
19175
|
+
prefixIdentifiers
|
|
19176
|
+
});
|
|
19177
|
+
const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
|
|
18852
19178
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);
|
|
18853
19179
|
if (options.isTS) {
|
|
18854
19180
|
const { expressionPlugins } = options;
|
|
@@ -18858,8 +19184,7 @@ function baseCompile(source, options = {}) {
|
|
|
18858
19184
|
}
|
|
18859
19185
|
transform(
|
|
18860
19186
|
ast,
|
|
18861
|
-
extend({},
|
|
18862
|
-
prefixIdentifiers,
|
|
19187
|
+
extend({}, resolvedOptions, {
|
|
18863
19188
|
nodeTransforms: [
|
|
18864
19189
|
...nodeTransforms,
|
|
18865
19190
|
...options.nodeTransforms || []
|
|
@@ -18873,12 +19198,7 @@ function baseCompile(source, options = {}) {
|
|
|
18873
19198
|
)
|
|
18874
19199
|
})
|
|
18875
19200
|
);
|
|
18876
|
-
return generate(
|
|
18877
|
-
ast,
|
|
18878
|
-
extend({}, options, {
|
|
18879
|
-
prefixIdentifiers
|
|
18880
|
-
})
|
|
18881
|
-
);
|
|
19201
|
+
return generate(ast, resolvedOptions);
|
|
18882
19202
|
}
|
|
18883
19203
|
|
|
18884
19204
|
const noopDirectiveTransform = () => ({ props: [] });
|
|
@@ -18909,7 +19229,7 @@ registerRuntimeHelpers({
|
|
|
18909
19229
|
const parserOptions = {
|
|
18910
19230
|
parseMode: "html",
|
|
18911
19231
|
isVoidTag,
|
|
18912
|
-
isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag),
|
|
19232
|
+
isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
|
|
18913
19233
|
isPreTag: (tag) => tag === "pre",
|
|
18914
19234
|
decodeEntities: void 0,
|
|
18915
19235
|
isBuiltInComponent: (tag) => {
|