feat: robots.txt editor and tester screen

- golem15.seo.robots singleton (UI-SPEC C10): staging callout and the
  served file (P4); the plugin's own extension adds the editor, the
  tester and the AI bots tab, saved to the robots row with history
- field type robotstxt (E4, live lint, size meter; Decode refuses over
  500 KB) and widget golem15-seo-robotstester (E5) on robots_test, which
  tests the unsaved text and switches through grobotstxt
- saving rules that block a noindex address answers robots.blocks_noindex
This commit is contained in:
2026-10-27 11:51:41 +01:00
parent 3dd936202f
commit 51413fbda4
21 changed files with 1336 additions and 26 deletions

View File

@@ -1,23 +1,39 @@
import './styles.css'
import { IMAGE_TAG, SeoImageElement } from './image'
import { ROBOTS_TAG, SeoRobotsElement } from './robots'
import { ROBOTSTESTER_TAG, SeoRobotsTesterElement } from './robotstester'
import { ROBOTSTXT_TAG, SeoRobotsTxtElement } from './robotstxt'
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)
const elements: Array<[string, CustomElementConstructor]> = [
[TEXT_TAG, SeoTextElement],
[ROBOTS_TAG, SeoRobotsElement],
[SERP_TAG, SeoSerpElement],
[IMAGE_TAG, SeoImageElement],
[ROBOTSTXT_TAG, SeoRobotsTxtElement],
[ROBOTSTESTER_TAG, SeoRobotsTesterElement],
]
for (const [tag, ctor] of elements) {
if (!customElements.get(tag)) {
customElements.define(tag, ctor)
}
}
export { IMAGE_TAG, ROBOTS_TAG, SERP_TAG, SeoImageElement, SeoRobotsElement, SeoSerpElement, SeoTextElement, TEXT_TAG }
export {
IMAGE_TAG,
ROBOTS_TAG,
ROBOTSTESTER_TAG,
ROBOTSTXT_TAG,
SERP_TAG,
SeoImageElement,
SeoRobotsElement,
SeoRobotsTesterElement,
SeoRobotsTxtElement,
SeoSerpElement,
SeoTextElement,
TEXT_TAG,
}