mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-21 14:24:47 +08:00
Large typedef import cleanup and smaller fixes
This commit is contained in:
@@ -6,11 +6,9 @@ import NodeElement from "./element/NodeElement.js"
|
||||
import Utility from "./Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("./element/PinElement").default} PinElement
|
||||
* @typedef {import("./entity/GuidEntity").default} GuidEntity
|
||||
* @typedef {import("./entity/PinReferenceEntity").default} PinReferenceEntity
|
||||
* @typedef {import("./template/node/CommentNodeTemplate").default} CommentNodeTemplate
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
* @typedef {import("./element/PinElement.js").default} PinElement
|
||||
* @typedef {import("./entity/PinReferenceEntity.js").default} PinReferenceEntity
|
||||
* @typedef {import("./template/node/CommentNodeTemplate.js").default} CommentNodeTemplate
|
||||
* @typedef {typeof Blueprint} BlueprintConstructor
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { css } from "lit"
|
||||
|
||||
/**
|
||||
* @typedef {import("./element/NodeElement").default} NodeElement
|
||||
* @typedef {import("./element/PinElement").default} PinElement
|
||||
* @typedef {import("lit").CSSResult} CSSResult
|
||||
* @typedef {import("./entity/ObjectEntity.js").default} ObjectEntity
|
||||
* @typedef {import("./entity/ObjectReferenceEntity.js").default} ObjectReferenceEntity
|
||||
*/
|
||||
|
||||
export default class Configuration {
|
||||
@@ -174,6 +173,12 @@ export default class Configuration {
|
||||
static selectAllKeyboardKey = "(bCtrl=True,Key=A)"
|
||||
static smoothScrollTime = 1000 // ms
|
||||
static stringEscapedCharacters = /['"\\]/g
|
||||
/** @param {ObjectEntity} objectEntity */
|
||||
static subObjectAttributeNameFromEntity = objectEntity =>
|
||||
"#SubObject" + (objectEntity.Class.type ? "_" + objectEntity.Class.type : "") + "_" + objectEntity.Name
|
||||
/** @param {ObjectReferenceEntity} objectReferenceEntity */
|
||||
static subObjectAttributeNameFromReference = objectReferenceEntity =>
|
||||
"#SubObject_" + objectReferenceEntity.type + "_" + objectReferenceEntity.path
|
||||
static trackingMouseEventName = {
|
||||
begin: "ueb-tracking-mouse-begin",
|
||||
end: "ueb-tracking-mouse-end",
|
||||
|
||||
@@ -3,13 +3,12 @@ import Configuration from "./Configuration.js"
|
||||
import UnionType from "./entity/UnionType.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("./element/IElement").default} IElement
|
||||
* @typedef {import("./entity/IEntity").AnyValue} AnyValue
|
||||
* @typedef {import("./entity/IEntity").AnyValueConstructor<*>} AnyValueConstructor
|
||||
* @typedef {import("./entity/IEntity").AttributeInformation} TypeInformation
|
||||
* @typedef {import("./entity/IEntity").default} IEntity
|
||||
* @typedef {import("./entity/IEntity").EntityConstructor} EntityConstructor
|
||||
* @typedef {import("./entity/LinearColorEntity").default} LinearColorEntity
|
||||
* @typedef {import("./entity/IEntity.js").AnyValue} AnyValue
|
||||
* @typedef {import("./entity/IEntity.js").AnyValueConstructor<*>} AnyValueConstructor
|
||||
* @typedef {import("./entity/IEntity.js").AttributeInformation} TypeInformation
|
||||
* @typedef {import("./entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("./entity/IEntity.js").EntityConstructor} EntityConstructor
|
||||
* @typedef {import("./entity/LinearColorEntity.js").default} LinearColorEntity
|
||||
*/
|
||||
|
||||
export default class Utility {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @typedef {import("./IElement").default} IElement
|
||||
* @typedef {import("./IElement.js").default} IElement
|
||||
* @typedef {new (...args) => IElement} ElementConstructor
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import IDraggableElement from "./IDraggableElement.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/WindowElement").default} WindowElement
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../template/IDraggableControlTemplate").default} IDraggableControlTemplate
|
||||
* @typedef {import("../element/WindowElement.js").default} WindowElement
|
||||
* @typedef {import("../entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("../template/IDraggableControlTemplate.js").default} IDraggableControlTemplate
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,8 +3,8 @@ import IElement from "./IElement.js"
|
||||
import Utility from "../Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../template/IDraggableTemplate").default} IDraggableTemplate
|
||||
* @typedef {import("../entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("../template/IDraggableTemplate.js").default} IDraggableTemplate
|
||||
* @typedef {CustomEvent<{
|
||||
* value: [Number, Number]
|
||||
* }>} DragEvent
|
||||
|
||||
@@ -2,11 +2,10 @@ import { LitElement } from "lit"
|
||||
import Configuration from "../Configuration.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../Blueprint").default} Blueprint
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../input/IInput").default} IInput
|
||||
* @typedef {import("../template/ITemplate").default} ITemplate
|
||||
* @typedef {import("lit").PropertyDeclarations} PropertyDeclarations
|
||||
* @typedef {import("../Blueprint.js").default} Blueprint
|
||||
* @typedef {import("../entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("../input/IInput.js").default} IInput
|
||||
* @typedef {import("../template/ITemplate.js").default} ITemplate
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import IElement from "./IElement.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../template/ITemplate").default} ITemplate
|
||||
* @typedef {import("../entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("../template/ITemplate.js").default} ITemplate
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,9 +3,9 @@ import Utility from "../Utility.js"
|
||||
import IDraggableElement from "./IDraggableElement.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IDraggableElement").DragEvent} DragEvent
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../template/ISelectableDraggableTemplate").default} ISelectableDraggableTemplate
|
||||
* @typedef {import("../element/IDraggableElement.js").DragEvent} DragEvent
|
||||
* @typedef {import("../entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("../template/ISelectableDraggableTemplate.js").default} ISelectableDraggableTemplate
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,8 @@ import SVGIcon from "../SVGIcon.js"
|
||||
import Utility from "../Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IDraggableElement").DragEvent} DragEvent
|
||||
* @typedef {import("./PinElement").default} PinElement
|
||||
* @typedef {import("../element/IDraggableElement.js").DragEvent} DragEvent
|
||||
* @typedef {import("./PinElement.js").default} PinElement
|
||||
* @typedef {import("lit").TemplateResult<1>} TemplateResult
|
||||
* @typedef {typeof LinkElement} LinkElementConstructor
|
||||
*/
|
||||
|
||||
@@ -13,11 +13,13 @@ import Utility from "../Utility.js"
|
||||
import VariableAccessNodeTemplate from "../template/node/VariableAccessNodeTemplate.js"
|
||||
import VariableConversionNodeTemplate from "../template/node/VariableConversionNodeTemplate.js"
|
||||
import VariableOperationNodeTemplate from "../template/node/VariableOperationNodeTemplate.js"
|
||||
import UnknownPinEntity from "../entity/UnknownPinEntity.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("./IDraggableElement").DragEvent} DragEvent
|
||||
* @typedef {import("./IElement").default} IElement
|
||||
* @typedef {import("./PinElement").default} PinElement
|
||||
* @typedef {import("./IDraggableElement.js").DragEvent} DragEvent
|
||||
* @typedef {import("./IElement.js").default} IElement
|
||||
* @typedef {import("../entity/ObjectReferenceEntity.js").default} ObjectReferenceEntity
|
||||
* @typedef {import("./PinElement.js").default} PinElement
|
||||
* @typedef {typeof NodeElement} NodeElementConstructor
|
||||
*/
|
||||
|
||||
@@ -278,7 +280,15 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
|
||||
/** @returns {PinEntity[]} */
|
||||
getPinEntities() {
|
||||
return this.entity.CustomProperties.filter(v => v instanceof PinEntity)
|
||||
if (this.entity.CustomProperties.length > 0) {
|
||||
return this.entity.CustomProperties.filter(v => v instanceof PinEntity)
|
||||
}
|
||||
// Legacy nodes attempt to find pin entities
|
||||
if (this.entity.Pins) {
|
||||
return this.entity.Pins.map(objectReference =>
|
||||
new UnknownPinEntity(this.entity[Configuration.subObjectAttributeNameFromReference(objectReference)])
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
setLocation(x = 0, y = 0, acknowledge = true) {
|
||||
|
||||
@@ -21,9 +21,9 @@ import Vector2DPinTemplate from "../template/pin/Vector2DPinTemplate.js"
|
||||
import VectorPinTemplate from "../template/pin/VectorPinTemplate.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
|
||||
* @typedef {import("./LinkElement").LinkElementConstructor} LinkElementConstructor
|
||||
* @typedef {import("./NodeElement").default} NodeElement
|
||||
* @typedef {import("../entity/IEntity.js").AnyValue} AnyValue
|
||||
* @typedef {import("./LinkElement.js").LinkElementConstructor} LinkElementConstructor
|
||||
* @typedef {import("./NodeElement.js").default} NodeElement
|
||||
* @typedef {import("lit").CSSResult} CSSResult
|
||||
* @typedef {typeof PinElement} PinElementConstructor
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,7 @@ import FastSelectionModel from "../selection/FastSelectionModel.js"
|
||||
import IFromToPositionedElement from "./IFromToPositionedElement.js"
|
||||
import SelectorTemplate from "../template/SelectorTemplate.js"
|
||||
|
||||
/** @typedef {import("../Blueprint").BlueprintConstructor} BlueprintConstructor */
|
||||
/** @typedef {import("../Blueprint.js").BlueprintConstructor} BlueprintConstructor */
|
||||
|
||||
/** @extends {IFromToPositionedElement<Object, SelectorTemplate>} */
|
||||
export default class SelectorElement extends IFromToPositionedElement {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** @typedef {import("./IEntity").default} IEntity */
|
||||
/** @typedef {import("./IEntity.js").default} IEntity */
|
||||
|
||||
export default class ComputedType {
|
||||
|
||||
|
||||
@@ -199,7 +199,12 @@ export default class ObjectEntity extends IEntity {
|
||||
showDefault: false,
|
||||
},
|
||||
CustomProperties: {
|
||||
type: [new UnionType(PinEntity, UnknownPinEntity)]
|
||||
type: [new UnionType(PinEntity, UnknownPinEntity)],
|
||||
},
|
||||
// Legacy
|
||||
Pins: {
|
||||
type: [ObjectReferenceEntity],
|
||||
inlined: true,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -301,6 +306,8 @@ export default class ObjectEntity extends IEntity {
|
||||
/** @type {IntegerEntity?} */ this.ErrorType
|
||||
/** @type {String?} */ this.ErrorMsg
|
||||
/** @type {(PinEntity | UnknownPinEntity)[]} */ this.CustomProperties
|
||||
// Legacy
|
||||
/** @type {ObjectReferenceEntity[]} */ this.Pins
|
||||
}
|
||||
|
||||
getClass() {
|
||||
|
||||
@@ -22,7 +22,7 @@ import Vector2DEntity from "./Vector2DEntity.js"
|
||||
import VectorEntity from "./VectorEntity.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("./IEntity").AnyValue} AnyValue
|
||||
* @typedef {import("./IEntity.js").AnyValue} AnyValue
|
||||
* @typedef {import("lit").CSSResult} CSSResult
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** @typedef {import("./IEntity").AnyValueConstructor<*>} AnyValueConstructor */
|
||||
/** @typedef {import("./IEntity.js").AnyValueConstructor<*>} AnyValueConstructor */
|
||||
|
||||
export default class UnionType {
|
||||
|
||||
|
||||
@@ -3,4 +3,8 @@ import PinEntity from "./PinEntity.js"
|
||||
export default class UnknownPinEntity extends PinEntity {
|
||||
|
||||
static lookbehind = ""
|
||||
|
||||
constructor(values = {}) {
|
||||
super(values, true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Configuration from "../Configuration.js"
|
||||
|
||||
/** @typedef {import("../Blueprint").default} Blueprint */
|
||||
/** @typedef {import("../Blueprint.js").default} Blueprint */
|
||||
|
||||
/** @template {HTMLElement} T */
|
||||
export default class IInput {
|
||||
|
||||
@@ -2,7 +2,7 @@ import ElementFactory from "../../element/ElementFactory.js"
|
||||
import IInput from "../IInput.js"
|
||||
import ObjectSerializer from "../../serialization/ObjectSerializer.js"
|
||||
|
||||
/** @typedef {import("../../element/NodeElement").NodeElementConstructor} NodeElementConstructor */
|
||||
/** @typedef {import("../../element/NodeElement.js").NodeElementConstructor} NodeElementConstructor */
|
||||
|
||||
export default class Paste extends IInput {
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import Grammar from "../../serialization/Grammar.js"
|
||||
import IInput from "../IInput.js"
|
||||
import KeyBindingEntity from "../../entity/KeyBindingEntity.js"
|
||||
|
||||
/** @typedef {import("../../Blueprint").default} Blueprint */
|
||||
/** @typedef {import("../../Blueprint.js").default} Blueprint */
|
||||
|
||||
/**
|
||||
* @template {HTMLElement} T
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import Configuration from "../../Configuration.js"
|
||||
import IKeyboardShortcut from "./IKeyboardShortcut.js"
|
||||
|
||||
/** @typedef {import("../../Blueprint.js").default} Blueprint */
|
||||
|
||||
export default class KeyboardCanc extends IKeyboardShortcut {
|
||||
|
||||
/**
|
||||
* @param {HTMLElement} target
|
||||
* @param {import("../../Blueprint").default} blueprint
|
||||
* @param {Blueprint} blueprint
|
||||
* @param {Object} options
|
||||
*/
|
||||
constructor(target, blueprint, options = {}) {
|
||||
|
||||
@@ -2,6 +2,8 @@ import Configuration from "../../Configuration.js"
|
||||
import IKeyboardShortcut from "./IKeyboardShortcut.js"
|
||||
import Zoom from "../mouse/Zoom.js"
|
||||
|
||||
/** @typedef {import("../../Blueprint.js").default} Blueprint */
|
||||
|
||||
export default class KeyboardEnableZoom extends IKeyboardShortcut {
|
||||
|
||||
/** @type {Zoom} */
|
||||
@@ -9,7 +11,7 @@ export default class KeyboardEnableZoom extends IKeyboardShortcut {
|
||||
|
||||
/**
|
||||
* @param {HTMLElement} target
|
||||
* @param {import("../../Blueprint").default} blueprint
|
||||
* @param {Blueprint} blueprint
|
||||
* @param {Object} options
|
||||
*/
|
||||
constructor(target, blueprint, options = {}) {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Configuration from "../../Configuration.js"
|
||||
import IKeyboardShortcut from "./IKeyboardShortcut.js"
|
||||
|
||||
/** @typedef {import("../../Blueprint").default} Blueprint */
|
||||
/** @typedef {import("../../Blueprint.js").default} Blueprint */
|
||||
|
||||
export default class KeyboardSelectAll extends IKeyboardShortcut {
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import IKeyboardShortcut from "./IKeyboardShortcut.js"
|
||||
|
||||
/** @typedef {import("../../Blueprint").default} Blueprint */
|
||||
/** @typedef {import("../../Blueprint.js").default} Blueprint */
|
||||
|
||||
/**
|
||||
* @template {HTMLElement} T
|
||||
|
||||
@@ -4,8 +4,8 @@ import IPointing from "./IPointing.js"
|
||||
import Utility from "../../Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../Blueprint").default} Blueprint
|
||||
* @typedef {import("../../element/IElement").default} IElement
|
||||
* @typedef {import("../../Blueprint.js").default} Blueprint
|
||||
* @typedef {import("../../element/IElement.js").default} IElement
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import Configuration from "../../Configuration.js"
|
||||
import IPointing from "./IPointing.js"
|
||||
|
||||
/** @typedef {import("../../Blueprint.js").default} Blueprint */
|
||||
|
||||
export default class IMouseWheel extends IPointing {
|
||||
|
||||
/** @param {WheelEvent} e */
|
||||
@@ -15,7 +17,7 @@ export default class IMouseWheel extends IPointing {
|
||||
|
||||
/**
|
||||
* @param {HTMLElement} target
|
||||
* @param {import("../../Blueprint").default} blueprint
|
||||
* @param {Blueprint} blueprint
|
||||
* @param {Object} options
|
||||
*/
|
||||
constructor(target, blueprint, options = {}) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import IPointing from "./IPointing.js"
|
||||
|
||||
/** @typedef {import("../../Blueprint").default} Blueprint */
|
||||
|
||||
/**
|
||||
* @template {HTMLElement} T
|
||||
* @extends {IPointing<T>}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import MouseMoveDraggable from "./MouseMoveDraggable.js"
|
||||
|
||||
/** @typedef {import("../../Blueprint").default} Blueprint */
|
||||
/** @typedef {import("../../Blueprint.js").default} Blueprint */
|
||||
|
||||
export default class MouseClickDrag extends MouseMoveDraggable {
|
||||
|
||||
|
||||
@@ -3,12 +3,11 @@ import ElementFactory from "../../element/ElementFactory.js"
|
||||
import IMouseClickDrag from "./IMouseClickDrag.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../Blueprint").default} Blueprint
|
||||
* @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
|
||||
* @typedef {import("../../template/pin/KnotPinTemplate").default} KnotPinTemplate
|
||||
* @typedef {import("../../Blueprint.js").default} Blueprint
|
||||
* @typedef {import("../../element/LinkElement.js").default} LinkElement
|
||||
* @typedef {import("../../element/LinkElement.js").LinkElementConstructor} LinkElementConstructor
|
||||
* @typedef {import("../../element/PinElement.js").default} PinElement
|
||||
* @typedef {import("../../template/pin/KnotPinTemplate.js").default} KnotPinTemplate
|
||||
*/
|
||||
|
||||
/** @extends IMouseClickDrag<PinElement> */
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import IPointing from "./IPointing.js"
|
||||
|
||||
/** @typedef {import("../../Blueprint").default} Blueprint */
|
||||
|
||||
/**
|
||||
* @template {HTMLElement} T
|
||||
* @extends {IPointing<T>}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import IMouseClickDrag from "./IMouseClickDrag.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/IDraggableElement").default} IDraggableElement
|
||||
* @typedef {import("../../element/IDraggableElement.js").default} IDraggableElement
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,8 +2,7 @@ import IMouseClickDrag from "./IMouseClickDrag.js"
|
||||
import Utility from "../../Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../Blueprint").default} Blueprint
|
||||
* @typedef {import("../../element/IDraggableElement").default} IDraggableElement
|
||||
* @typedef {import("../../element/IDraggableElement.js").default} IDraggableElement
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import MouseMoveDraggable from "./MouseMoveDraggable.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../Blueprint").default} Blueprint
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../template/node/CommentNodeTemplate").default} CommentNodeTemplate
|
||||
* @typedef {import("../../element/NodeElement.js").default} NodeElement
|
||||
* @typedef {import("../../template/node/CommentNodeTemplate.js").default} CommentNodeTemplate
|
||||
*/
|
||||
|
||||
/** @extends {MouseMoveDraggable<NodeElement>} */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import OrderedIndexArray from "./OrderedIndexArray.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/NodeElement").default} NodeElement
|
||||
* @typedef {typeof import("../Blueprint").default.nodeBoundariesSupplier} BoundariesFunction
|
||||
* @typedef {typeof import("../Blueprint").default.nodeSelectToggleFunction} SelectionFunction
|
||||
* @typedef {import("../element/NodeElement.js").default} NodeElement
|
||||
* @typedef {typeof import("../Blueprint.js").default.nodeBoundariesSupplier} BoundariesFunction
|
||||
* @typedef {typeof import("../Blueprint.js").default.nodeSelectToggleFunction} SelectionFunction
|
||||
* @typedef {{
|
||||
* primaryBoundary: Number,
|
||||
* secondaryBoundary: Number,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @typedef {import("../element/NodeElement").default} NodeElement
|
||||
* @typedef {typeof import("../Blueprint").default.nodeBoundariesSupplier} BoundariesFunction
|
||||
* @typedef {typeof import("../Blueprint").default.nodeSelectToggleFunction} SelectionFunction
|
||||
* @typedef {import("../element/NodeElement.js").default} NodeElement
|
||||
* @typedef {typeof import("../Blueprint.js").default.nodeBoundariesSupplier} BoundariesFunction
|
||||
* @typedef {typeof import("../Blueprint.js").default.nodeSelectToggleFunction} SelectionFunction
|
||||
* @typedef {{
|
||||
* primaryBoundary: Number,
|
||||
* secondaryBoundary: Number,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import Serializer from "./Serializer.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
|
||||
* @typedef {import("../entity/IEntity").AnyValueConstructor<*>} AnyValueConstructor
|
||||
* @typedef {import("../entity/IEntity.js").AnyValue} AnyValue
|
||||
* @typedef {import("../entity/IEntity.js").AnyValueConstructor<*>} AnyValueConstructor
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -652,7 +652,7 @@ export default class Grammar {
|
||||
static subObjectEntity = P.lazy(() =>
|
||||
this.objectEntity
|
||||
.map(object =>
|
||||
values => values["SubObject_" + object.Name] = object
|
||||
values => values[Configuration.subObjectAttributeNameFromEntity(object)] = object
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ export default class ObjectSerializer extends Serializer {
|
||||
)
|
||||
}
|
||||
let result = indentation + "Begin Object"
|
||||
+ (entity.Class.path ? ` Class=${entity.Class.path}` : "")
|
||||
+ (entity.Class.type || entity.Class.path ? ` Class=${this.doWriteValue(entity.Class, insideString)}` : "")
|
||||
+ (entity.Name ? ` Name=${this.doWriteValue(entity.Name, insideString)}` : "")
|
||||
+ "\n"
|
||||
+ super.doWrite(
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
|
||||
* @typedef {import("../entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("../entity/IEntity.js").AnyValue} AnyValue
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {AnyValue} T
|
||||
* @typedef {import("../entity/IEntity").AnyValueConstructor<T>} AnyValueConstructor
|
||||
* @typedef {import("../entity/IEntity.js").AnyValueConstructor<T>} AnyValueConstructor
|
||||
*/
|
||||
/**
|
||||
* @template {AnyValue} T
|
||||
* @typedef {import("./Serializer").default<T>} Serializer
|
||||
* @typedef {import("./Serializer.js").default<T>} Serializer
|
||||
*/
|
||||
|
||||
export default class SerializerFactory {
|
||||
|
||||
@@ -2,8 +2,8 @@ import Serializer from "./Serializer.js"
|
||||
import Utility from "../Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
|
||||
* @typedef {import("../entity/IEntity").AnyValueConstructor<*>} AnyValueConstructor
|
||||
* @typedef {import("../entity/IEntity.js").AnyValue} AnyValue
|
||||
* @typedef {import("../entity/IEntity.js").AnyValueConstructor<*>} AnyValueConstructor
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,10 +33,7 @@ import VariableReferenceEntity from "../entity/VariableReferenceEntity.js"
|
||||
import Vector2DEntity from "../entity/Vector2DEntity.js"
|
||||
import VectorEntity from "../entity/VectorEntity.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").AnySimpleValue} AnySimpleValue
|
||||
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
|
||||
*/
|
||||
/** @typedef {import("../entity/IEntity.js").AnySimpleValue} AnySimpleValue */
|
||||
|
||||
export default function initializeSerializerFactory() {
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ import Utility from "../Utility.js"
|
||||
import Zoom from "../input/mouse/Zoom.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../Blueprint").default} Blueprint
|
||||
* @typedef {import("../element/PinElement").default} PinElement
|
||||
* @typedef {import("../element/SelectorElement").default} SelectorElement
|
||||
* @typedef {import("../entity/PinReferenceEntity").default} PinReferenceEntity
|
||||
* @typedef {import("../Blueprint.js").default} Blueprint
|
||||
* @typedef {import("../element/PinElement.js").default} PinElement
|
||||
* @typedef {import("../element/SelectorElement.js").default} SelectorElement
|
||||
* @typedef {import("../entity/PinReferenceEntity.js").default} PinReferenceEntity
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import IDraggableControlTemplate from "./IDraggableControlTemplate.js"
|
||||
import Utility from "../Utility.js"
|
||||
|
||||
/** @typedef {import("../element/ColorHandlerElement").default} ColorHandlerElement */
|
||||
/** @typedef {import("../element/ColorHandlerElement.js").default} ColorHandlerElement */
|
||||
|
||||
/** @extends {IDraggableControlTemplate<ColorHandlerElement>} */
|
||||
export default class ColorHandlerTemplate extends IDraggableControlTemplate {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import IDraggableControlTemplate from "./IDraggableControlTemplate.js"
|
||||
import Utility from "../Utility.js"
|
||||
|
||||
/** @typedef {import("../element/ColorHandlerElement").default} ColorHandlerElement */
|
||||
/** @typedef {import("../element/ColorHandlerElement.js").default} ColorHandlerElement */
|
||||
|
||||
/** @extends {IDraggableControlTemplate<ColorHandlerElement>} */
|
||||
export default class ColorSliderTemplate extends IDraggableControlTemplate {
|
||||
|
||||
@@ -2,7 +2,7 @@ import IDraggableTemplate from "./IDraggableTemplate.js"
|
||||
import MouseMoveDraggable from "../input/mouse/MouseMoveDraggable.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IDraggableElement").default} IDraggableElement
|
||||
* @typedef {import("../element/IDraggableElement.js").default} IDraggableElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import IDraggableTemplate from "./IDraggableTemplate.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IDraggableElement").default} IDraggableElement
|
||||
* @typedef {import("../element/IDraggableElement.js").default} IDraggableElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,10 +3,7 @@ import ITemplate from "./ITemplate.js"
|
||||
import KeyboardShortcutAction from "../input/keybaord/KeyboardShortcutAction.js"
|
||||
import MouseMoveDraggable from "../input/mouse/MouseMoveDraggable.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../element/IDraggableElement").default} IDraggableElement
|
||||
*/
|
||||
/** @typedef {import("../element/IDraggableElement.js").default} IDraggableElement */
|
||||
|
||||
/**
|
||||
* @template {IDraggableElement} T
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import ITemplate from "./ITemplate.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IFromToPositionedElement").default} IFromToPositionedElement
|
||||
* @typedef {import("../element/IFromToPositionedElement.js").default} IFromToPositionedElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import MouseClickDrag from "../input/mouse/MouseClickDrag.js"
|
||||
import NodeTemplate from "./node/NodeTemplate.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../element/NodeElement.js").default} NodeElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ import IDraggablePositionedTemplate from "./IDraggablePositionedTemplate.js"
|
||||
import MouseMoveNodes from "../input/mouse/MouseMoveNodes.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../element/NodeElement.js").default} NodeElement
|
||||
* @typedef {import("../input/mouse/MouseMoveDraggable.js").default} MouseMoveDraggable
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
* @typedef {import("../input/mouse/MouseMoveDraggable").default} MouseMoveDraggable
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { html } from "lit"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IElement").default} IElement
|
||||
* @typedef {import("../input/IInput").default} IInput
|
||||
* @typedef {import("../element/IElement.js").default} IElement
|
||||
* @typedef {import("../input/IInput.js").default} IInput
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ import MouseDbClick from "../input/mouse/MouseDbClick.js"
|
||||
import Utility from "../Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/LinkElement").default} LinkElement
|
||||
* @typedef {import("../element/LinkElement").LinkElementConstructor} LinkElementConstructor
|
||||
* @typedef {import("../element/NodeElement").NodeElementConstructor} NodeElementConstructor
|
||||
* @typedef {import("./node/KnotNodeTemplate").default} KnotNodeTemplate
|
||||
* @typedef {import("../element/LinkElement.js").default} LinkElement
|
||||
* @typedef {import("../element/LinkElement.js").LinkElementConstructor} LinkElementConstructor
|
||||
* @typedef {import("../element/NodeElement.js").NodeElementConstructor} NodeElementConstructor
|
||||
* @typedef {import("./node/KnotNodeTemplate.js").default} KnotNodeTemplate
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import IFromToPositionedTemplate from "./IFromToPositionedTemplate.js"
|
||||
|
||||
/** @typedef {import("../element/SelectorElement").default} SelectorElement */
|
||||
/** @typedef {import("../element/SelectorElement.js").default} SelectorElement */
|
||||
|
||||
/** @extends IFromToPositionedTemplate<SelectorElement> */
|
||||
export default class SelectorTemplate extends IFromToPositionedTemplate {
|
||||
|
||||
@@ -5,8 +5,7 @@ import LinearColorEntity from "../../entity/LinearColorEntity.js"
|
||||
import Utility from "../../Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
* @typedef {import("../../element/NodeElement.js").default} NodeElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import MinimalPinTemplate from "../pin/MinimalPinTemplate.js"
|
||||
import NodeTemplate from "./NodeTemplate.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/PinElement").PinElementConstructor} PinElementConstructor
|
||||
* @typedef {import("../../element/PinElement.js").PinElementConstructor} PinElementConstructor
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ import KnotPinTemplate from "../pin/KnotPinTemplate.js"
|
||||
import NodeTemplate from "./NodeTemplate.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
* @typedef {import("../../element/PinElement").PinElementConstructor} PinElementConstructor
|
||||
* @typedef {import("../../element/NodeElement.js").default} NodeElement
|
||||
* @typedef {import("../../element/PinElement.js").default} PinElement
|
||||
* @typedef {import("../../element/PinElement.js").PinElementConstructor} PinElementConstructor
|
||||
*/
|
||||
|
||||
export default class KnotNodeTemplate extends NodeTemplate {
|
||||
|
||||
@@ -5,9 +5,9 @@ import SVGIcon from "../../SVGIcon.js"
|
||||
import Utility from "../../Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../element/PinElement").default} PinElement
|
||||
* @typedef {import("../../element/PinElement").PinElementConstructor} PinElementConstructor
|
||||
* @typedef {import("../../element/NodeElement.js").default} NodeElement
|
||||
* @typedef {import("../../element/PinElement.js").default} PinElement
|
||||
* @typedef {import("../../element/PinElement.js").PinElementConstructor} PinElementConstructor
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Configuration from "../../Configuration.js"
|
||||
import VariableManagementNodeTemplate from "./VariableMangementNodeTemplate.js"
|
||||
|
||||
/** @typedef {import("../../element/NodeElement").default} NodeElement */
|
||||
/** @typedef {import("../../element/NodeElement.js").default} NodeElement */
|
||||
|
||||
export default class VariableAccessNodeTemplate extends VariableManagementNodeTemplate {
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import VariableManagementNodeTemplate from "./VariableMangementNodeTemplate.js"
|
||||
|
||||
/** @typedef {import("../../element/NodeElement").default} NodeElement */
|
||||
|
||||
export default class VariableConversionNodeTemplate extends VariableManagementNodeTemplate {
|
||||
|
||||
static nodeStyleClasses = [...super.nodeStyleClasses, "ueb-node-style-conversion"]
|
||||
|
||||
@@ -3,8 +3,8 @@ import ElementFactory from "../../element/ElementFactory.js"
|
||||
import NodeTemplate from "./NodeTemplate.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../element/PinElement").PinElementConstructor} PinElementConstructor
|
||||
* @typedef {import("../../element/NodeElement.js").default} NodeElement
|
||||
* @typedef {import("../../element/PinElement.js").PinElementConstructor} PinElementConstructor
|
||||
*/
|
||||
|
||||
export default class VariableManagementNodeTemplate extends NodeTemplate {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import VariableManagementNodeTemplate from "./VariableMangementNodeTemplate.js"
|
||||
|
||||
/** @typedef {import("../../element/NodeElement").default} NodeElement */
|
||||
|
||||
export default class VariableOperationNodeTemplate extends VariableManagementNodeTemplate {
|
||||
|
||||
static nodeStyleClasses = [...super.nodeStyleClasses, "ueb-node-style-operation"]
|
||||
|
||||
@@ -3,8 +3,6 @@ import PinTemplate from "./PinTemplate.js"
|
||||
import SVGIcon from "../../SVGIcon.js"
|
||||
import Utility from "../../Utility.js"
|
||||
|
||||
/** @typedef {import("../../element/PinElement").default} PinElement */
|
||||
|
||||
export default class ExecPinTemplate extends PinTemplate {
|
||||
|
||||
renderIcon() {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import IntPinTemplate from "./IntPinTemplate.js"
|
||||
|
||||
/** @typedef {import("../../entity/IntegerEntity").default} IntegerEntity */
|
||||
|
||||
export default class Int64PinTemplate extends IntPinTemplate {
|
||||
|
||||
/** @param {String[]} values */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { html } from "lit"
|
||||
import INumericPinTemplate from "./INumericPinTemplate.js"
|
||||
|
||||
/** @typedef {import("../../entity/IntegerEntity").default} IntegerEntity */
|
||||
/** @typedef {import("../../entity/IntegerEntity.js").default} IntegerEntity */
|
||||
|
||||
/** @extends INumericPinTemplate<IntegerEntity> */
|
||||
export default class IntPinTemplate extends INumericPinTemplate {
|
||||
|
||||
@@ -3,8 +3,8 @@ import MinimalPinTemplate from "./MinimalPinTemplate.js"
|
||||
import Utility from "../../Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../node/KnotNodeTemplate").default} KnotNodeTemplate
|
||||
* @typedef {import("../../entity/PinEntity").default} KnotEntity
|
||||
* @typedef {import("../../entity/PinEntity.js").default} KnotEntity
|
||||
* @typedef {import("../node/KnotNodeTemplate.js").default} KnotNodeTemplate
|
||||
*/
|
||||
|
||||
/** @extends MinimalPinTemplate<KnotEntity> */
|
||||
|
||||
@@ -5,9 +5,9 @@ import ElementFactory from "../../element/ElementFactory.js"
|
||||
import PinTemplate from "./PinTemplate.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/WindowElement").default} WindowElement
|
||||
* @typedef {import("../../element/WindowElement").WindowElementConstructor} WindowElementConstructor
|
||||
* @typedef {import("../../entity/LinearColorEntity").default} LinearColorEntity
|
||||
* @typedef {import("../../element/WindowElement.js").default} WindowElement
|
||||
* @typedef {import("../../element/WindowElement.js").WindowElementConstructor} WindowElementConstructor
|
||||
* @typedef {import("../../entity/LinearColorEntity.js").default} LinearColorEntity
|
||||
*/
|
||||
|
||||
/** @extends PinTemplate<LinearColorEntity> */
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { html } from "lit"
|
||||
import PinTemplate from "./PinTemplate.js"
|
||||
|
||||
/** @typedef {import("../../entity/IEntity.js").AnyValue} AnyValue */
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import("../../element/PinElement").default<T>} PinElement
|
||||
* @template {AnyValue} T
|
||||
* @typedef {import("../../element/PinElement.js").default<T>} PinElement
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @template {AnyValue} T
|
||||
* @extends PinTemplate<PinElement<T>>
|
||||
*/
|
||||
export default class MinimalPinTemplate extends PinTemplate {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import IInputPinTemplate from "./IInputPinTemplate.js"
|
||||
|
||||
/** @typedef {import("../../element/PinElement").default} PinElement */
|
||||
|
||||
export default class NamePinTemplate extends IInputPinTemplate {
|
||||
|
||||
static singleLineInput = true
|
||||
|
||||
@@ -7,12 +7,12 @@ import VariableConversionNodeTemplate from "../node/VariableConversionNodeTempla
|
||||
import VariableOperationNodeTemplate from "../node/VariableOperationNodeTemplate.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../input/IInput").default} IInput
|
||||
* @typedef {import("../../input/IInput.js").default} IInput
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import("../../element/PinElement").default<T>} PinElement
|
||||
* @typedef {import("../../element/PinElement.js").default<T>} PinElement
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ import INumericPinTemplate from "./INumericPinTemplate.js"
|
||||
import RotatorEntity from "../../entity/RotatorEntity.js"
|
||||
import Utility from "../../Utility.js"
|
||||
|
||||
/** @typedef {import("../../entity/RotatorEntity").default} Rotator */
|
||||
/** @typedef {import("../../entity/RotatorEntity.js").default} Rotator */
|
||||
|
||||
/** @extends INumericPinTemplate<Rotator> */
|
||||
export default class RotatorPinTemplate extends INumericPinTemplate {
|
||||
|
||||
@@ -8,7 +8,7 @@ import Utility from "../../Utility.js"
|
||||
import WindowTemplate from "./WindowTemplate.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../element/WindowElement").default} WindowElement
|
||||
* @typedef {import("../../element/WindowElement.js").default} WindowElement
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import IDraggablePositionedTemplate from "../IDraggablePositionedTemplate.js"
|
||||
import MouseMoveDraggable from "../../input/mouse/MouseMoveDraggable.js"
|
||||
import SVGIcon from "../../SVGIcon.js"
|
||||
|
||||
/** @typedef {import("../../element/WindowElement").default} WindowElement */
|
||||
/** @typedef {import("../../element/WindowElement.js").default} WindowElement */
|
||||
|
||||
/** @extends {IDraggablePositionedTemplate<WindowElement>} */
|
||||
export default class WindowTemplate extends IDraggablePositionedTemplate {
|
||||
|
||||
Reference in New Issue
Block a user