mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-14 17:14:41 +08:00
Includes cleanup
This commit is contained in:
@@ -2,15 +2,15 @@ import BlueprintTemplate from "./template/BlueprintTemplate"
|
||||
import Configuration from "./Configuration"
|
||||
import Copy from "./input/common/Copy"
|
||||
import IElement from "./element/IElement"
|
||||
import LinkElement from "./element/LinkElement"
|
||||
import NodeElement from "./element/NodeElement"
|
||||
import SelectorElement from "./element/SelectorElement"
|
||||
import KeyboardCanc from "./input/keybaord/KeyboardCanc"
|
||||
import KeyboardSelectAll from "./input/keybaord/KeyboardSelectAll"
|
||||
import LinkElement from "./element/LinkElement"
|
||||
import MouseScrollGraph from "./input/mouse/MouseScrollGraph"
|
||||
import MouseTracking from "./input/mouse/MouseTracking"
|
||||
import NodeElement from "./element/NodeElement"
|
||||
import Paste from "./input/common/Paste"
|
||||
import Select from "./input/mouse/Select"
|
||||
import SelectorElement from "./element/SelectorElement"
|
||||
import Unfocus from "./input/mouse/Unfocus"
|
||||
import Utility from "./Utility"
|
||||
import Zoom from "./input/mouse/Zoom"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Configuration from "../Configuration"
|
||||
import MouseMoveNodes from "../input/mouse/MouseMoveNodes"
|
||||
import IElement from "./IElement"
|
||||
import MouseMoveNodes from "../input/mouse/MouseMoveNodes"
|
||||
|
||||
/** @typedef {import("../template/SelectableDraggableTemplate").default} SelectableDraggableTemplate */
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Configuration from "../Configuration"
|
||||
import IElement from "./IElement"
|
||||
import LinkTemplate from "../template/LinkTemplate"
|
||||
import Configuration from "../Configuration"
|
||||
|
||||
/**
|
||||
* @typedef {import("./PinElement").default} PinElement
|
||||
@@ -168,7 +168,12 @@ export default class LinkElement extends IElement {
|
||||
* @param {LinkMessageElement} linkMessage
|
||||
*/
|
||||
setLinkMessage(linkMessage) {
|
||||
this.template.applyLinkMessage(this, linkMessage)
|
||||
if (linkMessage) {
|
||||
this.template.applyLinkMessage(this, linkMessage)
|
||||
} else if (this.linkMessageElement) {
|
||||
this.linkMessageElement.remove()
|
||||
this.linkMessageElement = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import Configuration from "../Configuration"
|
||||
import ISelectableDraggableElement from "./ISelectableDraggableElement"
|
||||
import NodeTemplate from "../template/NodeTemplate"
|
||||
import ObjectEntity from "../entity/ObjectEntity"
|
||||
import PinEntity from "../entity/PinEntity"
|
||||
import ISelectableDraggableElement from "./ISelectableDraggableElement"
|
||||
import SerializerFactory from "../serialization/SerializerFactory"
|
||||
import Configuration from "../Configuration"
|
||||
|
||||
export default class NodeElement extends ISelectableDraggableElement {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import IElement from "./IElement"
|
||||
import PinTemplate from "../template/PinTemplate"
|
||||
import MouseCreateLink from "../input/mouse/MouseCreateLink"
|
||||
import PinTemplate from "../template/PinTemplate"
|
||||
|
||||
export default class PinElement extends IElement {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import IEntity from "./IEntity"
|
||||
import FunctionReferenceEntity from "./FunctionReferenceEntity"
|
||||
import GuidEntity from "./GuidEntity"
|
||||
import IEntity from "./IEntity"
|
||||
import IntegerEntity from "./IntegerEntity"
|
||||
import ObjectReferenceEntity from "./ObjectReferenceEntity"
|
||||
import PinEntity from "./PinEntity"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import IEntity from "./IEntity"
|
||||
import GuidEntity from "./GuidEntity"
|
||||
import IEntity from "./IEntity"
|
||||
import LocalizedTextEntity from "./LocalizedTextEntity"
|
||||
import ObjectReferenceEntity from "./ObjectReferenceEntity"
|
||||
import PinReferenceEntity from "./PinReferenceEntity"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import IEntity from "./IEntity"
|
||||
import GuidEntity from "./GuidEntity"
|
||||
import IEntity from "./IEntity"
|
||||
import PathSymbol from "./PathSymbolEntity"
|
||||
|
||||
export default class PinReferenceEntity extends IEntity {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import IContext from "../IContext"
|
||||
import NodeElement from "../../element/NodeElement"
|
||||
import ObjectSerializer from "../../serialization/ObjectSerializer"
|
||||
import IContext from "../IContext"
|
||||
|
||||
export default class Paste extends IContext {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import IKeyboardShortcut from "./IKeyboardShortcut"
|
||||
import Configuration from "../../Configuration"
|
||||
import IKeyboardShortcut from "./IKeyboardShortcut"
|
||||
|
||||
export default class KeyvoardCanc extends IKeyboardShortcut {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import IKeyboardShortcut from "./IKeyboardShortcut"
|
||||
import Configuration from "../../Configuration"
|
||||
import IKeyboardShortcut from "./IKeyboardShortcut"
|
||||
|
||||
export default class KeyboardSelectAll extends IKeyboardShortcut {
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import IMouseClickDrag from "./IMouseClickDrag"
|
||||
import LinkElement from "../../element/LinkElement"
|
||||
import LinkMessageElement from "../../element/LinkMessageElement"
|
||||
import IMouseClickDrag from "./IMouseClickDrag"
|
||||
|
||||
/** @typedef {import("../../element/PinElement").default} PinElement */
|
||||
/**
|
||||
* @typedef {import("../../element/LinkElement").default} LinkElement
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
*/
|
||||
export default class MouseCreateLink extends IMouseClickDrag {
|
||||
|
||||
/** @type {NodeListOf<PinElement>} */
|
||||
@@ -16,11 +19,11 @@ export default class MouseCreateLink extends IMouseClickDrag {
|
||||
|
||||
constructor(target, blueprint, options) {
|
||||
super(target, blueprint, options)
|
||||
/** @type {import("../../element/PinElement").PinElement} */
|
||||
/** @type {PinElement} */
|
||||
this.target
|
||||
/** @type {import("../../element/LinkElement").LinkElement} */
|
||||
/** @type {LinkElement} */
|
||||
this.link
|
||||
/** @type {import("../../entity/PinEntity").default} */
|
||||
/** @type {PinElement} */
|
||||
this.enteredPin
|
||||
|
||||
let self = this
|
||||
@@ -64,6 +67,7 @@ export default class MouseCreateLink extends IMouseClickDrag {
|
||||
|| link.getSourcePin() == this.enteredPin && link.getDestinationPin() == this.target
|
||||
)) {
|
||||
this.link.setDestinationPin(this.enteredPin)
|
||||
this.link.setLinkMessage(null)
|
||||
this.blueprint.addGraphElement(this.link)
|
||||
} else {
|
||||
this.link.remove()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import IEntity from "../entity/IEntity"
|
||||
import Grammar from "./Grammar"
|
||||
import IEntity from "../entity/IEntity"
|
||||
import Parsimmon from "parsimmon"
|
||||
import SerializerFactory from "./SerializerFactory"
|
||||
import TypeInitialization from "../entity/TypeInitialization"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import ISerializer from "./ISerializer"
|
||||
import ObjectEntity from "../entity/ObjectEntity"
|
||||
import PinEntity from "../entity/PinEntity"
|
||||
import ISerializer from "./ISerializer"
|
||||
import SerializerFactory from "./SerializerFactory"
|
||||
|
||||
export default class ObjectSerializer extends ISerializer {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import Configuration from "../Configuration"
|
||||
import html from "./html"
|
||||
import ITemplate from "./ITemplate"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import SelectorElement from "../element/SelectorElement"
|
||||
import ITemplate from "./ITemplate"
|
||||
|
||||
/** @typedef {import("../Blueprint").default} Blueprint */
|
||||
export default class BlueprintTemplate extends ITemplate {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import LinkElement from "../element/LinkElement"
|
||||
import html from "./html"
|
||||
import ITemplate from "./ITemplate"
|
||||
import LinkElement from "../element/LinkElement"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/LinkMessageElement").default} LinkMessageElement
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import html from "./html"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import ITemplate from "./ITemplate"
|
||||
import Configuration from "../Configuration"
|
||||
import html from "./html"
|
||||
import ITemplate from "./ITemplate"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/LinkElement").default} LinkElement
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import PinElement from "../element/PinElement"
|
||||
import html from "./html"
|
||||
import PinEntity from "../entity/PinEntity"
|
||||
import PinElement from "../element/PinElement"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import SelectableDraggableTemplate from "./SelectableDraggableTemplate"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Utility from "../Utility"
|
||||
import html from "./html"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import ITemplate from "./ITemplate"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import Utility from "../Utility"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/PinElement").default} PinElement
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import ITemplate from "./ITemplate"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/ISelectableDraggableElement").default} ISelectableDraggableElement
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sanitizeText from "./sanitizeText"
|
||||
import ITemplate from "./ITemplate"
|
||||
import sanitizeText from "./sanitizeText"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/SelectorElement").default} SelectorElement
|
||||
|
||||
Reference in New Issue
Block a user