From 9fc936f228475005c4006961d0ab015dd3c1774f Mon Sep 17 00:00:00 2001 From: barsdeveloper Date: Wed, 24 May 2023 19:45:01 +0200 Subject: [PATCH] How to use --- README.md | 24 +++++++++++++++++++++++- index.html | 5 +---- js/entity/IEntity.js | 1 + js/entity/PinEntity.js | 1 + js/serialization/ObjectSerializer.js | 1 + js/serialization/Serializer.js | 1 + 6 files changed, 28 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 832a4b7..b9ac162 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,26 @@ A stand alone editor implementation of the UE's Blueprint visual language. (WIP) ## How to use: -TODO +1. Include `dist/css/ueb-style.css` stylesheet in your page. +2. Define eventual CSS variables +```HTML + +``` +3. Import the class Blueprint in JavaScript (this library uses modules). +```HTML + +``` +4. Define your blueprint the by just writing the code inside a `ueb-blueprint`, inside a `template` element +```HTML + + + +``` diff --git a/index.html b/index.html index 9e3026f..e63a991 100755 --- a/index.html +++ b/index.html @@ -4,12 +4,9 @@ UE Blueprint - diff --git a/js/entity/IEntity.js b/js/entity/IEntity.js index 9ee26e6..8f08487 100644 --- a/js/entity/IEntity.js +++ b/js/entity/IEntity.js @@ -184,6 +184,7 @@ export default class IEntity { } else if (attributeType instanceof ComputedType) { return undefined } else { + // @ts-expect-error return () => new attributeType() } } diff --git a/js/entity/PinEntity.js b/js/entity/PinEntity.js index d39a09e..27cfc9a 100755 --- a/js/entity/PinEntity.js +++ b/js/entity/PinEntity.js @@ -213,6 +213,7 @@ export default class PinEntity extends IEntity { getDefaultValue(maybeCreate = false) { if (this.DefaultValue === undefined && maybeCreate) { + // @ts-expect-error this.DefaultValue = new (this.getEntityType(true))() } return this.DefaultValue diff --git a/js/serialization/ObjectSerializer.js b/js/serialization/ObjectSerializer.js index 7e23c84..494572f 100755 --- a/js/serialization/ObjectSerializer.js +++ b/js/serialization/ObjectSerializer.js @@ -74,6 +74,7 @@ export default class ObjectSerializer extends Serializer { attributeSeparator, trailingSeparator, attributeValueConjunctionSign, + // @ts-expect-error key => entity[key] instanceof ObjectEntity ? "" : attributeKeyPrinter(key) ) } diff --git a/js/serialization/Serializer.js b/js/serialization/Serializer.js index b568df5..21f4231 100644 --- a/js/serialization/Serializer.js +++ b/js/serialization/Serializer.js @@ -49,6 +49,7 @@ export default class Serializer { /** @param {T} value */ write(value, insideString = false) { + // @ts-expect-error return this.doWrite(value, insideString) }