Move node templates to sub directory

This commit is contained in:
barsdeveloper
2022-12-17 10:50:57 +01:00
parent 60a8aa544a
commit d9216d0d40
10 changed files with 31 additions and 36 deletions

22
dist/ueblueprint.js vendored
View File

@@ -2443,7 +2443,6 @@ class Grammar {
/** @template {AnyValue} T */ /** @template {AnyValue} T */
class ISerializer { class ISerializer {
// @ts-expect-error
static grammar = Parsimmon.createLanguage(new Grammar()) static grammar = Parsimmon.createLanguage(new Grammar())
/** @param {AnyValueConstructor<T>} entityType */ /** @param {AnyValueConstructor<T>} entityType */
@@ -2736,7 +2735,6 @@ class IKeyboardShortcut extends IInput {
return v return v
} }
if (v.constructor === String) { if (v.constructor === String) {
// @ts-expect-error
const parsed = ISerializer.grammar.KeyBinding.parse(v); const parsed = ISerializer.grammar.KeyBinding.parse(v);
if (parsed.status) { if (parsed.status) {
return parsed.value return parsed.value
@@ -3935,7 +3933,7 @@ class MouseDbClick extends IPointing {
/** /**
* @typedef {import("../element/LinkElement").default} LinkElement * @typedef {import("../element/LinkElement").default} LinkElement
* @typedef {import("../element/NodeElement").default} NodeElement * @typedef {import("../element/NodeElement").default} NodeElement
* @typedef {import("../template/KnotNodeTemplate").default} KnotNodeTemplate * @typedef {import("./node/KnotNodeTemplate").default} KnotNodeTemplate
*/ */
@@ -4788,8 +4786,8 @@ class ISelectableDraggableTemplate extends IDraggablePositionedTemplate {
} }
/** /**
* @typedef {import("../element/NodeElement").default} NodeElement * @typedef {import("../../element/NodeElement").default} NodeElement
* @typedef {import("../element/PinElement").default} PinElement * @typedef {import("../../element/PinElement").default} PinElement
*/ */
/** @extends {ISelectableDraggableTemplate<NodeElement>} */ /** @extends {ISelectableDraggableTemplate<NodeElement>} */
@@ -5267,7 +5265,7 @@ class ISelectableDraggableElement extends IDraggableElement {
/** /**
* @typedef {import("../../element/PinElement").default} PinElement * @typedef {import("../../element/PinElement").default} PinElement
* @typedef {import("../../element/LinkElement").default} LinkElement * @typedef {import("../../element/LinkElement").default} LinkElement
* @typedef {import("../../template/KnotNodeTemplate").default} KnotNodeTemplate * @typedef {import("../../template/node/KnotNodeTemplate").default} KnotNodeTemplate
*/ */
/** @extends IMouseClickDrag<PinElement> */ /** @extends IMouseClickDrag<PinElement> */
@@ -5481,7 +5479,7 @@ class PinTemplate extends ITemplate {
} }
} }
/** @typedef {import("./../KnotNodeTemplate").default} KnotNodeTemplate */ /** @typedef {import("../node/KnotNodeTemplate").default} KnotNodeTemplate */
class KnotPinTemplate extends PinTemplate { class KnotPinTemplate extends PinTemplate {
@@ -5508,8 +5506,8 @@ class KnotPinTemplate extends PinTemplate {
} }
/** /**
* @typedef {import("../element/NodeElement").default} NodeElement * @typedef {import("../../element/NodeElement").default} NodeElement
* @typedef {import("../element/PinElement").default} PinElement * @typedef {import("../../element/PinElement").default} PinElement
*/ */
class KnotNodeTemplate extends NodeTemplate { class KnotNodeTemplate extends NodeTemplate {
@@ -5600,8 +5598,8 @@ class KnotNodeTemplate extends NodeTemplate {
} }
/** /**
* @typedef {import("../element/NodeElement").default} NodeElement * @typedef {import("../../element/NodeElement").default} NodeElement
* @typedef {import("../element/PinElement").default} PinElement * @typedef {import("../../element/PinElement").default} PinElement
*/ */
class VariableAccessNodeTemplate extends NodeTemplate { class VariableAccessNodeTemplate extends NodeTemplate {
@@ -7758,7 +7756,6 @@ class PinElement extends IElement {
type: GuidEntity, type: GuidEntity,
converter: { converter: {
fromAttribute: (value, type) => value fromAttribute: (value, type) => value
// @ts-expect-error
? ISerializer.grammar.Guid.parse(value).value ? ISerializer.grammar.Guid.parse(value).value
: null, : null,
toAttribute: (value, type) => value?.toString(), toAttribute: (value, type) => value?.toString(),
@@ -7780,7 +7777,6 @@ class PinElement extends IElement {
type: LinearColorEntity, type: LinearColorEntity,
converter: { converter: {
fromAttribute: (value, type) => value fromAttribute: (value, type) => value
// @ts-expect-error
? ISerializer.grammar.LinearColorFromAnyColor.parse(value).value ? ISerializer.grammar.LinearColorFromAnyColor.parse(value).value
: null, : null,
toAttribute: (value, type) => value ? Utility.printLinearColor(value) : null, toAttribute: (value, type) => value ? Utility.printLinearColor(value) : null,

View File

@@ -2,14 +2,14 @@ import CommentNodeTemplate from "../template/node/CommentNodeTemplate"
import Configuration from "../Configuration" import Configuration from "../Configuration"
import IdentifierEntity from "../entity/IdentifierEntity" import IdentifierEntity from "../entity/IdentifierEntity"
import ISelectableDraggableElement from "./ISelectableDraggableElement" import ISelectableDraggableElement from "./ISelectableDraggableElement"
import KnotNodeTemplate from "../template/KnotNodeTemplate" import KnotNodeTemplate from "../template/node/KnotNodeTemplate"
import NodeTemplate from "../template/NodeTemplate" import NodeTemplate from "../template/node/NodeTemplate"
import ObjectEntity from "../entity/ObjectEntity" import ObjectEntity from "../entity/ObjectEntity"
import PinEntity from "../entity/PinEntity" import PinEntity from "../entity/PinEntity"
import PinReferenceEntity from "../entity/PinReferenceEntity" import PinReferenceEntity from "../entity/PinReferenceEntity"
import SerializerFactory from "../serialization/SerializerFactory" import SerializerFactory from "../serialization/SerializerFactory"
import Utility from "../Utility" import Utility from "../Utility"
import VariableAccessNodeTemplate from "../template/VariableAccessNodeTemplate" import VariableAccessNodeTemplate from "../template/node/VariableAccessNodeTemplate"
/** @typedef {import("./IElement").default} IElement */ /** @typedef {import("./IElement").default} IElement */

View File

@@ -5,7 +5,7 @@ import IMouseClickDrag from "./IMouseClickDrag"
/** /**
* @typedef {import("../../element/PinElement").default} PinElement * @typedef {import("../../element/PinElement").default} PinElement
* @typedef {import("../../element/LinkElement").default} LinkElement * @typedef {import("../../element/LinkElement").default} LinkElement
* @typedef {import("../../template/KnotNodeTemplate").default} KnotNodeTemplate * @typedef {import("../../template/node/KnotNodeTemplate").default} KnotNodeTemplate
*/ */
/** @extends IMouseClickDrag<PinElement> */ /** @extends IMouseClickDrag<PinElement> */

View File

@@ -15,7 +15,6 @@ import Utility from "../Utility"
/** @template {AnyValue} T */ /** @template {AnyValue} T */
export default class ISerializer { export default class ISerializer {
// @ts-expect-error
static grammar = Parsimmon.createLanguage(new Grammar()) static grammar = Parsimmon.createLanguage(new Grammar())
/** @param {AnyValueConstructor<T>} entityType */ /** @param {AnyValueConstructor<T>} entityType */

View File

@@ -1,5 +1,5 @@
import MouseClickDrag from "../input/mouse/MouseClickDrag" import MouseClickDrag from "../input/mouse/MouseClickDrag"
import NodeTemplate from "./NodeTemplate" import NodeTemplate from "./node/NodeTemplate"
/** @typedef {import("../element/NodeElement").default} NodeElement */ /** @typedef {import("../element/NodeElement").default} NodeElement */

View File

@@ -9,7 +9,7 @@ import Utility from "../Utility"
/** /**
* @typedef {import("../element/LinkElement").default} LinkElement * @typedef {import("../element/LinkElement").default} LinkElement
* @typedef {import("../element/NodeElement").default} NodeElement * @typedef {import("../element/NodeElement").default} NodeElement
* @typedef {import("../template/KnotNodeTemplate").default} KnotNodeTemplate * @typedef {import("./node/KnotNodeTemplate").default} KnotNodeTemplate
*/ */

View File

@@ -1,12 +1,12 @@
import { html } from "lit" import { html } from "lit"
import Configuration from "../Configuration" import Configuration from "../../Configuration"
import ElementFactory from "../element/ElementFactory" import ElementFactory from "../../element/ElementFactory"
import KnotPinTemplate from "./pin/KnotPinTemplate" import KnotPinTemplate from "../pin/KnotPinTemplate"
import NodeTemplate from "./NodeTemplate" import NodeTemplate from "./NodeTemplate"
/** /**
* @typedef {import("../element/NodeElement").default} NodeElement * @typedef {import("../../element/NodeElement").default} NodeElement
* @typedef {import("../element/PinElement").default} PinElement * @typedef {import("../../element/PinElement").default} PinElement
*/ */
export default class KnotNodeTemplate extends NodeTemplate { export default class KnotNodeTemplate extends NodeTemplate {

View File

@@ -1,13 +1,13 @@
import { css, html, nothing } from "lit" import { css, html, nothing } from "lit"
import Configuration from "../Configuration" import Configuration from "../../Configuration"
import ElementFactory from "../element/ElementFactory" import ElementFactory from "../../element/ElementFactory"
import ISelectableDraggableTemplate from "./ISelectableDraggableTemplate" import ISelectableDraggableTemplate from "../ISelectableDraggableTemplate"
import SVGIcon from "../SVGIcon" import SVGIcon from "../../SVGIcon"
import Utility from "../Utility" import Utility from "../../Utility"
/** /**
* @typedef {import("../element/NodeElement").default} NodeElement * @typedef {import("../../element/NodeElement").default} NodeElement
* @typedef {import("../element/PinElement").default} PinElement * @typedef {import("../../element/PinElement").default} PinElement
*/ */
/** @extends {ISelectableDraggableTemplate<NodeElement>} */ /** @extends {ISelectableDraggableTemplate<NodeElement>} */

View File

@@ -1,10 +1,10 @@
import { html, nothing } from "lit" import { html, nothing } from "lit"
import ElementFactory from "../element/ElementFactory" import ElementFactory from "../../element/ElementFactory"
import NodeTemplate from "./NodeTemplate" import NodeTemplate from "./NodeTemplate"
/** /**
* @typedef {import("../element/NodeElement").default} NodeElement * @typedef {import("../../element/NodeElement").default} NodeElement
* @typedef {import("../element/PinElement").default} PinElement * @typedef {import("../../element/PinElement").default} PinElement
*/ */
export default class VariableAccessNodeTemplate extends NodeTemplate { export default class VariableAccessNodeTemplate extends NodeTemplate {

View File

@@ -2,7 +2,7 @@ import { html } from "lit"
import PinTemplate from "./PinTemplate" import PinTemplate from "./PinTemplate"
import Utility from "../../Utility" import Utility from "../../Utility"
/** @typedef {import("./../KnotNodeTemplate").default} KnotNodeTemplate */ /** @typedef {import("../node/KnotNodeTemplate").default} KnotNodeTemplate */
export default class KnotPinTemplate extends PinTemplate { export default class KnotPinTemplate extends PinTemplate {