@vue/compat 3.4.0-alpha.4 → 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 +722 -553
- package/dist/vue.cjs.prod.js +661 -540
- package/dist/vue.esm-browser.js +447 -265
- package/dist/vue.esm-browser.prod.js +5 -5
- package/dist/vue.esm-bundler.js +485 -284
- package/dist/vue.global.js +447 -265
- package/dist/vue.global.prod.js +5 -5
- package/dist/vue.runtime.esm-browser.js +429 -245
- package/dist/vue.runtime.esm-browser.prod.js +5 -5
- package/dist/vue.runtime.esm-bundler.js +467 -264
- package/dist/vue.runtime.global.js +429 -245
- package/dist/vue.runtime.global.prod.js +5 -5
- package/package.json +2 -2
package/dist/vue.cjs.prod.js
CHANGED
|
@@ -187,9 +187,11 @@ function normalizeProps(props) {
|
|
|
187
187
|
|
|
188
188
|
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";
|
|
189
189
|
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";
|
|
190
|
+
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";
|
|
190
191
|
const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
|
|
191
192
|
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
|
192
193
|
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
|
194
|
+
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
193
195
|
const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
|
|
194
196
|
|
|
195
197
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
@@ -204,7 +206,7 @@ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
|
|
|
204
206
|
`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`
|
|
205
207
|
);
|
|
206
208
|
const isKnownSvgAttr = /* @__PURE__ */ makeMap(
|
|
207
|
-
`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`
|
|
209
|
+
`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`
|
|
208
210
|
);
|
|
209
211
|
|
|
210
212
|
const escapeRE = /["'&<>]/;
|
|
@@ -307,20 +309,29 @@ const replacer = (_key, val) => {
|
|
|
307
309
|
return replacer(_key, val.value);
|
|
308
310
|
} else if (isMap(val)) {
|
|
309
311
|
return {
|
|
310
|
-
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
311
|
-
entries[
|
|
312
|
-
|
|
313
|
-
|
|
312
|
+
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
313
|
+
(entries, [key, val2], i) => {
|
|
314
|
+
entries[stringifySymbol(key, i) + " =>"] = val2;
|
|
315
|
+
return entries;
|
|
316
|
+
},
|
|
317
|
+
{}
|
|
318
|
+
)
|
|
314
319
|
};
|
|
315
320
|
} else if (isSet(val)) {
|
|
316
321
|
return {
|
|
317
|
-
[`Set(${val.size})`]: [...val.values()]
|
|
322
|
+
[`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
|
|
318
323
|
};
|
|
324
|
+
} else if (isSymbol(val)) {
|
|
325
|
+
return stringifySymbol(val);
|
|
319
326
|
} else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
|
|
320
327
|
return String(val);
|
|
321
328
|
}
|
|
322
329
|
return val;
|
|
323
330
|
};
|
|
331
|
+
const stringifySymbol = (v, i = "") => {
|
|
332
|
+
var _a;
|
|
333
|
+
return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
|
|
334
|
+
};
|
|
324
335
|
|
|
325
336
|
let activeEffectScope;
|
|
326
337
|
class EffectScope {
|
|
@@ -736,8 +747,13 @@ class BaseReactiveHandler {
|
|
|
736
747
|
return isReadonly2;
|
|
737
748
|
} else if (key === "__v_isShallow") {
|
|
738
749
|
return shallow;
|
|
739
|
-
} else if (key === "__v_raw"
|
|
740
|
-
|
|
750
|
+
} else if (key === "__v_raw") {
|
|
751
|
+
if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
|
|
752
|
+
// this means the reciever is a user proxy of the reactive proxy
|
|
753
|
+
Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
|
|
754
|
+
return target;
|
|
755
|
+
}
|
|
756
|
+
return;
|
|
741
757
|
}
|
|
742
758
|
const targetIsArray = isArray(target);
|
|
743
759
|
if (!isReadonly2) {
|
|
@@ -773,17 +789,19 @@ class MutableReactiveHandler extends BaseReactiveHandler {
|
|
|
773
789
|
}
|
|
774
790
|
set(target, key, value, receiver) {
|
|
775
791
|
let oldValue = target[key];
|
|
776
|
-
if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
|
|
777
|
-
return false;
|
|
778
|
-
}
|
|
779
792
|
if (!this._shallow) {
|
|
793
|
+
const isOldValueReadonly = isReadonly(oldValue);
|
|
780
794
|
if (!isShallow(value) && !isReadonly(value)) {
|
|
781
795
|
oldValue = toRaw(oldValue);
|
|
782
796
|
value = toRaw(value);
|
|
783
797
|
}
|
|
784
798
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
785
|
-
|
|
786
|
-
|
|
799
|
+
if (isOldValueReadonly) {
|
|
800
|
+
return false;
|
|
801
|
+
} else {
|
|
802
|
+
oldValue.value = value;
|
|
803
|
+
return true;
|
|
804
|
+
}
|
|
787
805
|
}
|
|
788
806
|
}
|
|
789
807
|
const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
|
|
@@ -1596,10 +1614,13 @@ function queuePostFlushCb(cb) {
|
|
|
1596
1614
|
}
|
|
1597
1615
|
queueFlush();
|
|
1598
1616
|
}
|
|
1599
|
-
function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
1617
|
+
function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
1600
1618
|
for (; i < queue.length; i++) {
|
|
1601
1619
|
const cb = queue[i];
|
|
1602
1620
|
if (cb && cb.pre) {
|
|
1621
|
+
if (instance && cb.id !== instance.uid) {
|
|
1622
|
+
continue;
|
|
1623
|
+
}
|
|
1603
1624
|
queue.splice(i, 1);
|
|
1604
1625
|
i--;
|
|
1605
1626
|
cb();
|
|
@@ -2264,9 +2285,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
2264
2285
|
return false;
|
|
2265
2286
|
}
|
|
2266
2287
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
2267
|
-
while (parent
|
|
2268
|
-
|
|
2269
|
-
|
|
2288
|
+
while (parent) {
|
|
2289
|
+
const root = parent.subTree;
|
|
2290
|
+
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
2291
|
+
root.el = vnode.el;
|
|
2292
|
+
}
|
|
2293
|
+
if (root === vnode) {
|
|
2294
|
+
(vnode = parent.vnode).el = el;
|
|
2295
|
+
parent = parent.parent;
|
|
2296
|
+
} else {
|
|
2297
|
+
break;
|
|
2298
|
+
}
|
|
2270
2299
|
}
|
|
2271
2300
|
}
|
|
2272
2301
|
|
|
@@ -2321,6 +2350,7 @@ function resolve(registry, name) {
|
|
|
2321
2350
|
}
|
|
2322
2351
|
|
|
2323
2352
|
const isSuspense = (type) => type.__isSuspense;
|
|
2353
|
+
let suspenseId = 0;
|
|
2324
2354
|
const SuspenseImpl = {
|
|
2325
2355
|
name: "Suspense",
|
|
2326
2356
|
// In order to make Suspense tree-shakable, we need to avoid importing it
|
|
@@ -2328,7 +2358,7 @@ const SuspenseImpl = {
|
|
|
2328
2358
|
// on a vnode's type and calls the `process` method, passing in renderer
|
|
2329
2359
|
// internals.
|
|
2330
2360
|
__isSuspense: true,
|
|
2331
|
-
process(n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
2361
|
+
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
2332
2362
|
if (n1 == null) {
|
|
2333
2363
|
mountSuspense(
|
|
2334
2364
|
n2,
|
|
@@ -2336,7 +2366,7 @@ const SuspenseImpl = {
|
|
|
2336
2366
|
anchor,
|
|
2337
2367
|
parentComponent,
|
|
2338
2368
|
parentSuspense,
|
|
2339
|
-
|
|
2369
|
+
namespace,
|
|
2340
2370
|
slotScopeIds,
|
|
2341
2371
|
optimized,
|
|
2342
2372
|
rendererInternals
|
|
@@ -2348,7 +2378,7 @@ const SuspenseImpl = {
|
|
|
2348
2378
|
container,
|
|
2349
2379
|
anchor,
|
|
2350
2380
|
parentComponent,
|
|
2351
|
-
|
|
2381
|
+
namespace,
|
|
2352
2382
|
slotScopeIds,
|
|
2353
2383
|
optimized,
|
|
2354
2384
|
rendererInternals
|
|
@@ -2366,7 +2396,7 @@ function triggerEvent(vnode, name) {
|
|
|
2366
2396
|
eventListener();
|
|
2367
2397
|
}
|
|
2368
2398
|
}
|
|
2369
|
-
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense,
|
|
2399
|
+
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
2370
2400
|
const {
|
|
2371
2401
|
p: patch,
|
|
2372
2402
|
o: { createElement }
|
|
@@ -2379,7 +2409,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
2379
2409
|
container,
|
|
2380
2410
|
hiddenContainer,
|
|
2381
2411
|
anchor,
|
|
2382
|
-
|
|
2412
|
+
namespace,
|
|
2383
2413
|
slotScopeIds,
|
|
2384
2414
|
optimized,
|
|
2385
2415
|
rendererInternals
|
|
@@ -2391,7 +2421,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
2391
2421
|
null,
|
|
2392
2422
|
parentComponent,
|
|
2393
2423
|
suspense,
|
|
2394
|
-
|
|
2424
|
+
namespace,
|
|
2395
2425
|
slotScopeIds
|
|
2396
2426
|
);
|
|
2397
2427
|
if (suspense.deps > 0) {
|
|
@@ -2405,7 +2435,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
2405
2435
|
parentComponent,
|
|
2406
2436
|
null,
|
|
2407
2437
|
// fallback tree will not have suspense context
|
|
2408
|
-
|
|
2438
|
+
namespace,
|
|
2409
2439
|
slotScopeIds
|
|
2410
2440
|
);
|
|
2411
2441
|
setActiveBranch(suspense, vnode.ssFallback);
|
|
@@ -2413,7 +2443,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
2413
2443
|
suspense.resolve(false, true);
|
|
2414
2444
|
}
|
|
2415
2445
|
}
|
|
2416
|
-
function patchSuspense(n1, n2, container, anchor, parentComponent,
|
|
2446
|
+
function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
|
|
2417
2447
|
const suspense = n2.suspense = n1.suspense;
|
|
2418
2448
|
suspense.vnode = n2;
|
|
2419
2449
|
n2.el = n1.el;
|
|
@@ -2430,29 +2460,31 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2430
2460
|
null,
|
|
2431
2461
|
parentComponent,
|
|
2432
2462
|
suspense,
|
|
2433
|
-
|
|
2463
|
+
namespace,
|
|
2434
2464
|
slotScopeIds,
|
|
2435
2465
|
optimized
|
|
2436
2466
|
);
|
|
2437
2467
|
if (suspense.deps <= 0) {
|
|
2438
2468
|
suspense.resolve();
|
|
2439
2469
|
} else if (isInFallback) {
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2470
|
+
if (!isHydrating) {
|
|
2471
|
+
patch(
|
|
2472
|
+
activeBranch,
|
|
2473
|
+
newFallback,
|
|
2474
|
+
container,
|
|
2475
|
+
anchor,
|
|
2476
|
+
parentComponent,
|
|
2477
|
+
null,
|
|
2478
|
+
// fallback tree will not have suspense context
|
|
2479
|
+
namespace,
|
|
2480
|
+
slotScopeIds,
|
|
2481
|
+
optimized
|
|
2482
|
+
);
|
|
2483
|
+
setActiveBranch(suspense, newFallback);
|
|
2484
|
+
}
|
|
2453
2485
|
}
|
|
2454
2486
|
} else {
|
|
2455
|
-
suspense.pendingId++;
|
|
2487
|
+
suspense.pendingId = suspenseId++;
|
|
2456
2488
|
if (isHydrating) {
|
|
2457
2489
|
suspense.isHydrating = false;
|
|
2458
2490
|
suspense.activeBranch = pendingBranch;
|
|
@@ -2470,7 +2502,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2470
2502
|
null,
|
|
2471
2503
|
parentComponent,
|
|
2472
2504
|
suspense,
|
|
2473
|
-
|
|
2505
|
+
namespace,
|
|
2474
2506
|
slotScopeIds,
|
|
2475
2507
|
optimized
|
|
2476
2508
|
);
|
|
@@ -2485,7 +2517,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2485
2517
|
parentComponent,
|
|
2486
2518
|
null,
|
|
2487
2519
|
// fallback tree will not have suspense context
|
|
2488
|
-
|
|
2520
|
+
namespace,
|
|
2489
2521
|
slotScopeIds,
|
|
2490
2522
|
optimized
|
|
2491
2523
|
);
|
|
@@ -2499,7 +2531,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2499
2531
|
anchor,
|
|
2500
2532
|
parentComponent,
|
|
2501
2533
|
suspense,
|
|
2502
|
-
|
|
2534
|
+
namespace,
|
|
2503
2535
|
slotScopeIds,
|
|
2504
2536
|
optimized
|
|
2505
2537
|
);
|
|
@@ -2512,7 +2544,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2512
2544
|
null,
|
|
2513
2545
|
parentComponent,
|
|
2514
2546
|
suspense,
|
|
2515
|
-
|
|
2547
|
+
namespace,
|
|
2516
2548
|
slotScopeIds,
|
|
2517
2549
|
optimized
|
|
2518
2550
|
);
|
|
@@ -2530,7 +2562,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2530
2562
|
anchor,
|
|
2531
2563
|
parentComponent,
|
|
2532
2564
|
suspense,
|
|
2533
|
-
|
|
2565
|
+
namespace,
|
|
2534
2566
|
slotScopeIds,
|
|
2535
2567
|
optimized
|
|
2536
2568
|
);
|
|
@@ -2538,7 +2570,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2538
2570
|
} else {
|
|
2539
2571
|
triggerEvent(n2, "onPending");
|
|
2540
2572
|
suspense.pendingBranch = newBranch;
|
|
2541
|
-
|
|
2573
|
+
if (newBranch.shapeFlag & 512) {
|
|
2574
|
+
suspense.pendingId = newBranch.component.suspenseId;
|
|
2575
|
+
} else {
|
|
2576
|
+
suspense.pendingId = suspenseId++;
|
|
2577
|
+
}
|
|
2542
2578
|
patch(
|
|
2543
2579
|
null,
|
|
2544
2580
|
newBranch,
|
|
@@ -2546,7 +2582,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2546
2582
|
null,
|
|
2547
2583
|
parentComponent,
|
|
2548
2584
|
suspense,
|
|
2549
|
-
|
|
2585
|
+
namespace,
|
|
2550
2586
|
slotScopeIds,
|
|
2551
2587
|
optimized
|
|
2552
2588
|
);
|
|
@@ -2567,7 +2603,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2567
2603
|
}
|
|
2568
2604
|
}
|
|
2569
2605
|
}
|
|
2570
|
-
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor,
|
|
2606
|
+
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
|
|
2571
2607
|
const {
|
|
2572
2608
|
p: patch,
|
|
2573
2609
|
m: move,
|
|
@@ -2588,7 +2624,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2588
2624
|
vnode,
|
|
2589
2625
|
parent: parentSuspense,
|
|
2590
2626
|
parentComponent,
|
|
2591
|
-
|
|
2627
|
+
namespace,
|
|
2592
2628
|
container,
|
|
2593
2629
|
hiddenContainer,
|
|
2594
2630
|
anchor,
|
|
@@ -2597,7 +2633,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2597
2633
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
2598
2634
|
activeBranch: null,
|
|
2599
2635
|
pendingBranch: null,
|
|
2600
|
-
isInFallback:
|
|
2636
|
+
isInFallback: !isHydrating,
|
|
2601
2637
|
isHydrating,
|
|
2602
2638
|
isUnmounted: false,
|
|
2603
2639
|
effects: [],
|
|
@@ -2669,8 +2705,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2669
2705
|
if (!suspense.pendingBranch) {
|
|
2670
2706
|
return;
|
|
2671
2707
|
}
|
|
2672
|
-
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2,
|
|
2708
|
+
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
|
|
2673
2709
|
triggerEvent(vnode2, "onFallback");
|
|
2710
|
+
const anchor2 = next(activeBranch);
|
|
2674
2711
|
const mountFallback = () => {
|
|
2675
2712
|
if (!suspense.isInFallback) {
|
|
2676
2713
|
return;
|
|
@@ -2679,11 +2716,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2679
2716
|
null,
|
|
2680
2717
|
fallbackVNode,
|
|
2681
2718
|
container2,
|
|
2682
|
-
|
|
2719
|
+
anchor2,
|
|
2683
2720
|
parentComponent2,
|
|
2684
2721
|
null,
|
|
2685
2722
|
// fallback tree will not have suspense context
|
|
2686
|
-
|
|
2723
|
+
namespace2,
|
|
2687
2724
|
slotScopeIds,
|
|
2688
2725
|
optimized
|
|
2689
2726
|
);
|
|
@@ -2743,7 +2780,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2743
2780
|
// consider the comment placeholder case.
|
|
2744
2781
|
hydratedEl ? null : next(instance.subTree),
|
|
2745
2782
|
suspense,
|
|
2746
|
-
|
|
2783
|
+
namespace,
|
|
2747
2784
|
optimized
|
|
2748
2785
|
);
|
|
2749
2786
|
if (placeholder) {
|
|
@@ -2777,7 +2814,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2777
2814
|
};
|
|
2778
2815
|
return suspense;
|
|
2779
2816
|
}
|
|
2780
|
-
function hydrateSuspense(node, vnode, parentComponent, parentSuspense,
|
|
2817
|
+
function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
|
|
2781
2818
|
const suspense = vnode.suspense = createSuspenseBoundary(
|
|
2782
2819
|
vnode,
|
|
2783
2820
|
parentSuspense,
|
|
@@ -2785,7 +2822,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
|
|
|
2785
2822
|
node.parentNode,
|
|
2786
2823
|
document.createElement("div"),
|
|
2787
2824
|
null,
|
|
2788
|
-
|
|
2825
|
+
namespace,
|
|
2789
2826
|
slotScopeIds,
|
|
2790
2827
|
optimized,
|
|
2791
2828
|
rendererInternals,
|
|
@@ -3688,7 +3725,7 @@ const KeepAliveImpl = {
|
|
|
3688
3725
|
}
|
|
3689
3726
|
} = sharedContext;
|
|
3690
3727
|
const storageContainer = createElement("div");
|
|
3691
|
-
sharedContext.activate = (vnode, container, anchor,
|
|
3728
|
+
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
3692
3729
|
const instance2 = vnode.component;
|
|
3693
3730
|
move(vnode, container, anchor, 0, parentSuspense);
|
|
3694
3731
|
patch(
|
|
@@ -3698,7 +3735,7 @@ const KeepAliveImpl = {
|
|
|
3698
3735
|
anchor,
|
|
3699
3736
|
instance2,
|
|
3700
3737
|
parentSuspense,
|
|
3701
|
-
|
|
3738
|
+
namespace,
|
|
3702
3739
|
vnode.slotScopeIds,
|
|
3703
3740
|
optimized
|
|
3704
3741
|
);
|
|
@@ -4729,31 +4766,26 @@ function useSlots() {
|
|
|
4729
4766
|
function useAttrs() {
|
|
4730
4767
|
return getContext().attrs;
|
|
4731
4768
|
}
|
|
4732
|
-
function useModel(props, name
|
|
4769
|
+
function useModel(props, name) {
|
|
4733
4770
|
const i = getCurrentInstance();
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
)
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
__v_isRef: true,
|
|
4749
|
-
get value() {
|
|
4750
|
-
return props[name];
|
|
4751
|
-
},
|
|
4752
|
-
set value(value) {
|
|
4753
|
-
i.emit(`update:${name}`, value);
|
|
4771
|
+
let localValue;
|
|
4772
|
+
watchSyncEffect(() => {
|
|
4773
|
+
localValue = props[name];
|
|
4774
|
+
});
|
|
4775
|
+
return customRef((track, trigger) => ({
|
|
4776
|
+
get() {
|
|
4777
|
+
track();
|
|
4778
|
+
return localValue;
|
|
4779
|
+
},
|
|
4780
|
+
set(value) {
|
|
4781
|
+
const rawProps = i.vnode.props;
|
|
4782
|
+
if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
|
|
4783
|
+
localValue = value;
|
|
4784
|
+
trigger();
|
|
4754
4785
|
}
|
|
4755
|
-
|
|
4756
|
-
|
|
4786
|
+
i.emit(`update:${name}`, value);
|
|
4787
|
+
}
|
|
4788
|
+
}));
|
|
4757
4789
|
}
|
|
4758
4790
|
function getContext() {
|
|
4759
4791
|
const i = getCurrentInstance();
|
|
@@ -5214,7 +5246,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
5214
5246
|
return vm;
|
|
5215
5247
|
}
|
|
5216
5248
|
}
|
|
5217
|
-
Vue.version = `2.6.14-compat:${"3.4.0-
|
|
5249
|
+
Vue.version = `2.6.14-compat:${"3.4.0-beta.1"}`;
|
|
5218
5250
|
Vue.config = singletonApp.config;
|
|
5219
5251
|
Vue.use = (p, ...options) => {
|
|
5220
5252
|
if (p && isFunction(p.install)) {
|
|
@@ -5443,7 +5475,11 @@ function installCompatMount(app, context, render) {
|
|
|
5443
5475
|
} else {
|
|
5444
5476
|
container = selectorOrEl || document.createElement("div");
|
|
5445
5477
|
}
|
|
5446
|
-
|
|
5478
|
+
let namespace;
|
|
5479
|
+
if (container instanceof SVGElement)
|
|
5480
|
+
namespace = "svg";
|
|
5481
|
+
else if (typeof MathMLElement === "function" && container instanceof MathMLElement)
|
|
5482
|
+
namespace = "mathml";
|
|
5447
5483
|
if (hasNoRender && instance.render === emptyRender) {
|
|
5448
5484
|
instance.render = null;
|
|
5449
5485
|
component.template = container.innerHTML;
|
|
@@ -5455,7 +5491,7 @@ function installCompatMount(app, context, render) {
|
|
|
5455
5491
|
);
|
|
5456
5492
|
}
|
|
5457
5493
|
container.innerHTML = "";
|
|
5458
|
-
render(vnode, container,
|
|
5494
|
+
render(vnode, container, namespace);
|
|
5459
5495
|
if (container instanceof Element) {
|
|
5460
5496
|
container.removeAttribute("v-cloak");
|
|
5461
5497
|
container.setAttribute("data-v-app", "");
|
|
@@ -5623,14 +5659,19 @@ function createAppAPI(render, hydrate) {
|
|
|
5623
5659
|
context.directives[name] = directive;
|
|
5624
5660
|
return app;
|
|
5625
5661
|
},
|
|
5626
|
-
mount(rootContainer, isHydrate,
|
|
5662
|
+
mount(rootContainer, isHydrate, namespace) {
|
|
5627
5663
|
if (!isMounted) {
|
|
5628
5664
|
const vnode = createVNode(rootComponent, rootProps);
|
|
5629
5665
|
vnode.appContext = context;
|
|
5666
|
+
if (namespace === true) {
|
|
5667
|
+
namespace = "svg";
|
|
5668
|
+
} else if (namespace === false) {
|
|
5669
|
+
namespace = void 0;
|
|
5670
|
+
}
|
|
5630
5671
|
if (isHydrate && hydrate) {
|
|
5631
5672
|
hydrate(vnode, rootContainer);
|
|
5632
5673
|
} else {
|
|
5633
|
-
render(vnode, rootContainer,
|
|
5674
|
+
render(vnode, rootContainer, namespace);
|
|
5634
5675
|
}
|
|
5635
5676
|
isMounted = true;
|
|
5636
5677
|
app._container = rootContainer;
|
|
@@ -6199,7 +6240,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
6199
6240
|
}
|
|
6200
6241
|
|
|
6201
6242
|
let hasMismatch = false;
|
|
6202
|
-
const isSVGContainer = (container) =>
|
|
6243
|
+
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
6244
|
+
const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
|
|
6245
|
+
const getContainerType = (container) => {
|
|
6246
|
+
if (isSVGContainer(container))
|
|
6247
|
+
return "svg";
|
|
6248
|
+
if (isMathMLContainer(container))
|
|
6249
|
+
return "mathml";
|
|
6250
|
+
return void 0;
|
|
6251
|
+
};
|
|
6203
6252
|
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
6204
6253
|
function createHydrationFunctions(rendererInternals) {
|
|
6205
6254
|
const {
|
|
@@ -6344,7 +6393,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6344
6393
|
null,
|
|
6345
6394
|
parentComponent,
|
|
6346
6395
|
parentSuspense,
|
|
6347
|
-
|
|
6396
|
+
getContainerType(container),
|
|
6348
6397
|
optimized
|
|
6349
6398
|
);
|
|
6350
6399
|
if (isAsyncWrapper(vnode)) {
|
|
@@ -6379,7 +6428,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6379
6428
|
vnode,
|
|
6380
6429
|
parentComponent,
|
|
6381
6430
|
parentSuspense,
|
|
6382
|
-
|
|
6431
|
+
getContainerType(parentNode(node)),
|
|
6383
6432
|
slotScopeIds,
|
|
6384
6433
|
optimized,
|
|
6385
6434
|
rendererInternals,
|
|
@@ -6400,6 +6449,39 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6400
6449
|
if (dirs) {
|
|
6401
6450
|
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
6402
6451
|
}
|
|
6452
|
+
let needCallTransitionHooks = false;
|
|
6453
|
+
if (isTemplateNode(el)) {
|
|
6454
|
+
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
6455
|
+
const content = el.content.firstChild;
|
|
6456
|
+
if (needCallTransitionHooks) {
|
|
6457
|
+
transition.beforeEnter(content);
|
|
6458
|
+
}
|
|
6459
|
+
replaceNode(content, el, parentComponent);
|
|
6460
|
+
vnode.el = el = content;
|
|
6461
|
+
}
|
|
6462
|
+
if (shapeFlag & 16 && // skip if element has innerHTML / textContent
|
|
6463
|
+
!(props && (props.innerHTML || props.textContent))) {
|
|
6464
|
+
let next = hydrateChildren(
|
|
6465
|
+
el.firstChild,
|
|
6466
|
+
vnode,
|
|
6467
|
+
el,
|
|
6468
|
+
parentComponent,
|
|
6469
|
+
parentSuspense,
|
|
6470
|
+
slotScopeIds,
|
|
6471
|
+
optimized
|
|
6472
|
+
);
|
|
6473
|
+
while (next) {
|
|
6474
|
+
hasMismatch = true;
|
|
6475
|
+
const cur = next;
|
|
6476
|
+
next = next.nextSibling;
|
|
6477
|
+
remove(cur);
|
|
6478
|
+
}
|
|
6479
|
+
} else if (shapeFlag & 8) {
|
|
6480
|
+
if (el.textContent !== vnode.children) {
|
|
6481
|
+
hasMismatch = true;
|
|
6482
|
+
el.textContent = vnode.children;
|
|
6483
|
+
}
|
|
6484
|
+
}
|
|
6403
6485
|
if (props) {
|
|
6404
6486
|
if (forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
6405
6487
|
for (const key in props) {
|
|
@@ -6410,7 +6492,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6410
6492
|
key,
|
|
6411
6493
|
null,
|
|
6412
6494
|
props[key],
|
|
6413
|
-
|
|
6495
|
+
void 0,
|
|
6414
6496
|
void 0,
|
|
6415
6497
|
parentComponent
|
|
6416
6498
|
);
|
|
@@ -6422,7 +6504,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6422
6504
|
"onClick",
|
|
6423
6505
|
null,
|
|
6424
6506
|
props.onClick,
|
|
6425
|
-
|
|
6507
|
+
void 0,
|
|
6426
6508
|
void 0,
|
|
6427
6509
|
parentComponent
|
|
6428
6510
|
);
|
|
@@ -6432,16 +6514,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6432
6514
|
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
6433
6515
|
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
6434
6516
|
}
|
|
6435
|
-
let needCallTransitionHooks = false;
|
|
6436
|
-
if (isTemplateNode(el)) {
|
|
6437
|
-
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
6438
|
-
const content = el.content.firstChild;
|
|
6439
|
-
if (needCallTransitionHooks) {
|
|
6440
|
-
transition.beforeEnter(content);
|
|
6441
|
-
}
|
|
6442
|
-
replaceNode(content, el, parentComponent);
|
|
6443
|
-
vnode.el = el = content;
|
|
6444
|
-
}
|
|
6445
6517
|
if (dirs) {
|
|
6446
6518
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
6447
6519
|
}
|
|
@@ -6452,29 +6524,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6452
6524
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
6453
6525
|
}, parentSuspense);
|
|
6454
6526
|
}
|
|
6455
|
-
if (shapeFlag & 16 && // skip if element has innerHTML / textContent
|
|
6456
|
-
!(props && (props.innerHTML || props.textContent))) {
|
|
6457
|
-
let next = hydrateChildren(
|
|
6458
|
-
el.firstChild,
|
|
6459
|
-
vnode,
|
|
6460
|
-
el,
|
|
6461
|
-
parentComponent,
|
|
6462
|
-
parentSuspense,
|
|
6463
|
-
slotScopeIds,
|
|
6464
|
-
optimized
|
|
6465
|
-
);
|
|
6466
|
-
while (next) {
|
|
6467
|
-
hasMismatch = true;
|
|
6468
|
-
const cur = next;
|
|
6469
|
-
next = next.nextSibling;
|
|
6470
|
-
remove(cur);
|
|
6471
|
-
}
|
|
6472
|
-
} else if (shapeFlag & 8) {
|
|
6473
|
-
if (el.textContent !== vnode.children) {
|
|
6474
|
-
hasMismatch = true;
|
|
6475
|
-
el.textContent = vnode.children;
|
|
6476
|
-
}
|
|
6477
|
-
}
|
|
6478
6527
|
}
|
|
6479
6528
|
return el.nextSibling;
|
|
6480
6529
|
};
|
|
@@ -6504,7 +6553,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6504
6553
|
null,
|
|
6505
6554
|
parentComponent,
|
|
6506
6555
|
parentSuspense,
|
|
6507
|
-
|
|
6556
|
+
getContainerType(container),
|
|
6508
6557
|
slotScopeIds
|
|
6509
6558
|
);
|
|
6510
6559
|
}
|
|
@@ -6558,7 +6607,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6558
6607
|
next,
|
|
6559
6608
|
parentComponent,
|
|
6560
6609
|
parentSuspense,
|
|
6561
|
-
|
|
6610
|
+
getContainerType(container),
|
|
6562
6611
|
slotScopeIds
|
|
6563
6612
|
);
|
|
6564
6613
|
return next;
|
|
@@ -6624,7 +6673,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6624
6673
|
setScopeId: hostSetScopeId = NOOP,
|
|
6625
6674
|
insertStaticContent: hostInsertStaticContent
|
|
6626
6675
|
} = options;
|
|
6627
|
-
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null,
|
|
6676
|
+
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
|
|
6628
6677
|
if (n1 === n2) {
|
|
6629
6678
|
return;
|
|
6630
6679
|
}
|
|
@@ -6647,7 +6696,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6647
6696
|
break;
|
|
6648
6697
|
case Static:
|
|
6649
6698
|
if (n1 == null) {
|
|
6650
|
-
mountStaticNode(n2, container, anchor,
|
|
6699
|
+
mountStaticNode(n2, container, anchor, namespace);
|
|
6651
6700
|
}
|
|
6652
6701
|
break;
|
|
6653
6702
|
case Fragment:
|
|
@@ -6658,7 +6707,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6658
6707
|
anchor,
|
|
6659
6708
|
parentComponent,
|
|
6660
6709
|
parentSuspense,
|
|
6661
|
-
|
|
6710
|
+
namespace,
|
|
6662
6711
|
slotScopeIds,
|
|
6663
6712
|
optimized
|
|
6664
6713
|
);
|
|
@@ -6672,7 +6721,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6672
6721
|
anchor,
|
|
6673
6722
|
parentComponent,
|
|
6674
6723
|
parentSuspense,
|
|
6675
|
-
|
|
6724
|
+
namespace,
|
|
6676
6725
|
slotScopeIds,
|
|
6677
6726
|
optimized
|
|
6678
6727
|
);
|
|
@@ -6684,7 +6733,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6684
6733
|
anchor,
|
|
6685
6734
|
parentComponent,
|
|
6686
6735
|
parentSuspense,
|
|
6687
|
-
|
|
6736
|
+
namespace,
|
|
6688
6737
|
slotScopeIds,
|
|
6689
6738
|
optimized
|
|
6690
6739
|
);
|
|
@@ -6696,7 +6745,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6696
6745
|
anchor,
|
|
6697
6746
|
parentComponent,
|
|
6698
6747
|
parentSuspense,
|
|
6699
|
-
|
|
6748
|
+
namespace,
|
|
6700
6749
|
slotScopeIds,
|
|
6701
6750
|
optimized,
|
|
6702
6751
|
internals
|
|
@@ -6709,7 +6758,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6709
6758
|
anchor,
|
|
6710
6759
|
parentComponent,
|
|
6711
6760
|
parentSuspense,
|
|
6712
|
-
|
|
6761
|
+
namespace,
|
|
6713
6762
|
slotScopeIds,
|
|
6714
6763
|
optimized,
|
|
6715
6764
|
internals
|
|
@@ -6745,12 +6794,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6745
6794
|
n2.el = n1.el;
|
|
6746
6795
|
}
|
|
6747
6796
|
};
|
|
6748
|
-
const mountStaticNode = (n2, container, anchor,
|
|
6797
|
+
const mountStaticNode = (n2, container, anchor, namespace) => {
|
|
6749
6798
|
[n2.el, n2.anchor] = hostInsertStaticContent(
|
|
6750
6799
|
n2.children,
|
|
6751
6800
|
container,
|
|
6752
6801
|
anchor,
|
|
6753
|
-
|
|
6802
|
+
namespace,
|
|
6754
6803
|
n2.el,
|
|
6755
6804
|
n2.anchor
|
|
6756
6805
|
);
|
|
@@ -6773,8 +6822,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6773
6822
|
}
|
|
6774
6823
|
hostRemove(anchor);
|
|
6775
6824
|
};
|
|
6776
|
-
const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
6777
|
-
|
|
6825
|
+
const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6826
|
+
if (n2.type === "svg") {
|
|
6827
|
+
namespace = "svg";
|
|
6828
|
+
} else if (n2.type === "math") {
|
|
6829
|
+
namespace = "mathml";
|
|
6830
|
+
}
|
|
6778
6831
|
if (n1 == null) {
|
|
6779
6832
|
mountElement(
|
|
6780
6833
|
n2,
|
|
@@ -6782,7 +6835,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6782
6835
|
anchor,
|
|
6783
6836
|
parentComponent,
|
|
6784
6837
|
parentSuspense,
|
|
6785
|
-
|
|
6838
|
+
namespace,
|
|
6786
6839
|
slotScopeIds,
|
|
6787
6840
|
optimized
|
|
6788
6841
|
);
|
|
@@ -6792,19 +6845,19 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6792
6845
|
n2,
|
|
6793
6846
|
parentComponent,
|
|
6794
6847
|
parentSuspense,
|
|
6795
|
-
|
|
6848
|
+
namespace,
|
|
6796
6849
|
slotScopeIds,
|
|
6797
6850
|
optimized
|
|
6798
6851
|
);
|
|
6799
6852
|
}
|
|
6800
6853
|
};
|
|
6801
|
-
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense,
|
|
6854
|
+
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6802
6855
|
let el;
|
|
6803
6856
|
let vnodeHook;
|
|
6804
|
-
const {
|
|
6857
|
+
const { props, shapeFlag, transition, dirs } = vnode;
|
|
6805
6858
|
el = vnode.el = hostCreateElement(
|
|
6806
6859
|
vnode.type,
|
|
6807
|
-
|
|
6860
|
+
namespace,
|
|
6808
6861
|
props && props.is,
|
|
6809
6862
|
props
|
|
6810
6863
|
);
|
|
@@ -6817,7 +6870,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6817
6870
|
null,
|
|
6818
6871
|
parentComponent,
|
|
6819
6872
|
parentSuspense,
|
|
6820
|
-
|
|
6873
|
+
resolveChildrenNamespace(vnode, namespace),
|
|
6821
6874
|
slotScopeIds,
|
|
6822
6875
|
optimized
|
|
6823
6876
|
);
|
|
@@ -6834,7 +6887,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6834
6887
|
key,
|
|
6835
6888
|
null,
|
|
6836
6889
|
props[key],
|
|
6837
|
-
|
|
6890
|
+
namespace,
|
|
6838
6891
|
vnode.children,
|
|
6839
6892
|
parentComponent,
|
|
6840
6893
|
parentSuspense,
|
|
@@ -6843,7 +6896,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6843
6896
|
}
|
|
6844
6897
|
}
|
|
6845
6898
|
if ("value" in props) {
|
|
6846
|
-
hostPatchProp(el, "value", null, props.value);
|
|
6899
|
+
hostPatchProp(el, "value", null, props.value, namespace);
|
|
6847
6900
|
}
|
|
6848
6901
|
if (vnodeHook = props.onVnodeBeforeMount) {
|
|
6849
6902
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
@@ -6888,7 +6941,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6888
6941
|
}
|
|
6889
6942
|
}
|
|
6890
6943
|
};
|
|
6891
|
-
const mountChildren = (children, container, anchor, parentComponent, parentSuspense,
|
|
6944
|
+
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
6892
6945
|
for (let i = start; i < children.length; i++) {
|
|
6893
6946
|
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
6894
6947
|
patch(
|
|
@@ -6898,13 +6951,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6898
6951
|
anchor,
|
|
6899
6952
|
parentComponent,
|
|
6900
6953
|
parentSuspense,
|
|
6901
|
-
|
|
6954
|
+
namespace,
|
|
6902
6955
|
slotScopeIds,
|
|
6903
6956
|
optimized
|
|
6904
6957
|
);
|
|
6905
6958
|
}
|
|
6906
6959
|
};
|
|
6907
|
-
const patchElement = (n1, n2, parentComponent, parentSuspense,
|
|
6960
|
+
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6908
6961
|
const el = n2.el = n1.el;
|
|
6909
6962
|
let { patchFlag, dynamicChildren, dirs } = n2;
|
|
6910
6963
|
patchFlag |= n1.patchFlag & 16;
|
|
@@ -6919,7 +6972,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6919
6972
|
invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
6920
6973
|
}
|
|
6921
6974
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
6922
|
-
const areChildrenSVG = isSVG && n2.type !== "foreignObject";
|
|
6923
6975
|
if (dynamicChildren) {
|
|
6924
6976
|
patchBlockChildren(
|
|
6925
6977
|
n1.dynamicChildren,
|
|
@@ -6927,7 +6979,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6927
6979
|
el,
|
|
6928
6980
|
parentComponent,
|
|
6929
6981
|
parentSuspense,
|
|
6930
|
-
|
|
6982
|
+
resolveChildrenNamespace(n2, namespace),
|
|
6931
6983
|
slotScopeIds
|
|
6932
6984
|
);
|
|
6933
6985
|
} else if (!optimized) {
|
|
@@ -6938,7 +6990,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6938
6990
|
null,
|
|
6939
6991
|
parentComponent,
|
|
6940
6992
|
parentSuspense,
|
|
6941
|
-
|
|
6993
|
+
resolveChildrenNamespace(n2, namespace),
|
|
6942
6994
|
slotScopeIds,
|
|
6943
6995
|
false
|
|
6944
6996
|
);
|
|
@@ -6952,16 +7004,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6952
7004
|
newProps,
|
|
6953
7005
|
parentComponent,
|
|
6954
7006
|
parentSuspense,
|
|
6955
|
-
|
|
7007
|
+
namespace
|
|
6956
7008
|
);
|
|
6957
7009
|
} else {
|
|
6958
7010
|
if (patchFlag & 2) {
|
|
6959
7011
|
if (oldProps.class !== newProps.class) {
|
|
6960
|
-
hostPatchProp(el, "class", null, newProps.class,
|
|
7012
|
+
hostPatchProp(el, "class", null, newProps.class, namespace);
|
|
6961
7013
|
}
|
|
6962
7014
|
}
|
|
6963
7015
|
if (patchFlag & 4) {
|
|
6964
|
-
hostPatchProp(el, "style", oldProps.style, newProps.style,
|
|
7016
|
+
hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
|
|
6965
7017
|
}
|
|
6966
7018
|
if (patchFlag & 8) {
|
|
6967
7019
|
const propsToUpdate = n2.dynamicProps;
|
|
@@ -6975,7 +7027,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6975
7027
|
key,
|
|
6976
7028
|
prev,
|
|
6977
7029
|
next,
|
|
6978
|
-
|
|
7030
|
+
namespace,
|
|
6979
7031
|
n1.children,
|
|
6980
7032
|
parentComponent,
|
|
6981
7033
|
parentSuspense,
|
|
@@ -6998,7 +7050,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6998
7050
|
newProps,
|
|
6999
7051
|
parentComponent,
|
|
7000
7052
|
parentSuspense,
|
|
7001
|
-
|
|
7053
|
+
namespace
|
|
7002
7054
|
);
|
|
7003
7055
|
}
|
|
7004
7056
|
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
|
|
@@ -7008,7 +7060,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7008
7060
|
}, parentSuspense);
|
|
7009
7061
|
}
|
|
7010
7062
|
};
|
|
7011
|
-
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense,
|
|
7063
|
+
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
|
|
7012
7064
|
for (let i = 0; i < newChildren.length; i++) {
|
|
7013
7065
|
const oldVNode = oldChildren[i];
|
|
7014
7066
|
const newVNode = newChildren[i];
|
|
@@ -7033,13 +7085,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7033
7085
|
null,
|
|
7034
7086
|
parentComponent,
|
|
7035
7087
|
parentSuspense,
|
|
7036
|
-
|
|
7088
|
+
namespace,
|
|
7037
7089
|
slotScopeIds,
|
|
7038
7090
|
true
|
|
7039
7091
|
);
|
|
7040
7092
|
}
|
|
7041
7093
|
};
|
|
7042
|
-
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense,
|
|
7094
|
+
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
|
|
7043
7095
|
if (oldProps !== newProps) {
|
|
7044
7096
|
if (oldProps !== EMPTY_OBJ) {
|
|
7045
7097
|
for (const key in oldProps) {
|
|
@@ -7049,7 +7101,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7049
7101
|
key,
|
|
7050
7102
|
oldProps[key],
|
|
7051
7103
|
null,
|
|
7052
|
-
|
|
7104
|
+
namespace,
|
|
7053
7105
|
vnode.children,
|
|
7054
7106
|
parentComponent,
|
|
7055
7107
|
parentSuspense,
|
|
@@ -7069,7 +7121,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7069
7121
|
key,
|
|
7070
7122
|
prev,
|
|
7071
7123
|
next,
|
|
7072
|
-
|
|
7124
|
+
namespace,
|
|
7073
7125
|
vnode.children,
|
|
7074
7126
|
parentComponent,
|
|
7075
7127
|
parentSuspense,
|
|
@@ -7078,11 +7130,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7078
7130
|
}
|
|
7079
7131
|
}
|
|
7080
7132
|
if ("value" in newProps) {
|
|
7081
|
-
hostPatchProp(el, "value", oldProps.value, newProps.value);
|
|
7133
|
+
hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
|
|
7082
7134
|
}
|
|
7083
7135
|
}
|
|
7084
7136
|
};
|
|
7085
|
-
const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
7137
|
+
const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7086
7138
|
const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
|
|
7087
7139
|
const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
|
|
7088
7140
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
@@ -7098,7 +7150,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7098
7150
|
fragmentEndAnchor,
|
|
7099
7151
|
parentComponent,
|
|
7100
7152
|
parentSuspense,
|
|
7101
|
-
|
|
7153
|
+
namespace,
|
|
7102
7154
|
slotScopeIds,
|
|
7103
7155
|
optimized
|
|
7104
7156
|
);
|
|
@@ -7112,7 +7164,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7112
7164
|
container,
|
|
7113
7165
|
parentComponent,
|
|
7114
7166
|
parentSuspense,
|
|
7115
|
-
|
|
7167
|
+
namespace,
|
|
7116
7168
|
slotScopeIds
|
|
7117
7169
|
);
|
|
7118
7170
|
if (
|
|
@@ -7137,14 +7189,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7137
7189
|
fragmentEndAnchor,
|
|
7138
7190
|
parentComponent,
|
|
7139
7191
|
parentSuspense,
|
|
7140
|
-
|
|
7192
|
+
namespace,
|
|
7141
7193
|
slotScopeIds,
|
|
7142
7194
|
optimized
|
|
7143
7195
|
);
|
|
7144
7196
|
}
|
|
7145
7197
|
}
|
|
7146
7198
|
};
|
|
7147
|
-
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
7199
|
+
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7148
7200
|
n2.slotScopeIds = slotScopeIds;
|
|
7149
7201
|
if (n1 == null) {
|
|
7150
7202
|
if (n2.shapeFlag & 512) {
|
|
@@ -7152,7 +7204,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7152
7204
|
n2,
|
|
7153
7205
|
container,
|
|
7154
7206
|
anchor,
|
|
7155
|
-
|
|
7207
|
+
namespace,
|
|
7156
7208
|
optimized
|
|
7157
7209
|
);
|
|
7158
7210
|
} else {
|
|
@@ -7162,7 +7214,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7162
7214
|
anchor,
|
|
7163
7215
|
parentComponent,
|
|
7164
7216
|
parentSuspense,
|
|
7165
|
-
|
|
7217
|
+
namespace,
|
|
7166
7218
|
optimized
|
|
7167
7219
|
);
|
|
7168
7220
|
}
|
|
@@ -7170,7 +7222,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7170
7222
|
updateComponent(n1, n2, optimized);
|
|
7171
7223
|
}
|
|
7172
7224
|
};
|
|
7173
|
-
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense,
|
|
7225
|
+
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
7174
7226
|
const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
|
|
7175
7227
|
const instance = compatMountInstance || (initialVNode.component = createComponentInstance(
|
|
7176
7228
|
initialVNode,
|
|
@@ -7189,17 +7241,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7189
7241
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
7190
7242
|
processCommentNode(null, placeholder, container, anchor);
|
|
7191
7243
|
}
|
|
7192
|
-
|
|
7244
|
+
} else {
|
|
7245
|
+
setupRenderEffect(
|
|
7246
|
+
instance,
|
|
7247
|
+
initialVNode,
|
|
7248
|
+
container,
|
|
7249
|
+
anchor,
|
|
7250
|
+
parentSuspense,
|
|
7251
|
+
namespace,
|
|
7252
|
+
optimized
|
|
7253
|
+
);
|
|
7193
7254
|
}
|
|
7194
|
-
setupRenderEffect(
|
|
7195
|
-
instance,
|
|
7196
|
-
initialVNode,
|
|
7197
|
-
container,
|
|
7198
|
-
anchor,
|
|
7199
|
-
parentSuspense,
|
|
7200
|
-
isSVG,
|
|
7201
|
-
optimized
|
|
7202
|
-
);
|
|
7203
7255
|
};
|
|
7204
7256
|
const updateComponent = (n1, n2, optimized) => {
|
|
7205
7257
|
const instance = n2.component = n1.component;
|
|
@@ -7218,7 +7270,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7218
7270
|
instance.vnode = n2;
|
|
7219
7271
|
}
|
|
7220
7272
|
};
|
|
7221
|
-
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense,
|
|
7273
|
+
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
|
|
7222
7274
|
const componentUpdateFn = () => {
|
|
7223
7275
|
if (!instance.isMounted) {
|
|
7224
7276
|
let vnodeHook;
|
|
@@ -7267,7 +7319,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7267
7319
|
anchor,
|
|
7268
7320
|
instance,
|
|
7269
7321
|
parentSuspense,
|
|
7270
|
-
|
|
7322
|
+
namespace
|
|
7271
7323
|
);
|
|
7272
7324
|
initialVNode.el = subTree.el;
|
|
7273
7325
|
}
|
|
@@ -7300,6 +7352,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7300
7352
|
initialVNode = container = anchor = null;
|
|
7301
7353
|
} else {
|
|
7302
7354
|
let { next, bu, u, parent, vnode } = instance;
|
|
7355
|
+
{
|
|
7356
|
+
const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
|
|
7357
|
+
if (nonHydratedAsyncRoot) {
|
|
7358
|
+
if (next) {
|
|
7359
|
+
next.el = vnode.el;
|
|
7360
|
+
updateComponentPreRender(instance, next, optimized);
|
|
7361
|
+
}
|
|
7362
|
+
nonHydratedAsyncRoot.asyncDep.then(() => {
|
|
7363
|
+
if (!instance.isUnmounted) {
|
|
7364
|
+
componentUpdateFn();
|
|
7365
|
+
}
|
|
7366
|
+
});
|
|
7367
|
+
return;
|
|
7368
|
+
}
|
|
7369
|
+
}
|
|
7303
7370
|
let originNext = next;
|
|
7304
7371
|
let vnodeHook;
|
|
7305
7372
|
toggleRecurse(instance, false);
|
|
@@ -7331,7 +7398,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7331
7398
|
getNextHostNode(prevTree),
|
|
7332
7399
|
instance,
|
|
7333
7400
|
parentSuspense,
|
|
7334
|
-
|
|
7401
|
+
namespace
|
|
7335
7402
|
);
|
|
7336
7403
|
next.el = nextTree.el;
|
|
7337
7404
|
if (originNext === null) {
|
|
@@ -7378,10 +7445,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7378
7445
|
updateProps(instance, nextVNode.props, prevProps, optimized);
|
|
7379
7446
|
updateSlots(instance, nextVNode.children, optimized);
|
|
7380
7447
|
pauseTracking();
|
|
7381
|
-
flushPreFlushCbs();
|
|
7448
|
+
flushPreFlushCbs(instance);
|
|
7382
7449
|
resetTracking();
|
|
7383
7450
|
};
|
|
7384
|
-
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
7451
|
+
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
|
|
7385
7452
|
const c1 = n1 && n1.children;
|
|
7386
7453
|
const prevShapeFlag = n1 ? n1.shapeFlag : 0;
|
|
7387
7454
|
const c2 = n2.children;
|
|
@@ -7395,7 +7462,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7395
7462
|
anchor,
|
|
7396
7463
|
parentComponent,
|
|
7397
7464
|
parentSuspense,
|
|
7398
|
-
|
|
7465
|
+
namespace,
|
|
7399
7466
|
slotScopeIds,
|
|
7400
7467
|
optimized
|
|
7401
7468
|
);
|
|
@@ -7408,7 +7475,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7408
7475
|
anchor,
|
|
7409
7476
|
parentComponent,
|
|
7410
7477
|
parentSuspense,
|
|
7411
|
-
|
|
7478
|
+
namespace,
|
|
7412
7479
|
slotScopeIds,
|
|
7413
7480
|
optimized
|
|
7414
7481
|
);
|
|
@@ -7432,7 +7499,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7432
7499
|
anchor,
|
|
7433
7500
|
parentComponent,
|
|
7434
7501
|
parentSuspense,
|
|
7435
|
-
|
|
7502
|
+
namespace,
|
|
7436
7503
|
slotScopeIds,
|
|
7437
7504
|
optimized
|
|
7438
7505
|
);
|
|
@@ -7450,7 +7517,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7450
7517
|
anchor,
|
|
7451
7518
|
parentComponent,
|
|
7452
7519
|
parentSuspense,
|
|
7453
|
-
|
|
7520
|
+
namespace,
|
|
7454
7521
|
slotScopeIds,
|
|
7455
7522
|
optimized
|
|
7456
7523
|
);
|
|
@@ -7458,7 +7525,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7458
7525
|
}
|
|
7459
7526
|
}
|
|
7460
7527
|
};
|
|
7461
|
-
const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense,
|
|
7528
|
+
const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7462
7529
|
c1 = c1 || EMPTY_ARR;
|
|
7463
7530
|
c2 = c2 || EMPTY_ARR;
|
|
7464
7531
|
const oldLength = c1.length;
|
|
@@ -7474,7 +7541,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7474
7541
|
null,
|
|
7475
7542
|
parentComponent,
|
|
7476
7543
|
parentSuspense,
|
|
7477
|
-
|
|
7544
|
+
namespace,
|
|
7478
7545
|
slotScopeIds,
|
|
7479
7546
|
optimized
|
|
7480
7547
|
);
|
|
@@ -7495,14 +7562,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7495
7562
|
anchor,
|
|
7496
7563
|
parentComponent,
|
|
7497
7564
|
parentSuspense,
|
|
7498
|
-
|
|
7565
|
+
namespace,
|
|
7499
7566
|
slotScopeIds,
|
|
7500
7567
|
optimized,
|
|
7501
7568
|
commonLength
|
|
7502
7569
|
);
|
|
7503
7570
|
}
|
|
7504
7571
|
};
|
|
7505
|
-
const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense,
|
|
7572
|
+
const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7506
7573
|
let i = 0;
|
|
7507
7574
|
const l2 = c2.length;
|
|
7508
7575
|
let e1 = c1.length - 1;
|
|
@@ -7518,7 +7585,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7518
7585
|
null,
|
|
7519
7586
|
parentComponent,
|
|
7520
7587
|
parentSuspense,
|
|
7521
|
-
|
|
7588
|
+
namespace,
|
|
7522
7589
|
slotScopeIds,
|
|
7523
7590
|
optimized
|
|
7524
7591
|
);
|
|
@@ -7538,7 +7605,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7538
7605
|
null,
|
|
7539
7606
|
parentComponent,
|
|
7540
7607
|
parentSuspense,
|
|
7541
|
-
|
|
7608
|
+
namespace,
|
|
7542
7609
|
slotScopeIds,
|
|
7543
7610
|
optimized
|
|
7544
7611
|
);
|
|
@@ -7560,7 +7627,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7560
7627
|
anchor,
|
|
7561
7628
|
parentComponent,
|
|
7562
7629
|
parentSuspense,
|
|
7563
|
-
|
|
7630
|
+
namespace,
|
|
7564
7631
|
slotScopeIds,
|
|
7565
7632
|
optimized
|
|
7566
7633
|
);
|
|
@@ -7623,7 +7690,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7623
7690
|
null,
|
|
7624
7691
|
parentComponent,
|
|
7625
7692
|
parentSuspense,
|
|
7626
|
-
|
|
7693
|
+
namespace,
|
|
7627
7694
|
slotScopeIds,
|
|
7628
7695
|
optimized
|
|
7629
7696
|
);
|
|
@@ -7644,7 +7711,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7644
7711
|
anchor,
|
|
7645
7712
|
parentComponent,
|
|
7646
7713
|
parentSuspense,
|
|
7647
|
-
|
|
7714
|
+
namespace,
|
|
7648
7715
|
slotScopeIds,
|
|
7649
7716
|
optimized
|
|
7650
7717
|
);
|
|
@@ -7860,13 +7927,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7860
7927
|
}
|
|
7861
7928
|
return hostNextSibling(vnode.anchor || vnode.el);
|
|
7862
7929
|
};
|
|
7863
|
-
const render = (vnode, container,
|
|
7930
|
+
const render = (vnode, container, namespace) => {
|
|
7864
7931
|
if (vnode == null) {
|
|
7865
7932
|
if (container._vnode) {
|
|
7866
7933
|
unmount(container._vnode, null, null, true);
|
|
7867
7934
|
}
|
|
7868
7935
|
} else {
|
|
7869
|
-
patch(
|
|
7936
|
+
patch(
|
|
7937
|
+
container._vnode || null,
|
|
7938
|
+
vnode,
|
|
7939
|
+
container,
|
|
7940
|
+
null,
|
|
7941
|
+
null,
|
|
7942
|
+
null,
|
|
7943
|
+
namespace
|
|
7944
|
+
);
|
|
7870
7945
|
}
|
|
7871
7946
|
flushPreFlushCbs();
|
|
7872
7947
|
flushPostFlushCbs();
|
|
@@ -7897,6 +7972,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7897
7972
|
createApp: createAppAPI(render, hydrate)
|
|
7898
7973
|
};
|
|
7899
7974
|
}
|
|
7975
|
+
function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
7976
|
+
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
7977
|
+
}
|
|
7900
7978
|
function toggleRecurse({ effect, update }, allowed) {
|
|
7901
7979
|
effect.allowRecurse = update.allowRecurse = allowed;
|
|
7902
7980
|
}
|
|
@@ -7964,10 +8042,21 @@ function getSequence(arr) {
|
|
|
7964
8042
|
}
|
|
7965
8043
|
return result;
|
|
7966
8044
|
}
|
|
8045
|
+
function locateNonHydratedAsyncRoot(instance) {
|
|
8046
|
+
const subComponent = instance.subTree.component;
|
|
8047
|
+
if (subComponent) {
|
|
8048
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
8049
|
+
return subComponent;
|
|
8050
|
+
} else {
|
|
8051
|
+
return locateNonHydratedAsyncRoot(subComponent);
|
|
8052
|
+
}
|
|
8053
|
+
}
|
|
8054
|
+
}
|
|
7967
8055
|
|
|
7968
8056
|
const isTeleport = (type) => type.__isTeleport;
|
|
7969
8057
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
7970
8058
|
const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
|
|
8059
|
+
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
7971
8060
|
const resolveTarget = (props, select) => {
|
|
7972
8061
|
const targetSelector = props && props.to;
|
|
7973
8062
|
if (isString(targetSelector)) {
|
|
@@ -7984,7 +8073,7 @@ const resolveTarget = (props, select) => {
|
|
|
7984
8073
|
const TeleportImpl = {
|
|
7985
8074
|
name: "Teleport",
|
|
7986
8075
|
__isTeleport: true,
|
|
7987
|
-
process(n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
8076
|
+
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
7988
8077
|
const {
|
|
7989
8078
|
mc: mountChildren,
|
|
7990
8079
|
pc: patchChildren,
|
|
@@ -8002,7 +8091,11 @@ const TeleportImpl = {
|
|
|
8002
8091
|
const targetAnchor = n2.targetAnchor = createText("");
|
|
8003
8092
|
if (target) {
|
|
8004
8093
|
insert(targetAnchor, target);
|
|
8005
|
-
|
|
8094
|
+
if (namespace === "svg" || isTargetSVG(target)) {
|
|
8095
|
+
namespace = "svg";
|
|
8096
|
+
} else if (namespace === "mathml" || isTargetMathML(target)) {
|
|
8097
|
+
namespace = "mathml";
|
|
8098
|
+
}
|
|
8006
8099
|
}
|
|
8007
8100
|
const mount = (container2, anchor2) => {
|
|
8008
8101
|
if (shapeFlag & 16) {
|
|
@@ -8012,7 +8105,7 @@ const TeleportImpl = {
|
|
|
8012
8105
|
anchor2,
|
|
8013
8106
|
parentComponent,
|
|
8014
8107
|
parentSuspense,
|
|
8015
|
-
|
|
8108
|
+
namespace,
|
|
8016
8109
|
slotScopeIds,
|
|
8017
8110
|
optimized
|
|
8018
8111
|
);
|
|
@@ -8031,7 +8124,11 @@ const TeleportImpl = {
|
|
|
8031
8124
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
8032
8125
|
const currentContainer = wasDisabled ? container : target;
|
|
8033
8126
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
8034
|
-
|
|
8127
|
+
if (namespace === "svg" || isTargetSVG(target)) {
|
|
8128
|
+
namespace = "svg";
|
|
8129
|
+
} else if (namespace === "mathml" || isTargetMathML(target)) {
|
|
8130
|
+
namespace = "mathml";
|
|
8131
|
+
}
|
|
8035
8132
|
if (dynamicChildren) {
|
|
8036
8133
|
patchBlockChildren(
|
|
8037
8134
|
n1.dynamicChildren,
|
|
@@ -8039,7 +8136,7 @@ const TeleportImpl = {
|
|
|
8039
8136
|
currentContainer,
|
|
8040
8137
|
parentComponent,
|
|
8041
8138
|
parentSuspense,
|
|
8042
|
-
|
|
8139
|
+
namespace,
|
|
8043
8140
|
slotScopeIds
|
|
8044
8141
|
);
|
|
8045
8142
|
traverseStaticChildren(n1, n2, true);
|
|
@@ -8051,7 +8148,7 @@ const TeleportImpl = {
|
|
|
8051
8148
|
currentAnchor,
|
|
8052
8149
|
parentComponent,
|
|
8053
8150
|
parentSuspense,
|
|
8054
|
-
|
|
8151
|
+
namespace,
|
|
8055
8152
|
slotScopeIds,
|
|
8056
8153
|
false
|
|
8057
8154
|
);
|
|
@@ -8695,20 +8792,29 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
8695
8792
|
let currentInstance = null;
|
|
8696
8793
|
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
8697
8794
|
let internalSetCurrentInstance;
|
|
8698
|
-
let
|
|
8699
|
-
let settersKey = "__VUE_INSTANCE_SETTERS__";
|
|
8795
|
+
let setInSSRSetupState;
|
|
8700
8796
|
{
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8797
|
+
const g = getGlobalThis();
|
|
8798
|
+
const registerGlobalSetter = (key, setter) => {
|
|
8799
|
+
let setters;
|
|
8800
|
+
if (!(setters = g[key]))
|
|
8801
|
+
setters = g[key] = [];
|
|
8802
|
+
setters.push(setter);
|
|
8803
|
+
return (v) => {
|
|
8804
|
+
if (setters.length > 1)
|
|
8805
|
+
setters.forEach((set) => set(v));
|
|
8806
|
+
else
|
|
8807
|
+
setters[0](v);
|
|
8808
|
+
};
|
|
8711
8809
|
};
|
|
8810
|
+
internalSetCurrentInstance = registerGlobalSetter(
|
|
8811
|
+
`__VUE_INSTANCE_SETTERS__`,
|
|
8812
|
+
(v) => currentInstance = v
|
|
8813
|
+
);
|
|
8814
|
+
setInSSRSetupState = registerGlobalSetter(
|
|
8815
|
+
`__VUE_SSR_SETTERS__`,
|
|
8816
|
+
(v) => isInSSRComponentSetup = v
|
|
8817
|
+
);
|
|
8712
8818
|
}
|
|
8713
8819
|
const setCurrentInstance = (instance) => {
|
|
8714
8820
|
internalSetCurrentInstance(instance);
|
|
@@ -8723,13 +8829,13 @@ function isStatefulComponent(instance) {
|
|
|
8723
8829
|
}
|
|
8724
8830
|
let isInSSRComponentSetup = false;
|
|
8725
8831
|
function setupComponent(instance, isSSR = false) {
|
|
8726
|
-
|
|
8832
|
+
isSSR && setInSSRSetupState(isSSR);
|
|
8727
8833
|
const { props, children } = instance.vnode;
|
|
8728
8834
|
const isStateful = isStatefulComponent(instance);
|
|
8729
8835
|
initProps(instance, props, isStateful, isSSR);
|
|
8730
8836
|
initSlots(instance, children);
|
|
8731
8837
|
const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
|
|
8732
|
-
|
|
8838
|
+
isSSR && setInSSRSetupState(false);
|
|
8733
8839
|
return setupResult;
|
|
8734
8840
|
}
|
|
8735
8841
|
function setupStatefulComponent(instance, isSSR) {
|
|
@@ -8949,7 +9055,7 @@ function isMemoSame(cached, memo) {
|
|
|
8949
9055
|
return true;
|
|
8950
9056
|
}
|
|
8951
9057
|
|
|
8952
|
-
const version = "3.4.0-
|
|
9058
|
+
const version = "3.4.0-beta.1";
|
|
8953
9059
|
const ErrorTypeStrings = null;
|
|
8954
9060
|
const _ssrUtils = {
|
|
8955
9061
|
createComponentInstance,
|
|
@@ -8972,6 +9078,7 @@ const compatUtils = _compatUtils ;
|
|
|
8972
9078
|
const DeprecationTypes = DeprecationTypes$1 ;
|
|
8973
9079
|
|
|
8974
9080
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
9081
|
+
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
8975
9082
|
const doc = typeof document !== "undefined" ? document : null;
|
|
8976
9083
|
const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
|
|
8977
9084
|
const nodeOps = {
|
|
@@ -8984,8 +9091,8 @@ const nodeOps = {
|
|
|
8984
9091
|
parent.removeChild(child);
|
|
8985
9092
|
}
|
|
8986
9093
|
},
|
|
8987
|
-
createElement: (tag,
|
|
8988
|
-
const el =
|
|
9094
|
+
createElement: (tag, namespace, is, props) => {
|
|
9095
|
+
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
|
|
8989
9096
|
if (tag === "select" && props && props.multiple != null) {
|
|
8990
9097
|
el.setAttribute("multiple", props.multiple);
|
|
8991
9098
|
}
|
|
@@ -9009,7 +9116,7 @@ const nodeOps = {
|
|
|
9009
9116
|
// Reason: innerHTML.
|
|
9010
9117
|
// Static content here can only come from compiled templates.
|
|
9011
9118
|
// As long as the user only uses trusted templates, this is safe.
|
|
9012
|
-
insertStaticContent(content, parent, anchor,
|
|
9119
|
+
insertStaticContent(content, parent, anchor, namespace, start, end) {
|
|
9013
9120
|
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
9014
9121
|
if (start && (start === end || start.nextSibling)) {
|
|
9015
9122
|
while (true) {
|
|
@@ -9018,9 +9125,9 @@ const nodeOps = {
|
|
|
9018
9125
|
break;
|
|
9019
9126
|
}
|
|
9020
9127
|
} else {
|
|
9021
|
-
templateContainer.innerHTML =
|
|
9128
|
+
templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
|
|
9022
9129
|
const template = templateContainer.content;
|
|
9023
|
-
if (
|
|
9130
|
+
if (namespace === "svg" || namespace === "mathml") {
|
|
9024
9131
|
const wrapper = template.firstChild;
|
|
9025
9132
|
while (wrapper.firstChild) {
|
|
9026
9133
|
template.appendChild(wrapper.firstChild);
|
|
@@ -9645,7 +9752,8 @@ function patchStopImmediatePropagation(e, value) {
|
|
|
9645
9752
|
|
|
9646
9753
|
const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
|
|
9647
9754
|
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
|
|
9648
|
-
const patchProp = (el, key, prevValue, nextValue,
|
|
9755
|
+
const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
|
|
9756
|
+
const isSVG = namespace === "svg";
|
|
9649
9757
|
if (key === "class") {
|
|
9650
9758
|
patchClass(el, nextValue, isSVG);
|
|
9651
9759
|
} else if (key === "style") {
|
|
@@ -9697,7 +9805,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
9697
9805
|
}
|
|
9698
9806
|
if (key === "width" || key === "height") {
|
|
9699
9807
|
const tag = el.tagName;
|
|
9700
|
-
|
|
9808
|
+
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
|
|
9809
|
+
return false;
|
|
9810
|
+
}
|
|
9701
9811
|
}
|
|
9702
9812
|
if (isNativeOn(key) && isString(value)) {
|
|
9703
9813
|
return false;
|
|
@@ -10430,7 +10540,7 @@ const createApp = (...args) => {
|
|
|
10430
10540
|
component.template = container.innerHTML;
|
|
10431
10541
|
}
|
|
10432
10542
|
container.innerHTML = "";
|
|
10433
|
-
const proxy = mount(container, false, container
|
|
10543
|
+
const proxy = mount(container, false, resolveRootNamespace(container));
|
|
10434
10544
|
if (container instanceof Element) {
|
|
10435
10545
|
container.removeAttribute("v-cloak");
|
|
10436
10546
|
container.setAttribute("data-v-app", "");
|
|
@@ -10445,11 +10555,19 @@ const createSSRApp = (...args) => {
|
|
|
10445
10555
|
app.mount = (containerOrSelector) => {
|
|
10446
10556
|
const container = normalizeContainer(containerOrSelector);
|
|
10447
10557
|
if (container) {
|
|
10448
|
-
return mount(container, true, container
|
|
10558
|
+
return mount(container, true, resolveRootNamespace(container));
|
|
10449
10559
|
}
|
|
10450
10560
|
};
|
|
10451
10561
|
return app;
|
|
10452
10562
|
};
|
|
10563
|
+
function resolveRootNamespace(container) {
|
|
10564
|
+
if (container instanceof SVGElement) {
|
|
10565
|
+
return "svg";
|
|
10566
|
+
}
|
|
10567
|
+
if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
|
|
10568
|
+
return "mathml";
|
|
10569
|
+
}
|
|
10570
|
+
}
|
|
10453
10571
|
function normalizeContainer(container) {
|
|
10454
10572
|
if (isString(container)) {
|
|
10455
10573
|
const res = document.querySelector(container);
|
|
@@ -11828,54 +11946,317 @@ const errorMessages = {
|
|
|
11828
11946
|
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
11829
11947
|
[45]: `Error parsing JavaScript expression: `,
|
|
11830
11948
|
[46]: `<KeepAlive> expects exactly one child component.`,
|
|
11831
|
-
[
|
|
11949
|
+
[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.`,
|
|
11832
11950
|
// generic errors
|
|
11833
|
-
[
|
|
11834
|
-
[
|
|
11835
|
-
[
|
|
11836
|
-
[
|
|
11951
|
+
[47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
11952
|
+
[48]: `ES module mode is not supported in this build of compiler.`,
|
|
11953
|
+
[49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
11954
|
+
[50]: `"scopeId" option is only supported in module mode.`,
|
|
11837
11955
|
// just to fulfill types
|
|
11838
11956
|
[52]: ``
|
|
11839
11957
|
};
|
|
11840
11958
|
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
}
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11959
|
+
function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
|
|
11960
|
+
const rootExp = root.type === "Program" ? root.body[0].type === "ExpressionStatement" && root.body[0].expression : root;
|
|
11961
|
+
estreeWalker.walk(root, {
|
|
11962
|
+
enter(node, parent) {
|
|
11963
|
+
parent && parentStack.push(parent);
|
|
11964
|
+
if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) {
|
|
11965
|
+
return this.skip();
|
|
11966
|
+
}
|
|
11967
|
+
if (node.type === "Identifier") {
|
|
11968
|
+
const isLocal = !!knownIds[node.name];
|
|
11969
|
+
const isRefed = isReferencedIdentifier(node, parent, parentStack);
|
|
11970
|
+
if (includeAll || isRefed && !isLocal) {
|
|
11971
|
+
onIdentifier(node, parent, parentStack, isRefed, isLocal);
|
|
11972
|
+
}
|
|
11973
|
+
} else if (node.type === "ObjectProperty" && parent.type === "ObjectPattern") {
|
|
11974
|
+
node.inPattern = true;
|
|
11975
|
+
} else if (isFunctionType(node)) {
|
|
11976
|
+
walkFunctionParams(node, (id) => markScopeIdentifier(node, id, knownIds));
|
|
11977
|
+
} else if (node.type === "BlockStatement") {
|
|
11978
|
+
walkBlockDeclarations(
|
|
11979
|
+
node,
|
|
11980
|
+
(id) => markScopeIdentifier(node, id, knownIds)
|
|
11981
|
+
);
|
|
11982
|
+
}
|
|
11983
|
+
},
|
|
11984
|
+
leave(node, parent) {
|
|
11985
|
+
parent && parentStack.pop();
|
|
11986
|
+
if (node !== rootExp && node.scopeIds) {
|
|
11987
|
+
for (const id of node.scopeIds) {
|
|
11988
|
+
knownIds[id]--;
|
|
11989
|
+
if (knownIds[id] === 0) {
|
|
11990
|
+
delete knownIds[id];
|
|
11991
|
+
}
|
|
11992
|
+
}
|
|
11993
|
+
}
|
|
11867
11994
|
}
|
|
11868
|
-
|
|
11869
|
-
|
|
11995
|
+
});
|
|
11996
|
+
}
|
|
11997
|
+
function isReferencedIdentifier(id, parent, parentStack) {
|
|
11998
|
+
if (!parent) {
|
|
11999
|
+
return true;
|
|
12000
|
+
}
|
|
12001
|
+
if (id.name === "arguments") {
|
|
11870
12002
|
return false;
|
|
11871
12003
|
}
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
12004
|
+
if (isReferenced(id, parent)) {
|
|
12005
|
+
return true;
|
|
12006
|
+
}
|
|
12007
|
+
switch (parent.type) {
|
|
12008
|
+
case "AssignmentExpression":
|
|
12009
|
+
case "AssignmentPattern":
|
|
12010
|
+
return true;
|
|
12011
|
+
case "ObjectPattern":
|
|
12012
|
+
case "ArrayPattern":
|
|
12013
|
+
return isInDestructureAssignment(parent, parentStack);
|
|
12014
|
+
}
|
|
12015
|
+
return false;
|
|
12016
|
+
}
|
|
12017
|
+
function isInDestructureAssignment(parent, parentStack) {
|
|
12018
|
+
if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) {
|
|
12019
|
+
let i = parentStack.length;
|
|
12020
|
+
while (i--) {
|
|
12021
|
+
const p = parentStack[i];
|
|
12022
|
+
if (p.type === "AssignmentExpression") {
|
|
12023
|
+
return true;
|
|
12024
|
+
} else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) {
|
|
12025
|
+
break;
|
|
12026
|
+
}
|
|
12027
|
+
}
|
|
12028
|
+
}
|
|
12029
|
+
return false;
|
|
12030
|
+
}
|
|
12031
|
+
function walkFunctionParams(node, onIdent) {
|
|
12032
|
+
for (const p of node.params) {
|
|
12033
|
+
for (const id of extractIdentifiers(p)) {
|
|
12034
|
+
onIdent(id);
|
|
12035
|
+
}
|
|
12036
|
+
}
|
|
12037
|
+
}
|
|
12038
|
+
function walkBlockDeclarations(block, onIdent) {
|
|
12039
|
+
for (const stmt of block.body) {
|
|
12040
|
+
if (stmt.type === "VariableDeclaration") {
|
|
12041
|
+
if (stmt.declare)
|
|
12042
|
+
continue;
|
|
12043
|
+
for (const decl of stmt.declarations) {
|
|
12044
|
+
for (const id of extractIdentifiers(decl.id)) {
|
|
12045
|
+
onIdent(id);
|
|
12046
|
+
}
|
|
12047
|
+
}
|
|
12048
|
+
} else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
|
|
12049
|
+
if (stmt.declare || !stmt.id)
|
|
12050
|
+
continue;
|
|
12051
|
+
onIdent(stmt.id);
|
|
12052
|
+
} else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") {
|
|
12053
|
+
const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
|
|
12054
|
+
if (variable && variable.type === "VariableDeclaration") {
|
|
12055
|
+
for (const decl of variable.declarations) {
|
|
12056
|
+
for (const id of extractIdentifiers(decl.id)) {
|
|
12057
|
+
onIdent(id);
|
|
12058
|
+
}
|
|
12059
|
+
}
|
|
12060
|
+
}
|
|
12061
|
+
}
|
|
12062
|
+
}
|
|
12063
|
+
}
|
|
12064
|
+
function extractIdentifiers(param, nodes = []) {
|
|
12065
|
+
switch (param.type) {
|
|
12066
|
+
case "Identifier":
|
|
12067
|
+
nodes.push(param);
|
|
12068
|
+
break;
|
|
12069
|
+
case "MemberExpression":
|
|
12070
|
+
let object = param;
|
|
12071
|
+
while (object.type === "MemberExpression") {
|
|
12072
|
+
object = object.object;
|
|
12073
|
+
}
|
|
12074
|
+
nodes.push(object);
|
|
12075
|
+
break;
|
|
12076
|
+
case "ObjectPattern":
|
|
12077
|
+
for (const prop of param.properties) {
|
|
12078
|
+
if (prop.type === "RestElement") {
|
|
12079
|
+
extractIdentifiers(prop.argument, nodes);
|
|
12080
|
+
} else {
|
|
12081
|
+
extractIdentifiers(prop.value, nodes);
|
|
12082
|
+
}
|
|
12083
|
+
}
|
|
12084
|
+
break;
|
|
12085
|
+
case "ArrayPattern":
|
|
12086
|
+
param.elements.forEach((element) => {
|
|
12087
|
+
if (element)
|
|
12088
|
+
extractIdentifiers(element, nodes);
|
|
12089
|
+
});
|
|
12090
|
+
break;
|
|
12091
|
+
case "RestElement":
|
|
12092
|
+
extractIdentifiers(param.argument, nodes);
|
|
12093
|
+
break;
|
|
12094
|
+
case "AssignmentPattern":
|
|
12095
|
+
extractIdentifiers(param.left, nodes);
|
|
12096
|
+
break;
|
|
12097
|
+
}
|
|
12098
|
+
return nodes;
|
|
12099
|
+
}
|
|
12100
|
+
function markScopeIdentifier(node, child, knownIds) {
|
|
12101
|
+
const { name } = child;
|
|
12102
|
+
if (node.scopeIds && node.scopeIds.has(name)) {
|
|
12103
|
+
return;
|
|
12104
|
+
}
|
|
12105
|
+
if (name in knownIds) {
|
|
12106
|
+
knownIds[name]++;
|
|
12107
|
+
} else {
|
|
12108
|
+
knownIds[name] = 1;
|
|
12109
|
+
}
|
|
12110
|
+
(node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name);
|
|
12111
|
+
}
|
|
12112
|
+
const isFunctionType = (node) => {
|
|
12113
|
+
return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
|
|
12114
|
+
};
|
|
12115
|
+
const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
|
|
12116
|
+
const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
|
|
12117
|
+
function isReferenced(node, parent, grandparent) {
|
|
12118
|
+
switch (parent.type) {
|
|
12119
|
+
case "MemberExpression":
|
|
12120
|
+
case "OptionalMemberExpression":
|
|
12121
|
+
if (parent.property === node) {
|
|
12122
|
+
return !!parent.computed;
|
|
12123
|
+
}
|
|
12124
|
+
return parent.object === node;
|
|
12125
|
+
case "JSXMemberExpression":
|
|
12126
|
+
return parent.object === node;
|
|
12127
|
+
case "VariableDeclarator":
|
|
12128
|
+
return parent.init === node;
|
|
12129
|
+
case "ArrowFunctionExpression":
|
|
12130
|
+
return parent.body === node;
|
|
12131
|
+
case "PrivateName":
|
|
12132
|
+
return false;
|
|
12133
|
+
case "ClassMethod":
|
|
12134
|
+
case "ClassPrivateMethod":
|
|
12135
|
+
case "ObjectMethod":
|
|
12136
|
+
if (parent.key === node) {
|
|
12137
|
+
return !!parent.computed;
|
|
12138
|
+
}
|
|
12139
|
+
return false;
|
|
12140
|
+
case "ObjectProperty":
|
|
12141
|
+
if (parent.key === node) {
|
|
12142
|
+
return !!parent.computed;
|
|
12143
|
+
}
|
|
12144
|
+
return !grandparent || grandparent.type !== "ObjectPattern";
|
|
12145
|
+
case "ClassProperty":
|
|
12146
|
+
if (parent.key === node) {
|
|
12147
|
+
return !!parent.computed;
|
|
12148
|
+
}
|
|
12149
|
+
return true;
|
|
12150
|
+
case "ClassPrivateProperty":
|
|
12151
|
+
return parent.key !== node;
|
|
12152
|
+
case "ClassDeclaration":
|
|
12153
|
+
case "ClassExpression":
|
|
12154
|
+
return parent.superClass === node;
|
|
12155
|
+
case "AssignmentExpression":
|
|
12156
|
+
return parent.right === node;
|
|
12157
|
+
case "AssignmentPattern":
|
|
12158
|
+
return parent.right === node;
|
|
12159
|
+
case "LabeledStatement":
|
|
12160
|
+
return false;
|
|
12161
|
+
case "CatchClause":
|
|
12162
|
+
return false;
|
|
12163
|
+
case "RestElement":
|
|
12164
|
+
return false;
|
|
12165
|
+
case "BreakStatement":
|
|
12166
|
+
case "ContinueStatement":
|
|
12167
|
+
return false;
|
|
12168
|
+
case "FunctionDeclaration":
|
|
12169
|
+
case "FunctionExpression":
|
|
12170
|
+
return false;
|
|
12171
|
+
case "ExportNamespaceSpecifier":
|
|
12172
|
+
case "ExportDefaultSpecifier":
|
|
12173
|
+
return false;
|
|
12174
|
+
case "ExportSpecifier":
|
|
12175
|
+
if (grandparent == null ? void 0 : grandparent.source) {
|
|
12176
|
+
return false;
|
|
12177
|
+
}
|
|
12178
|
+
return parent.local === node;
|
|
12179
|
+
case "ImportDefaultSpecifier":
|
|
12180
|
+
case "ImportNamespaceSpecifier":
|
|
12181
|
+
case "ImportSpecifier":
|
|
12182
|
+
return false;
|
|
12183
|
+
case "ImportAttribute":
|
|
12184
|
+
return false;
|
|
12185
|
+
case "JSXAttribute":
|
|
12186
|
+
return false;
|
|
12187
|
+
case "ObjectPattern":
|
|
12188
|
+
case "ArrayPattern":
|
|
12189
|
+
return false;
|
|
12190
|
+
case "MetaProperty":
|
|
12191
|
+
return false;
|
|
12192
|
+
case "ObjectTypeProperty":
|
|
12193
|
+
return parent.key !== node;
|
|
12194
|
+
case "TSEnumMember":
|
|
12195
|
+
return parent.id !== node;
|
|
12196
|
+
case "TSPropertySignature":
|
|
12197
|
+
if (parent.key === node) {
|
|
12198
|
+
return !!parent.computed;
|
|
12199
|
+
}
|
|
12200
|
+
return true;
|
|
12201
|
+
}
|
|
12202
|
+
return true;
|
|
12203
|
+
}
|
|
12204
|
+
const TS_NODE_TYPES = [
|
|
12205
|
+
"TSAsExpression",
|
|
12206
|
+
// foo as number
|
|
12207
|
+
"TSTypeAssertion",
|
|
12208
|
+
// (<number>foo)
|
|
12209
|
+
"TSNonNullExpression",
|
|
12210
|
+
// foo!
|
|
12211
|
+
"TSInstantiationExpression",
|
|
12212
|
+
// foo<string>
|
|
12213
|
+
"TSSatisfiesExpression"
|
|
12214
|
+
// foo satisfies T
|
|
12215
|
+
];
|
|
12216
|
+
function unwrapTSNode(node) {
|
|
12217
|
+
if (TS_NODE_TYPES.includes(node.type)) {
|
|
12218
|
+
return unwrapTSNode(node.expression);
|
|
12219
|
+
} else {
|
|
12220
|
+
return node;
|
|
12221
|
+
}
|
|
12222
|
+
}
|
|
12223
|
+
|
|
12224
|
+
const isStaticExp = (p) => p.type === 4 && p.isStatic;
|
|
12225
|
+
function isCoreComponent(tag) {
|
|
12226
|
+
switch (tag) {
|
|
12227
|
+
case "Teleport":
|
|
12228
|
+
case "teleport":
|
|
12229
|
+
return TELEPORT;
|
|
12230
|
+
case "Suspense":
|
|
12231
|
+
case "suspense":
|
|
12232
|
+
return SUSPENSE;
|
|
12233
|
+
case "KeepAlive":
|
|
12234
|
+
case "keep-alive":
|
|
12235
|
+
return KEEP_ALIVE;
|
|
12236
|
+
case "BaseTransition":
|
|
12237
|
+
case "base-transition":
|
|
12238
|
+
return BASE_TRANSITION;
|
|
12239
|
+
}
|
|
12240
|
+
}
|
|
12241
|
+
const nonIdentifierRE = /^\d|[^\$\w]/;
|
|
12242
|
+
const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
|
|
12243
|
+
const isMemberExpressionNode = (path, context) => {
|
|
12244
|
+
try {
|
|
12245
|
+
let ret = parser.parseExpression(path, {
|
|
12246
|
+
plugins: context.expressionPlugins
|
|
12247
|
+
});
|
|
12248
|
+
ret = unwrapTSNode(ret);
|
|
12249
|
+
return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier";
|
|
12250
|
+
} catch (e) {
|
|
12251
|
+
return false;
|
|
12252
|
+
}
|
|
12253
|
+
};
|
|
12254
|
+
const isMemberExpression = isMemberExpressionNode;
|
|
12255
|
+
function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
|
|
12256
|
+
return advancePositionWithMutation(
|
|
12257
|
+
{
|
|
12258
|
+
offset: pos.offset,
|
|
12259
|
+
line: pos.line,
|
|
11879
12260
|
column: pos.column
|
|
11880
12261
|
},
|
|
11881
12262
|
source,
|
|
@@ -13084,6 +13465,7 @@ function createTransformContext(root, {
|
|
|
13084
13465
|
const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
|
|
13085
13466
|
const context = {
|
|
13086
13467
|
// options
|
|
13468
|
+
filename,
|
|
13087
13469
|
selfName: nameMatch && capitalize(camelize(nameMatch[1])),
|
|
13088
13470
|
prefixIdentifiers,
|
|
13089
13471
|
hoistStatic: hoistStatic2,
|
|
@@ -14126,264 +14508,6 @@ function genReturnStatement({ returns }, context) {
|
|
|
14126
14508
|
}
|
|
14127
14509
|
}
|
|
14128
14510
|
|
|
14129
|
-
function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
|
|
14130
|
-
const rootExp = root.type === "Program" ? root.body[0].type === "ExpressionStatement" && root.body[0].expression : root;
|
|
14131
|
-
estreeWalker.walk(root, {
|
|
14132
|
-
enter(node, parent) {
|
|
14133
|
-
parent && parentStack.push(parent);
|
|
14134
|
-
if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) {
|
|
14135
|
-
return this.skip();
|
|
14136
|
-
}
|
|
14137
|
-
if (node.type === "Identifier") {
|
|
14138
|
-
const isLocal = !!knownIds[node.name];
|
|
14139
|
-
const isRefed = isReferencedIdentifier(node, parent, parentStack);
|
|
14140
|
-
if (includeAll || isRefed && !isLocal) {
|
|
14141
|
-
onIdentifier(node, parent, parentStack, isRefed, isLocal);
|
|
14142
|
-
}
|
|
14143
|
-
} else if (node.type === "ObjectProperty" && parent.type === "ObjectPattern") {
|
|
14144
|
-
node.inPattern = true;
|
|
14145
|
-
} else if (isFunctionType(node)) {
|
|
14146
|
-
walkFunctionParams(node, (id) => markScopeIdentifier(node, id, knownIds));
|
|
14147
|
-
} else if (node.type === "BlockStatement") {
|
|
14148
|
-
walkBlockDeclarations(
|
|
14149
|
-
node,
|
|
14150
|
-
(id) => markScopeIdentifier(node, id, knownIds)
|
|
14151
|
-
);
|
|
14152
|
-
}
|
|
14153
|
-
},
|
|
14154
|
-
leave(node, parent) {
|
|
14155
|
-
parent && parentStack.pop();
|
|
14156
|
-
if (node !== rootExp && node.scopeIds) {
|
|
14157
|
-
for (const id of node.scopeIds) {
|
|
14158
|
-
knownIds[id]--;
|
|
14159
|
-
if (knownIds[id] === 0) {
|
|
14160
|
-
delete knownIds[id];
|
|
14161
|
-
}
|
|
14162
|
-
}
|
|
14163
|
-
}
|
|
14164
|
-
}
|
|
14165
|
-
});
|
|
14166
|
-
}
|
|
14167
|
-
function isReferencedIdentifier(id, parent, parentStack) {
|
|
14168
|
-
if (!parent) {
|
|
14169
|
-
return true;
|
|
14170
|
-
}
|
|
14171
|
-
if (id.name === "arguments") {
|
|
14172
|
-
return false;
|
|
14173
|
-
}
|
|
14174
|
-
if (isReferenced(id, parent)) {
|
|
14175
|
-
return true;
|
|
14176
|
-
}
|
|
14177
|
-
switch (parent.type) {
|
|
14178
|
-
case "AssignmentExpression":
|
|
14179
|
-
case "AssignmentPattern":
|
|
14180
|
-
return true;
|
|
14181
|
-
case "ObjectPattern":
|
|
14182
|
-
case "ArrayPattern":
|
|
14183
|
-
return isInDestructureAssignment(parent, parentStack);
|
|
14184
|
-
}
|
|
14185
|
-
return false;
|
|
14186
|
-
}
|
|
14187
|
-
function isInDestructureAssignment(parent, parentStack) {
|
|
14188
|
-
if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) {
|
|
14189
|
-
let i = parentStack.length;
|
|
14190
|
-
while (i--) {
|
|
14191
|
-
const p = parentStack[i];
|
|
14192
|
-
if (p.type === "AssignmentExpression") {
|
|
14193
|
-
return true;
|
|
14194
|
-
} else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) {
|
|
14195
|
-
break;
|
|
14196
|
-
}
|
|
14197
|
-
}
|
|
14198
|
-
}
|
|
14199
|
-
return false;
|
|
14200
|
-
}
|
|
14201
|
-
function walkFunctionParams(node, onIdent) {
|
|
14202
|
-
for (const p of node.params) {
|
|
14203
|
-
for (const id of extractIdentifiers(p)) {
|
|
14204
|
-
onIdent(id);
|
|
14205
|
-
}
|
|
14206
|
-
}
|
|
14207
|
-
}
|
|
14208
|
-
function walkBlockDeclarations(block, onIdent) {
|
|
14209
|
-
for (const stmt of block.body) {
|
|
14210
|
-
if (stmt.type === "VariableDeclaration") {
|
|
14211
|
-
if (stmt.declare)
|
|
14212
|
-
continue;
|
|
14213
|
-
for (const decl of stmt.declarations) {
|
|
14214
|
-
for (const id of extractIdentifiers(decl.id)) {
|
|
14215
|
-
onIdent(id);
|
|
14216
|
-
}
|
|
14217
|
-
}
|
|
14218
|
-
} else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
|
|
14219
|
-
if (stmt.declare || !stmt.id)
|
|
14220
|
-
continue;
|
|
14221
|
-
onIdent(stmt.id);
|
|
14222
|
-
} else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") {
|
|
14223
|
-
const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
|
|
14224
|
-
if (variable && variable.type === "VariableDeclaration") {
|
|
14225
|
-
for (const decl of variable.declarations) {
|
|
14226
|
-
for (const id of extractIdentifiers(decl.id)) {
|
|
14227
|
-
onIdent(id);
|
|
14228
|
-
}
|
|
14229
|
-
}
|
|
14230
|
-
}
|
|
14231
|
-
}
|
|
14232
|
-
}
|
|
14233
|
-
}
|
|
14234
|
-
function extractIdentifiers(param, nodes = []) {
|
|
14235
|
-
switch (param.type) {
|
|
14236
|
-
case "Identifier":
|
|
14237
|
-
nodes.push(param);
|
|
14238
|
-
break;
|
|
14239
|
-
case "MemberExpression":
|
|
14240
|
-
let object = param;
|
|
14241
|
-
while (object.type === "MemberExpression") {
|
|
14242
|
-
object = object.object;
|
|
14243
|
-
}
|
|
14244
|
-
nodes.push(object);
|
|
14245
|
-
break;
|
|
14246
|
-
case "ObjectPattern":
|
|
14247
|
-
for (const prop of param.properties) {
|
|
14248
|
-
if (prop.type === "RestElement") {
|
|
14249
|
-
extractIdentifiers(prop.argument, nodes);
|
|
14250
|
-
} else {
|
|
14251
|
-
extractIdentifiers(prop.value, nodes);
|
|
14252
|
-
}
|
|
14253
|
-
}
|
|
14254
|
-
break;
|
|
14255
|
-
case "ArrayPattern":
|
|
14256
|
-
param.elements.forEach((element) => {
|
|
14257
|
-
if (element)
|
|
14258
|
-
extractIdentifiers(element, nodes);
|
|
14259
|
-
});
|
|
14260
|
-
break;
|
|
14261
|
-
case "RestElement":
|
|
14262
|
-
extractIdentifiers(param.argument, nodes);
|
|
14263
|
-
break;
|
|
14264
|
-
case "AssignmentPattern":
|
|
14265
|
-
extractIdentifiers(param.left, nodes);
|
|
14266
|
-
break;
|
|
14267
|
-
}
|
|
14268
|
-
return nodes;
|
|
14269
|
-
}
|
|
14270
|
-
function markScopeIdentifier(node, child, knownIds) {
|
|
14271
|
-
const { name } = child;
|
|
14272
|
-
if (node.scopeIds && node.scopeIds.has(name)) {
|
|
14273
|
-
return;
|
|
14274
|
-
}
|
|
14275
|
-
if (name in knownIds) {
|
|
14276
|
-
knownIds[name]++;
|
|
14277
|
-
} else {
|
|
14278
|
-
knownIds[name] = 1;
|
|
14279
|
-
}
|
|
14280
|
-
(node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name);
|
|
14281
|
-
}
|
|
14282
|
-
const isFunctionType = (node) => {
|
|
14283
|
-
return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
|
|
14284
|
-
};
|
|
14285
|
-
const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
|
|
14286
|
-
const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
|
|
14287
|
-
function isReferenced(node, parent, grandparent) {
|
|
14288
|
-
switch (parent.type) {
|
|
14289
|
-
case "MemberExpression":
|
|
14290
|
-
case "OptionalMemberExpression":
|
|
14291
|
-
if (parent.property === node) {
|
|
14292
|
-
return !!parent.computed;
|
|
14293
|
-
}
|
|
14294
|
-
return parent.object === node;
|
|
14295
|
-
case "JSXMemberExpression":
|
|
14296
|
-
return parent.object === node;
|
|
14297
|
-
case "VariableDeclarator":
|
|
14298
|
-
return parent.init === node;
|
|
14299
|
-
case "ArrowFunctionExpression":
|
|
14300
|
-
return parent.body === node;
|
|
14301
|
-
case "PrivateName":
|
|
14302
|
-
return false;
|
|
14303
|
-
case "ClassMethod":
|
|
14304
|
-
case "ClassPrivateMethod":
|
|
14305
|
-
case "ObjectMethod":
|
|
14306
|
-
if (parent.key === node) {
|
|
14307
|
-
return !!parent.computed;
|
|
14308
|
-
}
|
|
14309
|
-
return false;
|
|
14310
|
-
case "ObjectProperty":
|
|
14311
|
-
if (parent.key === node) {
|
|
14312
|
-
return !!parent.computed;
|
|
14313
|
-
}
|
|
14314
|
-
return !grandparent || grandparent.type !== "ObjectPattern";
|
|
14315
|
-
case "ClassProperty":
|
|
14316
|
-
if (parent.key === node) {
|
|
14317
|
-
return !!parent.computed;
|
|
14318
|
-
}
|
|
14319
|
-
return true;
|
|
14320
|
-
case "ClassPrivateProperty":
|
|
14321
|
-
return parent.key !== node;
|
|
14322
|
-
case "ClassDeclaration":
|
|
14323
|
-
case "ClassExpression":
|
|
14324
|
-
return parent.superClass === node;
|
|
14325
|
-
case "AssignmentExpression":
|
|
14326
|
-
return parent.right === node;
|
|
14327
|
-
case "AssignmentPattern":
|
|
14328
|
-
return parent.right === node;
|
|
14329
|
-
case "LabeledStatement":
|
|
14330
|
-
return false;
|
|
14331
|
-
case "CatchClause":
|
|
14332
|
-
return false;
|
|
14333
|
-
case "RestElement":
|
|
14334
|
-
return false;
|
|
14335
|
-
case "BreakStatement":
|
|
14336
|
-
case "ContinueStatement":
|
|
14337
|
-
return false;
|
|
14338
|
-
case "FunctionDeclaration":
|
|
14339
|
-
case "FunctionExpression":
|
|
14340
|
-
return false;
|
|
14341
|
-
case "ExportNamespaceSpecifier":
|
|
14342
|
-
case "ExportDefaultSpecifier":
|
|
14343
|
-
return false;
|
|
14344
|
-
case "ExportSpecifier":
|
|
14345
|
-
if (grandparent == null ? void 0 : grandparent.source) {
|
|
14346
|
-
return false;
|
|
14347
|
-
}
|
|
14348
|
-
return parent.local === node;
|
|
14349
|
-
case "ImportDefaultSpecifier":
|
|
14350
|
-
case "ImportNamespaceSpecifier":
|
|
14351
|
-
case "ImportSpecifier":
|
|
14352
|
-
return false;
|
|
14353
|
-
case "ImportAttribute":
|
|
14354
|
-
return false;
|
|
14355
|
-
case "JSXAttribute":
|
|
14356
|
-
return false;
|
|
14357
|
-
case "ObjectPattern":
|
|
14358
|
-
case "ArrayPattern":
|
|
14359
|
-
return false;
|
|
14360
|
-
case "MetaProperty":
|
|
14361
|
-
return false;
|
|
14362
|
-
case "ObjectTypeProperty":
|
|
14363
|
-
return parent.key !== node;
|
|
14364
|
-
case "TSEnumMember":
|
|
14365
|
-
return parent.id !== node;
|
|
14366
|
-
case "TSPropertySignature":
|
|
14367
|
-
if (parent.key === node) {
|
|
14368
|
-
return !!parent.computed;
|
|
14369
|
-
}
|
|
14370
|
-
return true;
|
|
14371
|
-
}
|
|
14372
|
-
return true;
|
|
14373
|
-
}
|
|
14374
|
-
const TS_NODE_TYPES = [
|
|
14375
|
-
"TSAsExpression",
|
|
14376
|
-
// foo as number
|
|
14377
|
-
"TSTypeAssertion",
|
|
14378
|
-
// (<number>foo)
|
|
14379
|
-
"TSNonNullExpression",
|
|
14380
|
-
// foo!
|
|
14381
|
-
"TSInstantiationExpression",
|
|
14382
|
-
// foo<string>
|
|
14383
|
-
"TSSatisfiesExpression"
|
|
14384
|
-
// foo satisfies T
|
|
14385
|
-
];
|
|
14386
|
-
|
|
14387
14511
|
const isLiteralWhitelisted = /* @__PURE__ */ makeMap("true,false,null,this");
|
|
14388
14512
|
const constantBailRE = /\w\s*\(|\.[^\d]/;
|
|
14389
14513
|
const transformExpression = (node, context) => {
|
|
@@ -16531,12 +16655,15 @@ function baseCompile(source, options = {}) {
|
|
|
16531
16655
|
const isModuleMode = options.mode === "module";
|
|
16532
16656
|
const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode;
|
|
16533
16657
|
if (!prefixIdentifiers && options.cacheHandlers) {
|
|
16534
|
-
onError(createCompilerError(
|
|
16658
|
+
onError(createCompilerError(49));
|
|
16535
16659
|
}
|
|
16536
16660
|
if (options.scopeId && !isModuleMode) {
|
|
16537
|
-
onError(createCompilerError(
|
|
16661
|
+
onError(createCompilerError(50));
|
|
16538
16662
|
}
|
|
16539
|
-
const
|
|
16663
|
+
const resolvedOptions = extend({}, options, {
|
|
16664
|
+
prefixIdentifiers
|
|
16665
|
+
});
|
|
16666
|
+
const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
|
|
16540
16667
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);
|
|
16541
16668
|
if (options.isTS) {
|
|
16542
16669
|
const { expressionPlugins } = options;
|
|
@@ -16546,8 +16673,7 @@ function baseCompile(source, options = {}) {
|
|
|
16546
16673
|
}
|
|
16547
16674
|
transform(
|
|
16548
16675
|
ast,
|
|
16549
|
-
extend({},
|
|
16550
|
-
prefixIdentifiers,
|
|
16676
|
+
extend({}, resolvedOptions, {
|
|
16551
16677
|
nodeTransforms: [
|
|
16552
16678
|
...nodeTransforms,
|
|
16553
16679
|
...options.nodeTransforms || []
|
|
@@ -16561,12 +16687,7 @@ function baseCompile(source, options = {}) {
|
|
|
16561
16687
|
)
|
|
16562
16688
|
})
|
|
16563
16689
|
);
|
|
16564
|
-
return generate(
|
|
16565
|
-
ast,
|
|
16566
|
-
extend({}, options, {
|
|
16567
|
-
prefixIdentifiers
|
|
16568
|
-
})
|
|
16569
|
-
);
|
|
16690
|
+
return generate(ast, resolvedOptions);
|
|
16570
16691
|
}
|
|
16571
16692
|
|
|
16572
16693
|
const noopDirectiveTransform = () => ({ props: [] });
|
|
@@ -16597,7 +16718,7 @@ registerRuntimeHelpers({
|
|
|
16597
16718
|
const parserOptions = {
|
|
16598
16719
|
parseMode: "html",
|
|
16599
16720
|
isVoidTag,
|
|
16600
|
-
isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag),
|
|
16721
|
+
isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
|
|
16601
16722
|
isPreTag: (tag) => tag === "pre",
|
|
16602
16723
|
decodeEntities: void 0,
|
|
16603
16724
|
isBuiltInComponent: (tag) => {
|