@lightningjs/blits 1.4.2 → 1.4.3

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
+ ## v1.4.3
4
+
5
+ _26 sept 2024_
6
+
7
+ - Fixed issues with sprites in minified production build
8
+ - Bumped renderer to v2.2.0 (with fixes for nested alpha / show issue)
9
+ - Fixed reactivity in plugins not using reactivity mode setting
10
+ - Fixed named slots functionality
11
+
3
12
  ## v1.4.2
4
13
 
5
14
  _24 sept 2024_
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.js",
6
6
  "exports": {
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@lightningjs/msdf-generator": "^1.0.2",
50
- "@lightningjs/renderer": "^2.1.2",
50
+ "@lightningjs/renderer": "^2.2.0",
51
51
  "execa": "^8.0.1",
52
52
  "kolorist": "^1.8.0",
53
53
  "ora": "^7.0.1",
@@ -268,7 +268,7 @@ const Element = {
268
268
 
269
269
  this.props.element = this
270
270
 
271
- this.props['parent'] = this.config.parent
271
+ this.props['parent'] = props['parent'] || this.config.parent
272
272
  delete props.parent
273
273
 
274
274
  this.props.raw = data
@@ -305,7 +305,7 @@ const Element = {
305
305
  })
306
306
  }
307
307
 
308
- // if (this.component && this.component.___layout) {
308
+ // if (this.component !== undefined && '___layout' in this.component) {
309
309
  // this.node.on('loaded', () => {
310
310
  // this.component.___layout()
311
311
  // })
@@ -91,7 +91,7 @@ const generateElementCode = function (
91
91
  Object.keys(templateObject).forEach((key) => {
92
92
  if (key === 'slot') {
93
93
  renderCode.push(`
94
- elementConfig${counter}['parent'] = component[Symbol.for('slots')].filter(slot => slot.ref === '${templateObject.slot}').shift() || component[Symbol.for('slots')][0] || parent
94
+ elementConfig${counter}['parent'] = component[Symbol.for('slots')].filter(slot => slot.ref === '${templateObject.slot}').shift() || parent
95
95
  `)
96
96
  }
97
97
 
@@ -258,6 +258,7 @@ const generateComponentCode = function (
258
258
  }
259
259
  // if (!options.forloop) {
260
260
  // renderCode.push(`
261
+ // // console.log('here', component, rootComponent)
261
262
  // component = rootComponent
262
263
  // `)
263
264
  // }
@@ -15,6 +15,7 @@
15
15
  * SPDX-License-Identifier: Apache-2.0
16
16
  */
17
17
 
18
+ import { ImageTexture } from '@lightningjs/renderer'
18
19
  import { track, trigger, pauseTracking, resumeTracking } from './effect.js'
19
20
  import symbols from '../symbols.js'
20
21
 
@@ -32,7 +33,7 @@ const reactiveProxy = (original, _parent = null, _key) => {
32
33
  // is assigned to a state variable
33
34
  if (typeof original === 'object') {
34
35
  if (original[symbols.id] !== undefined) return original
35
- if (original.constructor.name === '_ImageTexture') return original
36
+ if (original.constructor.name === ImageTexture.name) return original
36
37
  }
37
38
 
38
39
  // if original object is already a proxy, don't create a new one but return the existing one instead
@@ -16,10 +16,11 @@
16
16
  */
17
17
 
18
18
  import { reactive } from '../lib/reactivity/reactive'
19
+ import Settings from '../settings.js'
19
20
 
20
21
  export default {
21
22
  name: 'appState',
22
23
  plugin(state = {}) {
23
- return reactive(state)
24
+ return reactive(state, Settings.get('reactivityMode'))
24
25
  },
25
26
  }
@@ -19,16 +19,21 @@ import fetchJson from '../helpers/fetchJson'
19
19
  import { Log } from '../lib/log'
20
20
  import { reactive } from '../lib/reactivity/reactive'
21
21
 
22
+ import Settings from '../settings.js'
23
+
22
24
  export default {
23
25
  name: 'language',
24
26
  plugin(options = {}) {
25
27
  let translations = {}
26
28
  let dictionary = {}
27
29
 
28
- const state = reactive({
29
- language: '',
30
- loaded: 0,
31
- })
30
+ const state = reactive(
31
+ {
32
+ language: '',
33
+ loaded: 0,
34
+ },
35
+ Settings.get('reactivityMode')
36
+ )
32
37
 
33
38
  const setLanguage = (language) => {
34
39
  // define the dictionary
@@ -18,6 +18,8 @@
18
18
  import { Log } from '../lib/log'
19
19
  import { reactive } from '../lib/reactivity/reactive.js'
20
20
 
21
+ import Settings from '../settings.js'
22
+
21
23
  const getValueByDotNotation = (obj, base, path) => {
22
24
  const keys = path.split('.')
23
25
 
@@ -46,9 +48,12 @@ export default {
46
48
  plugin(config = {}) {
47
49
  let themeMap = {}
48
50
 
49
- const state = reactive({
50
- current: 'default',
51
- })
51
+ const state = reactive(
52
+ {
53
+ current: 'default',
54
+ },
55
+ Settings.get('reactivityMode')
56
+ )
52
57
 
53
58
  let themes = {}
54
59
  let base = null