chore: move dom element config to compiler-dom
This commit is contained in:
@@ -28,3 +28,4 @@ export function compile(
|
||||
}
|
||||
|
||||
export * from '@vue/compiler-core'
|
||||
export * from './tagConfig'
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
Namespaces,
|
||||
NodeTypes
|
||||
} from '@vue/compiler-core'
|
||||
import { isVoidTag, isHTMLTag, isSVGTag } from '@vue/shared'
|
||||
import { isVoidTag, isHTMLTag, isSVGTag } from './tagConfig'
|
||||
|
||||
export const enum DOMNamespaces {
|
||||
HTML = Namespaces.HTML,
|
||||
|
||||
28
packages/compiler-dom/src/tagConfig.ts
Normal file
28
packages/compiler-dom/src/tagConfig.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { makeMap } from '../../shared/src/makeMap'
|
||||
|
||||
const HTML_TAGS =
|
||||
'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
|
||||
'header,h1,h2,h3,h4,h5,h6,hgroup,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,rtc,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,menuitem,' +
|
||||
'summary,content,element,shadow,template,blockquote,iframe,tfoot'
|
||||
|
||||
/**
|
||||
* this list is intentionally selective, only covering SVG elements that may
|
||||
* contain child elements.
|
||||
*/
|
||||
const SVG_TAGS =
|
||||
'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
|
||||
'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
|
||||
'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view'
|
||||
|
||||
const VOID_TAGS =
|
||||
'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr'
|
||||
|
||||
export const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS)
|
||||
export const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS)
|
||||
export const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS)
|
||||
Reference in New Issue
Block a user