mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-06 23:57:30 +08:00
Links wip (broken)
This commit is contained in:
@@ -51,4 +51,11 @@ export default class NodeTemplate extends SelectableDraggableTemplate {
|
||||
pins.filter(v => v.isInput()).forEach(v => inputContainer.appendChild(new PinElement(v)))
|
||||
pins.filter(v => v.isOutput()).forEach(v => outputContainer.appendChild(new PinElement(v)))
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {NodeElement} node
|
||||
*/
|
||||
getPinElements(node) {
|
||||
return node.querySelectorAll(PinElement.tagName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import html from "./html"
|
||||
import ITemplate from "./ITemplate"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import Utility from "../Utility"
|
||||
import NodeElement from "../element/NodeElement"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/NodeElement").default} NodeElement
|
||||
@@ -36,14 +37,14 @@ export default class PinTemplate extends ITemplate {
|
||||
super.apply(pin)
|
||||
pin.classList.add(
|
||||
"ueb-node-" + (pin.isInput() ? "input" : pin.isOutput() ? "output" : "hidden"),
|
||||
"ueb-pin-" + sanitizeText(pin.getType()),
|
||||
pin.isConnected() ? "ueb-pin-fill" : null
|
||||
"ueb-pin-" + sanitizeText(pin.getType())
|
||||
)
|
||||
pin.clickableElement = pin
|
||||
pin.nodeElement = pin.closest("ueb-node")
|
||||
pin.nodeElement = pin.closest(NodeElement.tagName)
|
||||
if (!pin.nodeElement) {
|
||||
window.customElements.whenDefined(linkMessage.constructor.tagName).then(linkMessage)
|
||||
}
|
||||
pin.getLin
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user