Naming refactoring

This commit is contained in:
barsdeveloper
2022-03-06 22:38:33 +01:00
parent 84dd01bfed
commit f613ea7924
22 changed files with 95 additions and 157 deletions

View File

@@ -1 +1 @@
.ueb{--ueb-node-value-color: white;--ueb-node-value-dim-color: #afafaf}.ueb-node-value-boolean{--ueb-node-value-color: #930000}.ueb-node-value-integer{--ueb-node-value-color: #1fe0ad}.ueb-node-value-float{--ueb-node-value-color: #9ffb44}.ueb-node-value-vector{--ueb-node-value-color: #fcc823}.ueb-node-value-rotator{--ueb-node-value-color: #9eb1fc}.ueb-node-value-string{--ueb-node-value-color: #fc00d2;--ueb-node-value-background: linear-gradient(90deg, #fc00d220, #fc00d280 15%, #fc00d250 85%, transparent)}.ueb-node-value-name{--ueb-node-value-color: #cb81fc}.ueb-node-value-objectreference{--ueb-node-value-color: #00a8f2}/*# sourceMappingURL=ueblueprint-node-value-type-color.css.map */
.ueb{--ueb-pin-color: white;--ueb-pin-dim-color: #afafaf}.ueb-pin-boolean{--ueb-pin-color: #930000}.ueb-pin-integer{--ueb-pin-color: #1fe0ad}.ueb-pin-float{--ueb-pin-color: #9ffb44}.ueb-pin-vector{--ueb-pin-color: #fcc823}.ueb-pin-rotator{--ueb-pin-color: #9eb1fc}.ueb-pin-string{--ueb-pin-color: #fc00d2;--ueb-pin-background: linear-gradient(90deg, #fc00d220, #fc00d280 15%, #fc00d250 85%, transparent)}.ueb-pin-name{--ueb-pin-color: #cb81fc}.ueb-pin-objectreference{--ueb-pin-color: #00a8f2}/*# sourceMappingURL=ueblueprint-node-value-type-color.css.map */

View File

@@ -1 +1 @@
{"version":3,"sourceRoot":"","sources":["../../scss/ueblueprint-node-value-type-color.scss"],"names":[],"mappings":"AAAA,KAGI,8BACA,oCAGJ,wBAEI,gCAGJ,wBAEI,gCAGJ,sBAEI,gCAGJ,uBAEI,gCAGJ,wBAEI,gCAGJ,uBAEI,gCACA,0GAGJ,qBAEI,gCAGJ,gCAEI","file":"ueblueprint-node-value-type-color.css"}
{"version":3,"sourceRoot":"","sources":["../../scss/ueblueprint-node-value-type-color.scss"],"names":[],"mappings":"AAAA,KAGI,uBACA,6BAGJ,iBAEI,yBAGJ,iBAEI,yBAGJ,eAEI,yBAGJ,gBAEI,yBAGJ,iBAEI,yBAGJ,gBAEI,yBACA,mGAGJ,cAEI,yBAGJ,yBAEI","file":"ueblueprint-node-value-type-color.css"}

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"sourceRoot":"","sources":["../../scss/ueblueprint-style.scss"],"names":[],"mappings":"AAAA,WACI,qBACA,iBACA,IACI,kGAIR,WACI,qBACA,mBACA,IACI,sGAIR,cACI,cACA,kBACA,8EACA,+BACA,iBAGJ,qBACI,aACA,kBACA,MACA,QACA,OACA,aACA,0BACA,UAGJ,mBACI,gBAGJ,mBACI,kBACA,aACA,gBACA,qBAGJ,oDACI,gBAGJ,UACI,kFACA,kBACA,eACA,gBACA,kEACA,mEACA,yBACA,iBAEI,s3BA0BJ,gBAEI,sZAQJ,sFACA,gEACA,oDACA,qBACA,gBAGJ,kDACI,gBAGJ,qBAGI,eACA,6CAGJ,iBAEI,mBAGJ,iBAEI,kBAGJ,iBAEI,mBAGJ,iBAEI,iBACA,uDAGJ,iBAEI,mBACA,uDAGJ,iBACI,sBACA,uDAGJ,iBACI,iBACA,uDAGJ,iBACI,sBACA,uDAGJ,iBACI,sBACA,uDAGJ,kBAEI,iBACA,uDAGJ,kBAEI,sBACA,uDAGJ,kBAEI,sBACA,uDAGJ,kBACI,kBACA,QACA,SACA,wGAGJ,SACI,cACA,kBACA,sGACA,qCACA,uDACA,sBAGJ,wEACI,YAGJ,iBACI,YACA,YACA,+CAGJ,cACI,UAGJ,+BACI,iBACI,kNAIJ,oDACA,0CACA,sDACA,0BACA,oBAGJ,kBACI,kBACA,YACA,gCACA,qCACA,0BACA,gBAGJ,iBACI,kBACA,6DACA,gEACA,8EACA,aACA,gBACA,mBAGJ,eACI,iFACA,qBACA,mBAGJ,eACI,aACA,cACA,WACA,gBACA,mBAGJ,iBACI,kBACA,iBAGJ,kBACI,kBAGJ,QACI,cACA,gBAGJ,mDACI,eAGJ,sFACI,4CACA,iBAGJ,qBACI,qBACA,kBACA,YACA,aACA,wBACA,wBAGJ,6BACI,WACA,cACA,kBACA,MACA,QACA,SACA,OACA,6CACA,kBAGJ,6BACI,uCAGJ,4BACI,WACA,cACA,kBACA,qBACA,sBACA,QACA,SACA,kCACA,qCACA,mDAGJ,gEACI,8DACA,8DACA,8DACA,8DACA,oGACA,qGACA,kBACA,wCACA,yCACA,0CACA,4CAGJ,aACI,cACA,kBACA,kBACA,MACA,OACA,QACA,SACA,iBAEI,wlDAmDJ,gBAEI,gQAWJ,oBAEI,wJAOJ,4BAGJ,gDACI,mBAIJ,eACI,mBAGJ,SACI,kEAEA,uEACA,cACA,8CAKA,kBAGJ,aACI,iEACA,kBACA,MACA,OACA,WACA,YACA,eACA,8FACA,iBAGJ,kBACI,mBACA,mCACA,eAGJ,8DAEI,eACA,4BAGJ,iBACI,cACA,mBACA,kBACA,kDACA,qHAOA,sBACA,gBACA,kBACA,4EACA,sCACA,mBACA","file":"ueblueprint-style.css"}
{"version":3,"sourceRoot":"","sources":["../../scss/ueblueprint-style.scss"],"names":[],"mappings":"AAAA,WACI,qBACA,iBACA,IACI,kGAIR,WACI,qBACA,mBACA,IACI,sGAIR,cACI,cACA,kBACA,8EACA,+BACA,iBAGJ,qBACI,aACA,kBACA,MACA,QACA,OACA,aACA,0BACA,UAGJ,mBACI,gBAGJ,mBACI,kBACA,aACA,gBACA,qBAGJ,oDACI,gBAGJ,UACI,kFACA,kBACA,eACA,gBACA,kEACA,mEACA,yBACA,iBAEI,s3BA0BJ,gBAEI,sZAQJ,sFACA,gEACA,oDACA,qBACA,gBAGJ,kDACI,gBAGJ,qBAGI,eACA,6CAGJ,iBAEI,mBAGJ,iBAEI,kBAGJ,iBAEI,mBAGJ,iBAEI,iBACA,uDAGJ,iBAEI,mBACA,uDAGJ,iBACI,sBACA,uDAGJ,iBACI,iBACA,uDAGJ,iBACI,sBACA,uDAGJ,iBACI,sBACA,uDAGJ,kBAEI,iBACA,uDAGJ,kBAEI,sBACA,uDAGJ,kBAEI,sBACA,uDAGJ,kBACI,kBACA,QACA,SACA,wGAGJ,SACI,cACA,kBACA,sGACA,qCACA,uDACA,sBAGJ,wEACI,YAGJ,iBACI,YACA,YACA,+CAGJ,cACI,UAGJ,+BACI,iBACI,kNAIJ,oDACA,0CACA,sDACA,0BACA,oBAGJ,kBACI,kBACA,YACA,gCACA,qCACA,0BACA,gBAGJ,iBACI,kBACA,6DACA,gEACA,8EACA,aACA,gBACA,mBAGJ,eACI,iFACA,qBACA,mBAGJ,eACI,aACA,cACA,WACA,gBACA,mBAGJ,iBACI,kBACA,iBAGJ,kBACI,kBAGJ,QACI,cACA,gBAGJ,mDACI,eAGJ,sFACI,qCACA,iBAGJ,cACI,qBACA,kBACA,YACA,aACA,wBACA,wBAGJ,sBACI,WACA,cACA,kBACA,MACA,QACA,SACA,OACA,sCACA,kBAGJ,2CACI,gCAGJ,qBACI,WACA,cACA,kBACA,qBACA,sBACA,QACA,SACA,kCACA,qCACA,4CAGJ,gEACI,8DACA,8DACA,8DACA,8DACA,oGACA,qGACA,kBACA,wCACA,yCACA,0CACA,4CAGJ,aACI,cACA,kBACA,kBACA,MACA,OACA,QACA,SACA,iBAEI,wlDAmDJ,gBAEI,gQAWJ,oBAEI,wJAOJ,4BAGJ,gDACI,mBAIJ,eACI,mBAGJ,SACI,kEAEA,uEACA,cACA,8CAKA,kBAGJ,aACI,iEACA,kBACA,MACA,OACA,WACA,YACA,eACA,8FACA,iBAGJ,kBACI,mBACA,4BACA,eAGJ,8DAEI,eACA,4BAGJ,iBACI,cACA,mBACA,kBACA,kDACA,qHAOA,sBACA,gBACA,kBACA,4EACA,+BACA,mBACA","file":"ueblueprint-style.css"}

89
dist/ueblueprint.js vendored
View File

@@ -949,7 +949,7 @@ class IEntity {
target[property] = defaultValue;
}
};
defineAllAttributes([], this, this.getAttributes());
defineAllAttributes([], this, this.constructor.attributes);
}
}
@@ -959,10 +959,6 @@ class ObjectReferenceEntity extends IEntity {
type: String,
path: String
}
getAttributes() {
return ObjectReferenceEntity.attributes
}
}
class FunctionReferenceEntity extends IEntity {
@@ -971,10 +967,6 @@ class FunctionReferenceEntity extends IEntity {
MemberParent: ObjectReferenceEntity,
MemberName: ""
}
getAttributes() {
return FunctionReferenceEntity.attributes
}
}
class GuidEntity extends IEntity {
@@ -995,10 +987,6 @@ class GuidEntity extends IEntity {
return new GuidEntity({ valud: guid })
}
getAttributes() {
return GuidEntity.attributes
}
toString() {
return this.value
}
@@ -1010,10 +998,6 @@ class IntegerEntity extends IEntity {
value: Number
}
getAttributes() {
return IntegerEntity.attributes
}
constructor(options = {}) {
if (options.constructor === Number || options.constructor === String) {
options = {
@@ -1041,10 +1025,6 @@ class LocalizedTextEntity extends IEntity {
key: String,
value: String
}
getAttributes() {
return LocalizedTextEntity.attributes
}
}
class PathSymbolEntity extends IEntity {
@@ -1053,10 +1033,6 @@ class PathSymbolEntity extends IEntity {
value: String
}
getAttributes() {
return PathSymbolEntity.attributes
}
toString() {
return this.value
}
@@ -1068,13 +1044,9 @@ class PinReferenceEntity extends IEntity {
objectName: PathSymbolEntity,
pinGuid: GuidEntity
}
getAttributes() {
return PinReferenceEntity.attributes
}
}
class PinEntity$1 extends IEntity {
class PinEntity extends IEntity {
static lookbehind = "Pin"
static attributes = {
@@ -1107,10 +1079,6 @@ class PinEntity$1 extends IEntity {
bOrphanedPin: false,
}
getAttributes() {
return PinEntity$1.attributes
}
isInput() {
return !this.bHidden && this.Direction !== "EGPD_Output"
}
@@ -1135,10 +1103,6 @@ class VariableReferenceEntity extends IEntity {
MemberGuid: GuidEntity,
bSelfContext: false
}
getAttributes() {
return VariableReferenceEntity.attributes
}
}
class ObjectEntity extends IEntity {
@@ -1156,11 +1120,7 @@ class ObjectEntity extends IEntity {
NodeGuid: GuidEntity,
ErrorType: new TypeInitialization(IntegerEntity, false),
ErrorMsg: new TypeInitialization(String, false, ""),
CustomProperties: [PinEntity$1]
}
getAttributes() {
return ObjectEntity.attributes
CustomProperties: [PinEntity]
}
/**
@@ -1266,7 +1226,7 @@ class Grammar {
return r.PinReference
case FunctionReferenceEntity:
return r.FunctionReference
case PinEntity$1:
case PinEntity:
return r.Pin
case Array:
return P$1.seqMap(
@@ -1321,7 +1281,7 @@ class Grammar {
return result
})
FunctionReference = r => Grammar.CreateMultiAttributeGrammar(r, FunctionReferenceEntity)
Pin = r => Grammar.CreateMultiAttributeGrammar(r, PinEntity$1)
Pin = r => Grammar.CreateMultiAttributeGrammar(r, PinEntity)
CustomProperties = r =>
P$1.string("CustomProperties")
.then(P$1.whitespace)
@@ -1486,7 +1446,7 @@ class ObjectSerializer extends ISerializer {
let result = `Begin Object Class=${this.writeValue(object.Class)} Name=${this.writeValue(object.Name)}
${this.subWrite([], object)
+ object
.CustomProperties.map(pin => this.separator + this.prefix + "CustomProperties " + SerializerFactory.getSerializer(PinEntity$1).write(pin))
.CustomProperties.map(pin => this.separator + this.prefix + "CustomProperties " + SerializerFactory.getSerializer(PinEntity).write(pin))
.join("")}
End Object`;
return result
@@ -1730,7 +1690,7 @@ class LinkTemplate extends ITemplate {
link.blueprint.dataset.creatingLink = true;
const referencePin = link.getSourcePin() ?? link.getDestinationPin();
if (referencePin) {
link.style.setProperty("--ueb-node-value-color", referencePin.getColor());
link.style.setProperty("--ueb-pin-color", referencePin.getColor());
}
link.classList.add("ueb-link-dragging");
}
@@ -2565,13 +2525,13 @@ class PinTemplate extends ITemplate {
render(pin) {
if (pin.isInput()) {
return html`
<span class="ueb-node-value-icon ${pin.isConnected() ? 'ueb-node-value-fill' : ''}"></span>
<span class="ueb-pin-icon"></span>
${sanitizeText(pin.getPinDisplayName())}
`
} else {
return html`
${sanitizeText(pin.getPinDisplayName())}
<span class="ueb-node-value-icon ${pin.isConnected() ? 'ueb-node-value-fill' : ''}"></span>
<span class="ueb-pin-icon"></span>
`
}
}
@@ -2583,17 +2543,32 @@ class PinTemplate extends ITemplate {
apply(pin) {
super.apply(pin);
pin.classList.add(
"ueb-node-" + (pin.isInput() ? "input" : pin.isOutput() ? "output" : "hidden"), "ueb-node-value-" + sanitizeText(pin.getType()));
"ueb-node-" + (pin.isInput() ? "input" : pin.isOutput() ? "output" : "hidden"),
"ueb-pin-" + sanitizeText(pin.getType()),
pin.isConnected() ? "ueb-pin-fill" : null
);
pin.clickableElement = pin;
}
/**
* Applies the connection style to the element.
* @param {PinElement} pin
*/
applyConnected(pin) {
if (pin.isConnected()) {
pin.classList.add("ueb-pin-fill");
} else {
pin.classList.remove("ueb-pin-fill");
}
}
/**
*
* @param {PinElement} pin
* @returns
*/
getLinkLocation(pin) {
const rect = pin.querySelector(".ueb-node-value-icon").getBoundingClientRect();
const rect = pin.querySelector(".ueb-pin-icon").getBoundingClientRect();
return pin.blueprint.compensateTranslation(Utility.convertLocation(
[(rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2],
pin.blueprint.gridElement))
@@ -2620,7 +2595,7 @@ class PinElement extends IElement {
connectedCallback() {
super.connectedCallback();
this.#color = window.getComputedStyle(this).getPropertyValue("--ueb-node-value-color");
this.#color = window.getComputedStyle(this).getPropertyValue("--ueb-pin-color");
}
createInputObjects() {
@@ -2640,10 +2615,6 @@ class PinElement extends IElement {
return this.entity.PinName
}
getAttributes() {
return PinEntity.attributes
}
isInput() {
return this.entity.isInput()
}
@@ -2791,7 +2762,7 @@ class NodeElement extends ISelectableDraggableElement {
* @returns {PinEntity[]}
*/
getPinEntities() {
return this.entity.CustomProperties.filter(v => v instanceof PinEntity$1)
return this.entity.CustomProperties.filter(v => v instanceof PinEntity)
}
connectedCallback() {
@@ -3412,8 +3383,8 @@ function initializeSerializerFactory() {
new ObjectSerializer()
);
SerializerFactory.registerSerializer(
PinEntity$1,
new GeneralSerializer(v => `${PinEntity$1.lookbehind} (${v})`, PinEntity$1, "", ",", true)
PinEntity,
new GeneralSerializer(v => `${PinEntity.lookbehind} (${v})`, PinEntity, "", ",", true)
);
SerializerFactory.registerSerializer(
FunctionReferenceEntity,