@vue/compiler-sfc 3.3.10 → 3.3.12
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/compiler-sfc.cjs.js
CHANGED
|
@@ -15672,6 +15672,7 @@ class ScriptCompileContext {
|
|
|
15672
15672
|
constructor(descriptor, options) {
|
|
15673
15673
|
this.descriptor = descriptor;
|
|
15674
15674
|
this.options = options;
|
|
15675
|
+
this.isCE = false;
|
|
15675
15676
|
this.source = this.descriptor.source;
|
|
15676
15677
|
this.filename = this.descriptor.filename;
|
|
15677
15678
|
this.s = new MagicString(this.source);
|
|
@@ -15698,6 +15699,11 @@ class ScriptCompileContext {
|
|
|
15698
15699
|
const scriptSetupLang = scriptSetup && scriptSetup.lang;
|
|
15699
15700
|
this.isJS = scriptLang === "js" || scriptLang === "jsx" || scriptSetupLang === "js" || scriptSetupLang === "jsx";
|
|
15700
15701
|
this.isTS = scriptLang === "ts" || scriptLang === "tsx" || scriptSetupLang === "ts" || scriptSetupLang === "tsx";
|
|
15702
|
+
const customElement = options.customElement;
|
|
15703
|
+
const filename = this.descriptor.filename;
|
|
15704
|
+
if (customElement) {
|
|
15705
|
+
this.isCE = typeof customElement === "boolean" ? customElement : customElement(filename);
|
|
15706
|
+
}
|
|
15701
15707
|
const plugins = resolveParserPlugins(
|
|
15702
15708
|
scriptLang || scriptSetupLang,
|
|
15703
15709
|
options.babelParserPlugins
|
|
@@ -18844,6 +18850,7 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
18844
18850
|
scope
|
|
18845
18851
|
);
|
|
18846
18852
|
}
|
|
18853
|
+
break;
|
|
18847
18854
|
case "TSMethodSignature":
|
|
18848
18855
|
case "TSFunctionType":
|
|
18849
18856
|
return ["Function"];
|
|
@@ -19385,6 +19392,15 @@ function genRuntimePropFromType(ctx, { key, required, type, skipCheck }, hasStat
|
|
|
19385
19392
|
defaultString
|
|
19386
19393
|
])} }`;
|
|
19387
19394
|
} else {
|
|
19395
|
+
if (ctx.isCE) {
|
|
19396
|
+
if (defaultString) {
|
|
19397
|
+
return `${finalKey}: ${`{ ${defaultString}, type: ${toRuntimeTypeString(
|
|
19398
|
+
type
|
|
19399
|
+
)} }`}`;
|
|
19400
|
+
} else {
|
|
19401
|
+
return `${finalKey}: {type: ${toRuntimeTypeString(type)}}`;
|
|
19402
|
+
}
|
|
19403
|
+
}
|
|
19388
19404
|
return `${finalKey}: ${defaultString ? `{ ${defaultString} }` : `{}`}`;
|
|
19389
19405
|
}
|
|
19390
19406
|
}
|
|
@@ -20629,7 +20645,7 @@ function isStaticNode(node) {
|
|
|
20629
20645
|
return false;
|
|
20630
20646
|
}
|
|
20631
20647
|
|
|
20632
|
-
const version = "3.3.
|
|
20648
|
+
const version = "3.3.12";
|
|
20633
20649
|
const parseCache = parseCache$1;
|
|
20634
20650
|
const walk = estreeWalker.walk;
|
|
20635
20651
|
|
package/dist/compiler-sfc.d.ts
CHANGED
|
@@ -144,6 +144,10 @@ export interface SFCScriptCompileOptions {
|
|
|
144
144
|
* using it, disable this and switch to the [Vue Macros implementation](https://vue-macros.sxzz.moe/features/reactivity-transform.html).
|
|
145
145
|
*/
|
|
146
146
|
reactivityTransform?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Transform Vue SFCs into custom elements.
|
|
149
|
+
*/
|
|
150
|
+
customElement?: boolean | ((filename: string) => boolean);
|
|
147
151
|
}
|
|
148
152
|
interface ImportBinding {
|
|
149
153
|
isType: boolean;
|
|
@@ -355,6 +359,7 @@ export declare class ScriptCompileContext {
|
|
|
355
359
|
options: Partial<SFCScriptCompileOptions>;
|
|
356
360
|
isJS: boolean;
|
|
357
361
|
isTS: boolean;
|
|
362
|
+
isCE: boolean;
|
|
358
363
|
scriptAst: Program | null;
|
|
359
364
|
scriptSetupAst: Program | null;
|
|
360
365
|
source: string;
|
|
@@ -224,7 +224,7 @@ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
|
|
|
224
224
|
`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`
|
|
225
225
|
);
|
|
226
226
|
const isKnownSvgAttr = /* @__PURE__ */ makeMap(
|
|
227
|
-
`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`
|
|
227
|
+
`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`
|
|
228
228
|
);
|
|
229
229
|
|
|
230
230
|
const escapeRE = /["'&<>]/;
|
|
@@ -275,20 +275,29 @@ const replacer = (_key, val) => {
|
|
|
275
275
|
return replacer(_key, val.value);
|
|
276
276
|
} else if (isMap(val)) {
|
|
277
277
|
return {
|
|
278
|
-
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
279
|
-
entries[
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
279
|
+
(entries, [key, val2], i) => {
|
|
280
|
+
entries[stringifySymbol(key, i) + " =>"] = val2;
|
|
281
|
+
return entries;
|
|
282
|
+
},
|
|
283
|
+
{}
|
|
284
|
+
)
|
|
282
285
|
};
|
|
283
286
|
} else if (isSet(val)) {
|
|
284
287
|
return {
|
|
285
|
-
[`Set(${val.size})`]: [...val.values()]
|
|
288
|
+
[`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
|
|
286
289
|
};
|
|
290
|
+
} else if (isSymbol$1(val)) {
|
|
291
|
+
return stringifySymbol(val);
|
|
287
292
|
} else if (isObject$2(val) && !isArray$3(val) && !isPlainObject(val)) {
|
|
288
293
|
return String(val);
|
|
289
294
|
}
|
|
290
295
|
return val;
|
|
291
296
|
};
|
|
297
|
+
const stringifySymbol = (v, i = "") => {
|
|
298
|
+
var _a;
|
|
299
|
+
return isSymbol$1(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
|
|
300
|
+
};
|
|
292
301
|
|
|
293
302
|
function defaultOnError(error) {
|
|
294
303
|
throw error;
|
|
@@ -47048,6 +47057,7 @@ class ScriptCompileContext {
|
|
|
47048
47057
|
constructor(descriptor, options) {
|
|
47049
47058
|
this.descriptor = descriptor;
|
|
47050
47059
|
this.options = options;
|
|
47060
|
+
this.isCE = false;
|
|
47051
47061
|
this.source = this.descriptor.source;
|
|
47052
47062
|
this.filename = this.descriptor.filename;
|
|
47053
47063
|
this.s = new MagicString(this.source);
|
|
@@ -47074,6 +47084,11 @@ class ScriptCompileContext {
|
|
|
47074
47084
|
const scriptSetupLang = scriptSetup && scriptSetup.lang;
|
|
47075
47085
|
this.isJS = scriptLang === "js" || scriptLang === "jsx" || scriptSetupLang === "js" || scriptSetupLang === "jsx";
|
|
47076
47086
|
this.isTS = scriptLang === "ts" || scriptLang === "tsx" || scriptSetupLang === "ts" || scriptSetupLang === "tsx";
|
|
47087
|
+
const customElement = options.customElement;
|
|
47088
|
+
const filename = this.descriptor.filename;
|
|
47089
|
+
if (customElement) {
|
|
47090
|
+
this.isCE = typeof customElement === "boolean" ? customElement : customElement(filename);
|
|
47091
|
+
}
|
|
47077
47092
|
const plugins = resolveParserPlugins(
|
|
47078
47093
|
scriptLang || scriptSetupLang,
|
|
47079
47094
|
options.babelParserPlugins
|
|
@@ -48122,6 +48137,7 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
48122
48137
|
scope
|
|
48123
48138
|
);
|
|
48124
48139
|
}
|
|
48140
|
+
break;
|
|
48125
48141
|
case "TSMethodSignature":
|
|
48126
48142
|
case "TSFunctionType":
|
|
48127
48143
|
return ["Function"];
|
|
@@ -48663,6 +48679,15 @@ function genRuntimePropFromType(ctx, { key, required, type, skipCheck }, hasStat
|
|
|
48663
48679
|
defaultString
|
|
48664
48680
|
])} }`;
|
|
48665
48681
|
} else {
|
|
48682
|
+
if (ctx.isCE) {
|
|
48683
|
+
if (defaultString) {
|
|
48684
|
+
return `${finalKey}: ${`{ ${defaultString}, type: ${toRuntimeTypeString(
|
|
48685
|
+
type
|
|
48686
|
+
)} }`}`;
|
|
48687
|
+
} else {
|
|
48688
|
+
return `${finalKey}: {type: ${toRuntimeTypeString(type)}}`;
|
|
48689
|
+
}
|
|
48690
|
+
}
|
|
48666
48691
|
return `${finalKey}: ${defaultString ? `{ ${defaultString} }` : `{}`}`;
|
|
48667
48692
|
}
|
|
48668
48693
|
}
|
|
@@ -49921,7 +49946,7 @@ function isStaticNode(node) {
|
|
|
49921
49946
|
return false;
|
|
49922
49947
|
}
|
|
49923
49948
|
|
|
49924
|
-
const version = "3.3.
|
|
49949
|
+
const version = "3.3.12";
|
|
49925
49950
|
const parseCache = parseCache$1;
|
|
49926
49951
|
const walk = walk$1;
|
|
49927
49952
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-sfc",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.12",
|
|
4
4
|
"description": "@vue/compiler-sfc",
|
|
5
5
|
"main": "dist/compiler-sfc.cjs.js",
|
|
6
6
|
"module": "dist/compiler-sfc.esm-browser.js",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"magic-string": "^0.30.5",
|
|
38
38
|
"postcss": "^8.4.32",
|
|
39
39
|
"source-map-js": "^1.0.2",
|
|
40
|
-
"@vue/compiler-core": "3.3.
|
|
41
|
-
"@vue/compiler-dom": "3.3.
|
|
42
|
-
"@vue/
|
|
43
|
-
"@vue/
|
|
44
|
-
"@vue/shared": "3.3.
|
|
40
|
+
"@vue/compiler-core": "3.3.12",
|
|
41
|
+
"@vue/compiler-dom": "3.3.12",
|
|
42
|
+
"@vue/reactivity-transform": "3.3.12",
|
|
43
|
+
"@vue/compiler-ssr": "3.3.12",
|
|
44
|
+
"@vue/shared": "3.3.12"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@babel/types": "^7.23.5",
|