How to use

This commit is contained in:
barsdeveloper
2023-05-24 19:45:01 +02:00
parent 4b7bce2211
commit 9fc936f228
6 changed files with 28 additions and 5 deletions

View File

@@ -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
<style>
ueb-blueprint {
--ueb-height: 500px;
}
</style>
```
3. Import the class Blueprint in JavaScript (this library uses modules).
```HTML
<script type="module">
import { Blueprint } from "./dist/ueblueprint.js"
</script>
```
4. Define your blueprint the by just writing the code inside a `ueb-blueprint`, inside a `template` element
```HTML
<ueb-blueprint>
<template>
...
</template>
</ueb-blueprint>
```

View File

@@ -4,12 +4,9 @@
<head>
<meta charset="utf-8" />
<title>UE Blueprint</title>
<link rel="stylesheet" href="dist/css/ueblueprint-node-value-type-color.css">
<link rel="stylesheet" href="dist/css/ueb-style.css">
<style>
body {
margin: 0;
padding: 0;
ueb-blueprint {
--ueb-height: 100vh;
}
</style>

View File

@@ -184,6 +184,7 @@ export default class IEntity {
} else if (attributeType instanceof ComputedType) {
return undefined
} else {
// @ts-expect-error
return () => new attributeType()
}
}

View File

@@ -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

View File

@@ -74,6 +74,7 @@ export default class ObjectSerializer extends Serializer {
attributeSeparator,
trailingSeparator,
attributeValueConjunctionSign,
// @ts-expect-error
key => entity[key] instanceof ObjectEntity ? "" : attributeKeyPrinter(key)
)
}

View File

@@ -49,6 +49,7 @@ export default class Serializer {
/** @param {T} value */
write(value, insideString = false) {
// @ts-expect-error
return this.doWrite(value, insideString)
}