import { type Directive, Phase } from "@mizu/internal/engine"
export type * from "@mizu/internal/engine"
export const _text = {
name: "*text",
phase: Phase.CONTENT,
default: "this.innerHTML",
async execute(renderer, element, { attributes: [attribute], ...options }) {
if (!renderer.isHtmlElement(element)) {
return
}
element.textContent = `${await renderer.evaluate(element, attribute.value || this.default, options)}`
},
} as Directive & { default: NonNullable<Directive["default"]> }
export default _text
|