@vue/shared 3.4.0-alpha.3 → 3.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,8 +12,8 @@ const EMPTY_ARR = Object.freeze([]) ;
12
12
  const NOOP = () => {
13
13
  };
14
14
  const NO = () => false;
15
- const onRE = /^on[^a-z]/;
16
- const isOn = (key) => onRE.test(key);
15
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
16
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
17
17
  const isModelListener = (key) => key.startsWith("onUpdate:");
18
18
  const extend = Object.assign;
19
19
  const remove = (arr, el) => {
@@ -102,6 +102,36 @@ function genPropsAccessExp(name) {
102
102
  return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
103
103
  }
104
104
 
105
+ const PatchFlags = {
106
+ "TEXT": 1,
107
+ "1": "TEXT",
108
+ "CLASS": 2,
109
+ "2": "CLASS",
110
+ "STYLE": 4,
111
+ "4": "STYLE",
112
+ "PROPS": 8,
113
+ "8": "PROPS",
114
+ "FULL_PROPS": 16,
115
+ "16": "FULL_PROPS",
116
+ "NEED_HYDRATION": 32,
117
+ "32": "NEED_HYDRATION",
118
+ "STABLE_FRAGMENT": 64,
119
+ "64": "STABLE_FRAGMENT",
120
+ "KEYED_FRAGMENT": 128,
121
+ "128": "KEYED_FRAGMENT",
122
+ "UNKEYED_FRAGMENT": 256,
123
+ "256": "UNKEYED_FRAGMENT",
124
+ "NEED_PATCH": 512,
125
+ "512": "NEED_PATCH",
126
+ "DYNAMIC_SLOTS": 1024,
127
+ "1024": "DYNAMIC_SLOTS",
128
+ "DEV_ROOT_FRAGMENT": 2048,
129
+ "2048": "DEV_ROOT_FRAGMENT",
130
+ "HOISTED": -1,
131
+ "-1": "HOISTED",
132
+ "BAIL": -2,
133
+ "-2": "BAIL"
134
+ };
105
135
  const PatchFlagNames = {
106
136
  [1]: `TEXT`,
107
137
  [2]: `CLASS`,
@@ -119,13 +149,46 @@ const PatchFlagNames = {
119
149
  [-2]: `BAIL`
120
150
  };
121
151
 
152
+ const ShapeFlags = {
153
+ "ELEMENT": 1,
154
+ "1": "ELEMENT",
155
+ "FUNCTIONAL_COMPONENT": 2,
156
+ "2": "FUNCTIONAL_COMPONENT",
157
+ "STATEFUL_COMPONENT": 4,
158
+ "4": "STATEFUL_COMPONENT",
159
+ "TEXT_CHILDREN": 8,
160
+ "8": "TEXT_CHILDREN",
161
+ "ARRAY_CHILDREN": 16,
162
+ "16": "ARRAY_CHILDREN",
163
+ "SLOTS_CHILDREN": 32,
164
+ "32": "SLOTS_CHILDREN",
165
+ "TELEPORT": 64,
166
+ "64": "TELEPORT",
167
+ "SUSPENSE": 128,
168
+ "128": "SUSPENSE",
169
+ "COMPONENT_SHOULD_KEEP_ALIVE": 256,
170
+ "256": "COMPONENT_SHOULD_KEEP_ALIVE",
171
+ "COMPONENT_KEPT_ALIVE": 512,
172
+ "512": "COMPONENT_KEPT_ALIVE",
173
+ "COMPONENT": 6,
174
+ "6": "COMPONENT"
175
+ };
176
+
177
+ const SlotFlags = {
178
+ "STABLE": 1,
179
+ "1": "STABLE",
180
+ "DYNAMIC": 2,
181
+ "2": "DYNAMIC",
182
+ "FORWARDED": 3,
183
+ "3": "FORWARDED"
184
+ };
122
185
  const slotFlagsText = {
123
186
  [1]: "STABLE",
124
187
  [2]: "DYNAMIC",
125
188
  [3]: "FORWARDED"
126
189
  };
127
190
 
128
- const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
191
+ const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
129
192
  const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
130
193
  const isGloballyWhitelisted = isGloballyAllowed;
131
194
 
@@ -248,9 +311,11 @@ function normalizeProps(props) {
248
311
 
249
312
  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";
250
313
  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";
314
+ 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";
251
315
  const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
252
316
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
253
317
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
318
+ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
254
319
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
255
320
 
256
321
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
@@ -283,7 +348,7 @@ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
283
348
  `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`
284
349
  );
285
350
  const isKnownSvgAttr = /* @__PURE__ */ makeMap(
286
- `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`
351
+ `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`
287
352
  );
288
353
 
289
354
  const escapeRE = /["'&<>]/;
@@ -390,26 +455,38 @@ const replacer = (_key, val) => {
390
455
  return replacer(_key, val.value);
391
456
  } else if (isMap(val)) {
392
457
  return {
393
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
394
- entries[`${key} =>`] = val2;
395
- return entries;
396
- }, {})
458
+ [`Map(${val.size})`]: [...val.entries()].reduce(
459
+ (entries, [key, val2], i) => {
460
+ entries[stringifySymbol(key, i) + " =>"] = val2;
461
+ return entries;
462
+ },
463
+ {}
464
+ )
397
465
  };
398
466
  } else if (isSet(val)) {
399
467
  return {
400
- [`Set(${val.size})`]: [...val.values()]
468
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
401
469
  };
470
+ } else if (isSymbol(val)) {
471
+ return stringifySymbol(val);
402
472
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
403
473
  return String(val);
404
474
  }
405
475
  return val;
406
476
  };
