Paste event handling WIP

This commit is contained in:
barsdeveloper
2021-10-31 17:01:56 +01:00
parent 199005ec20
commit ceb07688f2
11 changed files with 352 additions and 221 deletions

View File

@@ -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) {

View File

@@ -9,7 +9,7 @@ export default class Template {
* @returns The computed html
*/
render(entity) {
return ``
return ""
}
/**