+ style="--ueb-additional-x: ${Math.round(this.blueprint.translateX)}; --ueb-additional-y: ${Math.round(this.blueprint.translateY)}; --ueb-translate-x: ${Math.round(this.blueprint.translateX)}; --ueb-translate-y: ${Math.round(this.blueprint.translateY)};">
@@ -128,15 +139,15 @@ export default class BlueprintTemplate extends ITemplate {
/** @param {PropertyValues} changedProperties */
firstUpdated(changedProperties) {
super.firstUpdated(changedProperties)
- this.headerElement = this.element.querySelector('.ueb-viewport-header')
- this.overlayElement = this.element.querySelector('.ueb-viewport-overlay')
- this.viewportElement = this.element.querySelector('.ueb-viewport-body')
- this.selectorElement = this.element.querySelector('ueb-selector')
+ this.headerElement = this.blueprint.querySelector('.ueb-viewport-header')
+ this.overlayElement = this.blueprint.querySelector('.ueb-viewport-overlay')
+ this.viewportElement = this.blueprint.querySelector('.ueb-viewport-body')
+ this.selectorElement = this.blueprint.querySelector('ueb-selector')
this.gridElement = this.viewportElement.querySelector(".ueb-grid")
- this.linksContainerElement = this.element.querySelector("[data-links]")
- this.linksContainerElement.append(...this.element.getLinks())
- this.nodesContainerElement = this.element.querySelector("[data-nodes]")
- this.nodesContainerElement.append(...this.element.getNodes())
+ this.linksContainerElement = this.blueprint.querySelector("[data-links]")
+ this.linksContainerElement.append(...this.blueprint.getLinks())
+ this.nodesContainerElement = this.blueprint.querySelector("[data-nodes]")
+ this.nodesContainerElement.append(...this.blueprint.getNodes())
this.viewportElement.scroll(Configuration.expandGridSize, Configuration.expandGridSize)
}
@@ -156,34 +167,34 @@ export default class BlueprintTemplate extends ITemplate {
updated(changedProperties) {
super.updated(changedProperties)
if (changedProperties.has("scrollX") || changedProperties.has("scrollY")) {
- this.viewportElement.scroll(this.element.scrollX, this.element.scrollY)
+ this.viewportElement.scroll(this.blueprint.scrollX, this.blueprint.scrollY)
}
if (changedProperties.has("zoom")) {
- this.element.style.setProperty("--ueb-scale", this.blueprint.getScale())
+ this.blueprint.style.setProperty("--ueb-scale", this.blueprint.getScale())
const previousZoom = changedProperties.get("zoom")
- const minZoom = Math.min(previousZoom, this.element.zoom)
- const maxZoom = Math.max(previousZoom, this.element.zoom)
+ const minZoom = Math.min(previousZoom, this.blueprint.zoom)
+ const maxZoom = Math.max(previousZoom, this.blueprint.zoom)
const classes = Utility.range(minZoom, maxZoom)
const getClassName = v => `ueb-zoom-${v}`
- if (previousZoom < this.element.zoom) {
- this.element.classList.remove(...classes.filter(v => v < 0).map(getClassName))
- this.element.classList.add(...classes.filter(v => v > 0).map(getClassName))
+ if (previousZoom < this.blueprint.zoom) {
+ this.blueprint.classList.remove(...classes.filter(v => v < 0).map(getClassName))
+ this.blueprint.classList.add(...classes.filter(v => v > 0).map(getClassName))
} else {
- this.element.classList.remove(...classes.filter(v => v > 0).map(getClassName))
- this.element.classList.add(...classes.filter(v => v < 0).map(getClassName))
+ this.blueprint.classList.remove(...classes.filter(v => v > 0).map(getClassName))
+ this.blueprint.classList.add(...classes.filter(v => v < 0).map(getClassName))
}
}
}
getCommentNodes(justSelected = false) {
- return this.element.querySelectorAll(
- `ueb-node[data-type="${Configuration.nodeType.comment}"]${justSelected ? '[data-selected="true"]' : ''}`
+ return this.blueprint.querySelectorAll(
+ `ueb-node[data-type="${Configuration.paths.comment}"]${justSelected ? '[data-selected="true"]' : ''}`
)
}
/** @param {PinReferenceEntity} pinReference */
getPin(pinReference) {
- return /** @type {PinElement} */(this.element.querySelector(
+ return /** @type {PinElement} */(this.blueprint.querySelector(
`ueb-node[data-name="${pinReference.objectName}"] ueb-pin[data-id="${pinReference.pinGuid}"]`
))
}
@@ -192,6 +203,10 @@ export default class BlueprintTemplate extends ITemplate {
return this.getInputObject(Copy)
}
+ getPasteInputObject() {
+ return this.getInputObject(Paste)
+ }
+
/**
* @param {Number} x
* @param {Number} y
@@ -205,7 +220,6 @@ export default class BlueprintTemplate extends ITemplate {
}
gridRightVisibilityBoundary() {
- this.blueprint
return this.gridLeftVisibilityBoundary() + this.blueprint.scaleCorrect(this.viewportSize[0])
}
diff --git a/js/template/ITemplate.js b/js/template/ITemplate.js
index 8c4fda1..2db65bf 100644
--- a/js/template/ITemplate.js
+++ b/js/template/ITemplate.js
@@ -33,7 +33,7 @@ export default class ITemplate {
/**
* @template {IInput} T
- * @param {new () => T} type
+ * @param {new (...any) => T} type
*/
getInputObject(type) {
return /** @type {T} */(this.inputObjects.find(object => object.constructor == type))
diff --git a/js/template/LinkTemplate.js b/js/template/LinkTemplate.js
index b2026dd..2d80c4b 100755
--- a/js/template/LinkTemplate.js
+++ b/js/template/LinkTemplate.js
@@ -109,8 +109,8 @@ export default class LinkTemplate extends IFromToPositionedTemplate {
if (changedProperties.has("fromX") || changedProperties.has("toX")) {
const from = this.element.fromX
const to = this.element.toX
- const isSourceAKnot = sourcePin?.nodeElement.getType() == Configuration.nodeType.knot
- const isDestinationAKnot = destinationPin?.nodeElement.getType() == Configuration.nodeType.knot
+ const isSourceAKnot = sourcePin?.nodeElement.getType() == Configuration.paths.knot
+ const isDestinationAKnot = destinationPin?.nodeElement.getType() == Configuration.paths.knot
if (isSourceAKnot && (!destinationPin || isDestinationAKnot)) {
if (sourcePin?.isInput() && to > from + Configuration.distanceThreshold) {
this.element.source = /** @type {KnotNodeTemplate} */(sourcePin.nodeElement.template).outputPin
diff --git a/js/template/node/EventNodeTemplate.js b/js/template/node/EventNodeTemplate.js
index 73518a1..1ed0859 100755
--- a/js/template/node/EventNodeTemplate.js
+++ b/js/template/node/EventNodeTemplate.js
@@ -22,7 +22,7 @@ export default class EventNodeTemplate extends NodeTemplate {
renderTop() {
const icon = this.renderNodeIcon()
const name = this.renderNodeName()
- const customEvent = this.element.getType() === Configuration.nodeType.customEvent
+ const customEvent = this.element.getType() === Configuration.paths.customEvent
&& (this.element.entity.CustomFunctionName || this.element.entity.FunctionReference.MemberParent)
return html`
diff --git a/js/template/node/KnotNodeTemplate.js b/js/template/node/KnotNodeTemplate.js
index 524af41..7452c67 100644
--- a/js/template/node/KnotNodeTemplate.js
+++ b/js/template/node/KnotNodeTemplate.js
@@ -38,7 +38,7 @@ export default class KnotNodeTemplate extends NodeTemplate {
/** @param {PinElement} startingPin */
findDirectionaPin(startingPin) {
if (
- startingPin.nodeElement.getType() !== Configuration.nodeType.knot
+ startingPin.nodeElement.getType() !== Configuration.paths.knot
|| KnotNodeTemplate.#traversedPin.has(startingPin)
) {
KnotNodeTemplate.#traversedPin.clear()
diff --git a/js/template/node/VariableAccessNodeTemplate.js b/js/template/node/VariableAccessNodeTemplate.js
index 41d0d83..8912779 100644
--- a/js/template/node/VariableAccessNodeTemplate.js
+++ b/js/template/node/VariableAccessNodeTemplate.js
@@ -8,9 +8,9 @@ export default class VariableAccessNodeTemplate extends VariableManagementNodeTe
/** @param {NodeElement} element */
initialize(element) {
super.initialize(element)
- if (element.getType() === Configuration.nodeType.variableGet) {
+ if (element.getType() === Configuration.paths.variableGet) {
this.element.classList.add("ueb-node-style-getter")
- } else if (element.getType() === Configuration.nodeType.variableSet) {
+ } else if (element.getType() === Configuration.paths.variableSet) {
this.element.classList.add("ueb-node-style-setter")
}
}
diff --git a/scss/ueb-pin.scss b/scss/ueb-pin.scss
index 3318ce7..eec0d0c 100644
--- a/scss/ueb-pin.scss
+++ b/scss/ueb-pin.scss
@@ -72,6 +72,10 @@ ueb-blueprint[data-scrolling="false"][data-selecting="false"] .ueb-pin-wrapper:h
text-align: left;
}
+ueb-pin[data-connectable="false"] .ueb-pin-icon {
+ visibility: hidden;
+}
+
.ueb-node-style-event ueb-pin[data-type="delegate"] .ueb-pin-icon {
width: 11px;
height: 11px;