477
+ const stringifySymbol = (v, i = "") => {
478
+ var _a;
479
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
480
+ };
407
481
 
408
482
  exports.EMPTY_ARR = EMPTY_ARR;
409
483
  exports.EMPTY_OBJ = EMPTY_OBJ;
410
484
  exports.NO = NO;
411
485
  exports.NOOP = NOOP;
412
486
  exports.PatchFlagNames = PatchFlagNames;
487
+ exports.PatchFlags = PatchFlags;
488
+ exports.ShapeFlags = ShapeFlags;
489
+ exports.SlotFlags = SlotFlags;
413
490
  exports.camelize = camelize;
414
491
  exports.capitalize = capitalize;
415
492
  exports.def = def;
@@ -436,6 +513,7 @@ exports.isIntegerKey = isIntegerKey;
436
513
  exports.isKnownHtmlAttr = isKnownHtmlAttr;
437
514
  exports.isKnownSvgAttr = isKnownSvgAttr;
438
515
  exports.isMap = isMap;
516
+ exports.isMathMLTag = isMathMLTag;
439
517
  exports.isModelListener = isModelListener;
440
518
  exports.isObject = isObject;
441
519
  exports.isOn = isOn;
@@ -12,8 +12,8 @@ const EMPTY_ARR = [];
12
12
  const NOOP = () => {
13
13
  };
14
14
  const NO = () => false;
15
- const onRE = /^on[^a-z]/;
16
- const isOn = (key) => onRE.test(key);
15
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
16
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
17
17
  const isModelListener = (key) => key.startsWith("onUpdate:");
18
18
  const extend = Object.assign;
