feat: SEO field elements and bundle
This commit is contained in:
23
assets/src/elements/index.ts
Normal file
23
assets/src/elements/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import './styles.css'
|
||||
import { IMAGE_TAG, SeoImageElement } from './image'
|
||||
import { ROBOTS_TAG, SeoRobotsElement } from './robots'
|
||||
import { SERP_TAG, SeoSerpElement } from './serp'
|
||||
import { SeoTextElement, TEXT_TAG } from './text'
|
||||
|
||||
// The admin SPA loads this script once on every admin page (the SEO field
|
||||
// types list it in Scripts); defining a tag twice would throw, so a second
|
||||
// evaluation is a no-op.
|
||||
if (!customElements.get(TEXT_TAG)) {
|
||||
customElements.define(TEXT_TAG, SeoTextElement)
|
||||
}
|
||||
if (!customElements.get(ROBOTS_TAG)) {
|
||||
customElements.define(ROBOTS_TAG, SeoRobotsElement)
|
||||
}
|
||||
if (!customElements.get(SERP_TAG)) {
|
||||
customElements.define(SERP_TAG, SeoSerpElement)
|
||||
}
|
||||
if (!customElements.get(IMAGE_TAG)) {
|
||||
customElements.define(IMAGE_TAG, SeoImageElement)
|
||||
}
|
||||
|
||||
export { IMAGE_TAG, ROBOTS_TAG, SERP_TAG, SeoImageElement, SeoRobotsElement, SeoSerpElement, SeoTextElement, TEXT_TAG }
|
||||
Reference in New Issue
Block a user