mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:41:34 +08:00
Paste event handling WIP
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import PinEntity from "../entity/PinEntity"
|
||||
import Template from "./Template"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/ObjectEntity").default} ObjectEntity
|
||||
*/
|
||||
export default class NodeTemplate extends Template {
|
||||
|
||||
/**
|
||||
* Computes the html content of the target element.
|
||||
* @param {HTMLElement} entity Entity representing the element
|
||||
* @param {ObjectEntity} entity Entity representing the element
|
||||
* @returns The computed html
|
||||
*/
|
||||
header(entity) {
|
||||
@@ -13,7 +16,7 @@ export default class NodeTemplate extends Template {
|
||||
<div class="ueb-node-header">
|
||||
<span class="ueb-node-name">
|
||||
<span class="ueb-node-symbol"></span>
|
||||
<span class="ueb-node-text">${entity.graphNodeName}</span>
|
||||
<span class="ueb-node-text">${entity.getNodeDisplayName()}</span>
|
||||
</span>
|
||||
</div>
|
||||
`
|
||||
@@ -21,10 +24,11 @@ export default class NodeTemplate extends Template {
|
||||
|
||||
/**
|
||||
* Computes the html content of the target element.
|
||||
* @param {import("../entity/ObjectEntity").default} entity Entity representing the element
|
||||
* @param {ObjectEntity} entity Entity representing the element
|
||||
* @returns The computed html
|
||||
*/
|
||||
body(entity) {
|
||||
/** @type {PinEntity[]} */
|
||||
let inputs = entity.CustomProperties.filter(v => v instanceof PinEntity)
|
||||
let outputs = inputs.filter(v => v.isOutput())
|
||||
inputs = inputs.filter(v => !v.isOutput())
|
||||
@@ -34,14 +38,14 @@ export default class NodeTemplate extends Template {
|
||||
${inputs.map((input, index) => `
|
||||
<div class="ueb-node-input ueb-node-value-${input.type}">
|
||||
<span class="ueb-node-value-icon ${inputs[index].connected ? 'ueb-node-value-fill' : ''}"></span>
|
||||
${input.name}
|
||||
${input.getPinDisplayName()}
|
||||
</div>
|
||||
`).join("") ?? ""}
|
||||
</div>
|
||||
<div class="ueb-node-outputs">
|
||||
${outputs.map((output, index) => `
|
||||
<div class="ueb-node-output ueb-node-value-${output.type}">
|
||||
${output.name}
|
||||
${output.getPinDisplayName()}
|
||||
<span class="ueb-node-value-icon ${outputs[index].connected ? 'ueb-node-value-fill' : ''}"></span>
|
||||
</div>
|
||||
`).join("") ?? ''}
|
||||
@@ -52,7 +56,7 @@ export default class NodeTemplate extends Template {
|
||||
|
||||
/**
|
||||
* Computes the html content of the target element.
|
||||
* @param {HTMLElement} entity Entity representing the element
|
||||
* @param {ObjectEntity} entity Entity representing the element
|
||||
* @returns The computed html
|
||||
*/
|
||||
render(entity) {
|
||||
|
||||
@@ -9,7 +9,7 @@ export default class Template {
|
||||
* @returns The computed html
|
||||
*/
|
||||
render(entity) {
|
||||
return ``
|
||||
return ""
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user