mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-14 17:14:41 +08:00
Merge remote-tracking branch 'origin/temp'
This commit is contained in:
5
.vscode/extensions.json
vendored
Normal file
5
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"runem.lit-plugin"
|
||||
]
|
||||
}
|
||||
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
@@ -1,5 +1,9 @@
|
||||
{
|
||||
"files.trimFinalNewlines": true,
|
||||
"files.insertFinalNewline": true,
|
||||
"javascript.format.semicolons": "remove"
|
||||
"javascript.format.semicolons": "remove",
|
||||
"editor.formatOnSaveMode": "modificationsIfAvailable",
|
||||
"editor.rulers": [
|
||||
120
|
||||
],
|
||||
}
|
||||
|
||||
123
dist/css/ueb-style.css
vendored
123
dist/css/ueb-style.css
vendored
@@ -321,10 +321,6 @@ ueb-node {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
ueb-blueprint[data-scrolling=false][data-selecting=false] ueb-node {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.ueb-node-border {
|
||||
margin: -3px;
|
||||
padding: 3px;
|
||||
@@ -361,6 +357,10 @@ ueb-node[data-selected=true] > .ueb-node-border {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
ueb-blueprint[data-scrolling=false][data-selecting=false] .ueb-node-wrapper {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.ueb-zoom--2 .ueb-node-wrapper {
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
@@ -499,7 +499,7 @@ ueb-node.ueb-node-style-glass {
|
||||
|
||||
ueb-node.ueb-node-style-glass .ueb-node-wrapper {
|
||||
border: 1px solid black;
|
||||
box-shadow: 1px 1px 0 0 rgba(255, 255, 255, 0.6) inset, 0 -2px 2px 1px rgba(0, 0, 0, 0.5) inset;
|
||||
box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.6) inset, 0 -2px 2px 1px rgba(0, 0, 0, 0.5) inset;
|
||||
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.188) 0%, rgba(255, 255, 255, 0.063) 14px, rgba(0, 0, 0, 0.251) 14px), linear-gradient(to right, transparent 10%, rgba(var(--ueb-node-color), 0.3) 50%, transparent 90%);
|
||||
background-size: 100%, 100% 28px;
|
||||
background-repeat: repeat, no-repeat;
|
||||
@@ -528,6 +528,44 @@ ueb-node.ueb-node-style-glass .ueb-node-outputs:first-child {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
ueb-node.ueb-node-style-comment {
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
ueb-node.ueb-node-style-comment .ueb-node-border {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
ueb-node.ueb-node-style-comment .ueb-node-wrapper {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
border-radius: 0;
|
||||
background: rgba(var(--ueb-node-color), 0.5);
|
||||
box-shadow: none;
|
||||
}
|
||||
ueb-node.ueb-node-style-comment .ueb-node-wrapper::after {
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 3px;
|
||||
bottom: 3px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background: linear-gradient(135deg, transparent 50%, #fff 50%, #fff calc(50% + 2px), transparent calc(50% + 2px), transparent calc(50% + 3px), #fff calc(50% + 3px), #fff calc(50% + 5px), transparent calc(50% + 5px), transparent calc(50% + 7px), #fff calc(50% + 7px), #fff calc(50% + 9px), transparent calc(50% + 9px));
|
||||
}
|
||||
|
||||
ueb-node.ueb-node-style-comment .ueb-node-top {
|
||||
margin: 3px;
|
||||
padding: 3px 10px;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
background: rgb(var(--ueb-node-color));
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
text-shadow: 2px 1px 1px #444, 0 0 2px #bbb;
|
||||
}
|
||||
|
||||
ueb-blueprint {
|
||||
--ueb-pin-color-dim: #afafaf;
|
||||
}
|
||||
@@ -685,7 +723,6 @@ ueb-pin[data-type="/Script/CoreUObject.LinearColor"] .ueb-pin-input {
|
||||
line-height: calc(1em + 1px);
|
||||
background: none;
|
||||
color: inherit;
|
||||
cursor: text;
|
||||
overflow: auto;
|
||||
}
|
||||
.ueb-pin-input-content::-webkit-scrollbar {
|
||||
@@ -698,6 +735,10 @@ ueb-pin[data-type="/Script/CoreUObject.LinearColor"] .ueb-pin-input {
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
ueb-blueprint[data-scrolling=false][data-selecting=false] .ueb-node-wrapper {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.ueb-button {
|
||||
min-width: 60px;
|
||||
border: 1px solid #0f0f0f;
|
||||
@@ -786,6 +827,76 @@ ueb-window .ueb-pin-input-content {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ueb-resizeable-top,
|
||||
.ueb-resizeable-top-right,
|
||||
.ueb-resizeable-top-left {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.ueb-resizeable-top {
|
||||
right: 0;
|
||||
left: 0;
|
||||
cursor: ns-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-top-right {
|
||||
right: 0;
|
||||
width: 10px;
|
||||
cursor: nesw-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-top-left {
|
||||
left: 0;
|
||||
width: 10px;
|
||||
cursor: nwse-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-right {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 10px;
|
||||
cursor: ew-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-bottom,
|
||||
.ueb-resizeable-bottom-right,
|
||||
.ueb-resizeable-bottom-left {
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
height: 10px;
|
||||
cursor: ns-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-bottom {
|
||||
right: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.ueb-resizeable-bottom-right {
|
||||
right: 0;
|
||||
width: 10px;
|
||||
cursor: nwse-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-bottom-left {
|
||||
left: 0;
|
||||
width: 10px;
|
||||
cursor: nesw-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-left {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 10px;
|
||||
cursor: ew-resize;
|
||||
}
|
||||
|
||||
ueb-window {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
||||
2
dist/css/ueb-style.css.map
vendored
2
dist/css/ueb-style.css.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"sourceRoot":"","sources":["../../scss/style.scss","../../scss/ueb-knot.scss","../../scss/ueb-link.scss","../../scss/ueb-node.scss","../../scss/ueb-pin.scss","../../scss/ueb-ui-controls.scss","../../scss/ueb-window.scss"],"names":[],"mappings":"AAAA;EACI;EACA;EACA,KACI;;AAIR;EACI;EACA;EACA,KACI;;AAIR;EACI;EACA;EACA,KACI;;AAIR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA,kBAEI;EA0BJ,iBAEI;EAQJ;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;E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AA;EAEI;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;AAEA;EACI;;;AAIR;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAKA;EACI;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;;;AC5FR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAGJ;AAAA;EAEI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA,YACI;;;AAWR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;AAAA;EAEI;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;AAEA;EAEI;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;;;AAIR;AAAA;EAEI;EACA;;;AAGJ;EACI;;;AAGJ;AAAA;EAEI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;;AAEA;EACI;;;AAIR;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA","file":"ueb-style.css"}
|
||||
{"version":3,"sourceRoot":"","sources":["../../scss/style.scss","../../scss/ueb-knot.scss","../../scss/ueb-link.scss","../../scss/ueb-node.scss","../../scss/ueb-pin.scss","../../scss/ueb-ui-controls.scss","../../scss/ueb-window.scss"],"names":[],"mappings":"AAAA;EACI;EACA;EACA,KACI;;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ACI;;;AAGJ;EACI;EACA;EACA;;AAEA;EACI;EACA;;;AAIR;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EAII;EACA;;;AAIR;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAGJ;EACI;EACA;EACA;;;AAIR;EACI;;;ACjLJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;;;AAIR;EACI;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;AAEA;EAEI;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;;AAGJ;EACI;EACA;;;AAIR;AAAA;EAEI;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;AAEA;EACI;;;AAIR;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAKA;EACI;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;;;AAIR;AAAA;AAAA;EAGI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;AAGJ;AAAA;AAAA;EAGI;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;ACnKJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAGJ;AAAA;EAEI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA,YACI;;;AAWR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;AAAA;EAEI;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;AAEA;EAEI;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;;;AAIR;AAAA;EAEI;EACA;;;AAGJ;EACI;;;AAGJ;AAAA;EAEI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;;AAEA;EACI;;;AAIR;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA","file":"ueb-style.css"}
|
||||
2
dist/css/ueb-style.min.css
vendored
2
dist/css/ueb-style.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/ueb-style.min.css.map
vendored
2
dist/css/ueb-style.min.css.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"sourceRoot":"","sources":["../../scss/style.scss","../../scss/ueb-knot.scss","../../scss/ueb-link.scss","../../scss/ueb-node.scss","../../scss/ueb-pin.scss","../../scss/ueb-ui-controls.scss","../../scss/ueb-window.scss"],"names":[],"mappings":"AAAA,WACI,qBACA,oBACA,IACI,kGAIR,WACI,qBACA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,YACA,2BAGJ,0CACI,uBACA,WACA,YACA,sBAGJ,0CACI,kBAGJ,cACI,qBAGJ,8BACI,kBAGJ,gHACI,aAGJ,uBACI,iBAGJ,eACI,qBACA,sBACA,gBACA,yBACA,kBACA,oBACA,cAEA,4FAII,yCACA,aAIR,yCACI,aAGJ,uCACI,gBACA,UACA,YACA,WACA,yBACA,2BAGJ,+CACI,6OAGJ,oEACI,UACA,WACA,YACA,qBACA,gBACA,yCAGJ,oCACI,cAGJ,qBACI,sBACA,gBACA,WAGJ,uBACI,cACA,aACA,YACA,UACA,eACA,gBACA,gBACA,4BACA,gBACA,cACA,YACA,cAEA,0CACI,WACA,YAGJ,gDACI,mBACA,mBACA,WC7KR,YACI,eACA,yBACA,kBACA,iBACA,mBACA,kBACA,eAEA,kBACI,mBAIR,aACI,aACA,yBACA,SACA,gBAGJ,mCACI,kBACA,oBAEA,qFAEI,WACA,cACA,kBACA,QACA,SACA,+BAGJ,2CACI,UACA,0BAGJ,0CACI,WACA,2BAIR,uCAEI,kBACA,yBACA,kBACA,mBAGJ,uBACI,kBACA,YAEA,6BACI,iBAIR,kCACI,iBAGJ,qCACI,cACA,kBACA,YACA,kBACA,mBAGJ,4BACI,kBACA,cACA,iBACA,UAKA,4BACI,WACA,qBACA,6BACA,oCACA,qCACA,sBAGJ,0BACI,eC5FR,WACI,cACA,kBACA,yBACA,MACA,OACA,sGACA,mBACA,6CACA,aAGJ,gBACI,aACA,mBACA,mBACA,gBACA,YACA,mBAGJ,oBACI,aACA,yBAGJ,iBACI,YACA,kBACA,kBAGJ,kBACI,YACA,YACA,WACA,eAGJ,+CAEI,qBACA,sBAGJ,uBACI,aACA,2DAGJ,wBACI,kBACA,iBACA,gBACA,mBACA,WACI,mLAWR,kBACI,cACA,kBACA,gBACA,iBACA,UACA,WACA,sBACA,kBAGJ,0CACI,8BACA,6BAGJ,qDAEI,aACA,oBACA,WAGJ,6BACI,iBACA,4EAGJ,wBACI,kBACA,4EAGJ,cACI,cAGJ,2CACI,yCAGJ,sCACI,yCAGJ,0BACI,kBACA,sBAEA,mEAEI,WACA,cACA,kBACA,oBACA,UACA,0BAGJ,iCACI,QAIR,4DAEI,YACA,YAGJ,8BACI,aAGJ,wDAEI,UAGJ,2BACI,aACA,gBACA,gBAGJ,oDACI,aACA,sBACA,8BACA,YACA,UAGJ,wDACI,aACA,mBACA,kBAEA,4DACI,YAIR,kDACI,YAGJ,yDACI,oCAGJ,yDACI,oCAGJ,yDACI,oCAGJ,yDACI,oCAGJ,yDACI,oCAGJ,yDACI,oCAGJ,yDACI,oCAGJ,2BACI,WAGJ,mBACI,oBAGJ,yBACI,iBACA,aAGJ,0CACI,UACA,iBACA,sBACA","file":"ueb-style.min.css"}
|
||||
{"version":3,"sourceRoot":"","sources":["../../scss/style.scss","../../scss/ueb-knot.scss","../../scss/ueb-link.scss","../../scss/ueb-node.scss","../../scss/ueb-pin.scss","../../scss/ueb-ui-controls.scss","../../scss/ueb-window.scss"],"names":[],"mappings":"AAAA,WACI,qBACA,oBACA,IACI,kGAIR,WACI,qBACA,mBACA,IACI,sGAIR,WACI,qBACA,iBACA,IACI,gGAIR,cACI,eACA,6CACA,cACA,kBACA,8EACA,+BACA,WACA,iBAGJ,kBACI,iBAGJ,qBACI,aACA,kBACA,MACA,QACA,OACA,aACA,0BACA,UAGJ,mBACI,iBACA,iCACA,eAGJ,mBACI,kBACA,gCACA,gBACA,kBAGJ,oDACI,gBAGJ,UACI,kFACA,kBACA,eACA,gBACA,+DACA,gEACA,yBACA,iBAEI,s3BA0BJ,gBAEI,sZAQJ,sFACA,gEACA,oDACA,qBACA,gBAGJ,6CACI,gBAGJ,8CACI,eAGJ,6BACI,eAGJ,6BACI,mBAGJ,6BACI,kBAGJ,6BACI,mBAGJ,6BACI,iBAGJ,6BACI,mBAGJ,6BACI,kBAGJ,8BACI,mBAGJ,8BACI,kBAGJ,8BACI,mBAGJ,8BACI,iBACA,uDAGJ,0BACI,gCAGJ,8BACI,mBACA,uDAGJ,8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GJ,gDACI,mBACA,mBACA,WAIR,4EACI,YCjLJ,YACI,eACA,yBACA,kBACA,iBACA,mBACA,kBACA,eAEA,kBACI,mBAIR,aACI,aACA,yBACA,SACA,gBAGJ,mCACI,kBACA,oBAEA,qFAEI,WACA,cACA,kBACA,QACA,SACA,+BAGJ,2CACI,UACA,0BAGJ,0CACI,WACA,2BAIR,uCAEI,kBACA,yBACA,kBACA,mBAGJ,uBACI,kBACA,YAEA,6BACI,iBAIR,kCACI,iBAGJ,qCACI,cACA,kBACA,YACA,kBACA,mBAGJ,4BACI,kBACA,cACA,iBACA,UAKA,4BACI,WACA,qBACA,6BACA,oCACA,qCACA,sBAGJ,0BACI,eAIR,uEAGI,kBACA,MACA,YAGJ,oBACI,QACA,OACA,iBAGJ,0BACI,QACA,WACA,mBAGJ,yBACI,OACA,WACA,mBAGJ,sBACI,kBACA,MACA,QACA,SACA,WACA,iBAGJ,gFAGI,kBACA,YACA,YACA,iBAGJ,uBACI,QACA,OAGJ,6BACI,QACA,WACA,mBAGJ,4BACI,OACA,WACA,mBAGJ,qBACI,kBACA,MACA,SACA,OACA,WACA,iBCnKJ,WACI,cACA,kBACA,yBACA,MACA,OACA,sGACA,mBACA,6CACA,aAGJ,gBACI,aACA,mBACA,mBACA,gBACA,YACA,mBAGJ,oBACI,aACA,yBAGJ,iBACI,YACA,kBACA,kBAGJ,kBACI,YACA,YACA,WACA,eAGJ,+CAEI,qBACA,sBAGJ,uBACI,aACA,2DAGJ,wBACI,kBACA,iBACA,gBACA,mBACA,WACI,mLAWR,kBACI,cACA,kBACA,gBACA,iBACA,UACA,WACA,sBACA,kBAGJ,0CACI,8BACA,6BAGJ,qDAEI,aACA,oBACA,WAGJ,6BACI,iBACA,4EAGJ,wBACI,kBACA,4EAGJ,cACI,cAGJ,2CACI,yCAGJ,sCACI,yCAGJ,0BACI,kBACA,sBAEA,mEAEI,WACA,cACA,kBACA,oBACA,UACA,0BAGJ,iCACI,QAIR,4DAEI,YACA,YAGJ,8BACI,aAGJ,wDAEI,UAGJ,2BACI,aACA,gBACA,gBAGJ,oDACI,aACA,sBACA,8BACA,YACA,UAGJ,wDACI,aACA,mBACA,kBAEA,4DACI,YAIR,kDACI,YAGJ,yDACI,oCAGJ,yDACI,oCAGJ,yDACI,oCAGJ,yDACI,oCAGJ,yDACI,oCAGJ,yDACI,oCAGJ,yDACI,oCAGJ,2BACI,WAGJ,mBACI,oBAGJ,yBACI,iBACA,aAGJ,0CACI,UACA,iBACA,sBACA","file":"ueb-style.min.css"}
|
||||
1107
dist/ueblueprint.js
vendored
1107
dist/ueblueprint.js
vendored
File diff suppressed because it is too large
Load Diff
12
dist/ueblueprint.min.js
vendored
12
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -97,16 +97,16 @@ export default class Blueprint extends IElement {
|
||||
headerElement
|
||||
focused = false
|
||||
waitingExpandUpdate = false
|
||||
/** @param {NodeElement} node */
|
||||
nodeBoundariesSupplier = node => {
|
||||
let rect = node.getBoundingClientRect()
|
||||
let gridRect = this.nodesContainerElement.getBoundingClientRect()
|
||||
const scaleCorrection = 1 / this.getScale()
|
||||
return /** @type {BoundariesInfo} */ {
|
||||
primaryInf: (rect.left - gridRect.left) * scaleCorrection,
|
||||
primarySup: (rect.right - gridRect.right) * scaleCorrection,
|
||||
primaryInf: (node.leftBoundary() - gridRect.left) * scaleCorrection,
|
||||
primarySup: (node.rightBoundary() - gridRect.right) * scaleCorrection,
|
||||
// Counter intuitive here: the y (secondary axis is positive towards the bottom, therefore upper bound "sup" is bottom)
|
||||
secondaryInf: (rect.top - gridRect.top) * scaleCorrection,
|
||||
secondarySup: (rect.bottom - gridRect.bottom) * scaleCorrection
|
||||
secondaryInf: (node.topBoundary() - gridRect.top) * scaleCorrection,
|
||||
secondarySup: (node.bottomBoundary() - gridRect.bottom) * scaleCorrection
|
||||
}
|
||||
}
|
||||
/** @type {(node: NodeElement, selected: Boolean) => void}} */
|
||||
|
||||
@@ -30,6 +30,8 @@ export default class Configuration {
|
||||
static colorDragEventName = "ueb-color-drag"
|
||||
static colorPickEventName = "ueb-color-pick"
|
||||
static colorWindowEventName = "ueb-color-window"
|
||||
static defaultCommentHeight = 96
|
||||
static defaultCommentWidth = 400
|
||||
static deleteNodesKeyboardKey = "Delete"
|
||||
static dragGeneralEventName = "ueb-drag-general"
|
||||
static dragEventName = "ueb-drag"
|
||||
@@ -101,6 +103,7 @@ export default class Configuration {
|
||||
static nodeReflowEventName = "ueb-node-reflow"
|
||||
static nodeType = {
|
||||
callFunction: "/Script/BlueprintGraph.K2Node_CallFunction",
|
||||
comment: "/Script/UnrealEd.EdGraphNode_Comment",
|
||||
doN: "/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:Do N",
|
||||
dynamicCast: "/Script/BlueprintGraph.K2Node_DynamicCast",
|
||||
executionSequence: "/Script/BlueprintGraph.K2Node_ExecutionSequence",
|
||||
|
||||
@@ -68,6 +68,14 @@ export default class Utility {
|
||||
return Math.round(num * power) / power
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number} a
|
||||
* @param {Number} b
|
||||
*/
|
||||
static approximatelyEqual(a, b) {
|
||||
return !(Math.abs(a - b) > Number.EPSILON)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number[]} viewportLocation
|
||||
* @param {HTMLElement} movementElement
|
||||
|
||||
@@ -24,6 +24,14 @@ export default class IDraggableElement extends IElement {
|
||||
type: Number,
|
||||
attribute: false,
|
||||
},
|
||||
sizeX: {
|
||||
type: Number,
|
||||
attribute: false,
|
||||
},
|
||||
sizeY: {
|
||||
type: Number,
|
||||
attribute: false,
|
||||
},
|
||||
}
|
||||
static dragEventName = Configuration.dragEventName
|
||||
static dragGeneralEventName = Configuration.dragGeneralEventName
|
||||
@@ -36,6 +44,20 @@ export default class IDraggableElement extends IElement {
|
||||
super(entity, template)
|
||||
this.locationX = 0
|
||||
this.locationY = 0
|
||||
this.sizeX ??= 0 // It may be set in the template already
|
||||
this.sizeY ??= 0 // It may be set in the template already
|
||||
}
|
||||
|
||||
computeSizes() {
|
||||
const bounding = this.getBoundingClientRect()
|
||||
this.sizeX = bounding.width
|
||||
this.sizeY = bounding.height
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
this.computeSizes()
|
||||
}
|
||||
|
||||
/** @param {Number[]} param0 */
|
||||
@@ -80,4 +102,20 @@ export default class IDraggableElement extends IElement {
|
||||
this.setLocation(snappedLocation)
|
||||
}
|
||||
}
|
||||
|
||||
topBoundary() {
|
||||
return this.locationY
|
||||
}
|
||||
|
||||
rightBoundary() {
|
||||
return this.locationX + this.sizeX
|
||||
}
|
||||
|
||||
bottomBoundary() {
|
||||
return this.locationY + this.sizeY
|
||||
}
|
||||
|
||||
leftBoundary() {
|
||||
return this.locationX
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,10 @@ export default class IElement extends LitElement {
|
||||
updated(changedProperties) {
|
||||
super.updated(changedProperties)
|
||||
this.template.updated(changedProperties)
|
||||
this.#nextUpdatedCallbacks.forEach(f => f(changedProperties))
|
||||
// Remember the array might change while iterating
|
||||
for (const f of this.#nextUpdatedCallbacks) {
|
||||
f(changedProperties)
|
||||
}
|
||||
this.#nextUpdatedCallbacks = []
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import CommentNodeTemplate from "../template/CommentNodeTemplate"
|
||||
import Configuration from "../Configuration"
|
||||
import IdentifierEntity from "../entity/IdentifierEntity"
|
||||
import ISelectableDraggableElement from "./ISelectableDraggableElement"
|
||||
@@ -16,6 +17,7 @@ import VariableAccessNodeTemplate from "../template/VariableAccessNodeTemplate"
|
||||
export default class NodeElement extends ISelectableDraggableElement {
|
||||
|
||||
static #typeTemplateMap = {
|
||||
[Configuration.nodeType.comment]: CommentNodeTemplate,
|
||||
[Configuration.nodeType.knot]: KnotNodeTemplate,
|
||||
[Configuration.nodeType.variableGet]: VariableAccessNodeTemplate,
|
||||
[Configuration.nodeType.variableSet]: VariableAccessNodeTemplate,
|
||||
@@ -94,6 +96,12 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
super.setLocation([this.entity.NodePosX.value, this.entity.NodePosY.value])
|
||||
this.entity.subscribe("AdvancedPinDisplay", value => this.advancedPinDisplay = value)
|
||||
this.entity.subscribe("Name", value => this.nodeName = value)
|
||||
if (this.entity.NodeWidth && this.entity.NodeHeight) {
|
||||
this.sizeX = this.entity.NodeWidth.value
|
||||
this.sizeY = this.entity.NodeHeight.value
|
||||
} else {
|
||||
Promise.all([this.updateComplete, ...this.#pins.map(p => p.updateComplete)]).then(() => this.computeSizes())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,6 +183,7 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
}
|
||||
|
||||
dispatchReflowEvent() {
|
||||
this.addNextUpdatedCallbacks(() => this.computeSizes(), true)
|
||||
let reflowEvent = new CustomEvent(Configuration.nodeReflowEventName)
|
||||
this.dispatchEvent(reflowEvent)
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ export default class SelectorElement extends IFromToPositionedElement {
|
||||
|
||||
constructor() {
|
||||
super({}, new SelectorTemplate())
|
||||
/** @type {FastSelectionModel} */
|
||||
this.selectionModel = null
|
||||
}
|
||||
|
||||
@@ -24,8 +25,7 @@ export default class SelectorElement extends IFromToPositionedElement {
|
||||
|
||||
/** @param {Number[]} finalPosition */
|
||||
selectTo(finalPosition) {
|
||||
/** @type {FastSelectionModel} */ (this.selectionModel)
|
||||
.selectTo(finalPosition)
|
||||
this.selectionModel.selectTo(finalPosition)
|
||||
this.toX = finalPosition[0]
|
||||
this.toY = finalPosition[1]
|
||||
}
|
||||
|
||||
@@ -41,7 +41,23 @@ export default class LinearColorEntity extends IEntity {
|
||||
}
|
||||
}
|
||||
|
||||
static getWhite() {
|
||||
return new LinearColorEntity({
|
||||
R: 1,
|
||||
G: 1,
|
||||
B: 1,
|
||||
})
|
||||
}
|
||||
|
||||
constructor(values) {
|
||||
if (values instanceof Array) {
|
||||
values = {
|
||||
R: values[0] ?? 0,
|
||||
G: values[1] ?? 0,
|
||||
B: values[2] ?? 0,
|
||||
A: values[3] ?? 1,
|
||||
}
|
||||
}
|
||||
super(values)
|
||||
/** @type {RealUnitEntity} */ this.R
|
||||
/** @type {RealUnitEntity} */ this.G
|
||||
@@ -57,12 +73,9 @@ export default class LinearColorEntity extends IEntity {
|
||||
const r = this.R.value
|
||||
const g = this.G.value
|
||||
const b = this.B.value
|
||||
if (
|
||||
!(Math.abs(r - g) > Number.EPSILON)
|
||||
&& !(Math.abs(r - b) > Number.EPSILON)
|
||||
&& !(Math.abs(g - b) > Number.EPSILON)
|
||||
) {
|
||||
this.V.value = 0
|
||||
if (Utility.approximatelyEqual(r, g) && Utility.approximatelyEqual(r, b) && Utility.approximatelyEqual(g, b)) {
|
||||
this.S.value = 0
|
||||
this.V.value = r
|
||||
return
|
||||
}
|
||||
const max = Math.max(r, g, b)
|
||||
@@ -168,7 +181,11 @@ export default class LinearColorEntity extends IEntity {
|
||||
}
|
||||
|
||||
toNumber() {
|
||||
return (this.R.value << 24) + (this.G.value << 16) + (this.B.value << 8) + this.A.value
|
||||
return (
|
||||
Math.round(this.R.value * 0xff) << 24)
|
||||
+ (Math.round(this.G.value * 0xff) << 16)
|
||||
+ (Math.round(this.B.value * 0xff) << 8)
|
||||
+ Math.round(this.A.value * 0xff)
|
||||
}
|
||||
|
||||
/** @param {Number} number */
|
||||
|
||||
@@ -4,6 +4,7 @@ import GuidEntity from "./GuidEntity"
|
||||
import IdentifierEntity from "./IdentifierEntity"
|
||||
import IEntity from "./IEntity"
|
||||
import IntegerEntity from "./IntegerEntity"
|
||||
import LinearColorEntity from "./LinearColorEntity"
|
||||
import MacroGraphReferenceEntity from "./MacroGraphReferenceEntity"
|
||||
import ObjectReferenceEntity from "./ObjectReferenceEntity"
|
||||
import PinEntity from "./PinEntity"
|
||||
@@ -25,8 +26,17 @@ export default class ObjectEntity extends IEntity {
|
||||
TargetType: new TypeInitialization(ObjectReferenceEntity, false, null),
|
||||
MacroGraphReference: new TypeInitialization(MacroGraphReferenceEntity, false, null),
|
||||
Enum: new TypeInitialization(ObjectReferenceEntity, false),
|
||||
CommentColor: new TypeInitialization(LinearColorEntity, false),
|
||||
bCommentBubbleVisible_InDetailsPanel: new TypeInitialization(Boolean, false),
|
||||
bColorCommentBubble: new TypeInitialization(Boolean, false, false),
|
||||
MoveMode: new TypeInitialization(SymbolEntity, false),
|
||||
NodePosX: IntegerEntity,
|
||||
NodePosY: IntegerEntity,
|
||||
NodeWidth: new TypeInitialization(IntegerEntity, false),
|
||||
NodeHeight: new TypeInitialization(IntegerEntity, false),
|
||||
bCommentBubblePinned: new TypeInitialization(Boolean, false),
|
||||
bCommentBubbleVisible: new TypeInitialization(Boolean, false),
|
||||
NodeComment: new TypeInitialization(String, false),
|
||||
AdvancedPinDisplay: new TypeInitialization(IdentifierEntity, false, null),
|
||||
EnabledState: new TypeInitialization(IdentifierEntity, false, null),
|
||||
NodeGuid: GuidEntity,
|
||||
@@ -49,8 +59,15 @@ export default class ObjectEntity extends IEntity {
|
||||
/** @type {ObjectReferenceEntity?} */ this.TargetType
|
||||
/** @type {MacroGraphReferenceEntity?} */ this.MacroGraphReference
|
||||
/** @type {ObjectReferenceEntity?} */ this.Enum
|
||||
/** @type {LinearColorEntity?} */ this.CommentColor
|
||||
/** @type {Boolean?} */ this.bCommentBubbleVisible_InDetailsPanel
|
||||
/** @type {IntegerEntity} */ this.NodePosX
|
||||
/** @type {IntegerEntity} */ this.NodePosY
|
||||
/** @type {IntegerEntity?} */ this.NodeWidth
|
||||
/** @type {IntegerEntity?} */ this.NodeHeight
|
||||
/** @type {Boolean?} */ this.bCommentBubblePinned
|
||||
/** @type {Boolean?} */ this.bCommentBubbleVisible
|
||||
/** @type {String?} */ this.NodeComment
|
||||
/** @type {IdentifierEntity?} */ this.AdvancedPinDisplay
|
||||
/** @type {IdentifierEntity?} */ this.EnabledState
|
||||
/** @type {GuidEntity} */ this.NodeGuid
|
||||
@@ -132,4 +149,30 @@ export default class ObjectEntity extends IEntity {
|
||||
getCounter() {
|
||||
return this.getNameAndCounter()[1]
|
||||
}
|
||||
|
||||
getNodeWidth() {
|
||||
return this.NodeWidth ??
|
||||
this.getType() == Configuration.nodeType.comment ? Configuration.defaultCommentWidth : undefined
|
||||
}
|
||||
|
||||
/** @param {Number} value */
|
||||
setNodeWidth(value) {
|
||||
if (!this.NodeWidth) {
|
||||
this.NodeWidth = new IntegerEntity()
|
||||
}
|
||||
this.NodeWidth.value = value
|
||||
}
|
||||
|
||||
getNodeHeight() {
|
||||
return this.NodeHeight ??
|
||||
this.getType() == Configuration.nodeType.comment ? Configuration.defaultCommentHeight : undefined
|
||||
}
|
||||
|
||||
/** @param {Number} value */
|
||||
setNodeHeight(value) {
|
||||
if (!this.NodeHeight) {
|
||||
this.NodeHeight = new IntegerEntity()
|
||||
}
|
||||
this.NodeHeight.value = value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export default class Copy extends IInput {
|
||||
const value = this.blueprint
|
||||
.getNodes(true)
|
||||
.map(node => Copy.#serializer.serialize(node.entity, false))
|
||||
.join("\n\n")
|
||||
.join("")
|
||||
navigator.clipboard.writeText(value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export default class IMouseClickDrag extends IPointing {
|
||||
this.#trackingMouse = this.target.dispatchEvent(dragEvent) == false
|
||||
const location = this.locationFromEvent(e)
|
||||
// Do actual actions
|
||||
this.mouseLocation = Utility.snapToGrid(this.clickedPosition, this.stepSize)
|
||||
this.lastLocation = Utility.snapToGrid(this.clickedPosition, this.stepSize)
|
||||
this.startDrag(location)
|
||||
this.started = true
|
||||
}
|
||||
@@ -111,15 +111,14 @@ export default class IMouseClickDrag extends IPointing {
|
||||
|
||||
clickedOffset = [0, 0]
|
||||
clickedPosition = [0, 0]
|
||||
mouseLocation = [0, 0]
|
||||
lastLocation = [0, 0]
|
||||
started = false
|
||||
stepSize = 1
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {T} target
|
||||
* @param {Blueprint} blueprint
|
||||
* @param {Object} options
|
||||
* @param {T} target
|
||||
* @param {Blueprint} blueprint
|
||||
* @param {Object} options
|
||||
*/
|
||||
constructor(target, blueprint, options = {}) {
|
||||
options.clickButton ??= 0
|
||||
@@ -133,12 +132,13 @@ export default class IMouseClickDrag extends IPointing {
|
||||
super(target, blueprint, options)
|
||||
this.stepSize = parseInt(options?.stepSize ?? Configuration.gridSize)
|
||||
this.#movementListenedElement = this.options.moveEverywhere ? document.documentElement : this.movementSpace
|
||||
this.#draggableElement = this.options.draggableElement
|
||||
this.#draggableElement = /** @type {HTMLElement} */(this.options.draggableElement)
|
||||
|
||||
this.listenEvents()
|
||||
}
|
||||
|
||||
listenEvents() {
|
||||
super.listenEvents()
|
||||
this.#draggableElement.addEventListener("mousedown", this.#mouseDownHandler)
|
||||
if (this.options.clickButton == 2) {
|
||||
this.#draggableElement.addEventListener("contextmenu", e => e.preventDefault())
|
||||
@@ -146,6 +146,7 @@ export default class IMouseClickDrag extends IPointing {
|
||||
}
|
||||
|
||||
unlistenEvents() {
|
||||
super.unlistenEvents()
|
||||
this.#draggableElement.removeEventListener("mousedown", this.#mouseDownHandler)
|
||||
}
|
||||
|
||||
|
||||
51
js/input/mouse/MouseClickDrag.js
Executable file
51
js/input/mouse/MouseClickDrag.js
Executable file
@@ -0,0 +1,51 @@
|
||||
import MouseMoveDraggable from "./MouseMoveDraggable"
|
||||
|
||||
/** @typedef {import("../../Blueprint").default} Blueprint */
|
||||
|
||||
export default class MouseClickDrag extends MouseMoveDraggable {
|
||||
|
||||
#onClicked
|
||||
#onStartDrag
|
||||
#onDrag
|
||||
#onEndDrag
|
||||
|
||||
/**
|
||||
* @param {HTMLElement} target
|
||||
* @param {Blueprint} blueprint
|
||||
* @param {Object} options
|
||||
*/
|
||||
constructor(target, blueprint, options = {}) {
|
||||
super(target, blueprint, options)
|
||||
if (options.onClicked) {
|
||||
this.#onClicked = options.onClicked
|
||||
}
|
||||
if (options.onStartDrag) {
|
||||
this.#onStartDrag = options.onStartDrag
|
||||
}
|
||||
if (options.onDrag) {
|
||||
this.#onDrag = options.onDrag
|
||||
}
|
||||
if (options.onEndDrag) {
|
||||
this.#onEndDrag = options.onEndDrag
|
||||
}
|
||||
}
|
||||
|
||||
clicked() {
|
||||
super.clicked()
|
||||
this.#onClicked?.()
|
||||
}
|
||||
|
||||
startDrag() {
|
||||
super.startDrag()
|
||||
this.#onStartDrag?.()
|
||||
}
|
||||
|
||||
dragAction(location, movement) {
|
||||
this.#onDrag?.(location, movement)
|
||||
}
|
||||
|
||||
endDrag() {
|
||||
super.endDrag()
|
||||
this.#onEndDrag?.()
|
||||
}
|
||||
}
|
||||
@@ -23,29 +23,32 @@ export default class MouseMoveDraggable extends IMouseClickDrag {
|
||||
}
|
||||
|
||||
dragTo(location, offset) {
|
||||
const targetLocation = [this.target.locationX, this.target.locationY]
|
||||
const targetLocation = [
|
||||
this.target.locationX ?? this.lastLocation[0],
|
||||
this.target.locationY ?? this.lastLocation[1],
|
||||
]
|
||||
const [adjustedLocation, adjustedTargetLocation] = this.stepSize > 1
|
||||
? [Utility.snapToGrid(location, this.stepSize), Utility.snapToGrid(targetLocation, this.stepSize)]
|
||||
: [location, targetLocation]
|
||||
offset = [
|
||||
adjustedLocation[0] - this.mouseLocation[0],
|
||||
adjustedLocation[1] - this.mouseLocation[1]
|
||||
adjustedLocation[0] - this.lastLocation[0],
|
||||
adjustedLocation[1] - this.lastLocation[1],
|
||||
]
|
||||
if (offset[0] == 0 && offset[1] == 0) {
|
||||
return
|
||||
}
|
||||
// Make sure it snaps on the grid
|
||||
offset[0] += adjustedTargetLocation[0] - this.target.locationX
|
||||
offset[1] += adjustedTargetLocation[1] - this.target.locationY
|
||||
offset[0] += adjustedTargetLocation[0] - targetLocation[0]
|
||||
offset[1] += adjustedTargetLocation[1] - targetLocation[1]
|
||||
this.dragAction(adjustedLocation, offset)
|
||||
// Reassign the position of mouse
|
||||
this.mouseLocation = adjustedLocation
|
||||
this.lastLocation = adjustedLocation
|
||||
}
|
||||
|
||||
dragAction(location, offset) {
|
||||
this.target.setLocation([
|
||||
location[0] - this.clickedOffset[0],
|
||||
location[1] - this.clickedOffset[1]
|
||||
location[1] - this.clickedOffset[1],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export default class Grammar {
|
||||
.sepBy(P.string(","))
|
||||
.skip(P.regex(/,?\s*/)),
|
||||
P.string(")"),
|
||||
(_, grammar, __) => grammar
|
||||
(_0, grammar, _2) => grammar
|
||||
)
|
||||
case Boolean:
|
||||
return r.Boolean
|
||||
@@ -144,7 +144,7 @@ export default class Grammar {
|
||||
})
|
||||
|
||||
/** @param {Grammar} r */
|
||||
static createEntityGrammar = (r, entityType) =>
|
||||
static createEntityGrammar = (r, entityType, limitUnknownKeys = false) =>
|
||||
P.seqMap(
|
||||
entityType.lookbehind
|
||||
? P.seq(P.string(entityType.lookbehind), P.optWhitespace, P.string("("))
|
||||
@@ -162,14 +162,16 @@ export default class Grammar {
|
||||
)
|
||||
// Decide if we accept the entity or not. It is accepted if it doesn't have too many unexpected keys
|
||||
.chain(values => {
|
||||
let unexpectedKeysCount = 0
|
||||
let totalKeys = 0
|
||||
for (const key in values) {
|
||||
unexpectedKeysCount += key in entityType.attributes ? 0 : 1
|
||||
++totalKeys
|
||||
}
|
||||
if (unexpectedKeysCount + 0.5 > Math.sqrt(totalKeys)) {
|
||||
return P.fail()
|
||||
if (limitUnknownKeys) {
|
||||
let unexpectedKeysCount = 0
|
||||
let totalKeys = 0
|
||||
for (const key in values) {
|
||||
unexpectedKeysCount += key in entityType.attributes ? 0 : 1
|
||||
++totalKeys
|
||||
}
|
||||
if (unexpectedKeysCount + 0.5 > Math.sqrt(totalKeys)) {
|
||||
return P.fail()
|
||||
}
|
||||
}
|
||||
return P.succeed().map(() => new entityType(values))
|
||||
})
|
||||
@@ -186,7 +188,7 @@ export default class Grammar {
|
||||
MultilineWhitespace = r => P.regex(/[^\S\n]*\n\s*/).desc("whitespace with at least a newline")
|
||||
|
||||
/** @param {Grammar} r */
|
||||
Null = r => P.seq(P.string("("), r.InlineOptWhitespace, P.string(")")).map(_ => null).desc("null: ()")
|
||||
Null = r => P.seq(P.string("("), r.InlineOptWhitespace, P.string(")")).map(() => null).desc("null: ()")
|
||||
|
||||
/** @param {Grammar} r */
|
||||
Boolean = r => P.alt(
|
||||
@@ -216,7 +218,7 @@ export default class Grammar {
|
||||
ColorNumber = r => r.NaturalNumber.assert(n => 0 <= n && n < 256, "the color must be between 0 and 256 excluded")
|
||||
|
||||
/** @param {Grammar} r */
|
||||
Word = r => P.regex(/[a-zA-Z]+/).desc("a word")
|
||||
Word = r => P.regex(/[a-zA-Z_]+/).desc("a word")
|
||||
|
||||
/** @param {Grammar} r */
|
||||
String = r => P.regex(/(?:[^"\\]|\\.)*/).wrap(P.string('"'), P.string('"')).map(Utility.unescapeString)
|
||||
@@ -228,7 +230,7 @@ export default class Grammar {
|
||||
/* --- Entity --- */
|
||||
|
||||
/** @param {Grammar} r */
|
||||
None = r => P.string("None").map(_ => new ObjectReferenceEntity({ type: "None", path: "" })).desc("none")
|
||||
None = r => P.string("None").map(() => new ObjectReferenceEntity({ type: "None", path: "" })).desc("none")
|
||||
|
||||
/** @param {Grammar} r */
|
||||
Integer = r => P.regex(/[\-\+]?[0-9]+/).map(v => new IntegerEntity(v)).desc("an integer")
|
||||
@@ -301,13 +303,12 @@ export default class Grammar {
|
||||
r.Guid,
|
||||
r.None,
|
||||
r.Null,
|
||||
r.Integer,
|
||||
r.Number,
|
||||
r.String,
|
||||
r.LocalizedText,
|
||||
r.InvariantText,
|
||||
r.Vector,
|
||||
r.LinearColor,
|
||||
Grammar.createEntityGrammar(r, VectorEntity, true),
|
||||
Grammar.createEntityGrammar(r, LinearColorEntity, true),
|
||||
r.UnknownKeys,
|
||||
r.ObjectReference,
|
||||
r.Symbol,
|
||||
@@ -316,9 +317,9 @@ export default class Grammar {
|
||||
/** @param {Grammar} r */
|
||||
PinReference = r => P.seqMap(
|
||||
r.PathSymbol, // Goes into objectNAme
|
||||
P.whitespace, // Goes into _ (ignored)
|
||||
P.whitespace, // Goes into _1 (ignored)
|
||||
r.Guid, // Goes into pinGuid
|
||||
(objectName, _, pinGuid) => new PinReferenceEntity({
|
||||
(objectName, _1, pinGuid) => new PinReferenceEntity({
|
||||
objectName: objectName,
|
||||
pinGuid: pinGuid,
|
||||
})
|
||||
@@ -403,7 +404,7 @@ export default class Grammar {
|
||||
)
|
||||
.sepBy1(P.whitespace),
|
||||
P.seq(r.MultilineWhitespace, P.string("End"), P.whitespace, P.string("Object")),
|
||||
(_, attributes, __) => {
|
||||
(_0, attributes, _2) => {
|
||||
let values = {}
|
||||
attributes.forEach(attributeSetter => attributeSetter(values))
|
||||
return new ObjectEntity(values)
|
||||
@@ -434,7 +435,7 @@ export default class Grammar {
|
||||
r.ColorNumber,
|
||||
P.string(",").skip(P.optWhitespace),
|
||||
r.ColorNumber.map(Number),
|
||||
(R, _, G, __, B) => new LinearColorEntity({
|
||||
(R, _1, G, _3, B) => new LinearColorEntity({
|
||||
R: R / 255,
|
||||
G: G / 255,
|
||||
B: B / 255,
|
||||
@@ -460,7 +461,7 @@ export default class Grammar {
|
||||
r.ColorNumber.map(Number),
|
||||
P.string(",").skip(P.optWhitespace),
|
||||
P.regex(/0?\.\d+|[01]/).map(Number),
|
||||
(R, _, G, __, B, ___, A) => new LinearColorEntity({
|
||||
(R, _1, G, _3, B, _4, A) => new LinearColorEntity({
|
||||
R: R / 255,
|
||||
G: G / 255,
|
||||
B: B / 255,
|
||||
|
||||
68
js/template/CommentNodeTemplate.js
Normal file
68
js/template/CommentNodeTemplate.js
Normal file
@@ -0,0 +1,68 @@
|
||||
import { css, html } from "lit"
|
||||
import Configuration from "../Configuration"
|
||||
import IResizeableTemplate from "./IResizeableTemplate"
|
||||
import LinearColorEntity from "../entity/LinearColorEntity"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../element/PinElement").default} PinElement
|
||||
*/
|
||||
|
||||
export default class CommentNodeTemplate extends IResizeableTemplate {
|
||||
|
||||
#color = LinearColorEntity.getWhite()
|
||||
|
||||
/** @param {NodeElement} element */
|
||||
constructed(element) {
|
||||
if (element.entity.CommentColor) {
|
||||
this.#color.setFromRGBANumber(element.entity.CommentColor.toNumber())
|
||||
this.#color.setFromHSVA(this.#color.H.value, this.#color.S.value, Math.pow(this.#color.V.value, 0.45) * 0.67)
|
||||
}
|
||||
element.classList.add("ueb-node-style-comment", "ueb-node-resizeable")
|
||||
element.sizeX ??= 25 * Configuration.gridSize
|
||||
element.sizeY ??= 6 * Configuration.gridSize
|
||||
super.constructed(element) // Keep it at the end because it calls this.getColor() where this.#color must be initialized
|
||||
}
|
||||
|
||||
getColor() {
|
||||
return css`${Math.round(this.#color.R.value * 255)}, ${Math.round(this.#color.G.value * 255)}, ${Math.round(this.#color.B.value * 255)}`
|
||||
}
|
||||
|
||||
getDraggableElement() {
|
||||
return this.element.querySelector(".ueb-node-top")
|
||||
}
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<div class="ueb-node-border">
|
||||
<div class="ueb-node-wrapper">
|
||||
<div class="ueb-node-top">
|
||||
${this.element.entity.NodeComment}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
||||
/** @param {Number} value */
|
||||
setSizeX(value) {
|
||||
value = Math.round(value)
|
||||
if (value >= Configuration.gridSet * Configuration.gridSize) {
|
||||
this.element.sizeX = value
|
||||
this.element.entity.setNodeWidth(this.element.sizeX)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/** @param {Number} value */
|
||||
setSizeY(value) {
|
||||
value = Math.round(value)
|
||||
if (value >= 3 * Configuration.gridSize) {
|
||||
this.element.sizeY = Math.max(value, 3 * Configuration.gridSize)
|
||||
this.element.entity.setNodeHeight(this.element.sizeY)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import MouseMoveDraggable from "../input/mouse/MouseMoveDraggable"
|
||||
export default class IDraggableTemplate extends ITemplate {
|
||||
|
||||
getDraggableElement() {
|
||||
return this.element
|
||||
return /** @type {Element} */(this.element)
|
||||
}
|
||||
|
||||
createDraggableObject() {
|
||||
|
||||
142
js/template/IResizeableTemplate.js
Normal file
142
js/template/IResizeableTemplate.js
Normal file
@@ -0,0 +1,142 @@
|
||||
import MouseClickDrag from "../input/mouse/MouseClickDrag"
|
||||
import NodeTemplate from "./NodeTemplate"
|
||||
|
||||
/** @typedef {import("../element/NodeElement").default} NodeElement */
|
||||
|
||||
export default class IResizeableTemplate extends NodeTemplate {
|
||||
|
||||
#THandler = document.createElement("div")
|
||||
#RHandler = document.createElement("div")
|
||||
#BHandler = document.createElement("div")
|
||||
#LHandler = document.createElement("div")
|
||||
#TRHandler = document.createElement("div")
|
||||
#BRHandler = document.createElement("div")
|
||||
#BLHandler = document.createElement("div")
|
||||
#TLHandler = document.createElement("div")
|
||||
|
||||
/** @param {NodeElement} element */
|
||||
constructed(element) {
|
||||
super.constructed(element)
|
||||
this.element.classList.add("ueb-resizeable")
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
update(changedProperties) {
|
||||
super.update(changedProperties)
|
||||
if (this.element.sizeX >= 0 && changedProperties.has("sizeX")) {
|
||||
this.element.style.width = `${this.element.sizeX}px`
|
||||
}
|
||||
if (this.element.sizeY >= 0 && changedProperties.has("sizeY")) {
|
||||
this.element.style.height = `${this.element.sizeY}px`
|
||||
}
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
this.#THandler.classList.add("ueb-resizeable-top")
|
||||
this.#RHandler.classList.add("ueb-resizeable-right")
|
||||
this.#BHandler.classList.add("ueb-resizeable-bottom")
|
||||
this.#LHandler.classList.add("ueb-resizeable-left")
|
||||
this.#TRHandler.classList.add("ueb-resizeable-top-right")
|
||||
this.#BRHandler.classList.add("ueb-resizeable-bottom-right")
|
||||
this.#BLHandler.classList.add("ueb-resizeable-bottom-left")
|
||||
this.#TLHandler.classList.add("ueb-resizeable-top-left")
|
||||
this.element.append(
|
||||
this.#THandler,
|
||||
this.#RHandler,
|
||||
this.#BHandler,
|
||||
this.#LHandler,
|
||||
this.#TRHandler,
|
||||
this.#BRHandler,
|
||||
this.#BLHandler,
|
||||
this.#TLHandler
|
||||
)
|
||||
}
|
||||
|
||||
createInputObjects() {
|
||||
return [
|
||||
...super.createInputObjects(),
|
||||
new MouseClickDrag(this.#THandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
movement[1] = location[1] - this.element.topBoundary()
|
||||
if (this.setSizeY(this.element.sizeY - movement[1])) {
|
||||
this.element.addLocation([0, movement[1]])
|
||||
}
|
||||
}
|
||||
}),
|
||||
new MouseClickDrag(this.#RHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
movement[0] = location[0] - this.element.rightBoundary()
|
||||
this.setSizeX(this.element.sizeX + movement[0])
|
||||
}
|
||||
}),
|
||||
new MouseClickDrag(this.#BHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
movement[1] = location[1] - this.element.bottomBoundary()
|
||||
this.setSizeY(this.element.sizeY + movement[1])
|
||||
}
|
||||
}),
|
||||
new MouseClickDrag(this.#LHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
movement[0] = location[0] - this.element.leftBoundary()
|
||||
if (this.setSizeX(this.element.sizeX - movement[0])) {
|
||||
this.element.addLocation([movement[0], 0])
|
||||
}
|
||||
}
|
||||
}),
|
||||
new MouseClickDrag(this.#TRHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
movement[0] = location[0] - this.element.rightBoundary()
|
||||
movement[1] = location[1] - this.element.topBoundary()
|
||||
this.setSizeX(this.element.sizeX + movement[0])
|
||||
if (this.setSizeY(this.element.sizeY - movement[1])) {
|
||||
this.element.addLocation([0, movement[1]])
|
||||
}
|
||||
}
|
||||
}),
|
||||
new MouseClickDrag(this.#BRHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
movement[0] = location[0] - this.element.rightBoundary()
|
||||
movement[1] = location[1] - this.element.bottomBoundary()
|
||||
this.setSizeX(this.element.sizeX + movement[0])
|
||||
this.setSizeY(this.element.sizeY + movement[1])
|
||||
}
|
||||
}),
|
||||
new MouseClickDrag(this.#BLHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
movement[0] = location[0] - this.element.leftBoundary()
|
||||
movement[1] = location[1] - this.element.bottomBoundary()
|
||||
if (this.setSizeX(this.element.sizeX - movement[0])) {
|
||||
this.element.addLocation([movement[0], 0])
|
||||
}
|
||||
this.setSizeY(this.element.sizeY + movement[1])
|
||||
}
|
||||
}),
|
||||
new MouseClickDrag(this.#TLHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
movement[0] = location[0] - this.element.leftBoundary()
|
||||
movement[1] = location[1] - this.element.topBoundary()
|
||||
if (this.setSizeX(this.element.sizeX - movement[0])) {
|
||||
this.element.addLocation([movement[0], 0])
|
||||
}
|
||||
if (this.setSizeY(this.element.sizeY - movement[1])) {
|
||||
this.element.addLocation([0, movement[1]])
|
||||
}
|
||||
}
|
||||
}),
|
||||
]
|
||||
}
|
||||
|
||||
/** @param {Number} value */
|
||||
setSizeX(value) {
|
||||
this.element.sizeX = value
|
||||
return true
|
||||
}
|
||||
|
||||
/** @param {Number} value */
|
||||
setSizeY(value) {
|
||||
this.element.sizeY = value
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import MouseMoveNodes from "../input/mouse/MouseMoveNodes"
|
||||
export default class ISelectableDraggableTemplate extends IDraggablePositionedTemplate {
|
||||
|
||||
getDraggableElement() {
|
||||
return this.element
|
||||
return /** @type {Element} */ (this.element)
|
||||
}
|
||||
|
||||
createDraggableObject() {
|
||||
|
||||
@@ -37,6 +37,12 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
|
||||
this.element.addNextUpdatedCallbacks(() => this.element.dispatchReflowEvent(), true)
|
||||
}
|
||||
|
||||
/** @param {NodeElement} element */
|
||||
constructed(element) {
|
||||
super.constructed(element)
|
||||
this.element.style.setProperty("--ueb-node-color", this.getColor().cssText)
|
||||
}
|
||||
|
||||
getColor() {
|
||||
const functionColor = css`84, 122, 156`
|
||||
const pureFunctionColor = css`95, 129, 90`
|
||||
@@ -60,12 +66,6 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
|
||||
return functionColor
|
||||
}
|
||||
|
||||
/** @param {NodeElement} element */
|
||||
constructed(element) {
|
||||
super.constructed(element)
|
||||
this.element.style.setProperty("--ueb-node-color", this.getColor().cssText)
|
||||
}
|
||||
|
||||
render() {
|
||||
const icon = this.renderNodeIcon()
|
||||
const name = this.renderNodeName()
|
||||
@@ -153,7 +153,7 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
|
||||
if (!this.#hasTargetInputNode && v.getDisplayName() === "Target") {
|
||||
this.#hasTargetInputNode = true
|
||||
}
|
||||
return/** @type {PinElement} */(
|
||||
return /** @type {PinElement} */(
|
||||
new (ElementFactory.getConstructor("ueb-pin"))(v, undefined, this.element)
|
||||
)
|
||||
})
|
||||
|
||||
@@ -68,6 +68,7 @@ export default class PinTemplate extends ITemplate {
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
updated(changedProperties) {
|
||||
super.updated(changedProperties)
|
||||
if (this.element.isInput() && changedProperties.has("isLinked")) {
|
||||
// When connected, an input may drop its input fields which means the node has to reflow
|
||||
const node = this.element.nodeElement
|
||||
|
||||
@@ -11,10 +11,6 @@ ueb-node {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
ueb-blueprint[data-scrolling="false"][data-selecting="false"] ueb-node {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.ueb-node-border {
|
||||
margin: -3px;
|
||||
padding: 3px;
|
||||
@@ -55,6 +51,10 @@ ueb-node[data-selected="true"]>.ueb-node-border {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
ueb-blueprint[data-scrolling="false"][data-selecting="false"] .ueb-node-wrapper {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.ueb-zoom--2 .ueb-node-wrapper {
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
@@ -206,7 +206,7 @@ ueb-node.ueb-node-style-glass {
|
||||
|
||||
ueb-node.ueb-node-style-glass .ueb-node-wrapper {
|
||||
border: 1px solid black;
|
||||
box-shadow: 1px 1px 0 0 rgba(255, 255, 255, 0.6) inset, 0 -2px 2px 1px rgba(0, 0, 0, 0.5) inset;
|
||||
box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.6) inset, 0 -2px 2px 1px rgba(0, 0, 0, 0.5) inset;
|
||||
background:
|
||||
linear-gradient(to bottom, rgba(255, 255, 255, 0.188) 0%, rgba(255, 255, 255, 0.063) 14px, rgba(0, 0, 0, 0.251) 14px),
|
||||
linear-gradient(to right, transparent 10%, rgba(var(--ueb-node-color), 0.3) 50%, transparent 90%);
|
||||
@@ -236,3 +236,54 @@ ueb-node.ueb-node-style-glass .ueb-node-top {
|
||||
ueb-node.ueb-node-style-glass .ueb-node-outputs:first-child {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
ueb-node.ueb-node-style-comment {
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
ueb-node.ueb-node-style-comment .ueb-node-border {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
ueb-node.ueb-node-style-comment .ueb-node-wrapper {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
border-radius: 0;
|
||||
background: rgba(var(--ueb-node-color), 0.5);
|
||||
box-shadow: none;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 3px;
|
||||
bottom: 3px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background: linear-gradient(135deg,
|
||||
transparent 50%,
|
||||
#fff 50%,
|
||||
#fff calc(50% + 2px),
|
||||
transparent calc(50% + 2px),
|
||||
transparent calc(50% + 3px),
|
||||
#fff calc(50% + 3px),
|
||||
#fff calc(50% + 5px),
|
||||
transparent calc(50% + 5px),
|
||||
transparent calc(50% + 7px),
|
||||
#fff calc(50% + 7px),
|
||||
#fff calc(50% + 9px),
|
||||
transparent calc(50% + 9px));
|
||||
}
|
||||
}
|
||||
|
||||
ueb-node.ueb-node-style-comment .ueb-node-top {
|
||||
margin: 3px;
|
||||
padding: 3px 10px;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
background: rgb(var(--ueb-node-color));
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
text-shadow: 2px 1px 1px #444, 0 0 2px #bbb;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,6 @@ ueb-pin[data-type="/Script/CoreUObject.LinearColor"] .ueb-pin-input {
|
||||
line-height: calc(1em + 1px);
|
||||
background: none;
|
||||
color: inherit;
|
||||
cursor: text;
|
||||
overflow: auto;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
@@ -174,3 +173,7 @@ ueb-pin[data-type="/Script/CoreUObject.LinearColor"] .ueb-pin-input {
|
||||
margin: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
ueb-blueprint[data-scrolling="false"][data-selecting="false"] .ueb-node-wrapper {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
@@ -95,3 +95,73 @@ ueb-window .ueb-pin-input-content {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.ueb-resizeable-top,
|
||||
.ueb-resizeable-top-right,
|
||||
.ueb-resizeable-top-left {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.ueb-resizeable-top {
|
||||
right: 0;
|
||||
left: 0;
|
||||
cursor: ns-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-top-right {
|
||||
right: 0;
|
||||
width: 10px;
|
||||
cursor: nesw-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-top-left {
|
||||
left: 0;
|
||||
width: 10px;
|
||||
cursor: nwse-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-right {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 10px;
|
||||
cursor: ew-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-bottom,
|
||||
.ueb-resizeable-bottom-right,
|
||||
.ueb-resizeable-bottom-left {
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
height: 10px;
|
||||
cursor: ns-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-bottom {
|
||||
right: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.ueb-resizeable-bottom-right {
|
||||
right: 0;
|
||||
width: 10px;
|
||||
cursor: nwse-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-bottom-left {
|
||||
left: 0;
|
||||
width: 10px;
|
||||
cursor: nesw-resize;
|
||||
}
|
||||
|
||||
.ueb-resizeable-left {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 10px;
|
||||
cursor: ew-resize;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user