mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-16 02:10:38 +08:00
Make elements default constructible, testing wip
This commit is contained in:
35
.vscode/launch.json
vendored
Normal file
35
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch index.html",
|
||||
"type": "firefox",
|
||||
"request": "launch",
|
||||
"reAttach": true,
|
||||
"file": "${workspaceFolder}/index.html"
|
||||
},
|
||||
{
|
||||
"name": "Launch localhost",
|
||||
"type": "firefox",
|
||||
"request": "launch",
|
||||
"reAttach": true,
|
||||
"url": "http://localhost/index.html",
|
||||
"webRoot": "${workspaceFolder}"
|
||||
},
|
||||
{
|
||||
"name": "Attach",
|
||||
"type": "firefox",
|
||||
"request": "attach"
|
||||
},
|
||||
{
|
||||
"name": "Launch WebExtension",
|
||||
"type": "firefox",
|
||||
"request": "launch",
|
||||
"reAttach": true,
|
||||
"addonPath": "${workspaceFolder}"
|
||||
}
|
||||
]
|
||||
}
|
||||
9
cypress.config.js
Normal file
9
cypress.config.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const { defineConfig } = require("cypress");
|
||||
|
||||
module.exports = defineConfig({
|
||||
e2e: {
|
||||
setupNodeEvents(on, config) {
|
||||
// implement node event listeners here
|
||||
},
|
||||
},
|
||||
});
|
||||
5
cypress/e2e/color_picker.cy.js
Normal file
5
cypress/e2e/color_picker.cy.js
Normal file
@@ -0,0 +1,5 @@
|
||||
describe('empty spec', () => {
|
||||
it('passes', () => {
|
||||
cy.visit('http://127.0.0.1:8080/')
|
||||
})
|
||||
})
|
||||
5
cypress/fixtures/example.json
Normal file
5
cypress/fixtures/example.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "Using fixtures to represent data",
|
||||
"email": "hello@cypress.io",
|
||||
"body": "Fixtures are a great way to mock data for responses to routes"
|
||||
}
|
||||
25
cypress/support/commands.js
Normal file
25
cypress/support/commands.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// ***********************************************
|
||||
// This example commands.js shows you how to
|
||||
// create various custom commands and overwrite
|
||||
// existing commands.
|
||||
//
|
||||
// For more comprehensive examples of custom
|
||||
// commands please read more here:
|
||||
// https://on.cypress.io/custom-commands
|
||||
// ***********************************************
|
||||
//
|
||||
//
|
||||
// -- This is a parent command --
|
||||
// Cypress.Commands.add('login', (email, password) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a child command --
|
||||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a dual command --
|
||||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
||||
20
cypress/support/e2e.js
Normal file
20
cypress/support/e2e.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// ***********************************************************
|
||||
// This example support/e2e.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands'
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
5
dist/css/ueb-style.css
vendored
5
dist/css/ueb-style.css
vendored
@@ -752,10 +752,13 @@ ueb-pin[data-type="/Script/CoreUObject.LinearColor"] .ueb-pin-input {
|
||||
height: 10px;
|
||||
}
|
||||
.ueb-pin-input-content::-webkit-scrollbar-thumb {
|
||||
background: #575757;
|
||||
background: transparent;
|
||||
border-radius: 10px;
|
||||
margin: 4px;
|
||||
}
|
||||
.ueb-pin-input-content:hover::-webkit-scrollbar-thumb {
|
||||
background: #575757;
|
||||
}
|
||||
|
||||
ueb-blueprint[data-scrolling=false][data-selecting=false] .ueb-node-wrapper {
|
||||
cursor: move;
|
||||
|
||||
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;;;AAGJ;EACI;IACI;;EAGJ;IACI;;;AAIR;EACI;;;AAGJ;EACI;EACA;EACA;EACA;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;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;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A;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"}
|
||||
{"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;;;AAGJ;EACI;IACI;;EAGJ;IACI;;;AAIR;EACI;;;AAGJ;EACI;EACA;EACA;EACA;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;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EAC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;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,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,0BACA,UAGJ,8BACI,GACI,cAGJ,KACI,eAIR,qCACI,mCAGJ,mBACI,iBACA,YACA,cACA,eACA,iBACA,oBAGJ,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,8BACI,sBACA,uDAGJ,8BACI,iBACA,uDAGJ,8BACI,sBACA,uDAGJ,8BACI,sBACA,uDAGJ,+BACI,iBAC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A,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"}
|
||||
{"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,0BACA,UAGJ,8BACI,GACI,cAGJ,KACI,eAIR,qCACI,mCAGJ,mBACI,iBACA,YACA,cACA,eACA,iBACA,oBAGJ,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,8BACI,sBACA,uDAGJ,8BACI,iBACA,uDAGJ,8BACI,sBACA,uDAGJ,8BACI,sBACA,uDAGJ,+BACI,iBACA,uDAGJ,+BACI,sBACA,uDAGJ,+BAC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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"}
|
||||
788
dist/ueblueprint.js
vendored
788
dist/ueblueprint.js
vendored
File diff suppressed because it is too large
Load Diff
10
dist/ueblueprint.min.js
vendored
10
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -72,8 +72,6 @@ export default class Blueprint extends IElement {
|
||||
},
|
||||
}
|
||||
|
||||
static styles = BlueprintTemplate.styles
|
||||
|
||||
/** @type {Map<String, Number>} */
|
||||
#nodeNameCounter = new Map()
|
||||
/** @type {NodeElement[]}" */
|
||||
@@ -96,7 +94,6 @@ export default class Blueprint extends IElement {
|
||||
nodesContainerElement
|
||||
/** @type {HTMLElement} */
|
||||
headerElement
|
||||
focused = false
|
||||
waitingExpandUpdate = false
|
||||
/** @param {NodeElement} node */
|
||||
nodeBoundariesSupplier = node => {
|
||||
@@ -113,9 +110,8 @@ export default class Blueprint extends IElement {
|
||||
node.setSelected(selected)
|
||||
}
|
||||
|
||||
/** @param {Configuration} settings */
|
||||
constructor(settings = new Configuration()) {
|
||||
super({}, new BlueprintTemplate())
|
||||
constructor() {
|
||||
super()
|
||||
this.selecting = false
|
||||
this.scrolling = false
|
||||
this.focused = false
|
||||
@@ -124,16 +120,17 @@ export default class Blueprint extends IElement {
|
||||
this.scrollY = Configuration.expandGridSize
|
||||
this.translateX = Configuration.expandGridSize
|
||||
this.translateY = Configuration.expandGridSize
|
||||
super.initialize({}, new BlueprintTemplate())
|
||||
}
|
||||
|
||||
initialize() {
|
||||
// Initialized in the constructor, this method does nothing
|
||||
}
|
||||
|
||||
getGridDOMElement() {
|
||||
return this.gridElement
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback()
|
||||
}
|
||||
|
||||
getScroll() {
|
||||
return [this.scrollX, this.scrollY]
|
||||
}
|
||||
@@ -418,7 +415,7 @@ export default class Blueprint extends IElement {
|
||||
if (this.focused == value) {
|
||||
return
|
||||
}
|
||||
let event = new CustomEvent(value ? "blueprint-focus" : "blueprint-unfocus")
|
||||
let event = new CustomEvent(value ? Configuration.focusEventName.begin : Configuration.focusEventName.end)
|
||||
this.focused = value
|
||||
if (!this.focused) {
|
||||
this.unselectAll()
|
||||
|
||||
@@ -5,6 +5,7 @@ import UnionType from "./entity/UnionType"
|
||||
/**
|
||||
* @typedef {import("./element/IElement").default} IElement
|
||||
* @typedef {import("./entity/IEntity").default} IEntity
|
||||
* @typedef {import("./entity/IEntity").EntityConstructor} EntityConstructor
|
||||
* @typedef {import("./entity/LinearColorEntity").default} LinearColorEntity
|
||||
* @typedef {import("./entity/TypeInitialization").AnyValue} AnyValue
|
||||
*/
|
||||
@@ -99,8 +100,7 @@ export default class Utility {
|
||||
static isSerialized(
|
||||
entity,
|
||||
keys,
|
||||
// @ts-expect-error
|
||||
propertyDefinition = Utility.objectGet(entity.constructor.attributes, keys)
|
||||
propertyDefinition = Utility.objectGet(/** @type {EntityConstructor} */(entity.constructor).attributes, keys)
|
||||
) {
|
||||
if (propertyDefinition instanceof CalculatedType) {
|
||||
return Utility.isSerialized(entity, keys, propertyDefinition.calculate(entity))
|
||||
@@ -183,8 +183,7 @@ export default class Utility {
|
||||
// value is already a constructor
|
||||
return value
|
||||
}
|
||||
/** @ts-expect-error */
|
||||
return value?.constructor
|
||||
return /** @type {AnyValueConstructor<IEntity>} */(value?.constructor)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
import ColorHandlerTemplate from "../template/ColorHandlerTemplate"
|
||||
import IDraggableControlElement from "./IDraggableControlElement"
|
||||
|
||||
/** @typedef {import("../template/ColorPickerWindowTemplate").default} ColorPickerWindowTemplate */
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import("./WindowElement").default<T>} WindowElement
|
||||
*/
|
||||
|
||||
/** @extends {IDraggableControlElement<Object, ColorHandlerTemplate>} */
|
||||
export default class ColorHandlerElement extends IDraggableControlElement {
|
||||
|
||||
constructor() {
|
||||
super({}, new ColorHandlerTemplate())
|
||||
super()
|
||||
super.initialize({}, new ColorHandlerTemplate())
|
||||
}
|
||||
|
||||
static newObject() {
|
||||
return new ColorHandlerElement()
|
||||
}
|
||||
|
||||
initialize() {
|
||||
// Initialized in the constructor, this method does nothing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
import ColorSliderTemplate from "../template/ColorSliderTemplate"
|
||||
import IDraggableControlElement from "./IDraggableControlElement"
|
||||
|
||||
/** @typedef {import("../template/IDraggableControlTemplate").default} IDraggableControlTemplate */
|
||||
|
||||
/** @extends {IDraggableControlElement<Object, ColorSliderTemplate>} */
|
||||
export default class ColorSliderElement extends IDraggableControlElement {
|
||||
|
||||
constructor() {
|
||||
super({}, new ColorSliderTemplate())
|
||||
super()
|
||||
super.initialize({}, new ColorSliderTemplate())
|
||||
}
|
||||
|
||||
static newObject() {
|
||||
return new ColorSliderElement()
|
||||
}
|
||||
|
||||
initialize() {
|
||||
// Initialized in the constructor, this method does nothing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @typedef {new (...args) => IElement} ElementConstructor
|
||||
* @typedef {import("./IElement").default} IElement
|
||||
* @typedef {new (...args) => IElement} ElementConstructor
|
||||
*/
|
||||
|
||||
export default class ElementFactory {
|
||||
@@ -16,9 +16,7 @@ export default class ElementFactory {
|
||||
ElementFactory.#elementConstructors.set(tagName, entityConstructor)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String} tagName
|
||||
*/
|
||||
/** @param {String} tagName */
|
||||
static getConstructor(tagName) {
|
||||
return ElementFactory.#elementConstructors.get(tagName)
|
||||
}
|
||||
|
||||
@@ -16,16 +16,8 @@ export default class IDraggableControlElement extends IDraggableElement {
|
||||
/** @type {WindowElement} */
|
||||
windowElement
|
||||
|
||||
/**
|
||||
* @param {T} entity
|
||||
* @param {U} template
|
||||
*/
|
||||
constructor(entity, template) {
|
||||
super(entity, template)
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback()
|
||||
setup() {
|
||||
super.setup()
|
||||
this.windowElement = this.closest("ueb-window")
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,9 @@ import IElement from "./IElement"
|
||||
import Utility from "../Utility"
|
||||
|
||||
/**
|
||||
* @typedef {import("../template/IDraggableTemplate").default} IDraggableTemplate
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../template/IDraggableTemplate").default} IDraggableTemplate
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -36,16 +37,12 @@ export default class IDraggableElement extends IElement {
|
||||
static dragEventName = Configuration.dragEventName
|
||||
static dragGeneralEventName = Configuration.dragGeneralEventName
|
||||
|
||||
/**
|
||||
* @param {T} entity
|
||||
* @param {U} template
|
||||
*/
|
||||
constructor(entity, template) {
|
||||
super(entity, template)
|
||||
constructor() {
|
||||
super()
|
||||
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
|
||||
this.sizeX = 0
|
||||
this.sizeY = 0
|
||||
}
|
||||
|
||||
computeSizes() {
|
||||
@@ -55,7 +52,7 @@ export default class IDraggableElement extends IElement {
|
||||
this.sizeY = bounding.height * scaleCorrection
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
this.computeSizes()
|
||||
@@ -67,14 +64,16 @@ export default class IDraggableElement extends IElement {
|
||||
this.locationX = x
|
||||
this.locationY = y
|
||||
if (this.blueprint && acknowledge) {
|
||||
// @ts-expect-error
|
||||
const dragLocalEvent = new CustomEvent(this.constructor.dragEventName, {
|
||||
detail: {
|
||||
value: d,
|
||||
},
|
||||
bubbles: false,
|
||||
cancelable: true,
|
||||
})
|
||||
const dragLocalEvent = new CustomEvent(
|
||||
/** @type {typeof IDraggableElement} */(this.constructor).dragEventName,
|
||||
{
|
||||
detail: {
|
||||
value: d,
|
||||
},
|
||||
bubbles: false,
|
||||
cancelable: true,
|
||||
}
|
||||
)
|
||||
this.dispatchEvent(dragLocalEvent)
|
||||
}
|
||||
}
|
||||
@@ -86,14 +85,16 @@ export default class IDraggableElement extends IElement {
|
||||
|
||||
/** @param {Number[]} value */
|
||||
acknowledgeDrag(value) {
|
||||
// @ts-expect-error
|
||||
const dragEvent = new CustomEvent(this.constructor.dragGeneralEventName, {
|
||||
detail: {
|
||||
value: value
|
||||
},
|
||||
bubbles: true,
|
||||
cancelable: true
|
||||
})
|
||||
const dragEvent = new CustomEvent(
|
||||
/** @type {typeof IDraggableElement} */(this.constructor).dragGeneralEventName,
|
||||
{
|
||||
detail: {
|
||||
value: value
|
||||
},
|
||||
bubbles: true,
|
||||
cancelable: true
|
||||
}
|
||||
)
|
||||
this.dispatchEvent(dragEvent)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import { LitElement } from "lit"
|
||||
* @typedef {import("../input/IInput").default} IInput
|
||||
* @typedef {import("../template/ITemplate").default} ITemplate
|
||||
* @typedef {import("lit").PropertyDeclarations} PropertyDeclarations
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -44,6 +45,9 @@ export default class IElement extends LitElement {
|
||||
return this.#template
|
||||
}
|
||||
|
||||
isInitialized = false
|
||||
isSetup = false
|
||||
|
||||
/** @type {IInput[]} */
|
||||
inputObjects = []
|
||||
|
||||
@@ -51,31 +55,60 @@ export default class IElement extends LitElement {
|
||||
* @param {T} entity
|
||||
* @param {U} template
|
||||
*/
|
||||
constructor(entity, template) {
|
||||
super()
|
||||
initialize(entity, template) {
|
||||
this.requestUpdate()
|
||||
this.#entity = entity
|
||||
this.#template = template
|
||||
this.inputObjects = []
|
||||
this.#template.constructed(this)
|
||||
this.#template.initialize(this)
|
||||
if (this.isConnected) {
|
||||
this.updateComplete.then(() => this.setup())
|
||||
}
|
||||
this.isInitialized = true
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback()
|
||||
this.blueprint = /** @type {Blueprint} */(this.closest("ueb-blueprint"))
|
||||
if (this.isInitialized) {
|
||||
this.requestUpdate()
|
||||
this.updateComplete.then(() => this.setup())
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback()
|
||||
if (this.isSetup) {
|
||||
this.updateComplete.then(() => this.cleanup())
|
||||
}
|
||||
}
|
||||
|
||||
createRenderRoot() {
|
||||
return this
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback()
|
||||
this.blueprint = /** @type {Blueprint} */ this.closest("ueb-blueprint")
|
||||
this.template.connectedCallback()
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
shouldUpdate(changedProperties) {
|
||||
return this.isInitialized && this.isConnected
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
setup() {
|
||||
this.template.setup()
|
||||
this.template.inputSetup()
|
||||
this.isSetup = true
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
this.template.cleanup()
|
||||
this.isSetup = false
|
||||
}
|
||||
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
willUpdate(changedProperties) {
|
||||
super.willUpdate(changedProperties)
|
||||
this.template.willUpdate(changedProperties)
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
update(changedProperties) {
|
||||
super.update(changedProperties)
|
||||
this.template.update(changedProperties)
|
||||
@@ -85,14 +118,13 @@ export default class IElement extends LitElement {
|
||||
return this.template.render()
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
this.template.firstUpdated(changedProperties)
|
||||
this.template.inputSetup()
|
||||
}
|
||||
|
||||
/** @param {Map<String, String>} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
updated(changedProperties) {
|
||||
super.updated(changedProperties)
|
||||
this.template.updated(changedProperties)
|
||||
@@ -103,11 +135,6 @@ export default class IElement extends LitElement {
|
||||
this.#nextUpdatedCallbacks = []
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback()
|
||||
this.template.cleanup()
|
||||
}
|
||||
|
||||
addNextUpdatedCallbacks(callback, requestUpdate = false) {
|
||||
this.#nextUpdatedCallbacks.push(callback)
|
||||
if (requestUpdate) {
|
||||
@@ -125,6 +152,6 @@ export default class IElement extends LitElement {
|
||||
* @param {new (...args: any[]) => V} type
|
||||
*/
|
||||
getInputObject(type) {
|
||||
return /** @type {V} */ (this.template.inputObjects.find(object => object.constructor == type))
|
||||
return /** @type {V} */(this.template.inputObjects.find(object => object.constructor == type))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,9 +32,8 @@ export default class IFromToPositionedElement extends IElement {
|
||||
},
|
||||
}
|
||||
|
||||
constructor(...args) {
|
||||
// @ts-expect-error
|
||||
super(...args)
|
||||
constructor() {
|
||||
super()
|
||||
this.fromX = 0
|
||||
this.fromY = 0
|
||||
this.toX = 0
|
||||
|
||||
@@ -24,22 +24,21 @@ export default class ISelectableDraggableElement extends IDraggableElement {
|
||||
},
|
||||
}
|
||||
|
||||
constructor(...args) {
|
||||
// @ts-expect-error
|
||||
super(...args)
|
||||
dragHandler = e => this.addLocation(e.detail.value)
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
this.selected = false
|
||||
this.listeningDrag = false
|
||||
let self = this
|
||||
this.dragHandler = e => self.addLocation(e.detail.value)
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback()
|
||||
setup() {
|
||||
super.setup()
|
||||
this.setSelected(this.selected)
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback()
|
||||
cleanup() {
|
||||
super.cleanup()
|
||||
this.blueprint.removeEventListener(Configuration.nodeDragGeneralEventName, this.dragHandler)
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,18 @@ export default class InputElement extends IElement {
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super({}, new InputTemplate())
|
||||
super()
|
||||
this.singleLine = false
|
||||
this.selectOnFocus = true
|
||||
this.blurOnEnter = true
|
||||
super.initialize({}, new InputTemplate())
|
||||
}
|
||||
|
||||
static newObject() {
|
||||
return new InputElement()
|
||||
}
|
||||
|
||||
initialize() {
|
||||
// Initialized in the constructor, this method does nothing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import Utility from "../Utility"
|
||||
/**
|
||||
* @typedef {import("./PinElement").default} PinElement
|
||||
* @typedef {import("lit").TemplateResult<1>} TemplateResult
|
||||
* @typedef {typeof LinkElement} LinkElementConstructor
|
||||
*/
|
||||
|
||||
/** @extends {IFromToPositionedElement<Object, LinkTemplate>} */
|
||||
@@ -65,11 +66,11 @@ export default class LinkElement extends IFromToPositionedElement {
|
||||
this.#setPin(pin, true)
|
||||
}
|
||||
|
||||
#nodeDeleteHandler
|
||||
#nodeDragSourceHandler
|
||||
#nodeDragDestinatonHandler
|
||||
#nodeReflowSourceHandler
|
||||
#nodeReflowDestinatonHandler
|
||||
#nodeDeleteHandler = () => this.remove()
|
||||
#nodeDragSourceHandler = e => this.addSourceLocation(e.detail.value)
|
||||
#nodeDragDestinatonHandler = e => this.addDestinationLocation(e.detail.value)
|
||||
#nodeReflowSourceHandler = e => this.setSourceLocation()
|
||||
#nodeReflowDestinatonHandler = e => this.setDestinationLocation()
|
||||
|
||||
/** @type {TemplateResult | nothing} */
|
||||
linkMessageIcon = nothing
|
||||
@@ -79,18 +80,8 @@ export default class LinkElement extends IFromToPositionedElement {
|
||||
/** @type {SVGPathElement} */
|
||||
pathElement
|
||||
|
||||
/**
|
||||
* @param {PinElement} source
|
||||
* @param {PinElement?} destination
|
||||
*/
|
||||
constructor(source, destination) {
|
||||
super({}, new LinkTemplate())
|
||||
const self = this
|
||||
this.#nodeDeleteHandler = () => self.remove()
|
||||
this.#nodeDragSourceHandler = e => self.addSourceLocation(e.detail.value)
|
||||
this.#nodeDragDestinatonHandler = e => self.addDestinationLocation(e.detail.value)
|
||||
this.#nodeReflowSourceHandler = e => self.setSourceLocation()
|
||||
this.#nodeReflowDestinatonHandler = e => self.setDestinationLocation()
|
||||
constructor() {
|
||||
super()
|
||||
this.source = null
|
||||
this.destination = null
|
||||
this.dragging = false
|
||||
@@ -98,6 +89,24 @@ export default class LinkElement extends IFromToPositionedElement {
|
||||
this.startPercentage = 0
|
||||
this.svgPathD = ""
|
||||
this.startPixels = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} source
|
||||
* @param {PinElement?} destination
|
||||
*/
|
||||
static newObject(source, destination) {
|
||||
const result = new LinkElement()
|
||||
result.initialize(source, destination)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} source
|
||||
* @param {PinElement?} destination
|
||||
*/
|
||||
initialize(source, destination) {
|
||||
super.initialize({}, new LinkTemplate())
|
||||
if (source) {
|
||||
this.sourcePin = source
|
||||
if (!destination) {
|
||||
@@ -172,8 +181,8 @@ export default class LinkElement extends IFromToPositionedElement {
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback()
|
||||
cleanup() {
|
||||
super.cleanup()
|
||||
this.#unlinkPins()
|
||||
this.sourcePin = null
|
||||
this.destinationPin = null
|
||||
|
||||
@@ -11,7 +11,11 @@ import SerializerFactory from "../serialization/SerializerFactory"
|
||||
import Utility from "../Utility"
|
||||
import VariableAccessNodeTemplate from "../template/node/VariableAccessNodeTemplate"
|
||||
|
||||
/** @typedef {import("./IElement").default} IElement */
|
||||
/**
|
||||
* @typedef {import("./IElement").default} IElement
|
||||
* @typedef {import("./PinElement").default} PinElement
|
||||
* @typedef {typeof NodeElement} NodeElementConstructor
|
||||
*/
|
||||
|
||||
/** @extends {ISelectableDraggableElement<ObjectEntity, NodeTemplate>} */
|
||||
export default class NodeElement extends ISelectableDraggableElement {
|
||||
@@ -77,7 +81,8 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
this.#nodeNameElement = value
|
||||
}
|
||||
|
||||
#pins
|
||||
/** @type {PinElement[]} */
|
||||
#pins = []
|
||||
/** @type {NodeElement[]} */
|
||||
boundComments = []
|
||||
#commentDragged = false
|
||||
@@ -90,12 +95,34 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {ObjectEntity} nodeEntity
|
||||
* @return {new () => NodeTemplate}
|
||||
*/
|
||||
static getTypeTemplate(nodeEntity) {
|
||||
let result = NodeElement.#typeTemplateMap[nodeEntity.getClass()]
|
||||
return result ?? NodeTemplate
|
||||
}
|
||||
|
||||
/** @param {String} str */
|
||||
static fromSerializedObject(str) {
|
||||
str = str.trim()
|
||||
let entity = SerializerFactory.getSerializer(ObjectEntity).deserialize(str)
|
||||
return NodeElement.newObject(/** @type {ObjectEntity} */(entity))
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {ObjectEntity} entity
|
||||
* @param {NodeTemplate} template
|
||||
*/
|
||||
constructor(entity, template = undefined) {
|
||||
super(entity, template ?? new (NodeElement.getTypeTemplate(entity))())
|
||||
static newObject(entity = new ObjectEntity(), template = new (NodeElement.getTypeTemplate(entity))()) {
|
||||
const result = new NodeElement()
|
||||
result.initialize(entity, template)
|
||||
return result
|
||||
}
|
||||
|
||||
initialize(entity = new ObjectEntity(), template = new (NodeElement.getTypeTemplate(entity))()) {
|
||||
super.initialize(entity, template)
|
||||
this.#pins = this.template.createPinElements()
|
||||
this.typePath = this.entity.getType()
|
||||
this.nodeName = this.entity.getObjectName()
|
||||
@@ -115,25 +142,11 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {ObjectEntity} nodeEntity
|
||||
* @return {new () => NodeTemplate}
|
||||
*/
|
||||
static getTypeTemplate(nodeEntity) {
|
||||
let result = NodeElement.#typeTemplateMap[nodeEntity.getClass()]
|
||||
return result ?? NodeTemplate
|
||||
}
|
||||
|
||||
/** @param {String} str */
|
||||
static fromSerializedObject(str) {
|
||||
str = str.trim()
|
||||
let entity = SerializerFactory.getSerializer(ObjectEntity).deserialize(str)
|
||||
// @ts-expect-error
|
||||
return new NodeElement(entity)
|
||||
}
|
||||
|
||||
getUpdateComplete() {
|
||||
return Promise.all([super.getUpdateComplete(), ...this.getPinElements().map(pin => pin.updateComplete)]).then(() => true)
|
||||
return Promise.all([
|
||||
super.getUpdateComplete(),
|
||||
...this.getPinElements().map(pin => pin.updateComplete)
|
||||
]).then(() => true)
|
||||
}
|
||||
|
||||
/** @param {NodeElement} commentNode */
|
||||
@@ -162,8 +175,8 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
&& this.leftBoundary() >= commentNode.leftBoundary()
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback()
|
||||
cleanup() {
|
||||
super.cleanup()
|
||||
this.acknowledgeDelete()
|
||||
}
|
||||
|
||||
@@ -224,11 +237,8 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
}
|
||||
|
||||
setLocation(value = [0, 0], acknowledge = true) {
|
||||
let nodeConstructor = this.entity.NodePosX.constructor
|
||||
// @ts-expect-error
|
||||
this.entity.NodePosX = new nodeConstructor(value[0])
|
||||
// @ts-expect-error
|
||||
this.entity.NodePosY = new nodeConstructor(value[1])
|
||||
this.entity.NodePosX.value = value[0]
|
||||
this.entity.NodePosY.value = value[1]
|
||||
super.setLocation(value, acknowledge)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import ISerializer from "../serialization/ISerializer"
|
||||
import LinearColorEntity from "../entity/LinearColorEntity"
|
||||
import LinearColorInputPinTemplate from "../template/pin/LinearColorPinTemplate"
|
||||
import NameInputPinTemplate from "../template/pin/NamePinTemplate"
|
||||
import PinEntity from "../entity/PinEntity"
|
||||
import PinTemplate from "../template/pin/PinTemplate"
|
||||
import RealInputPinTemplate from "../template/pin/RealInputPinTemplate"
|
||||
import ReferencePinTemplate from "../template/pin/ReferencePinTemplate"
|
||||
@@ -19,16 +20,15 @@ import VectorInputPinTemplate from "../template/pin/VectorInputPinTemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/PinReferenceEntity").default} PinReferenceEntity
|
||||
* @typedef {import("../entity/TypeInitialization").AnyValue} AnyValue
|
||||
* @typedef {import("./LinkElement").LinkElementConstructor} LinkElementConstructor
|
||||
* @typedef {import("./NodeElement").default} NodeElement
|
||||
* @typedef {import("lit").CSSResult} CSSResult
|
||||
*/
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import("../entity/PinEntity").default<T>} PinEntity
|
||||
* @typedef {typeof PinElement} PinElementConstructor
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @template {AnyValue} T
|
||||
* @extends {IElement<PinEntity<T>, PinTemplate>}
|
||||
*/
|
||||
export default class PinElement extends IElement {
|
||||
@@ -95,6 +95,9 @@ export default class PinElement extends IElement {
|
||||
},
|
||||
}
|
||||
|
||||
/** @type {NodeElement} */
|
||||
nodeElement
|
||||
|
||||
/**
|
||||
* @param {PinEntity<any>} pinEntity
|
||||
* @return {new () => PinTemplate}
|
||||
@@ -113,18 +116,22 @@ export default class PinElement extends IElement {
|
||||
return result ?? PinTemplate
|
||||
}
|
||||
|
||||
/** @type {NodeElement} */
|
||||
nodeElement
|
||||
static newObject(
|
||||
entity = new PinEntity(),
|
||||
template = new (PinElement.getTypeTemplate(entity))(),
|
||||
nodeElement = undefined
|
||||
) {
|
||||
const result = new PinElement()
|
||||
result.initialize(entity, template, nodeElement)
|
||||
return result
|
||||
}
|
||||
|
||||
connections = 0
|
||||
|
||||
/**
|
||||
* @param {PinEntity<T>} entity
|
||||
* @param {PinTemplate} template
|
||||
* @param {NodeElement} nodeElement
|
||||
*/
|
||||
constructor(entity, template = undefined, nodeElement = undefined) {
|
||||
super(entity, template ?? new (PinElement.getTypeTemplate(entity))())
|
||||
initialize(
|
||||
entity = /** @type {PinEntity<T>} */(new PinEntity()),
|
||||
template = new (PinElement.getTypeTemplate(entity))(),
|
||||
nodeElement = undefined
|
||||
) {
|
||||
super.initialize(entity, template)
|
||||
this.pinId = this.entity.PinId
|
||||
this.pinType = this.entity.getType()
|
||||
this.advancedView = this.entity.bAdvancedView
|
||||
@@ -132,7 +139,7 @@ export default class PinElement extends IElement {
|
||||
this.color = PinElement.properties.color.converter.fromAttribute(this.getColor().toString())
|
||||
this.isLinked = false
|
||||
this.pinDirection = entity.isInput() ? "input" : entity.isOutput() ? "output" : "hidden"
|
||||
this.nodeElement = nodeElement
|
||||
this.nodeElement = /** @type {NodeElement} */(nodeElement)
|
||||
|
||||
// this.entity.subscribe("DefaultValue", value => this.defaultValue = value.toString())
|
||||
this.entity.subscribe("PinToolTip", value => {
|
||||
@@ -144,6 +151,11 @@ export default class PinElement extends IElement {
|
||||
})
|
||||
}
|
||||
|
||||
setup() {
|
||||
super.setup()
|
||||
this.nodeElement = this.closest("ueb-node")
|
||||
}
|
||||
|
||||
/** @return {GuidEntity} */
|
||||
getPinId() {
|
||||
return this.entity.PinId
|
||||
@@ -175,7 +187,6 @@ export default class PinElement extends IElement {
|
||||
return this.template.getLinkLocation()
|
||||
}
|
||||
|
||||
/** @returns {NodeElement} */
|
||||
getNodeElement() {
|
||||
return this.nodeElement
|
||||
}
|
||||
@@ -204,7 +215,9 @@ export default class PinElement extends IElement {
|
||||
}
|
||||
let link = this.blueprint.getLink(this, pin, true)
|
||||
if (!link) {
|
||||
this.blueprint.addGraphElement(new (ElementFactory.getConstructor("ueb-link"))(this, pin))
|
||||
link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
|
||||
.newObject(this, pin)
|
||||
this.blueprint.addGraphElement(link)
|
||||
}
|
||||
}
|
||||
return pin
|
||||
|
||||
@@ -5,10 +5,20 @@ import SelectorTemplate from "../template/SelectorTemplate"
|
||||
/** @extends {IFromToPositionedElement<Object, SelectorTemplate>} */
|
||||
export default class SelectorElement extends IFromToPositionedElement {
|
||||
|
||||
/** @type {FastSelectionModel} */
|
||||
selectionModel = null
|
||||
|
||||
constructor() {
|
||||
super({}, new SelectorTemplate())
|
||||
/** @type {FastSelectionModel} */
|
||||
this.selectionModel = null
|
||||
super()
|
||||
super.initialize({}, new SelectorTemplate())
|
||||
}
|
||||
|
||||
static newObject() {
|
||||
return new SelectorElement()
|
||||
}
|
||||
|
||||
initialize() {
|
||||
// Initialized in the constructor, this method does nothing
|
||||
}
|
||||
|
||||
/** @param {Number[]} initialPosition */
|
||||
|
||||
@@ -3,6 +3,8 @@ import Configuration from "../Configuration"
|
||||
import IDraggableElement from "./IDraggableElement"
|
||||
import WindowTemplate from "../template/WindowTemplate"
|
||||
|
||||
/** @typedef {typeof WindowElement} WindowElementConstructor */
|
||||
|
||||
/**
|
||||
* @template {WindowTemplate} T
|
||||
* @extends {IDraggableElement<Object, T>}
|
||||
@@ -23,24 +25,26 @@ export default class WindowElement extends IDraggableElement {
|
||||
converter: {
|
||||
fromAttribute: (value, type) => WindowElement.#typeTemplateMap[value],
|
||||
toAttribute: (value, type) =>
|
||||
Object.entries(WindowElement.#typeTemplateMap).find(([k, v]) => value == v)[0]
|
||||
Object.entries(WindowElement.#typeTemplateMap).find(([k, v]) => value.constructor === v)?.[0],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
constructor(options = {}) {
|
||||
if (options.type.constructor == String) {
|
||||
options.type = WindowElement.#typeTemplateMap[options.type]
|
||||
}
|
||||
options.type ??= WindowTemplate
|
||||
options.windowOptions ??= {}
|
||||
super({}, new options.type())
|
||||
this.type = options.type
|
||||
this.windowOptions = options.windowOptions
|
||||
static newObject(entity = {}, template = entity.type ?? new WindowTemplate()) {
|
||||
const result = new WindowElement()
|
||||
result.initialize(entity, template)
|
||||
return result
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback()
|
||||
initialize(entity = {}, template = entity.type ?? new WindowTemplate()) {
|
||||
entity.windowOptions ??= {}
|
||||
this.type = entity.type
|
||||
this.windowOptions = entity.windowOptions
|
||||
super.initialize(entity, template)
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
super.cleanup()
|
||||
this.acknowledgeClose()
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import TypeInitialization from "./TypeInitialization"
|
||||
import Utility from "../Utility"
|
||||
import UnionType from "./UnionType"
|
||||
|
||||
/** @typedef {typeof IEntity} EntityConstructor */
|
||||
/**
|
||||
* @template {IEntity} T
|
||||
* @typedef {new (Object) => T} IEntityConstructor
|
||||
@@ -101,8 +102,7 @@ export default class IEntity extends Observable {
|
||||
target[attribute] = TypeInitialization.sanitize(defaultValue, defaultType)
|
||||
}
|
||||
}
|
||||
// @ts-expect-error
|
||||
const attributes = this.constructor.attributes
|
||||
const attributes = /** @type {typeof IEntity} */(this.constructor).attributes
|
||||
if (values.constructor !== Object && Object.getOwnPropertyNames(attributes).length === 1) {
|
||||
// Where there is just one attribute, option can be the value of that attribute
|
||||
values = {
|
||||
|
||||
@@ -17,11 +17,11 @@ export default class Copy extends IInput {
|
||||
}
|
||||
|
||||
listenEvents() {
|
||||
document.body.addEventListener("copy", this.#copyHandler)
|
||||
window.addEventListener("copy", this.#copyHandler)
|
||||
}
|
||||
|
||||
unlistenEvents() {
|
||||
document.body.removeEventListener("copy", this.#copyHandler)
|
||||
window.removeEventListener("copy", this.#copyHandler)
|
||||
}
|
||||
|
||||
copied() {
|
||||
|
||||
@@ -2,7 +2,10 @@ import ElementFactory from "../../element/ElementFactory"
|
||||
import IInput from "../IInput"
|
||||
import ObjectSerializer from "../../serialization/ObjectSerializer"
|
||||
|
||||
/** @typedef {import("../../element/NodeElement").default} NodeElement */
|
||||
/**
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../element/NodeElement").NodeElementConstructor} NodeElementConstructor
|
||||
*/
|
||||
|
||||
export default class Paste extends IInput {
|
||||
|
||||
@@ -20,11 +23,11 @@ export default class Paste extends IInput {
|
||||
}
|
||||
|
||||
listenEvents() {
|
||||
document.body.addEventListener("paste", this.#pasteHandle)
|
||||
window.addEventListener("paste", this.#pasteHandle)
|
||||
}
|
||||
|
||||
unlistenEvents() {
|
||||
document.body.removeEventListener("paste", this.#pasteHandle)
|
||||
window.removeEventListener("paste", this.#pasteHandle)
|
||||
}
|
||||
|
||||
pasted(value) {
|
||||
@@ -33,8 +36,8 @@ export default class Paste extends IInput {
|
||||
let count = 0
|
||||
let nodes = Paste.#serializer.readMultiple(value).map(entity => {
|
||||
/** @type {NodeElement} */
|
||||
// @ts-expect-error
|
||||
let node = new (ElementFactory.getConstructor("ueb-node"))(entity)
|
||||
let node = /** @type {NodeElementConstructor} */(ElementFactory.getConstructor("ueb-node"))
|
||||
.newObject(entity)
|
||||
top += node.locationY
|
||||
left += node.locationX
|
||||
++count
|
||||
|
||||
@@ -3,8 +3,9 @@ import ElementFactory from "../../element/ElementFactory"
|
||||
import IMouseClickDrag from "./IMouseClickDrag"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
* @typedef {import("../../element/LinkElement").default} LinkElement
|
||||
* @typedef {import("../../element/LinkElement").LinkElementConstructor} LinkElementConstructor
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
* @typedef {import("../../template/node/KnotNodeTemplate").default} KnotNodeTemplate
|
||||
*/
|
||||
|
||||
@@ -71,8 +72,8 @@ export default class MouseCreateLink extends IMouseClickDrag {
|
||||
this.#knotPin = this.target
|
||||
}
|
||||
/** @type {LinkElement} */
|
||||
// @ts-expect-error
|
||||
this.link = new (ElementFactory.getConstructor("ueb-link"))(this.target, null)
|
||||
this.link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
|
||||
.newObject(this.target, null)
|
||||
this.blueprint.linksContainerElement.prepend(this.link)
|
||||
this.link.setMessagePlaceNode()
|
||||
this.#listenedPins = this.blueprint.querySelectorAll("ueb-pin")
|
||||
|
||||
@@ -5,6 +5,7 @@ import TypeInitialization from "../entity/TypeInitialization"
|
||||
import Utility from "../Utility"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").EntityConstructor} EntityConstructor
|
||||
* @typedef {import("../entity/TypeInitialization").AnyValue} AnyValue
|
||||
*/
|
||||
/**
|
||||
@@ -117,7 +118,7 @@ export default class ISerializer {
|
||||
|
||||
showProperty(entity, object, attributeKey, attributeValue) {
|
||||
// @ts-expect-error
|
||||
const attributes = this.entityType.attributes
|
||||
const attributes = /** @type {EntityConstructor} */(this.entityType).attributes
|
||||
const attribute = Utility.objectGet(attributes, attributeKey)
|
||||
if (attribute instanceof TypeInitialization) {
|
||||
if (attribute.ignored) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import Zoom from "../input/mouse/Zoom"
|
||||
* @typedef {import("../element/PinElement").default} PinElement
|
||||
* @typedef {import("../element/SelectorElement").default} SelectorElement
|
||||
* @typedef {import("../entity/PinReferenceEntity").default} PinReferenceEntity
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
/** @extends ITemplate<Blueprint> */
|
||||
@@ -37,8 +38,8 @@ export default class BlueprintTemplate extends ITemplate {
|
||||
}
|
||||
|
||||
/** @param {Blueprint} element */
|
||||
constructed(element) {
|
||||
super.constructed(element)
|
||||
initialize(element) {
|
||||
super.initialize(element)
|
||||
this.element.style.cssText = Object.entries(BlueprintTemplate.styleVariables).map(([k, v]) => `${k}:${v};`).join("")
|
||||
}
|
||||
|
||||
@@ -87,7 +88,7 @@ export default class BlueprintTemplate extends ITemplate {
|
||||
`
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
this.element.headerElement = /** @type {HTMLElement} */(this.element.querySelector('.ueb-viewport-header'))
|
||||
@@ -102,7 +103,7 @@ export default class BlueprintTemplate extends ITemplate {
|
||||
this.element.viewportElement.scroll(Configuration.expandGridSize, Configuration.expandGridSize)
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
willUpdate(changedProperties) {
|
||||
super.willUpdate(changedProperties)
|
||||
if (this.element.headerElement && changedProperties.has("zoom")) {
|
||||
@@ -114,7 +115,7 @@ export default class BlueprintTemplate extends ITemplate {
|
||||
}
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
updated(changedProperties) {
|
||||
super.updated(changedProperties)
|
||||
if (changedProperties.has("scrollX") || changedProperties.has("scrollY")) {
|
||||
|
||||
@@ -7,39 +7,23 @@ import LinearColorEntity from "../entity/LinearColorEntity"
|
||||
import Utility from "../Utility"
|
||||
import WindowTemplate from "./WindowTemplate"
|
||||
|
||||
/** @typedef {import("../element/WindowElement").default} WindowElement */
|
||||
/**
|
||||
* @typedef {import("../element/WindowElement").default} WindowElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
export default class ColorPickerWindowTemplate extends WindowTemplate {
|
||||
|
||||
/** @type {ColorHandlerElement} */
|
||||
#wheelHandler
|
||||
|
||||
/** @type {ColorSliderElement} */
|
||||
#saturationSlider
|
||||
|
||||
/** @type {ColorSliderElement} */
|
||||
#valueSlider
|
||||
|
||||
/** @type {ColorSliderElement} */
|
||||
#rSlider
|
||||
|
||||
/** @type {ColorSliderElement} */
|
||||
#gSlider
|
||||
|
||||
/** @type {ColorSliderElement} */
|
||||
#bSlider
|
||||
|
||||
/** @type {ColorSliderElement} */
|
||||
#aSlider
|
||||
|
||||
/** @type {ColorSliderElement} */
|
||||
#hSlider
|
||||
|
||||
/** @type {ColorSliderElement} */
|
||||
#sSlider
|
||||
|
||||
/** @type {ColorSliderElement} */
|
||||
#vSlider
|
||||
/** @type {ColorHandlerElement} */ #wheelHandler
|
||||
/** @type {ColorSliderElement} */ #saturationSlider
|
||||
/** @type {ColorSliderElement} */ #valueSlider
|
||||
/** @type {ColorSliderElement} */ #rSlider
|
||||
/** @type {ColorSliderElement} */ #gSlider
|
||||
/** @type {ColorSliderElement} */ #bSlider
|
||||
/** @type {ColorSliderElement} */ #aSlider
|
||||
/** @type {ColorSliderElement} */ #hSlider
|
||||
/** @type {ColorSliderElement} */ #sSlider
|
||||
/** @type {ColorSliderElement} */ #vSlider
|
||||
|
||||
#hexRGBHandler =
|
||||
/** @param {UIEvent} v */
|
||||
@@ -82,7 +66,6 @@ export default class ColorPickerWindowTemplate extends WindowTemplate {
|
||||
get color() {
|
||||
return this.#color
|
||||
}
|
||||
/** @param {LinearColorEntity} value */
|
||||
set color(value) {
|
||||
if (value.toNumber() == this.color?.toNumber()) {
|
||||
return
|
||||
@@ -110,8 +93,10 @@ export default class ColorPickerWindowTemplate extends WindowTemplate {
|
||||
return opaque ? `${result.substring(0, 6)}FF` : result
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback()
|
||||
|
||||
/** @param {WindowElement} element */
|
||||
initialize(element) {
|
||||
super.initialize(element)
|
||||
this.#initialColor = this.element.windowOptions.getPinColor()
|
||||
this.color.setFromHSVA(
|
||||
this.initialColor.H.value,
|
||||
@@ -122,7 +107,7 @@ export default class ColorPickerWindowTemplate extends WindowTemplate {
|
||||
this.fullColor.setFromHSVA(this.color.H.value, 1, 1, 1)
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
this.#wheelHandler = this.element.querySelector(".ueb-color-picker-wheel ueb-color-handler")
|
||||
this.#saturationSlider = this.element.querySelector(".ueb-color-picker-saturation ueb-ui-slider")
|
||||
|
||||
@@ -23,8 +23,8 @@ export default class IDraggableControlTemplate extends IDraggableTemplate {
|
||||
movementSpace
|
||||
movementSpaceSize = [0, 0]
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback()
|
||||
setup() {
|
||||
super.setup()
|
||||
this.movementSpace = this.element.parentElement
|
||||
const bounding = this.movementSpace.getBoundingClientRect()
|
||||
this.movementSpaceSize = [bounding.width, bounding.height]
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import IDraggableTemplate from "./IDraggableTemplate"
|
||||
|
||||
/** @typedef {import("../element/IDraggableElement").default} IDraggableElement */
|
||||
/**
|
||||
* @typedef {import("../element/IDraggableElement").default} IDraggableElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {IDraggableElement} T
|
||||
@@ -8,7 +11,7 @@ import IDraggableTemplate from "./IDraggableTemplate"
|
||||
*/
|
||||
export default class IDraggablePositionedTemplate extends IDraggableTemplate {
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
update(changedProperties) {
|
||||
super.update(changedProperties)
|
||||
if (changedProperties.has("locationX")) {
|
||||
@@ -18,4 +21,4 @@ export default class IDraggablePositionedTemplate extends IDraggableTemplate {
|
||||
this.element.style.top = `${this.element.locationY}px`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import ITemplate from "./ITemplate"
|
||||
|
||||
/** @typedef {import("../element/IFromToPositionedElement").default} IFromToPositionedElement */
|
||||
/**
|
||||
* @typedef {import("../element/IFromToPositionedElement").default} IFromToPositionedElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {IFromToPositionedElement} T
|
||||
@@ -8,7 +11,7 @@ import ITemplate from "./ITemplate"
|
||||
*/
|
||||
export default class IFromToPositionedTemplate extends ITemplate {
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
update(changedProperties) {
|
||||
super.update(changedProperties)
|
||||
const [fromX, fromY, toX, toY] = [
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import MouseClickDrag from "../input/mouse/MouseClickDrag"
|
||||
import NodeTemplate from "./node/NodeTemplate"
|
||||
|
||||
/** @typedef {import("../element/NodeElement").default} NodeElement */
|
||||
/**
|
||||
* @typedef {import("../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
export default class IResizeableTemplate extends NodeTemplate {
|
||||
|
||||
@@ -15,12 +18,20 @@ export default class IResizeableTemplate extends NodeTemplate {
|
||||
#TLHandler = document.createElement("div")
|
||||
|
||||
/** @param {NodeElement} element */
|
||||
constructed(element) {
|
||||
super.constructed(element)
|
||||
initialize(element) {
|
||||
super.initialize(element)
|
||||
this.element.classList.add("ueb-resizeable")
|
||||
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")
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
update(changedProperties) {
|
||||
super.update(changedProperties)
|
||||
if (this.element.sizeX >= 0 && changedProperties.has("sizeX")) {
|
||||
@@ -31,17 +42,9 @@ export default class IResizeableTemplate extends NodeTemplate {
|
||||
}
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} 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,
|
||||
@@ -64,21 +67,21 @@ export default class IResizeableTemplate extends NodeTemplate {
|
||||
this.element.addLocation([0, movement[1]], false)
|
||||
}
|
||||
},
|
||||
onEndDrag : () => this.endResize(),
|
||||
onEndDrag: () => this.endResize(),
|
||||
}),
|
||||
new MouseClickDrag(this.#RHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
movement[0] = location[0] - this.element.rightBoundary()
|
||||
this.setSizeX(this.element.sizeX + movement[0])
|
||||
},
|
||||
onEndDrag : () => this.endResize(),
|
||||
onEndDrag: () => this.endResize(),
|
||||
}),
|
||||
new MouseClickDrag(this.#BHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
movement[1] = location[1] - this.element.bottomBoundary()
|
||||
this.setSizeY(this.element.sizeY + movement[1])
|
||||
},
|
||||
onEndDrag : () => this.endResize(),
|
||||
onEndDrag: () => this.endResize(),
|
||||
}),
|
||||
new MouseClickDrag(this.#LHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
@@ -87,7 +90,7 @@ export default class IResizeableTemplate extends NodeTemplate {
|
||||
this.element.addLocation([movement[0], 0], false)
|
||||
}
|
||||
},
|
||||
onEndDrag : () => this.endResize(),
|
||||
onEndDrag: () => this.endResize(),
|
||||
}),
|
||||
new MouseClickDrag(this.#TRHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
@@ -98,7 +101,7 @@ export default class IResizeableTemplate extends NodeTemplate {
|
||||
this.element.addLocation([0, movement[1]], false)
|
||||
}
|
||||
},
|
||||
onEndDrag : () => this.endResize(),
|
||||
onEndDrag: () => this.endResize(),
|
||||
}),
|
||||
new MouseClickDrag(this.#BRHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
@@ -107,7 +110,7 @@ export default class IResizeableTemplate extends NodeTemplate {
|
||||
this.setSizeX(this.element.sizeX + movement[0])
|
||||
this.setSizeY(this.element.sizeY + movement[1])
|
||||
},
|
||||
onEndDrag : () => this.endResize(),
|
||||
onEndDrag: () => this.endResize(),
|
||||
}),
|
||||
new MouseClickDrag(this.#BLHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
@@ -118,7 +121,7 @@ export default class IResizeableTemplate extends NodeTemplate {
|
||||
}
|
||||
this.setSizeY(this.element.sizeY + movement[1])
|
||||
},
|
||||
onEndDrag : () => this.endResize(),
|
||||
onEndDrag: () => this.endResize(),
|
||||
}),
|
||||
new MouseClickDrag(this.#TLHandler, this.element.blueprint, {
|
||||
onDrag: (location, movement) => {
|
||||
@@ -131,7 +134,7 @@ export default class IResizeableTemplate extends NodeTemplate {
|
||||
this.element.addLocation([0, movement[1]], false)
|
||||
}
|
||||
},
|
||||
onEndDrag : () => this.endResize(),
|
||||
onEndDrag: () => this.endResize(),
|
||||
}),
|
||||
]
|
||||
}
|
||||
@@ -148,5 +151,6 @@ export default class IResizeableTemplate extends NodeTemplate {
|
||||
return true
|
||||
}
|
||||
|
||||
endResize() {}
|
||||
endResize() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import MouseMoveNodes from "../input/mouse/MouseMoveNodes"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
* @typedef {import("../input/mouse/MouseMoveDraggable").default} MouseMoveDraggable
|
||||
*/
|
||||
|
||||
@@ -22,7 +23,7 @@ export default class ISelectableDraggableTemplate extends IDraggablePositionedTe
|
||||
}))
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
if (this.element.selected && !this.element.listeningDrag) {
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import { css, html } from "lit"
|
||||
import { html } from "lit"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IElement").default} IElement
|
||||
* @typedef {import("../input/IInput").default} IInput
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
/** @template {IElement} T */
|
||||
export default class ITemplate {
|
||||
|
||||
static styles = css``
|
||||
|
||||
/** @type {T} */
|
||||
element
|
||||
|
||||
@@ -20,23 +19,26 @@ export default class ITemplate {
|
||||
}
|
||||
|
||||
/** @param {T} element */
|
||||
constructed(element) {
|
||||
initialize(element) {
|
||||
this.element = element
|
||||
}
|
||||
|
||||
/** @returns {IInput[]} */
|
||||
createInputObjects() {
|
||||
return []
|
||||
return /** @type {IInput[]} */([])
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
setup() {
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
cleanup() {
|
||||
this.#inputObjects.forEach(v => v.unlistenDOMElement())
|
||||
}
|
||||
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
willUpdate(changedProperties) {
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
update(changedProperties) {
|
||||
}
|
||||
|
||||
@@ -44,19 +46,15 @@ export default class ITemplate {
|
||||
return html``
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
updated(changedProperties) {
|
||||
}
|
||||
|
||||
inputSetup() {
|
||||
this.#inputObjects = this.createInputObjects()
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
this.#inputObjects.forEach(v => v.unlistenDOMElement())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,10 @@ import Utility from "../Utility"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/LinkElement").default} LinkElement
|
||||
* @typedef {import("../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../element/LinkElement").LinkElementConstructor} LinkElementConstructor
|
||||
* @typedef {import("../element/NodeElement").NodeElementConstructor} NodeElementConstructor
|
||||
* @typedef {import("./node/KnotNodeTemplate").default} KnotNodeTemplate
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -65,13 +67,15 @@ export default class LinkTemplate extends IFromToPositionedTemplate {
|
||||
/** @param {Number[]} location */
|
||||
location => {
|
||||
const knotEntity = new KnotEntity({}, this.element.sourcePin.entity)
|
||||
const knot = /** @type {NodeElement} */(new (ElementFactory.getConstructor("ueb-node"))(knotEntity))
|
||||
const knot = /** @type {NodeElementConstructor} */(ElementFactory.getConstructor("ueb-node"))
|
||||
.newObject(knotEntity)
|
||||
knot.setLocation(this.element.blueprint.snapToGrid(location))
|
||||
this.element.blueprint.addGraphElement(knot) // Important: keep it before changing existing links
|
||||
const link = new (ElementFactory.getConstructor("ueb-link"))(
|
||||
const link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
|
||||
.newObject(
|
||||
/** @type {KnotNodeTemplate} */(knot.template).outputPin,
|
||||
this.element.destinationPin
|
||||
)
|
||||
this.element.destinationPin
|
||||
)
|
||||
this.element.destinationPin = /** @type {KnotNodeTemplate} */(knot.template).inputPin
|
||||
this.element.blueprint.addGraphElement(link)
|
||||
}
|
||||
@@ -88,9 +92,7 @@ export default class LinkTemplate extends IFromToPositionedTemplate {
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Map} changedProperties
|
||||
*/
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
willUpdate(changedProperties) {
|
||||
super.willUpdate(changedProperties)
|
||||
const sourcePin = this.element.sourcePin
|
||||
@@ -138,7 +140,7 @@ export default class LinkTemplate extends IFromToPositionedTemplate {
|
||||
this.element.svgPathD = Configuration.linkRightSVGPath(this.element.startPercentage, c1, c2)
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
update(changedProperties) {
|
||||
super.update(changedProperties)
|
||||
if (changedProperties.has("originatesFromInput")) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import LinearColorEntity from "../../entity/LinearColorEntity"
|
||||
/**
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
export default class CommentNodeTemplate extends IResizeableTemplate {
|
||||
@@ -14,15 +15,19 @@ export default class CommentNodeTemplate extends IResizeableTemplate {
|
||||
#selectableAreaHeight = 0
|
||||
|
||||
/** @param {NodeElement} element */
|
||||
constructed(element) {
|
||||
initialize(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)
|
||||
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
|
||||
super.initialize(element) // Keep it at the end because it calls this.getColor() where this.#color must be initialized
|
||||
}
|
||||
|
||||
getColor() {
|
||||
@@ -45,7 +50,7 @@ export default class CommentNodeTemplate extends IResizeableTemplate {
|
||||
`
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
const bounding = this.getDraggableElement().getBoundingClientRect()
|
||||
|
||||
@@ -7,6 +7,7 @@ import NodeTemplate from "./NodeTemplate"
|
||||
/**
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
* @typedef {import("../../element/PinElement").PinElementConstructor} PinElementConstructor
|
||||
*/
|
||||
|
||||
export default class KnotNodeTemplate extends NodeTemplate {
|
||||
@@ -29,8 +30,8 @@ export default class KnotNodeTemplate extends NodeTemplate {
|
||||
}
|
||||
|
||||
/** @param {NodeElement} element */
|
||||
constructed(element) {
|
||||
super.constructed(element)
|
||||
initialize(element) {
|
||||
super.initialize(element)
|
||||
this.element.classList.add("ueb-node-style-minimal")
|
||||
}
|
||||
|
||||
@@ -76,19 +77,12 @@ export default class KnotNodeTemplate extends NodeTemplate {
|
||||
const entities = this.element.getPinEntities().filter(v => !v.isHidden())
|
||||
const inputEntity = entities[entities[0].isInput() ? 0 : 1]
|
||||
const outputEntity = entities[entities[0].isOutput() ? 0 : 1]
|
||||
const pinElementConstructor = ElementFactory.getConstructor("ueb-pin")
|
||||
return [
|
||||
this.#inputPin = /** @type {PinElement} */(new pinElementConstructor(
|
||||
inputEntity,
|
||||
new KnotPinTemplate(),
|
||||
this.element
|
||||
)),
|
||||
this.#outputPin = /** @type {PinElement} */(new pinElementConstructor(
|
||||
outputEntity,
|
||||
new KnotPinTemplate(),
|
||||
this.element
|
||||
)),
|
||||
const pinElementConstructor = /** @type {PinElementConstructor} */(ElementFactory.getConstructor("ueb-pin"))
|
||||
let result = [
|
||||
this.#inputPin = pinElementConstructor.newObject(inputEntity, new KnotPinTemplate(), this.element),
|
||||
this.#outputPin = pinElementConstructor.newObject(outputEntity, new KnotPinTemplate(), this.element),
|
||||
]
|
||||
return result
|
||||
}
|
||||
|
||||
linksChanged() {
|
||||
|
||||
@@ -8,6 +8,8 @@ import Utility from "../../Utility"
|
||||
/**
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
* @typedef {import("../../element/PinElement").PinElementConstructor} PinElementConstructor
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
/** @extends {ISelectableDraggableTemplate<NodeElement>} */
|
||||
@@ -38,8 +40,8 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
|
||||
}
|
||||
|
||||
/** @param {NodeElement} element */
|
||||
constructed(element) {
|
||||
super.constructed(element)
|
||||
initialize(element) {
|
||||
super.initialize(element)
|
||||
this.element.style.setProperty("--ueb-node-color", this.getColor().cssText)
|
||||
}
|
||||
|
||||
@@ -125,7 +127,7 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
|
||||
return this.element.getNodeDisplayName()
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
this.setupPins()
|
||||
@@ -152,9 +154,9 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
|
||||
if (!this.#hasTargetInputNode && v.getDisplayName() === "Target") {
|
||||
this.#hasTargetInputNode = true
|
||||
}
|
||||
return /** @type {PinElement} */(
|
||||
new (ElementFactory.getConstructor("ueb-pin"))(v, undefined, this.element)
|
||||
)
|
||||
let pinElement = /** @type {PinElementConstructor} */(ElementFactory.getConstructor("ueb-pin"))
|
||||
.newObject(v, undefined, this.element)
|
||||
return pinElement
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import NodeTemplate from "./NodeTemplate"
|
||||
/**
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
* @typedef {import("../../element/PinElement").PinElementConstructor} PinElementConstructor
|
||||
*/
|
||||
|
||||
export default class VariableAccessNodeTemplate extends NodeTemplate {
|
||||
@@ -14,8 +15,8 @@ export default class VariableAccessNodeTemplate extends NodeTemplate {
|
||||
#displayName = ""
|
||||
|
||||
/** @param {NodeElement} element */
|
||||
constructed(element) {
|
||||
super.constructed(element)
|
||||
initialize(element) {
|
||||
super.initialize(element)
|
||||
this.element.classList.add("ueb-node-style-glass")
|
||||
this.#displayName = this.element.getNodeDisplayName()
|
||||
}
|
||||
@@ -52,9 +53,9 @@ export default class VariableAccessNodeTemplate extends NodeTemplate {
|
||||
.map(v => {
|
||||
this.#hasInput ||= v.isInput()
|
||||
this.#hasOutput ||= v.isOutput()
|
||||
return /** @type {PinElement} */(
|
||||
new (ElementFactory.getConstructor("ueb-pin"))(v, undefined, this.element)
|
||||
)
|
||||
const result = /** @type {PinElementConstructor} */(ElementFactory.getConstructor("ueb-pin"))
|
||||
.newObject(v, undefined, this.element)
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ import { html } from "lit"
|
||||
import MouseIgnore from "../../input/mouse/MouseIgnore"
|
||||
import PinTemplate from "./PinTemplate"
|
||||
|
||||
/**
|
||||
* @extends PinTemplate<Boolean>
|
||||
*/
|
||||
/** @typedef {import("lit").PropertyValues} PropertyValues */
|
||||
|
||||
/** @extends PinTemplate<Boolean> */
|
||||
export default class BoolInputPinTemplate extends PinTemplate {
|
||||
|
||||
/** @type {HTMLInputElement?} */
|
||||
@@ -12,10 +12,14 @@ export default class BoolInputPinTemplate extends PinTemplate {
|
||||
|
||||
#onChangeHandler = _ => this.element.setDefaultValue(this.#input.checked)
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
this.#input = this.element.querySelector(".ueb-pin-input")
|
||||
}
|
||||
|
||||
setup() {
|
||||
super.setup()
|
||||
this.#input?.addEventListener("change", this.#onChangeHandler)
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ import MouseIgnore from "../../input/mouse/MouseIgnore"
|
||||
import PinTemplate from "./PinTemplate"
|
||||
import Utility from "../../Utility"
|
||||
|
||||
/** @typedef {import("lit").PropertyValues} PropertyValues */
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import("../../element/PinElement").default<T>} PinElement
|
||||
@@ -39,15 +41,17 @@ export default class IInputPinTemplate extends PinTemplate {
|
||||
|
||||
#onFocusOutHandler = () => this.setInputs(this.getInputs(), true)
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
this.#inputContentElements = /** @type {HTMLElement[]} */([...this.element.querySelectorAll("ueb-input")])
|
||||
if (this.#inputContentElements.length) {
|
||||
this.#inputContentElements.forEach(element => {
|
||||
element.addEventListener("focusout", this.#onFocusOutHandler)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
setup() {
|
||||
super.setup()
|
||||
this.#inputContentElements.forEach(element => {
|
||||
element.addEventListener("focusout", this.#onFocusOutHandler)
|
||||
})
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
@@ -75,10 +79,9 @@ export default class IInputPinTemplate extends PinTemplate {
|
||||
)
|
||||
}
|
||||
|
||||
/** @param {String[]?} values */
|
||||
/** @param {String[]} values */
|
||||
setInputs(values = [], updateDefaultValue = true) {
|
||||
// @ts-expect-error
|
||||
this.#inputContentElements.forEach(this.constructor.singleLineInput
|
||||
this.#inputContentElements.forEach(/** @type {typeof IInputPinTemplate } */(this.constructor).singleLineInput
|
||||
? (elem, i) => elem.innerText = values[i]
|
||||
: (elem, i) => elem.innerText = values[i].replaceAll("\n", "")
|
||||
)
|
||||
@@ -96,10 +99,8 @@ export default class IInputPinTemplate extends PinTemplate {
|
||||
}
|
||||
|
||||
renderInput() {
|
||||
// @ts-expect-error
|
||||
const singleLine = this.constructor.singleLineInput
|
||||
// @ts-expect-error
|
||||
const selectOnFocus = this.constructor.selectOnFocus
|
||||
const singleLine = /** @type {typeof IInputPinTemplate} */(this.constructor).singleLineInput
|
||||
const selectOnFocus = /** @type {typeof IInputPinTemplate} */(this.constructor).selectOnFocus
|
||||
return html`
|
||||
<div class="ueb-pin-input">
|
||||
<ueb-input .singleLine="${singleLine}" .selectOnFocus="${selectOnFocus}"
|
||||
|
||||
@@ -22,19 +22,20 @@ export default class InputTemplate extends ITemplate {
|
||||
/** @param {KeyboardEvent} e */
|
||||
e => {
|
||||
if (e.code == "Enter" && !e.shiftKey) {
|
||||
/** @type {HTMLElement} */(e.target).blur()
|
||||
/** @type {HTMLElement} */(e.target).blur()
|
||||
}
|
||||
}
|
||||
|
||||
/** @param {InputElement} element */
|
||||
constructed(element) {
|
||||
super.constructed(element)
|
||||
initialize(element) {
|
||||
super.initialize(element)
|
||||
this.element.classList.add("ueb-pin-input-content")
|
||||
this.element.setAttribute("role", "textbox")
|
||||
this.element.contentEditable = "true"
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
setup() {
|
||||
super.setup()
|
||||
this.element.addEventListener("focus", this.#focusHandler)
|
||||
this.element.addEventListener("focusout", this.#focusoutHandler)
|
||||
if (this.element.singleLine) {
|
||||
@@ -46,13 +47,10 @@ export default class InputTemplate extends ITemplate {
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
super.cleanup()
|
||||
this.element.removeEventListener("focus", this.#focusHandler)
|
||||
this.element.removeEventListener("focusout", this.#focusoutHandler)
|
||||
if (this.element.singleLine) {
|
||||
this.element.removeEventListener("input", this.#inputSingleLineHandler)
|
||||
}
|
||||
if (this.element.blurOnEnter) {
|
||||
this.element.removeEventListener("keydown", this.#onKeydownBlurOnEnterHandler)
|
||||
}
|
||||
this.element.removeEventListener("input", this.#inputSingleLineHandler)
|
||||
this.element.removeEventListener("keydown", this.#onKeydownBlurOnEnterHandler)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import PinTemplate from "./PinTemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/WindowElement").default} WindowElement
|
||||
* @typedef {import("../../element/WindowElement").WindowElementConstructor} WindowElementConstructor
|
||||
* @typedef {import("../../entity/LinearColorEntity").default} LinearColorEntity
|
||||
*/
|
||||
|
||||
@@ -19,9 +20,10 @@ export default class LinearColorInputPinTemplate extends PinTemplate {
|
||||
#launchColorPickerWindow = e => {
|
||||
e.preventDefault()
|
||||
this.element.blueprint.setFocused(true)
|
||||
this.#window = /** @type {WindowElement} */ (
|
||||
new (ElementFactory.getConstructor("ueb-window"))({
|
||||
type: ColorPickerWindowTemplate,
|
||||
/** @type {WindowElement} */
|
||||
this.#window = /** @type {WindowElementConstructor} */(ElementFactory.getConstructor("ueb-window"))
|
||||
.newObject({
|
||||
type: new ColorPickerWindowTemplate(),
|
||||
windowOptions: {
|
||||
// The created window will use the following functions to get and set the color
|
||||
getPinColor: () => this.element.defaultValue,
|
||||
@@ -29,7 +31,6 @@ export default class LinearColorInputPinTemplate extends PinTemplate {
|
||||
setPinColor: color => this.element.setDefaultValue(color),
|
||||
},
|
||||
})
|
||||
)
|
||||
this.element.blueprint.append(this.#window)
|
||||
const windowApplyHandler = () => {
|
||||
this.element.setDefaultValue(
|
||||
|
||||
@@ -5,7 +5,10 @@ import MouseCreateLink from "../../input/mouse/MouseCreateLink"
|
||||
import SVGIcon from "../../SVGIcon"
|
||||
import Utility from "../../Utility"
|
||||
|
||||
/** @typedef {import("../../input/IInput").default} IInput */
|
||||
/**
|
||||
* @typedef {import("../../input/IInput").default} IInput
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import("../../element/PinElement").default<T>} PinElement
|
||||
@@ -23,8 +26,8 @@ export default class PinTemplate extends ITemplate {
|
||||
return this.#iconElement
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback()
|
||||
setup() {
|
||||
super.setup()
|
||||
this.element.nodeElement = this.element.closest("ueb-node")
|
||||
}
|
||||
|
||||
@@ -66,7 +69,7 @@ export default class PinTemplate extends ITemplate {
|
||||
return html``
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
updated(changedProperties) {
|
||||
super.updated(changedProperties)
|
||||
if (this.element.isInput() && changedProperties.has("isLinked")) {
|
||||
@@ -77,8 +80,7 @@ export default class PinTemplate extends ITemplate {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
this.element.style.setProperty("--ueb-pin-color-rgb", Configuration.getPinColor(this.element).cssText)
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"@rollup/plugin-commonjs": "^21.1.0",
|
||||
"@rollup/plugin-node-resolve": "^13.3.0",
|
||||
"@rollup/plugin-terser": "^0.1.0",
|
||||
"cypress": "^12.1.0",
|
||||
"minify-html-literals": "^1.3.5",
|
||||
"rollup": "^2.75.5",
|
||||
"rollup-plugin-copy": "^3.4.0",
|
||||
|
||||
@@ -168,10 +168,14 @@ ueb-pin[data-type="/Script/CoreUObject.LinearColor"] .ueb-pin-input {
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: #575757;
|
||||
background: transparent;
|
||||
border-radius: 10px;
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
&:hover::-webkit-scrollbar-thumb {
|
||||
background: #575757;
|
||||
}
|
||||
}
|
||||
|
||||
ueb-blueprint[data-scrolling="false"][data-selecting="false"] .ueb-node-wrapper {
|
||||
|
||||
Reference in New Issue
Block a user