import html from "./html"
import PinEntity from "../entity/PinEntity"
import SelectableDraggableTemplate from "./SelectableDraggableTemplate"
/**
* @typedef {import("../graph/GraphNode").default} GraphNode
*/
export default class NodeTemplate extends SelectableDraggableTemplate {
/**
* Computes the html content of the target element.
* @param {GraphNode} node Graph node element
* @returns The result html
*/
header(node) {
return html`
`
}
/**
* Computes the html content of the target element.
* @param {GraphNode} node Graph node element
* @returns The result html
*/
body(node) {
/** @type {PinEntity[]} */
let inputs = node.entity.CustomProperties.filter(v => v instanceof PinEntity)
let outputs = inputs.filter(v => v.isOutput())
inputs = inputs.filter(v => v.isInput())
return html`
${outputs.map((output, index) => html`
${output.getPinDisplayName()}
`).join('') ?? ''}
`
}
/**
* Computes the html content of the target element.
* @param {GraphNode} node Graph node element
* @returns The result html
*/
render(node) {
return html`