19
19
  const remove = (arr, el) => {
@@ -102,6 +102,36 @@ function genPropsAccessExp(name) {
102
102
  return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
103
103
  }
104
104
 
105
+ const PatchFlags = {
106
+ "TEXT": 1,
107
+ "1": "TEXT",
108
+ "CLASS": 2,
109
+ "2": "CLASS",
110
+ "STYLE": 4,
111
+ "4": "STYLE",
112
+ "PROPS": 8,
113
+ "8": "PROPS",
114
+ "FULL_PROPS": 16,
115
+ "16": "FULL_PROPS",
116
+ "NEED_HYDRATION": 32,
117
+ "32": "NEED_HYDRATION",
118
+ "STABLE_FRAGMENT": 64,
119
+ "64": "STABLE_FRAGMENT",
120
+ "KEYED_FRAGMENT": 128,
121
+ "128": "KEYED_FRAGMENT",
122
+ "UNKEYED_FRAGMENT": 256,
123
+ "256": "UNKEYED_FRAGMENT",
124
+ "NEED_PATCH": 512,
125
+ "512": "NEED_PATCH",
126
+ "DYNAMIC_SLOTS": 1024,
127
+ "1024": "DYNAMIC_SLOTS",
128
+ "DEV_ROOT_FRAGMENT": 2048,
129
+ "2048": "DEV_ROOT_FRAGMENT",
130
+ "HOISTED": -1,
131
+ "-1": "HOISTED",
132
+ "BAIL": -2,
133
+ "-2": "BAIL"
134
+ };
105
135
  const PatchFlagNames = {
106
136
  [1]: `TEXT`,
107
137
  [2]: `CLASS`,
@@ -119,13 +149,46 @@ const PatchFlagNames = {
119
149
  [-2]: `BAIL`
120
150
  };
121
151
 
152
+ const ShapeFlags = {
153
+ "ELEMENT": 1,
154
+ "1": "ELEMENT",
155
+ "FUNCTIONAL_COMPONENT": 2,
156
+ "2": "FUNCTIONAL_COMPONENT",
157
+ "STATEFUL_COMPONENT": 4,
158
+ "4": "STATEFUL_COMPONENT",
159
+ "TEXT_CHILDREN": 8,
160
+ "8": "TEXT_CHILDREN",
161
+ "ARRAY_CHILDREN": 16,
162
+ "16": "ARRAY_CHILDREN",
163
+ "SLOTS_CHILDREN": 32,
164
+ "32": "SLOTS_CHILDREN",
165
+ "TELEPORT": 64,
166
+ "64": "TELEPORT",
167
+ "SUSPENSE": 128,
168
+ "128": "SUSPENSE",
169
+ "COMPONENT_SHOULD_KEEP_ALIVE": 256,
170
+ "256": "COMPONENT_SHOULD_KEEP_ALIVE",
171
+ "COMPONENT_KEPT_ALIVE": 512,
172
+ "512": "COMPONENT_KEPT_ALIVE",
173
+ "COMPONENT": 6,
174
+ "6": "COMPONENT"
175
+ };
176
+
177
+ const SlotFlags = {
178
+ "STABLE": 1,
179
+ "1": "STABLE",
180
+ "DYNAMIC": 2,
181
+ "2": "DYNAMIC",
182
+ "FORWARDED": 3,
183
+ "3": "FORWARDED"
184
+ };
122
185
  const slotFlagsText = {
123
186
  [1]: "STABLE",
124
187
  [2]: "DYNAMIC",
125
188
  [3]: "FORWARDED"
126
189
  };
127
190
 
128
- const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
191
+ const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
129
192
  const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
130
193
  const isGloballyWhitelisted = isGloballyAllowed;
131
194
 
@@ -248,9 +311,11 @@ function normalizeProps(props) {
248
311
 
249
312
  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";
250
313
  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";
314
+ 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";
251
315
  const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
252
316
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
253
317
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
318
+ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
254
319
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
255
320
 
256
321
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
@@ -283,7 +348,7 @@ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
283
348
  `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`
284
349
  );
285
350
  const isKnownSvgAttr = /* @__PURE__ */ makeMap(
286
- `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`
351
+ `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`
287
352
  );
288
353
 
289
354
  const escapeRE = /["'&<>]/;
@@ -390,26 +455,38 @@ const replacer = (_key, val) => {
390
455
  return replacer(_key, val.value);
391
456
  } else if (isMap(val)) {
392
457
  return {
393
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
394
- entries[`${key} =>`] = val2;
395
- return entries;
396
- }, {})
458
+ [`Map(${val.size})`]: [...val.entries()].reduce(
459
+ (entries, [key, val2], i) => {
460
+ entries[stringifySymbol(key, i) + " =>"] = val2;
461
+ return entries;
462
+ },
463
+ {}
464
+ )
397
465
  };
398
466
  } else if (isSet(val)) {
399
467
  return {
400
- [`Set(${val.size})`]: [...val.values()]
468
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
401
469
  };
470
+ } else if (isSymbol(val)) {
471
+ return stringifySymbol(val);
402
472
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
403
473
  return String(val);
404
474
  }
405
475
  return val;
406
476
  };
477
+ const stringifySymbol = (v, i = "") => {
478
+ var _a;
479
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
480
+ };
407
481
 
408
482
  exports.EMPTY_ARR = EMPTY_ARR;
409
483
  exports.EMPTY_OBJ = EMPTY_OBJ;
410
484
  exports.NO = NO;
411
485
  exports.NOOP = NOOP;
412
486
  exports.PatchFlagNames = PatchFlagNames;
487
+ exports.PatchFlags = PatchFlags;
488
+ exports.ShapeFlags = ShapeFlags;
489
+ exports.SlotFlags = SlotFlags;
413
490
  exports.camelize = camelize;
414
491
  exports.capitalize = capitalize;
415
492
  exports.def = def;
