@lightningjs/blits 1.8.1 → 1.8.2

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.8.2
4
+
5
+ _30 oct 2024_
6
+
7
+ - Fixed edgecase issue with array based props not triggering reactivity
8
+
9
+
3
10
  ## v1.8.1
4
11
 
5
12
  _29 oct 2024_
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.js",
6
6
  "exports": {
@@ -25,6 +25,7 @@ export default () =>
25
25
  const elms = []
26
26
  let componentType
27
27
  const rootComponent = component
28
+ let propData
28
29
  const elementConfig0 = {}
29
30
 
30
31
  elms[0] = this.element({ parent: parent || 'root' }, component)
@@ -27,6 +27,7 @@ export default () =>
27
27
  const elms = []
28
28
  let componentType
29
29
  const rootComponent = component
30
+ let propData
30
31
  const elementConfig0 = {}
31
32
 
32
33
  elms[0] = this.element({ parent: parent || 'root' }, component)
@@ -142,7 +143,11 @@ export default () =>
142
143
  props7['w'] = 20
143
144
  props7['map'] = component.sprite
144
145
 
145
- props7['frame'] = component.fps[0]
146
+ propData = component.fps[0]
147
+ if (Array.isArray(propData) === true) {
148
+ propData = getRaw(propData).slice(0)
149
+ }
150
+ props7['frame'] = propData
146
151
 
147
152
  componentType = props7['is'] || 'Sprite'
148
153
 
@@ -200,7 +205,11 @@ export default () =>
200
205
  props9['w'] = 20
201
206
  props9['map'] = component.sprite
202
207
 
203
- props9['frame'] = component.fps[1]
208
+ propData = component.fps[1]
209
+ if (Array.isArray(propData) === true) {
210
+ propData = getRaw(propData).slice(0)
211
+ }
212
+ props9['frame'] = propData
204
213
 
205
214
  componentType = props9['is'] || 'Sprite'
206
215
 
@@ -258,7 +267,11 @@ export default () =>
258
267
  props11['w'] = 20
259
268
  props11['map'] = component.sprite
260
269
 
261
- props11['frame'] = component.fps[2]
270
+ propData = component.fps[2]
271
+ if (Array.isArray(propData) === true) {
272
+ propData = getRaw(propData).slice(0)
273
+ }
274
+ props11['frame'] = propData
262
275
 
263
276
  componentType = props11['is'] || 'Sprite'
264
277
 
@@ -390,7 +403,11 @@ export default () =>
390
403
  props17['w'] = 20
391
404
  props17['map'] = component.sprite
392
405
 
393
- props17['frame'] = component.avgFps[0]
406
+ propData = component.avgFps[0]
407
+ if (Array.isArray(propData) === true) {
408
+ propData = getRaw(propData).slice(0)
409
+ }
410
+ props17['frame'] = propData
394
411
 
395
412
  componentType = props17['is'] || 'Sprite'
396
413
 
@@ -448,7 +465,11 @@ export default () =>
448
465
  props19['w'] = 20
449
466
  props19['map'] = component.sprite
450
467
 
451
- props19['frame'] = component.avgFps[1]
468
+ propData = component.avgFps[1]
469
+ if (Array.isArray(propData) === true) {
470
+ propData = getRaw(propData).slice(0)
471
+ }
472
+ props19['frame'] = propData
452
473
 
453
474
  componentType = props19['is'] || 'Sprite'
454
475
 
@@ -506,7 +527,11 @@ export default () =>
506
527
  props21['w'] = 20
507
528
  props21['map'] = component.sprite
508
529
 
509
- props21['frame'] = component.avgFps[2]
530
+ propData = component.avgFps[2]
531
+ if (Array.isArray(propData) === true) {
532
+ propData = getRaw(propData).slice(0)
533
+ }
534
+ props21['frame'] = propData
510
535
 
511
536
  componentType = props21['is'] || 'Sprite'
512
537
 
@@ -639,7 +664,11 @@ export default () =>
639
664
  props27['w'] = 20
640
665
  props27['map'] = component.sprite
641
666
 
642
- props27['frame'] = component.minFps[0]
667
+ propData = component.minFps[0]
668
+ if (Array.isArray(propData) === true) {
669
+ propData = getRaw(propData).slice(0)
670
+ }
671
+ props27['frame'] = propData
643
672
 
644
673
  componentType = props27['is'] || 'Sprite'
645
674
 
@@ -697,7 +726,11 @@ export default () =>
697
726
  props29['w'] = 20
698
727
  props29['map'] = component.sprite
699
728
 
700
- props29['frame'] = component.minFps[1]
729
+ propData = component.minFps[1]
730
+ if (Array.isArray(propData) === true) {
731
+ propData = getRaw(propData).slice(0)
732
+ }
733
+ props29['frame'] = propData
701
734
 
702
735
  componentType = props29['is'] || 'Sprite'
703
736
 
@@ -755,7 +788,11 @@ export default () =>
755
788
  props31['w'] = 20
756
789
  props31['map'] = component.sprite
757
790
 
758
- props31['frame'] = component.minFps[2]
791
+ propData = component.minFps[2]
792
+ if (Array.isArray(propData) === true) {
793
+ propData = getRaw(propData).slice(0)
794
+ }
795
+ props31['frame'] = propData
759
796
 
760
797
  componentType = props31['is'] || 'Sprite'
761
798
 
@@ -886,7 +923,11 @@ export default () =>
886
923
  props37['w'] = 20
887
924
  props37['map'] = component.sprite
888
925
 
889
- props37['frame'] = component.maxFps[0]
926
+ propData = component.maxFps[0]
927
+ if (Array.isArray(propData) === true) {
928
+ propData = getRaw(propData).slice(0)
929
+ }
930
+ props37['frame'] = propData
890
931
 
891
932
  componentType = props37['is'] || 'Sprite'
892
933
 
@@ -944,7 +985,11 @@ export default () =>
944
985
  props39['w'] = 20
945
986
  props39['map'] = component.sprite
946
987
 
947
- props39['frame'] = component.maxFps[1]
988
+ propData = component.maxFps[1]
989
+ if (Array.isArray(propData) === true) {
990
+ propData = getRaw(propData).slice(0)
991
+ }
992
+ props39['frame'] = propData
948
993
 
949
994
  componentType = props39['is'] || 'Sprite'
950
995
 
@@ -1002,7 +1047,11 @@ export default () =>
1002
1047
  props41['w'] = 20
1003
1048
  props41['map'] = component.sprite
1004
1049
 
1005
- props41['frame'] = component.maxFps[2]
1050
+ propData = component.maxFps[2]
1051
+ if (Array.isArray(propData) === true) {
1052
+ propData = getRaw(propData).slice(0)
1053
+ }
1054
+ props41['frame'] = propData
1006
1055
 
1007
1056
  componentType = props41['is'] || 'Sprite'
1008
1057
 
@@ -8,6 +8,7 @@ export default () => {
8
8
  const elms = []
9
9
  let componentType
10
10
  const rootComponent = component
11
+ let propData
11
12
  const elementConfig0 = {}
12
13
 
13
14
  elms[0] = this.element({ parent: parent || 'root' }, component)
@@ -28,6 +28,7 @@ export default () =>
28
28
  const elms = []
29
29
  let componentType
30
30
  const rootComponent = component
31
+ let propData
31
32
  const elementConfig0 = {}
32
33
 
33
34
  elms[0] = this.element({ parent: parent || 'root' }, component)
@@ -27,6 +27,7 @@ export default () =>
27
27
  const elms = []
28
28
  let componentType
29
29
  const rootComponent = component
30
+ let propData
30
31
  const elementConfig0 = {}
31
32
 
32
33
  elms[0] = this.element({ parent: parent || 'root' }, component)
@@ -19,7 +19,12 @@ let counter
19
19
 
20
20
  export default function (templateObject = { children: [] }) {
21
21
  const ctx = {
22
- renderCode: ['const elms = []', 'let componentType', 'const rootComponent = component'],
22
+ renderCode: [
23
+ 'const elms = []',
24
+ 'let componentType',
25
+ 'const rootComponent = component',
26
+ 'let propData',
27
+ ],
23
28
  effectsCode: [],
24
29
  context: { props: [], components: this.components },
25
30
  }
@@ -213,10 +218,11 @@ const generateComponentCode = function (
213
218
  options.component
214
219
  )}`)
215
220
  renderCode.push(`
216
- props${counter}['${key.substring(1)}']= ${interpolate(
217
- templateObject[key],
218
- options.component
219
- )}`)
221
+ propData = ${interpolate(templateObject[key], options.component)}
222
+ if (Array.isArray(propData) === true) {
223
+ propData = getRaw(propData).slice(0)
224
+ }
225
+ props${counter}['${key.substring(1)}'] = propData`)
220
226
  } else {
221
227
  renderCode.push(
222
228
  `props${counter}['${key}'] = ${cast(templateObject[key], key, options.component)}`