mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-03 23:55:04 +08:00
Fix single line doc comments
This commit is contained in:
5264
dist/ueblueprint.js
vendored
5264
dist/ueblueprint.js
vendored
File diff suppressed because one or more lines are too long
2
dist/ueblueprint.min.js
vendored
2
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -12,9 +12,7 @@ import Utility from "./Utility"
|
||||
* @typedef {import("./entity/PinReferenceEntity").default} PinReferenceEntity
|
||||
*/
|
||||
|
||||
/**
|
||||
* @extends {IElement<Object, BlueprintTemplate>}
|
||||
*/
|
||||
/** @extends {IElement<Object, BlueprintTemplate>} */
|
||||
export default class Blueprint extends IElement {
|
||||
|
||||
static properties = {
|
||||
@@ -109,9 +107,7 @@ export default class Blueprint extends IElement {
|
||||
node.setSelected(selected)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Configuration} settings
|
||||
*/
|
||||
/** @param {Configuration} settings */
|
||||
constructor(settings = new Configuration()) {
|
||||
super({}, new BlueprintTemplate())
|
||||
this.selecting = false
|
||||
@@ -206,9 +202,7 @@ export default class Blueprint extends IElement {
|
||||
return Utility.snapToGrid(location, Configuration.gridSize)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number[]} param0
|
||||
*/
|
||||
/** @param {Number[]} param0 */
|
||||
seamlessExpand([x, y]) {
|
||||
x = Math.round(x)
|
||||
y = Math.round(y)
|
||||
@@ -266,18 +260,13 @@ export default class Blueprint extends IElement {
|
||||
return parseFloat(getComputedStyle(this.gridElement).getPropertyValue("--ueb-scale"))
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number[]} param0
|
||||
*/
|
||||
/** @param {Number[]} param0 */
|
||||
compensateTranslation([x, y]) {
|
||||
x -= this.translateX
|
||||
y -= this.translateY
|
||||
return [x, y]
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of nodes in this blueprint. It can filter the list providing just the selected ones.
|
||||
*/
|
||||
getNodes(selected = false) {
|
||||
if (selected) {
|
||||
return this.nodes.filter(
|
||||
@@ -288,9 +277,7 @@ export default class Blueprint extends IElement {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinReferenceEntity} pinReference
|
||||
*/
|
||||
/** @param {PinReferenceEntity} pinReference */
|
||||
getPin(pinReference) {
|
||||
/*let result = this.template.getPin(this, pinReference)
|
||||
if (result) {
|
||||
@@ -332,23 +319,15 @@ export default class Blueprint extends IElement {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Select all nodes
|
||||
*/
|
||||
selectAll() {
|
||||
this.getNodes().forEach(node => this.nodeSelectToggleFunction(node, true))
|
||||
}
|
||||
|
||||
/**
|
||||
* Unselect all nodes
|
||||
*/
|
||||
unselectAll() {
|
||||
this.getNodes().forEach(node => this.nodeSelectToggleFunction(node, false))
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {...IElement} graphElements
|
||||
*/
|
||||
/** @param {...IElement} graphElements */
|
||||
addGraphElement(...graphElements) {
|
||||
let nodeElements = []
|
||||
for (let element of graphElements) {
|
||||
@@ -382,9 +361,7 @@ export default class Blueprint extends IElement {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {...IElement} graphElements
|
||||
*/
|
||||
/** @param {...IElement} graphElements */
|
||||
removeGraphElement(...graphElements) {
|
||||
for (let element of graphElements) {
|
||||
if (element.closest("ueb-blueprint") == this) {
|
||||
|
||||
@@ -67,17 +67,13 @@ export default class IElement extends LitElement {
|
||||
this.template.connectedCallback(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Map} changedProperties
|
||||
*/
|
||||
/** @param {Map} changedProperties */
|
||||
willUpdate(changedProperties) {
|
||||
super.willUpdate(changedProperties)
|
||||
this.template.willUpdate(this, changedProperties)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Map} changedProperties
|
||||
*/
|
||||
/** @param {Map} changedProperties */
|
||||
update(changedProperties) {
|
||||
super.update(changedProperties)
|
||||
this.template.update(this, changedProperties)
|
||||
@@ -87,9 +83,7 @@ export default class IElement extends LitElement {
|
||||
return this.template.render(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Map} changedProperties
|
||||
*/
|
||||
/** @param {Map} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
this.template.firstUpdated(this, changedProperties)
|
||||
@@ -115,9 +109,7 @@ export default class IElement extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {IElement} element
|
||||
*/
|
||||
/** @param {IElement} element */
|
||||
isSameGraph(element) {
|
||||
return this.blueprint && this.blueprint == element?.blueprint
|
||||
}
|
||||
|
||||
@@ -40,9 +40,7 @@ export default class IFromToPositionedElement extends IElement {
|
||||
this.finaPositionY = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number[]} param0
|
||||
*/
|
||||
/** @param {Number[]} param0 */
|
||||
setBothLocations([x, y]) {
|
||||
this.initialPositionX = x
|
||||
this.initialPositionY = y
|
||||
@@ -50,17 +48,13 @@ export default class IFromToPositionedElement extends IElement {
|
||||
this.finaPositionY = y
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number[]} offset
|
||||
*/
|
||||
/** @param {Number[]} offset */
|
||||
addSourceLocation([offsetX, offsetY]) {
|
||||
this.initialPositionX += offsetX
|
||||
this.initialPositionY += offsetY
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number[]} offset
|
||||
*/
|
||||
/** @param {Number[]} offset */
|
||||
addDestinationLocation([offsetX, offsetY]) {
|
||||
this.finaPositionX += offsetX
|
||||
this.finaPositionY += offsetY
|
||||
|
||||
@@ -3,13 +3,9 @@ import IFromToPositionedElement from "./IFromToPositionedElement"
|
||||
import LinkTemplate from "../template/LinkTemplate"
|
||||
import Utility from "../Utility"
|
||||
|
||||
/**
|
||||
* @typedef {import("./PinElement").default} PinElement
|
||||
*/
|
||||
/** @typedef {import("./PinElement").default} PinElement */
|
||||
|
||||
/**
|
||||
* @extends {IFromToPositionedElement<Object, LinkTemplate>}
|
||||
*/
|
||||
/** @extends {IFromToPositionedElement<Object, LinkTemplate>} */
|
||||
export default class LinkElement extends IFromToPositionedElement {
|
||||
|
||||
static properties = {
|
||||
@@ -174,9 +170,7 @@ export default class LinkElement extends IFromToPositionedElement {
|
||||
this.destinationPin = null
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number[]?} location
|
||||
*/
|
||||
/** @param {Number[]?} location */
|
||||
setSourceLocation(location = null) {
|
||||
if (location == null) {
|
||||
const self = this
|
||||
@@ -191,9 +185,7 @@ export default class LinkElement extends IFromToPositionedElement {
|
||||
this.initialPositionY = y
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number[]?} location
|
||||
*/
|
||||
/** @param {Number[]?} location */
|
||||
setDestinationLocation(location = null) {
|
||||
if (location == null) {
|
||||
const self = this
|
||||
|
||||
@@ -9,9 +9,7 @@ import PinReferenceEntity from "../entity/PinReferenceEntity"
|
||||
import SerializerFactory from "../serialization/SerializerFactory"
|
||||
import Utility from "../Utility"
|
||||
|
||||
/**
|
||||
* @extends {ISelectableDraggableElement<ObjectEntity, NodeTemplate>}
|
||||
*/
|
||||
/** @extends {ISelectableDraggableElement<ObjectEntity, NodeTemplate>} */
|
||||
export default class NodeElement extends ISelectableDraggableElement {
|
||||
|
||||
static properties = {
|
||||
@@ -63,9 +61,7 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
|
||||
#pins
|
||||
|
||||
/**
|
||||
* @param {ObjectEntity} entity
|
||||
*/
|
||||
/** @param {ObjectEntity} entity */
|
||||
constructor(entity) {
|
||||
super(entity, new NodeTemplate())
|
||||
this.#pins = this.getPinEntities().filter(v => !v.isHidden()).map(v => new PinElement(v))
|
||||
@@ -81,9 +77,7 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
this.entity.subscribe("Name", value => this.name = value)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String} str
|
||||
*/
|
||||
/** @param {String} str */
|
||||
static fromSerializedObject(str) {
|
||||
str = str.trim()
|
||||
let entity = SerializerFactory.getSerializer(ObjectEntity).deserialize(str)
|
||||
@@ -112,9 +106,7 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
this.getPinElements().forEach(pin => pin.sanitizeLinks())
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String} name
|
||||
*/
|
||||
/** @param {String} name */
|
||||
rename(name) {
|
||||
if (this.entity.Name == name) {
|
||||
return false
|
||||
@@ -134,9 +126,7 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
return this.#pins
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {PinEntity[]}
|
||||
*/
|
||||
/** @returns {PinEntity[]} */
|
||||
getPinEntities() {
|
||||
return this.entity.CustomProperties.filter(v => v instanceof PinEntity)
|
||||
}
|
||||
|
||||
@@ -2,18 +2,14 @@ import FastSelectionModel from "../selection/FastSelectionModel"
|
||||
import IFromToPositionedElement from "./IFromToPositionedElement"
|
||||
import SelectorTemplate from "../template/SelectorTemplate"
|
||||
|
||||
/**
|
||||
* @extends {IFromToPositionedElement<Object, SelectorTemplate>}
|
||||
*/
|
||||
/** @extends {IFromToPositionedElement<Object, SelectorTemplate>} */
|
||||
export default class SelectorElement extends IFromToPositionedElement {
|
||||
|
||||
constructor() {
|
||||
super({}, new SelectorTemplate())
|
||||
this.selectionModel = null
|
||||
}
|
||||
/**
|
||||
* @param {Number[]} initialPosition
|
||||
*/
|
||||
/** @param {Number[]} initialPosition */
|
||||
beginSelect(initialPosition) {
|
||||
this.blueprint.selecting = true
|
||||
this.setBothLocations(initialPosition)
|
||||
@@ -25,9 +21,7 @@ export default class SelectorElement extends IFromToPositionedElement {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number[]} finalPosition
|
||||
*/
|
||||
/** @param {Number[]} finalPosition */
|
||||
selectTo(finalPosition) {
|
||||
/** @type {FastSelectionModel} */ (this.selectionModel)
|
||||
.selectTo(finalPosition)
|
||||
|
||||
@@ -1,21 +1,15 @@
|
||||
/**
|
||||
* @typedef {import("./IEntity").default} IEntity
|
||||
*/
|
||||
/** @typedef {import("./IEntity").default} IEntity */
|
||||
|
||||
export default class CalculatedType {
|
||||
|
||||
#f
|
||||
|
||||
/**
|
||||
* @param {Function} f
|
||||
*/
|
||||
/** @param {Function} f */
|
||||
constructor(f) {
|
||||
this.#f = f
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {IEntity} entity
|
||||
*/
|
||||
/** @param {IEntity} entity */
|
||||
calculate(entity) {
|
||||
return this.#f(entity)
|
||||
}
|
||||
|
||||
@@ -6,9 +6,7 @@ export default class IntegerEntity extends IEntity {
|
||||
value: Number,
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object | Number | String} options
|
||||
*/
|
||||
/** @param {Object | Number | String} options */
|
||||
constructor(options = 0) {
|
||||
super(options)
|
||||
this.value = Math.round(this.value)
|
||||
|
||||
@@ -38,9 +38,7 @@ export default class ObjectEntity extends IEntity {
|
||||
return this.Name
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {[String, Number]}
|
||||
*/
|
||||
/** @returns {[String, Number]} */
|
||||
getNameAndCounter() {
|
||||
const result = this.getObjectName(false).match(ObjectEntity.nameRegex)
|
||||
if (result && result.length == 3) {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/**
|
||||
* @template T
|
||||
*/
|
||||
/** @template T */
|
||||
export default class TypeInitialization {
|
||||
|
||||
/** @type {Constructor|Array<Constructor>} */
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import Configuration from "../Configuration"
|
||||
|
||||
/**
|
||||
* @typedef {import("../Blueprint").default} Blueprint
|
||||
*/
|
||||
/** @typedef {import("../Blueprint").default} Blueprint */
|
||||
|
||||
/**
|
||||
* @template {HTMLElement} T
|
||||
*/
|
||||
/** @template {HTMLElement} T */
|
||||
export default class IInput {
|
||||
|
||||
/** @type {T} */
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import Configuration from "../../Configuration"
|
||||
import IKeyboardShortcut from "./IKeyboardShortcut"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../Blueprint").default} Blueprint
|
||||
*/
|
||||
/** @typedef {import("../../Blueprint").default} Blueprint */
|
||||
export default class KeyboardSelectAll extends IKeyboardShortcut {
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,9 +2,7 @@ import Configuration from "../../Configuration"
|
||||
import IPointing from "./IPointing"
|
||||
import Utility from "../../Utility"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../Blueprint").default} Blueprint
|
||||
*/
|
||||
/** @typedef {import("../../Blueprint").default} Blueprint */
|
||||
|
||||
/**
|
||||
* @template {HTMLElement} T
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import IInput from "../IInput"
|
||||
import Utility from "../../Utility"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../Blueprint").default} Blueprint
|
||||
*/
|
||||
/** @typedef {import("../../Blueprint").default} Blueprint */
|
||||
|
||||
/**
|
||||
* @template {HTMLElement} T
|
||||
@@ -16,9 +14,7 @@ export default class IPointing extends IInput {
|
||||
this.movementSpace = this.blueprint?.getGridDOMElement() ?? document.documentElement
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {MouseEvent} mouseEvent
|
||||
*/
|
||||
/** @param {MouseEvent} mouseEvent */
|
||||
locationFromEvent(mouseEvent) {
|
||||
const location = Utility.convertLocation(
|
||||
[mouseEvent.clientX, mouseEvent.clientY],
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
import IMouseClickDrag from "./IMouseClickDrag"
|
||||
import LinkElement from "../../element/LinkElement"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
*/
|
||||
/** @typedef {import("../../element/PinElement").default} PinElement */
|
||||
|
||||
/**
|
||||
* @extends IMouseClickDrag<PinElement>
|
||||
*/
|
||||
/** @extends IMouseClickDrag<PinElement> */
|
||||
export default class MouseCreateLink extends IMouseClickDrag {
|
||||
|
||||
/** @type {NodeListOf<PinElement>} */
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import IMouseClickDrag from "./IMouseClickDrag"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
*/
|
||||
/** @typedef {import("../../element/PinElement").default} PinElement */
|
||||
|
||||
/**
|
||||
* @extends IMouseClickDrag<PinElement>
|
||||
*/
|
||||
/** @extends IMouseClickDrag<PinElement> */
|
||||
export default class MouseIgnore extends IMouseClickDrag {
|
||||
|
||||
constructor(target, blueprint, options = {}) {
|
||||
|
||||
@@ -16,9 +16,7 @@ export default class Unfocus extends IInput {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLElement} target
|
||||
*/
|
||||
/** @param {HTMLElement} target */
|
||||
clickedSomewhere(target) {
|
||||
// If target is outside the blueprint grid
|
||||
if (!target.closest("ueb-blueprint")) {
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import GeneralSerializer from "./GeneralSerializer"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
*/
|
||||
/** @typedef {import("../entity/IEntity").default} IEntity */
|
||||
|
||||
/**
|
||||
* @template {IEntity | Boolean | Number | String} T
|
||||
*/
|
||||
/** @template {IEntity | Boolean | Number | String} T */
|
||||
export default class CustomSerializer extends GeneralSerializer {
|
||||
|
||||
#objectWriter
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
import Grammar from "./Grammar"
|
||||
import ISerializer from "./ISerializer"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
*/
|
||||
/** @typedef {import("../entity/IEntity").default} IEntity */
|
||||
|
||||
/**
|
||||
* @template {IEntity} T
|
||||
*/
|
||||
/** @template {IEntity} T */
|
||||
export default class GeneralSerializer extends ISerializer {
|
||||
|
||||
/**
|
||||
* @param {new () => T} entityType
|
||||
*/
|
||||
/** @param {new () => T} entityType */
|
||||
constructor(wrap, entityType, prefix, separator, trailingSeparator, attributeValueConjunctionSign, attributeKeyPrinter) {
|
||||
wrap = wrap ?? (v => `(${v})`)
|
||||
super(entityType, prefix, separator, trailingSeparator, attributeValueConjunctionSign, attributeKeyPrinter)
|
||||
|
||||
@@ -17,9 +17,7 @@ import TypeInitialization from "../entity/TypeInitialization"
|
||||
import Utility from "../Utility"
|
||||
import VectorEntity from "../entity/VectorEntity"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
*/
|
||||
/** @typedef {import("../entity/IEntity").default} IEntity */
|
||||
|
||||
let P = Parsimmon
|
||||
|
||||
|
||||
@@ -5,9 +5,7 @@ import SerializerFactory from "./SerializerFactory"
|
||||
import TypeInitialization from "../entity/TypeInitialization"
|
||||
import Utility from "../Utility"
|
||||
|
||||
/**
|
||||
* @template {IEntity} T
|
||||
*/
|
||||
/** @template {IEntity} T */
|
||||
export default class ISerializer {
|
||||
|
||||
static grammar = Parsimmon.createLanguage(new Grammar())
|
||||
|
||||
@@ -20,9 +20,7 @@ export default class ObjectSerializer extends ISerializer {
|
||||
return super.showProperty(entity, object, attributeKey, attributeValue)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String} value
|
||||
*/
|
||||
/** @param {String} value */
|
||||
read(value) {
|
||||
const parseResult = ISerializer.grammar.Object.parse(value)
|
||||
if (!parseResult.status) {
|
||||
@@ -31,9 +29,7 @@ export default class ObjectSerializer extends ISerializer {
|
||||
return parseResult.value
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String} value
|
||||
*/
|
||||
/** @param {String} value */
|
||||
readMultiple(value) {
|
||||
const parseResult = ISerializer.grammar.MultipleObject.parse(value)
|
||||
if (!parseResult.status) {
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
import Utility from "../Utility"
|
||||
import GeneralSerializer from "./GeneralSerializer"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
*/
|
||||
/** @typedef {import("../entity/IEntity").default} IEntity */
|
||||
|
||||
/**
|
||||
* @template {IEntity} T
|
||||
*/
|
||||
/** @template {IEntity} T */
|
||||
export default class ToStringSerializer extends GeneralSerializer {
|
||||
|
||||
/**
|
||||
* @param {new () => T} entityType
|
||||
*/
|
||||
/** @param {new () => T} entityType */
|
||||
constructor(entityType) {
|
||||
super(undefined, entityType)
|
||||
}
|
||||
|
||||
@@ -43,16 +43,12 @@ export default class BlueprintTemplate extends ITemplate {
|
||||
}), {}),
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Blueprint} blueprint
|
||||
*/
|
||||
/** @param {Blueprint} blueprint */
|
||||
constructed(blueprint) {
|
||||
blueprint.style.cssText = Object.entries(BlueprintTemplate.styleVariables).map(([k, v]) => `${k}:${v};`).join("")
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Blueprint} blueprint
|
||||
*/
|
||||
/** @param {Blueprint} blueprint */
|
||||
createInputObjects(blueprint) {
|
||||
return [
|
||||
new Copy(blueprint.getGridDOMElement(), blueprint),
|
||||
@@ -93,11 +89,11 @@ export default class BlueprintTemplate extends ITemplate {
|
||||
<div class="ueb-viewport-overlay"></div>
|
||||
<div class="ueb-viewport-body">
|
||||
<div class="ueb-grid" style="
|
||||
--ueb-additional-x: ${element};
|
||||
--ueb-additional-y: ${element.translateY};
|
||||
--ueb-translate-x: ${element.translateX};
|
||||
--ueb-translate-y: ${element.translateY};
|
||||
">
|
||||
--ueb-additional-x: xxxxxxxxxx;
|
||||
--ueb-additional-y: xxxxxxxxxxxxxxxxxxxxx;
|
||||
--ueb-translate-x: xxxxxxxxxxxxxxxxxxxxx;
|
||||
--ueb-translate-y: xxxxxxxxxxxxxxxxxxxxx;
|
||||
">
|
||||
<div class="ueb-grid-content">
|
||||
<div data-links></div>
|
||||
<div data-nodes></div>
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { html } from "lit"
|
||||
import IInputPinTemplate from "./IInputPinTemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/PinElement").default} PinElement
|
||||
*/
|
||||
/** @typedef {import("../element/PinElement").default} PinElement */
|
||||
|
||||
export default class BoolPinTemplate extends IInputPinTemplate {
|
||||
|
||||
@@ -22,28 +20,22 @@ export default class BoolPinTemplate extends IInputPinTemplate {
|
||||
this.#input.addEventListener("change", this.onChangeHandler)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
cleanup(pin) {
|
||||
super.cleanup(pin)
|
||||
this.#input.removeEventListener("change", this.onChangeHandler)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
getInputs(pin) {
|
||||
return [this.#input.checked ? "true" : "false"]
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
renderInput(pin) {
|
||||
if (pin.isInput()) {
|
||||
return html`
|
||||
<input type="checkbox" class="ueb-pin-input" .checked=${pin.defaultValue == "true"} />
|
||||
<input type="checkbox" class="ueb-pin-input" .checked=${pin.defaultValue=="true" } />
|
||||
`
|
||||
}
|
||||
return super.renderInput(pin)
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
import { html } from "lit"
|
||||
import PinTemplate from "./PinTemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/PinElement").default} PinElement
|
||||
*/
|
||||
/** @typedef {import("../element/PinElement").default} PinElement */
|
||||
|
||||
export default class ExecPinTemplate extends PinTemplate {
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
renderIcon(pin) {
|
||||
return html`
|
||||
<svg viewBox="-2 0 16 16">
|
||||
<path class="ueb-pin-tofill" stroke-width="1.25" stroke="white"
|
||||
d="M 2 1 a 2 2 0 0 0 -2 2 v 10 a 2 2 0 0 0 2 2 h 4 a 2 2 0 0 0 1.519 -0.698 l 4.843 -5.651 a 1 1 0 0 0 0 -1.302 L 7.52 1.7 a 2 2 0 0 0 -1.519 -0.698 z"
|
||||
/>
|
||||
d="M 2 1 a 2 2 0 0 0 -2 2 v 10 a 2 2 0 0 0 2 2 h 4 a 2 2 0 0 0 1.519 -0.698 l 4.843 -5.651 a 1 1 0 0 0 0 -1.302 L 7.52 1.7 a 2 2 0 0 0 -1.519 -0.698 z" />
|
||||
</svg>
|
||||
`
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import ITemplate from "./ITemplate"
|
||||
import MouseMoveDraggable from "../input/mouse/MouseMoveDraggable"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IDraggableElement").default} IDraggableElement
|
||||
*/
|
||||
/** @typedef {import("../element/IDraggableElement").default} IDraggableElement */
|
||||
|
||||
/**
|
||||
* @template {ISelectableDraggableElement} T
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import ITemplate from "./ITemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IFromToPositionedElement").default} IFromToPositionedElement
|
||||
*/
|
||||
/** @typedef {import("../element/IFromToPositionedElement").default} IFromToPositionedElement */
|
||||
|
||||
/**
|
||||
* @template {IFromToPositionedElement} T
|
||||
|
||||
@@ -2,9 +2,7 @@ import { html } from "lit"
|
||||
import MouseIgnore from "../input/mouse/MouseIgnore"
|
||||
import PinTemplate from "./PinTemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/PinElement").default} PinElement
|
||||
*/
|
||||
/** @typedef {import("../element/PinElement").default} PinElement */
|
||||
|
||||
export default class IInputPinTemplate extends PinTemplate {
|
||||
|
||||
|
||||
@@ -5,9 +5,7 @@ import { css, html } from "lit"
|
||||
* @typedef {import("../input/IInput").default} IInput
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {IElement} T
|
||||
*/
|
||||
/** @template {IElement} T */
|
||||
export default class ITemplate {
|
||||
|
||||
static styles = css``
|
||||
|
||||
@@ -35,9 +35,7 @@ export default class LinearColorPinTemplate extends IInputPinTemplate {
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
getInputs(pin) {
|
||||
return [this.#input.dataset.linearColor]
|
||||
}
|
||||
@@ -49,9 +47,7 @@ export default class LinearColorPinTemplate extends IInputPinTemplate {
|
||||
setInputs(pin, value = []) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
renderInput(pin) {
|
||||
if (pin.isInput()) {
|
||||
return html`
|
||||
|
||||
@@ -3,14 +3,10 @@ import Configuration from "../Configuration"
|
||||
import Utility from "../Utility"
|
||||
import IFromToPositionedTemplate from "./IFromToPositionedTemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/LinkElement").default} LinkElement
|
||||
*/
|
||||
/** @typedef {import("../element/LinkElement").default} LinkElement */
|
||||
|
||||
|
||||
/**
|
||||
* @extends {IFromToPositionedTemplate<LinkElement>}
|
||||
*/
|
||||
/** @extends {IFromToPositionedTemplate<LinkElement>} */
|
||||
export default class LinkTemplate extends IFromToPositionedTemplate {
|
||||
|
||||
/**
|
||||
@@ -107,9 +103,7 @@ export default class LinkTemplate extends IFromToPositionedTemplate {
|
||||
link.style.setProperty("--ueb-start-percentage", `${Math.round(link.startPercentage)}%`)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {LinkElement} link
|
||||
*/
|
||||
/** @param {LinkElement} link */
|
||||
render(link) {
|
||||
const uniqueId = "ueb-id-" + Math.floor(Math.random() * 1E12)
|
||||
return html`
|
||||
@@ -120,10 +114,10 @@ export default class LinkTemplate extends IFromToPositionedTemplate {
|
||||
</g>
|
||||
</svg>
|
||||
${link.linkMessageIcon != "" || link.linkMessageText != "" ? html`
|
||||
<div class="ueb-link-message">
|
||||
<span class="${link.linkMessageIcon}"></span>
|
||||
<span class="ueb-link-message-text">${link.linkMessageText}</span>
|
||||
</div>
|
||||
<div class="ueb-link-message">
|
||||
<span class="${link.linkMessageIcon}"></span>
|
||||
<span class="ueb-link-message-text">${link.linkMessageText}</span>
|
||||
</div>
|
||||
` : html``}
|
||||
`
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import IInputPinTemplate from "./IInputPinTemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/PinElement").default} PinElement
|
||||
*/
|
||||
/** @typedef {import("../element/PinElement").default} PinElement */
|
||||
|
||||
export default class NamePinTemplate extends IInputPinTemplate {
|
||||
|
||||
@@ -31,9 +29,7 @@ export default class NamePinTemplate extends IInputPinTemplate {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
cleanup(pin) {
|
||||
super.cleanup(pin)
|
||||
this.inputContentElements.forEach(element => {
|
||||
@@ -41,9 +37,7 @@ export default class NamePinTemplate extends IInputPinTemplate {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
getInputs(pin) {
|
||||
return this.inputContentElements.map(element => element.textContent) // textContent for performance reason
|
||||
}
|
||||
|
||||
@@ -2,17 +2,13 @@ import { html } from "lit"
|
||||
import PinElement from "../element/PinElement"
|
||||
import SelectableDraggableTemplate from "./SelectableDraggableTemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/NodeElement").default} NodeElement
|
||||
*/
|
||||
/** @typedef {import("../element/NodeElement").default} NodeElement */
|
||||
|
||||
export default class NodeTemplate extends SelectableDraggableTemplate {
|
||||
|
||||
toggleAdvancedDisplayHandler
|
||||
|
||||
/**
|
||||
* @param {NodeElement} node
|
||||
*/
|
||||
/** @param {NodeElement} node */
|
||||
render(node) {
|
||||
return html`
|
||||
<div class="ueb-node-border">
|
||||
@@ -23,8 +19,7 @@ export default class NodeTemplate extends SelectableDraggableTemplate {
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M9.72002 6.0699C9.88111 4.96527 10.299 3.9138 10.94 2.99991C10.94 2.99991 10.94 3.05991 10.94 3.08991C10.94 3.36573 11.0496 3.63026 11.2446 3.8253C11.4397 4.02033 11.7042 4.12991 11.98 4.12991C12.2558 4.12991 12.5204 4.02033 12.7154 3.8253C12.9105 3.63026 13.02 3.36573 13.02 3.08991C13.0204 2.90249 12.9681 2.71873 12.8691 2.5596C12.7701 2.40047 12.6283 2.27237 12.46 2.18991H12.37C11.8725 2.00961 11.3275 2.00961 10.83 2.18991C9.21002 2.63991 8.58002 4.99991 8.58002 4.99991L8.40002 5.1199H5.40002L5.15002 6.1199H8.27002L7.27002 11.4199C7.11348 12.0161 6.79062 12.5555 6.33911 12.9751C5.8876 13.3948 5.32607 13.6773 4.72002 13.7899C4.78153 13.655 4.81227 13.5081 4.81002 13.3599C4.81002 13.0735 4.69624 12.7988 4.4937 12.5962C4.29116 12.3937 4.01646 12.2799 3.73002 12.2799C3.44359 12.2799 3.16889 12.3937 2.96635 12.5962C2.76381 12.7988 2.65002 13.0735 2.65002 13.3599C2.66114 13.605 2.75692 13.8386 2.92104 14.021C3.08517 14.2033 3.30746 14.3231 3.55002 14.3599C7.91002 15.1999 8.55002 11.4499 8.55002 11.4499L9.55002 7.05991H12.55L12.8 6.05991H9.64002L9.72002 6.0699Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
fill="currentColor" />
|
||||
</svg>
|
||||
</span>
|
||||
<span class="ueb-node-name-text">
|
||||
@@ -37,21 +32,15 @@ export default class NodeTemplate extends SelectableDraggableTemplate {
|
||||
<div class="ueb-node-outputs"></div>
|
||||
</div>
|
||||
${node.enabledState?.toString() == "DevelopmentOnly" ? html`
|
||||
<div class="ueb-node-developmentonly">Development Only</div>
|
||||
<div class="ueb-node-developmentonly">Development Only</div>
|
||||
` : html``}
|
||||
${node.advancedPinDisplay ? html`
|
||||
<div class="ueb-node-expansion" @click="${this.toggleAdvancedDisplayHandler}">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="16"
|
||||
height="16"
|
||||
fill="currentColor"
|
||||
class="ueb-node-expansion-icon"
|
||||
viewBox="4 4 24 24"
|
||||
>
|
||||
<path d="M 16.003 18.626 l 7.081 -7.081 L 25 13.46 l -8.997 8.998 -9.003 -9 1.917 -1.916 z" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ueb-node-expansion" @click="${this.toggleAdvancedDisplayHandler}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="ueb-node-expansion-icon" viewBox="4 4 24 24">
|
||||
<path d="M 16.003 18.626 l 7.081 -7.081 L 25 13.46 l -8.997 8.998 -9.003 -9 1.917 -1.916 z" />
|
||||
</svg>
|
||||
</div>
|
||||
` : html``}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,9 +13,7 @@ export default class PinTemplate extends ITemplate {
|
||||
|
||||
static styles = css``
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
connectedCallback(pin) {
|
||||
super.connectedCallback(pin)
|
||||
pin.nodeElement = pin.closest("ueb-node")
|
||||
@@ -34,9 +32,7 @@ export default class PinTemplate extends ITemplate {
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
render(pin) {
|
||||
const icon = html`
|
||||
<div class="ueb-pin-icon">
|
||||
@@ -66,9 +62,7 @@ export default class PinTemplate extends ITemplate {
|
||||
`
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
renderInput(pin) {
|
||||
return html``
|
||||
}
|
||||
@@ -83,9 +77,7 @@ export default class PinTemplate extends ITemplate {
|
||||
pin.clickableElement = pin
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PinElement} pin
|
||||
*/
|
||||
/** @param {PinElement} pin */
|
||||
getLinkLocation(pin) {
|
||||
const rect = pin.querySelector(".ueb-pin-icon").getBoundingClientRect()
|
||||
const location = Utility.convertLocation(
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import IInputPinTemplate from "./IInputPinTemplate"
|
||||
import Utility from "../Utility"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/PinElement").default} PinElement
|
||||
*/
|
||||
/** @typedef {import("../element/PinElement").default} PinElement */
|
||||
|
||||
export default class RealPinTemplate extends IInputPinTemplate {
|
||||
|
||||
|
||||
@@ -2,9 +2,7 @@ import IDraggableTemplate from "./IDraggableTemplate"
|
||||
import ITemplate from "./ITemplate"
|
||||
import MouseMoveNodes from "../input/mouse/MouseMoveNodes"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/ISelectableDraggableElement").default} ISelectableDraggableElement
|
||||
*/
|
||||
/** @typedef {import("../element/ISelectableDraggableElement").default} ISelectableDraggableElement */
|
||||
|
||||
/**
|
||||
* @template {ISelectableDraggableElement} T
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import IFromToPositionedTemplate from "./IFromToPositionedTemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/SelectorElement").default} SelectorElement
|
||||
*/
|
||||
/** @typedef {import("../element/SelectorElement").default} SelectorElement */
|
||||
|
||||
export default class SelectorTemplate extends IFromToPositionedTemplate {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user