@lightningjs/blits 0.3.13 → 0.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.3.14
4
+
5
+ _19 oct 2023_
6
+
7
+ - Fixed error when `<Text />`-component doesn't have any content
8
+ - Removed generic escape key handler that closed the App
9
+ - Introduced `quit()`-method on the root Application component
10
+ - Updated to v0.4.0 of the renderer
11
+
3
12
  ## v0.3.13
4
13
 
5
14
  _18 oct 2023_
@@ -7,7 +16,8 @@ _18 oct 2023_
7
16
  - Added support for `borderTop`, `borderBottom`, `borderLeft`, `borderRight` and `grayScale` effects
8
17
  - Fixed `@loaded` and `@error` events on `<Text/>` componenent only firing once (and not for each change)
9
18
  - Fixed loading of web canvas2d fonts
10
- - Firex error when using `this`-reference in component state
19
+ - Fixed error when using `this`-reference in component state
20
+ - Added basic support for inline text (i.e. `<Text>My text with a {{$dynamic}} value</Text>`)
11
21
 
12
22
  ## v0.3.12
13
23
 
@@ -31,6 +31,6 @@
31
31
  "vite": "^4.0.4"
32
32
  },
33
33
  "dependencies": {
34
- "@lightningjs/blits": "^0.3.13"
34
+ "@lightningjs/blits": "^0.3.14"
35
35
  }
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "0.3.13",
3
+ "version": "0.3.14",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.cjs",
6
6
  "exports": {
@@ -41,7 +41,7 @@
41
41
  "tape": "^5.5.0"
42
42
  },
43
43
  "dependencies": {
44
- "@lightningjs/renderer": "^0.3.6",
44
+ "@lightningjs/renderer": "^0.4.0",
45
45
  "@lightningjs/vite-plugin-import-chunk-url": "^0.3.0"
46
46
  }
47
47
  }
@@ -29,6 +29,7 @@ const Application = (config) => {
29
29
  Enter: 'enter',
30
30
  ' ': 'space',
31
31
  Backspace: 'back',
32
+ Escape: 'escape',
32
33
  }
33
34
 
34
35
  const handler = (e) => {
package/src/element.js CHANGED
@@ -133,7 +133,7 @@ const transformations = {
133
133
  props.rotation = props.rotation * (Math.PI / 180)
134
134
  },
135
135
  text(props) {
136
- props.text = props.text.toString()
136
+ props.text = props.text !== undefined ? props.text.toString() : ''
137
137
  },
138
138
  textureColor(props) {
139
139
  if (!('color' in props)) {
package/src/launch.js CHANGED
@@ -18,7 +18,7 @@
18
18
  import { MainRenderDriver, RendererMain, ThreadXRenderDriver } from '@lightningjs/renderer'
19
19
  // import RendererWorker from '@lightningjs/renderer/workers/renderer?worker'
20
20
  import Settings from './settings.js'
21
- import { initLog } from './lib/log.js'
21
+ import { initLog, Log } from './lib/log.js'
22
22
 
23
23
  // import coreExtensionModule from './fontLoader.js?importChunkUrl'
24
24
 
@@ -46,18 +46,15 @@ export default (App, target, settings) => {
46
46
  driver
47
47
  )
48
48
 
49
- let app
50
-
51
- const handler = (e) => {
52
- if (e.key === 'Escape') {
53
- document.removeEventListener('keydown', handler)
49
+ const initApp = () => {
50
+ let app = App()
51
+ app.quit = () => {
52
+ Log.info('Closing App')
54
53
  app.destroy()
55
54
  app = null
56
55
  renderer = null
57
56
  }
58
57
  }
59
58
 
60
- document.addEventListener('keydown', handler)
61
-
62
- renderer.init().then(() => (app = App()))
59
+ renderer.init().then(() => initApp())
63
60
  }