@@ -436,6 +513,7 @@ exports.isIntegerKey = isIntegerKey;
436
513
  exports.isKnownHtmlAttr = isKnownHtmlAttr;
437
514
  exports.isKnownSvgAttr = isKnownSvgAttr;
438
515
  exports.isMap = isMap;
516
+ exports.isMathMLTag = isMathMLTag;
439
517
  exports.isModelListener = isModelListener;
440
518
  exports.isObject = isObject;
441
519
  exports.isOn = isOn;
package/dist/shared.d.ts CHANGED
@@ -93,7 +93,7 @@ export declare function genPropsAccessExp(name: string): string;
93
93
  * Check the `patchElement` function in '../../runtime-core/src/renderer.ts' to see how the
94
94
  * flags are handled during diff.
95
95
  */
96
- export declare const enum PatchFlags {
96
+ export declare enum PatchFlags {
97
97
  /**
98
98
  * Indicates an element with dynamic textContent (children fast path)
99
99
  */
@@ -191,7 +191,7 @@ export declare const enum PatchFlags {
191
191
  */
192
192
  export declare const PatchFlagNames: Record<PatchFlags, string>;
193
193
 
194
- export declare const enum ShapeFlags {
194
+ export declare enum ShapeFlags {
195
195
  ELEMENT = 1,
196
196
  FUNCTIONAL_COMPONENT = 2,
197
197
  STATEFUL_COMPONENT = 4,
@@ -205,7 +205,7 @@ export declare const enum ShapeFlags {
205
205
  COMPONENT = 6
206
206
  }
207
207
 
208
- export declare const enum SlotFlags {
208
+ export declare enum SlotFlags {
209
209
  /**
210
210
  * Stable slots that only reference slot props or context state. The slot
211
211
  * can fully capture its own dependencies so when passed down the parent won't
@@ -258,6 +258,11 @@ export declare const isHTMLTag: (key: string) => boolean;
258
258
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
259
259
  */
260
260
  export declare const isSVGTag: (key: string) => boolean;
261
+ /**
262
+ * Compiler only.
263
+ * Do NOT use in runtime code paths unless behind `__DEV__` flag.
264
+ */
265
+ export declare const isMathMLTag: (key: string) => boolean;
261
266
  /**
262
267
  * Compiler only.
263
268
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
@@ -8,8 +8,8 @@ const EMPTY_ARR = !!(process.env.NODE_ENV !== "production") ? Object.freeze([])
8
8
  const NOOP = () => {
9
9
  };
10
10
  const NO = () => false;
11
- const onRE = /^on[^a-z]/;
12
- const isOn = (key) => onRE.test(key);
11
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
12
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
13
13
  const isModelListener = (key) => key.startsWith("onUpdate:");
14
14
  const extend = Object.assign;
15
15
  const remove = (arr, el) => {
@@ -98,6 +98,36 @@ function genPropsAccessExp(name) {
98
98
  return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
99
99
  }
100
100
 
101
+ const PatchFlags = {
102
+ "TEXT": 1,
103
+ "1": "TEXT",
104
+ "CLASS": 2,
105
+ "2": "CLASS",
106
+ "STYLE": 4,
107
+ "4": "STYLE",
108
+ "PROPS": 8,
109
+ "8": "PROPS",
110
+ "FULL_PROPS": 16,
111
+ "16": "FULL_PROPS",
112
+ "NEED_HYDRATION": 32,
113
+ "32": "NEED_HYDRATION",
114
+ "STABLE_FRAGMENT": 64,
115
+ "64": "STABLE_FRAGMENT",
116
+ "KEYED_FRAGMENT": 128,
117
+ "128": "KEYED_FRAGMENT",
118
+ "UNKEYED_FRAGMENT": 256,
119
+ "256": "UNKEYED_FRAGMENT",
120
+ "NEED_PATCH": 512,
121
+ "512": "NEED_PATCH",
122
+ "DYNAMIC_SLOTS": 1024,
123
+ "1024": "DYNAMIC_SLOTS",
124
+ "DEV_ROOT_FRAGMENT": 2048,
125
+ "2048": "DEV_ROOT_FRAGMENT",
126
+ "HOISTED": -1,
127
+ "-1": "HOISTED",
128
+ "BAIL": -2,
129
+ "-2": "BAIL"
130
+ };
101
131
  const PatchFlagNames = {
102
132
  [1]: `TEXT`,
103
133
  [2]: `CLASS`,
@@ -115,13 +145,46 @@ const PatchFlagNames = {
115
145
  [-2]: `BAIL`
116
146
  };
117
147
 
148
+ const ShapeFlags = {
149
+ "ELEMENT": 1,
150
+ "1": "ELEMENT",
151
+ "FUNCTIONAL_COMPONENT": 2,
152
+ "2": "FUNCTIONAL_COMPONENT",
153
+ "STATEFUL_COMPONENT": 4,
154
+ "4": "STATEFUL_COMPONENT",
155
+ "TEXT_CHILDREN": 8,
156
+ "8": "TEXT_CHILDREN",
157
+ "ARRAY_CHILDREN": 16,
158
+ "16": "ARRAY_CHILDREN",
159
+ "SLOTS_CHILDREN": 32,
160
+ "32": "SLOTS_CHILDREN",
161
+ "TELEPORT": 64,
162
+ "64": "TELEPORT",
163
+ "SUSPENSE": 128,
164
+ "128": "SUSPENSE",
165
+ "COMPONENT_SHOULD_KEEP_ALIVE": 256,
166
+ "256": "COMPONENT_SHOULD_KEEP_ALIVE",
167
+ "COMPONENT_KEPT_ALIVE": 512,
168
+ "512": "COMPONENT_KEPT_ALIVE",
169
+ "COMPONENT": 6,
170
+ "6": "COMPONENT"
171
+ };
172
+
173
+ const SlotFlags = {
174
+ "STABLE": 1,
175
+ "1": "STABLE",
176
+ "DYNAMIC": 2,
177
+ "2": "DYNAMIC",
178
+ "FORWARDED": 3,
179
+ "3": "FORWARDED"
180
+ };
118
181
  const slotFlagsText = {
119
182
  [1]: "STABLE",
120
183
  [2]: "DYNAMIC",
121
184
  [3]: "FORWARDED"
122
185
  };
123
186
 
124
- const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
187
+ const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
125
188
  const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
126
189
  const isGloballyWhitelisted = isGloballyAllowed;
127
190
 
@@ -244,9 +307,11 @@ function normalizeProps(props) {
244
307
 
245
308
  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";
246
309
  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";
310
+ 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";
247
311
  const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
248
312
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
249
313
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
314
+ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
250
315
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
251
316
 
252
317
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
@@ -279,7 +344,7 @@ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
279
344
  `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`
280
345
  );
281
346
  const isKnownSvgAttr = /* @__PURE__ */ makeMap(
282
- `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`
347
+ `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`
283
348
  );
284
349
 
285
350
  const escapeRE = /["'&<>]/;
@@ -386,19 +451,28 @@ const replacer = (_key, val) => {
386
451
  return replacer(_key, val.value);
387
452
  } else if (isMap(val)) {
388
453
  return {
389
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
390
- entries[`${key} =>`] = val2;
391
- return entries;
392
- }, {})
454
+ [`Map(${val.size})`]: [...val.entries()].reduce(
455
+ (entries, [key, val2], i) => {
456
+ entries[stringifySymbol(key, i) + " =>"] = val2;
457
+ return entries;
458
+ },
459
+ {}
460
+ )
393
461
  };
394
462
  } else if (isSet(val)) {
395
463
  return {
396
- [`Set(${val.size})`]: [...val.values()]
464
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
397
465
  };
466
+ } else if (isSymbol(val)) {
467
+ return stringifySymbol(val);
398
468
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
399
469
  return String(val);
400
470
  }
401
471
  return val;
402
472
  };
473
+ const stringifySymbol = (v, i = "") => {
474
+ var _a;
475
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
476
+ };
403
477
 
404
- export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, camelize, capitalize, def, escapeHtml, escapeHtmlComment, extend, genPropsAccessExp, generateCodeFrame, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownSvgAttr, isMap, isModelListener, isObject, isOn, isPlainObject, isPromise, isRegExp, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };
478
+ export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, camelize, capitalize, def, escapeHtml, escapeHtmlComment, extend, genPropsAccessExp, generateCodeFrame, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isObject, isOn, isPlainObject, isPromise, isRegExp, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/shared",
3
- "version": "3.4.0-alpha.3",
3
+ "version": "3.4.0-beta.1",
4
4
  "description": "internal utils shared across @vue packages",
5
5
  "main": "index.js",
6
6
  "module": "dist/shared.esm-bundler.js",