UNPKG

@jverneaut/html-to-gutenberg

Version:

Create custom Gutenberg blocks from the HTML templates you already have.

22 lines (16 loc) 635 B
import JSXElementTransformer from "./CustomElementJSXTransformer.js"; import PrinterRenderPHP from "#printers/PrinterRenderPHP.js"; import { deleteTagName } from "#utils-html/index.js"; export default class CustomElementBlockControls extends JSXElementTransformer { static JSXTagName = "BlockControls"; static HTMLTagName = "block-controls"; onMatch(node) { this.blockData._hasBlockControlsImport = true; } processAstByFilename(filename) { super.processAstByFilename(filename); if (filename === PrinterRenderPHP.filename) { deleteTagName(this.asts[filename], this.constructor.HTMLTagName); } } }