@lightningjs/blits 1.51.0 → 2.0.0-beta.10

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.
Files changed (45) hide show
  1. package/element-test-full.txt +0 -0
  2. package/index.d.ts +35 -50
  3. package/package.json +6 -6
  4. package/scripts/lint.js +17 -0
  5. package/scripts/prepublishOnly.js +2 -2
  6. package/scripts/prepush.js +4 -6
  7. package/src/component/base/methods.js +16 -76
  8. package/src/component/base/utils.js +18 -4
  9. package/src/component/setup/props.js +37 -28
  10. package/src/component/setup/state.js +5 -5
  11. package/src/component.js +28 -19
  12. package/src/components/Circle.js +52 -9
  13. package/src/components/FPScounter.js +224 -88
  14. package/src/components/RouterView.js +58 -6
  15. package/src/components/Sprite.js +72 -8
  16. package/src/constants.js +17 -0
  17. package/src/engine.js +17 -0
  18. package/src/engines/L3/element.js +109 -86
  19. package/src/engines/L3/fontLoader.js +43 -31
  20. package/src/engines/L3/index.js +17 -0
  21. package/src/engines/L3/launch.js +1 -0
  22. package/src/engines/L3/shaderLoader.js +73 -6
  23. package/src/engines/index.js +17 -0
  24. package/src/focus/focus.js +7 -7
  25. package/src/focus/helpers.js +4 -2
  26. package/src/focus/hover.js +7 -6
  27. package/src/helpers/fetchJson.js +4 -6
  28. package/src/launch.js +1 -2
  29. package/src/lib/codegenerator/generator.js +127 -16
  30. package/src/lib/colors/colors.js +0 -1
  31. package/src/lib/lifecycle.js +8 -10
  32. package/src/lib/log.js +4 -4
  33. package/src/lib/reactivityguard/computedprops.js +27 -13
  34. package/src/lib/shaders/shaders.js +164 -0
  35. package/src/lib/symbols.js +25 -0
  36. package/src/lib/templateparser/parser.js +6 -2
  37. package/src/lib/utils.js +53 -0
  38. package/src/plugin.js +17 -0
  39. package/src/plugins/storage/localCookie.js +4 -6
  40. package/src/router/router.js +23 -15
  41. package/test-output.txt +0 -0
  42. package/vite/blitsTips.js +57 -0
  43. package/vite/inject-dev-config.js +17 -0
  44. package/vite/msdfGenerator.js +52 -6
  45. package/vscode/data/template-attributes.json +112 -0
@@ -25,6 +25,48 @@ export const FPScounter = Blits.Component('FPScounter', {
25
25
  code: {
26
26
  render: function anonymous(parent, component, context, components, effect, getRaw, Log) {
27
27
  const elms = []
28
+ const validAttributes = [
29
+ 'parent',
30
+ 'rotation',
31
+ 'w',
32
+ 'width',
33
+ 'h',
34
+ 'height',
35
+ 'x',
36
+ 'y',
37
+ 'z',
38
+ 'zIndex',
39
+ 'color',
40
+ 'src',
41
+ 'texture',
42
+ 'fit',
43
+ 'rtt',
44
+ 'mount',
45
+ 'pivot',
46
+ 'scale',
47
+ 'show',
48
+ 'alpha',
49
+ 'rounded',
50
+ 'border',
51
+ 'shadow',
52
+ 'shader',
53
+ 'clipping',
54
+ 'overflow',
55
+ 'font',
56
+ 'size',
57
+ 'maxwidth',
58
+ 'maxheight',
59
+ 'maxlines',
60
+ 'textoverflow',
61
+ 'letterspacing',
62
+ 'lineheight',
63
+ 'contain',
64
+ 'align',
65
+ 'content',
66
+ 'placement',
67
+ 'inspector-data',
68
+ 'holder',
69
+ ]
28
70
  const elementConfigs = []
29
71
  const forloops = []
30
72
  const props = []
@@ -100,10 +142,15 @@ export const FPScounter = Blits.Component('FPScounter', {
100
142
  elementConfigs[3]['frame'] = 'fps'
101
143
 
102
144
  skips[3] = []
103
- if (typeof cmps[3] !== 'undefined') {
104
- for (let key in cmps[3][Symbol.for('config')].props) {
105
- delete elementConfigs[3][cmps[3][Symbol.for('config')].props[key]]
106
- skips[3].push(cmps[3][Symbol.for('config')].props[key])
145
+ if (typeof cmps[3] !== 'undefined' && cmps[3][Symbol.for('config')].props !== undefined) {
146
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
147
+ let props = cmps[3][Symbol.for('config')].props
148
+ if (Array.isArray(props) === false) props = Object.keys(cmps[3][Symbol.for('config')].props)
149
+ for (let k = 0; k < props.length; k++) {
150
+ const key = props[k]
151
+ if (validAttributes.indexOf(key) !== -1) continue
152
+ delete elementConfigs[3][key]
153
+ skips[3].push(key)
107
154
  }
108
155
  }
109
156
 
@@ -186,10 +233,15 @@ export const FPScounter = Blits.Component('FPScounter', {
186
233
  elementConfigs[6]['frame'] = component.fps[0]
187
234
 
188
235
  skips[6] = []
189
- if (typeof cmps[6] !== 'undefined') {
190
- for (let key in cmps[6][Symbol.for('config')].props) {
191
- delete elementConfigs[6][cmps[6][Symbol.for('config')].props[key]]
192
- skips[6].push(cmps[6][Symbol.for('config')].props[key])
236
+ if (typeof cmps[6] !== 'undefined' && cmps[6][Symbol.for('config')].props !== undefined) {
237
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
238
+ let props = cmps[6][Symbol.for('config')].props
239
+ if (Array.isArray(props) === false) props = Object.keys(cmps[6][Symbol.for('config')].props)
240
+ for (let k = 0; k < props.length; k++) {
241
+ const key = props[k]
242
+ if (validAttributes.indexOf(key) !== -1) continue
243
+ delete elementConfigs[6][key]
244
+ skips[6].push(key)
193
245
  }
194
246
  }
195
247
 
@@ -262,10 +314,15 @@ export const FPScounter = Blits.Component('FPScounter', {
262
314
  elementConfigs[8]['frame'] = component.fps[1]
263
315
 
264
316
  skips[8] = []
265
- if (typeof cmps[8] !== 'undefined') {
266
- for (let key in cmps[8][Symbol.for('config')].props) {
267
- delete elementConfigs[8][cmps[8][Symbol.for('config')].props[key]]
268
- skips[8].push(cmps[8][Symbol.for('config')].props[key])
317
+ if (typeof cmps[8] !== 'undefined' && cmps[8][Symbol.for('config')].props !== undefined) {
318
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
319
+ let props = cmps[8][Symbol.for('config')].props
320
+ if (Array.isArray(props) === false) props = Object.keys(cmps[8][Symbol.for('config')].props)
321
+ for (let k = 0; k < props.length; k++) {
322
+ const key = props[k]
323
+ if (validAttributes.indexOf(key) !== -1) continue
324
+ delete elementConfigs[8][key]
325
+ skips[8].push(key)
269
326
  }
270
327
  }
271
328
 
@@ -338,10 +395,16 @@ export const FPScounter = Blits.Component('FPScounter', {
338
395
  elementConfigs[10]['frame'] = component.fps[2]
339
396
 
340
397
  skips[10] = []
341
- if (typeof cmps[10] !== 'undefined') {
342
- for (let key in cmps[10][Symbol.for('config')].props) {
343
- delete elementConfigs[10][cmps[10][Symbol.for('config')].props[key]]
344
- skips[10].push(cmps[10][Symbol.for('config')].props[key])
398
+ if (typeof cmps[10] !== 'undefined' && cmps[10][Symbol.for('config')].props !== undefined) {
399
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
400
+ let props = cmps[10][Symbol.for('config')].props
401
+ if (Array.isArray(props) === false)
402
+ props = Object.keys(cmps[10][Symbol.for('config')].props)
403
+ for (let k = 0; k < props.length; k++) {
404
+ const key = props[k]
405
+ if (validAttributes.indexOf(key) !== -1) continue
406
+ delete elementConfigs[10][key]
407
+ skips[10].push(key)
345
408
  }
346
409
  }
347
410
 
@@ -429,10 +492,16 @@ export const FPScounter = Blits.Component('FPScounter', {
429
492
  elementConfigs[13]['frame'] = 'avg'
430
493
 
431
494
  skips[13] = []
432
- if (typeof cmps[13] !== 'undefined') {
433
- for (let key in cmps[13][Symbol.for('config')].props) {
434
- delete elementConfigs[13][cmps[13][Symbol.for('config')].props[key]]
435
- skips[13].push(cmps[13][Symbol.for('config')].props[key])
495
+ if (typeof cmps[13] !== 'undefined' && cmps[13][Symbol.for('config')].props !== undefined) {
496
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
497
+ let props = cmps[13][Symbol.for('config')].props
498
+ if (Array.isArray(props) === false)
499
+ props = Object.keys(cmps[13][Symbol.for('config')].props)
500
+ for (let k = 0; k < props.length; k++) {
501
+ const key = props[k]
502
+ if (validAttributes.indexOf(key) !== -1) continue
503
+ delete elementConfigs[13][key]
504
+ skips[13].push(key)
436
505
  }
437
506
  }
438
507
 
@@ -516,10 +585,16 @@ export const FPScounter = Blits.Component('FPScounter', {
516
585
  elementConfigs[16]['frame'] = component.avgFps[0]
517
586
 
518
587
  skips[16] = []
519
- if (typeof cmps[16] !== 'undefined') {
520
- for (let key in cmps[16][Symbol.for('config')].props) {
521
- delete elementConfigs[16][cmps[16][Symbol.for('config')].props[key]]
522
- skips[16].push(cmps[16][Symbol.for('config')].props[key])
588
+ if (typeof cmps[16] !== 'undefined' && cmps[16][Symbol.for('config')].props !== undefined) {
589
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
590
+ let props = cmps[16][Symbol.for('config')].props
591
+ if (Array.isArray(props) === false)
592
+ props = Object.keys(cmps[16][Symbol.for('config')].props)
593
+ for (let k = 0; k < props.length; k++) {
594
+ const key = props[k]
595
+ if (validAttributes.indexOf(key) !== -1) continue
596
+ delete elementConfigs[16][key]
597
+ skips[16].push(key)
523
598
  }
524
599
  }
525
600
 
@@ -592,10 +667,16 @@ export const FPScounter = Blits.Component('FPScounter', {
592
667
  elementConfigs[18]['frame'] = component.avgFps[1]
593
668
 
594
669
  skips[18] = []
595
- if (typeof cmps[18] !== 'undefined') {
596
- for (let key in cmps[18][Symbol.for('config')].props) {
597
- delete elementConfigs[18][cmps[18][Symbol.for('config')].props[key]]
598
- skips[18].push(cmps[18][Symbol.for('config')].props[key])
670
+ if (typeof cmps[18] !== 'undefined' && cmps[18][Symbol.for('config')].props !== undefined) {
671
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
672
+ let props = cmps[18][Symbol.for('config')].props
673
+ if (Array.isArray(props) === false)
674
+ props = Object.keys(cmps[18][Symbol.for('config')].props)
675
+ for (let k = 0; k < props.length; k++) {
676
+ const key = props[k]
677
+ if (validAttributes.indexOf(key) !== -1) continue
678
+ delete elementConfigs[18][key]
679
+ skips[18].push(key)
599
680
  }
600
681
  }
601
682
 
@@ -668,10 +749,16 @@ export const FPScounter = Blits.Component('FPScounter', {
668
749
  elementConfigs[20]['frame'] = component.avgFps[2]
669
750
 
670
751
  skips[20] = []
671
- if (typeof cmps[20] !== 'undefined') {
672
- for (let key in cmps[20][Symbol.for('config')].props) {
673
- delete elementConfigs[20][cmps[20][Symbol.for('config')].props[key]]
674
- skips[20].push(cmps[20][Symbol.for('config')].props[key])
752
+ if (typeof cmps[20] !== 'undefined' && cmps[20][Symbol.for('config')].props !== undefined) {
753
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
754
+ let props = cmps[20][Symbol.for('config')].props
755
+ if (Array.isArray(props) === false)
756
+ props = Object.keys(cmps[20][Symbol.for('config')].props)
757
+ for (let k = 0; k < props.length; k++) {
758
+ const key = props[k]
759
+ if (validAttributes.indexOf(key) !== -1) continue
760
+ delete elementConfigs[20][key]
761
+ skips[20].push(key)
675
762
  }
676
763
  }
677
764
 
@@ -760,10 +847,16 @@ export const FPScounter = Blits.Component('FPScounter', {
760
847
  elementConfigs[23]['frame'] = 'min'
761
848
 
762
849
  skips[23] = []
763
- if (typeof cmps[23] !== 'undefined') {
764
- for (let key in cmps[23][Symbol.for('config')].props) {
765
- delete elementConfigs[23][cmps[23][Symbol.for('config')].props[key]]
766
- skips[23].push(cmps[23][Symbol.for('config')].props[key])
850
+ if (typeof cmps[23] !== 'undefined' && cmps[23][Symbol.for('config')].props !== undefined) {
851
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
852
+ let props = cmps[23][Symbol.for('config')].props
853
+ if (Array.isArray(props) === false)
854
+ props = Object.keys(cmps[23][Symbol.for('config')].props)
855
+ for (let k = 0; k < props.length; k++) {
856
+ const key = props[k]
857
+ if (validAttributes.indexOf(key) !== -1) continue
858
+ delete elementConfigs[23][key]
859
+ skips[23].push(key)
767
860
  }
768
861
  }
769
862
 
@@ -847,10 +940,16 @@ export const FPScounter = Blits.Component('FPScounter', {
847
940
  elementConfigs[26]['frame'] = component.minFps[0]
848
941
 
849
942
  skips[26] = []
850
- if (typeof cmps[26] !== 'undefined') {
851
- for (let key in cmps[26][Symbol.for('config')].props) {
852
- delete elementConfigs[26][cmps[26][Symbol.for('config')].props[key]]
853
- skips[26].push(cmps[26][Symbol.for('config')].props[key])
943
+ if (typeof cmps[26] !== 'undefined' && cmps[26][Symbol.for('config')].props !== undefined) {
944
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
945
+ let props = cmps[26][Symbol.for('config')].props
946
+ if (Array.isArray(props) === false)
947
+ props = Object.keys(cmps[26][Symbol.for('config')].props)
948
+ for (let k = 0; k < props.length; k++) {
949
+ const key = props[k]
950
+ if (validAttributes.indexOf(key) !== -1) continue
951
+ delete elementConfigs[26][key]
952
+ skips[26].push(key)
854
953
  }
855
954
  }
856
955
 
@@ -923,10 +1022,16 @@ export const FPScounter = Blits.Component('FPScounter', {
923
1022
  elementConfigs[28]['frame'] = component.minFps[1]
924
1023
 
925
1024
  skips[28] = []
926
- if (typeof cmps[28] !== 'undefined') {
927
- for (let key in cmps[28][Symbol.for('config')].props) {
928
- delete elementConfigs[28][cmps[28][Symbol.for('config')].props[key]]
929
- skips[28].push(cmps[28][Symbol.for('config')].props[key])
1025
+ if (typeof cmps[28] !== 'undefined' && cmps[28][Symbol.for('config')].props !== undefined) {
1026
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
1027
+ let props = cmps[28][Symbol.for('config')].props
1028
+ if (Array.isArray(props) === false)
1029
+ props = Object.keys(cmps[28][Symbol.for('config')].props)
1030
+ for (let k = 0; k < props.length; k++) {
1031
+ const key = props[k]
1032
+ if (validAttributes.indexOf(key) !== -1) continue
1033
+ delete elementConfigs[28][key]
1034
+ skips[28].push(key)
930
1035
  }
931
1036
  }
932
1037
 
@@ -999,10 +1104,16 @@ export const FPScounter = Blits.Component('FPScounter', {
999
1104
  elementConfigs[30]['frame'] = component.minFps[2]
1000
1105
 
1001
1106
  skips[30] = []
1002
- if (typeof cmps[30] !== 'undefined') {
1003
- for (let key in cmps[30][Symbol.for('config')].props) {
1004
- delete elementConfigs[30][cmps[30][Symbol.for('config')].props[key]]
1005
- skips[30].push(cmps[30][Symbol.for('config')].props[key])
1107
+ if (typeof cmps[30] !== 'undefined' && cmps[30][Symbol.for('config')].props !== undefined) {
1108
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
1109
+ let props = cmps[30][Symbol.for('config')].props
1110
+ if (Array.isArray(props) === false)
1111
+ props = Object.keys(cmps[30][Symbol.for('config')].props)
1112
+ for (let k = 0; k < props.length; k++) {
1113
+ const key = props[k]
1114
+ if (validAttributes.indexOf(key) !== -1) continue
1115
+ delete elementConfigs[30][key]
1116
+ skips[30].push(key)
1006
1117
  }
1007
1118
  }
1008
1119
 
@@ -1090,10 +1201,16 @@ export const FPScounter = Blits.Component('FPScounter', {
1090
1201
  elementConfigs[33]['frame'] = 'max'
1091
1202
 
1092
1203
  skips[33] = []
1093
- if (typeof cmps[33] !== 'undefined') {
1094
- for (let key in cmps[33][Symbol.for('config')].props) {
1095
- delete elementConfigs[33][cmps[33][Symbol.for('config')].props[key]]
1096
- skips[33].push(cmps[33][Symbol.for('config')].props[key])
1204
+ if (typeof cmps[33] !== 'undefined' && cmps[33][Symbol.for('config')].props !== undefined) {
1205
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
1206
+ let props = cmps[33][Symbol.for('config')].props
1207
+ if (Array.isArray(props) === false)
1208
+ props = Object.keys(cmps[33][Symbol.for('config')].props)
1209
+ for (let k = 0; k < props.length; k++) {
1210
+ const key = props[k]
1211
+ if (validAttributes.indexOf(key) !== -1) continue
1212
+ delete elementConfigs[33][key]
1213
+ skips[33].push(key)
1097
1214
  }
1098
1215
  }
1099
1216
 
@@ -1176,10 +1293,16 @@ export const FPScounter = Blits.Component('FPScounter', {
1176
1293
  elementConfigs[36]['frame'] = component.maxFps[0]
1177
1294
 
1178
1295
  skips[36] = []
1179
- if (typeof cmps[36] !== 'undefined') {
1180
- for (let key in cmps[36][Symbol.for('config')].props) {
1181
- delete elementConfigs[36][cmps[36][Symbol.for('config')].props[key]]
1182
- skips[36].push(cmps[36][Symbol.for('config')].props[key])
1296
+ if (typeof cmps[36] !== 'undefined' && cmps[36][Symbol.for('config')].props !== undefined) {
1297
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
1298
+ let props = cmps[36][Symbol.for('config')].props
1299
+ if (Array.isArray(props) === false)
1300
+ props = Object.keys(cmps[36][Symbol.for('config')].props)
1301
+ for (let k = 0; k < props.length; k++) {
1302
+ const key = props[k]
1303
+ if (validAttributes.indexOf(key) !== -1) continue
1304
+ delete elementConfigs[36][key]
1305
+ skips[36].push(key)
1183
1306
  }
1184
1307
  }
1185
1308
 
@@ -1252,10 +1375,16 @@ export const FPScounter = Blits.Component('FPScounter', {
1252
1375
  elementConfigs[38]['frame'] = component.maxFps[1]
1253
1376
 
1254
1377
  skips[38] = []
1255
- if (typeof cmps[38] !== 'undefined') {
1256
- for (let key in cmps[38][Symbol.for('config')].props) {
1257
- delete elementConfigs[38][cmps[38][Symbol.for('config')].props[key]]
1258
- skips[38].push(cmps[38][Symbol.for('config')].props[key])
1378
+ if (typeof cmps[38] !== 'undefined' && cmps[38][Symbol.for('config')].props !== undefined) {
1379
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
1380
+ let props = cmps[38][Symbol.for('config')].props
1381
+ if (Array.isArray(props) === false)
1382
+ props = Object.keys(cmps[38][Symbol.for('config')].props)
1383
+ for (let k = 0; k < props.length; k++) {
1384
+ const key = props[k]
1385
+ if (validAttributes.indexOf(key) !== -1) continue
1386
+ delete elementConfigs[38][key]
1387
+ skips[38].push(key)
1259
1388
  }
1260
1389
  }
1261
1390
 
@@ -1328,10 +1457,16 @@ export const FPScounter = Blits.Component('FPScounter', {
1328
1457
  elementConfigs[40]['frame'] = component.maxFps[2]
1329
1458
 
1330
1459
  skips[40] = []
1331
- if (typeof cmps[40] !== 'undefined') {
1332
- for (let key in cmps[40][Symbol.for('config')].props) {
1333
- delete elementConfigs[40][cmps[40][Symbol.for('config')].props[key]]
1334
- skips[40].push(cmps[40][Symbol.for('config')].props[key])
1460
+ if (typeof cmps[40] !== 'undefined' && cmps[40][Symbol.for('config')].props !== undefined) {
1461
+ // attributes that are a prop should be removed from element config (even if it's a know element prop)
1462
+ let props = cmps[40][Symbol.for('config')].props
1463
+ if (Array.isArray(props) === false)
1464
+ props = Object.keys(cmps[40][Symbol.for('config')].props)
1465
+ for (let k = 0; k < props.length; k++) {
1466
+ const key = props[k]
1467
+ if (validAttributes.indexOf(key) !== -1) continue
1468
+ delete elementConfigs[40][key]
1469
+ skips[40].push(key)
1335
1470
  }
1336
1471
  }
1337
1472
 
@@ -1481,10 +1616,11 @@ export const FPScounter = Blits.Component('FPScounter', {
1481
1616
  props.length = 0
1482
1617
  skips.length = 0
1483
1618
  },
1619
+ skips,
1484
1620
  }
1485
1621
  },
1486
1622
  effects: [
1487
- function anonymous(component, elms, context, components, rootComponent, effect) {
1623
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1488
1624
  if (
1489
1625
  typeof skips === 'undefined' ||
1490
1626
  typeof skips[6] === 'undefined' ||
@@ -1492,10 +1628,10 @@ export const FPScounter = Blits.Component('FPScounter', {
1492
1628
  )
1493
1629
  elms[6].set('frame', component.fps[0])
1494
1630
  },
1495
- function anonymous(component, elms, context, components, rootComponent, effect) {
1631
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1496
1632
  elms[7][Symbol.for('props')]['frame'] = component.fps[0]
1497
1633
  },
1498
- function anonymous(component, elms, context, components, rootComponent, effect) {
1634
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1499
1635
  if (
1500
1636
  typeof skips === 'undefined' ||
1501
1637
  typeof skips[8] === 'undefined' ||
@@ -1503,10 +1639,10 @@ export const FPScounter = Blits.Component('FPScounter', {
1503
1639
  )
1504
1640
  elms[8].set('frame', component.fps[1])
1505
1641
  },
1506
- function anonymous(component, elms, context, components, rootComponent, effect) {
1642
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1507
1643
  elms[9][Symbol.for('props')]['frame'] = component.fps[1]
1508
1644
  },
1509
- function anonymous(component, elms, context, components, rootComponent, effect) {
1645
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1510
1646
  if (
1511
1647
  typeof skips === 'undefined' ||
1512
1648
  typeof skips[10] === 'undefined' ||
@@ -1514,10 +1650,10 @@ export const FPScounter = Blits.Component('FPScounter', {
1514
1650
  )
1515
1651
  elms[10].set('frame', component.fps[2])
1516
1652
  },
1517
- function anonymous(component, elms, context, components, rootComponent, effect) {
1653
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1518
1654
  elms[11][Symbol.for('props')]['frame'] = component.fps[2]
1519
1655
  },
1520
- function anonymous(component, elms, context, components, rootComponent, effect) {
1656
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1521
1657
  if (
1522
1658
  typeof skips === 'undefined' ||
1523
1659
  typeof skips[16] === 'undefined' ||
@@ -1525,10 +1661,10 @@ export const FPScounter = Blits.Component('FPScounter', {
1525
1661
  )
1526
1662
  elms[16].set('frame', component.avgFps[0])
1527
1663
  },
1528
- function anonymous(component, elms, context, components, rootComponent, effect) {
1664
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1529
1665
  elms[17][Symbol.for('props')]['frame'] = component.avgFps[0]
1530
1666
  },
1531
- function anonymous(component, elms, context, components, rootComponent, effect) {
1667
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1532
1668
  if (
1533
1669
  typeof skips === 'undefined' ||
1534
1670
  typeof skips[18] === 'undefined' ||
@@ -1536,10 +1672,10 @@ export const FPScounter = Blits.Component('FPScounter', {
1536
1672
  )
1537
1673
  elms[18].set('frame', component.avgFps[1])
1538
1674
  },
1539
- function anonymous(component, elms, context, components, rootComponent, effect) {
1675
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1540
1676
  elms[19][Symbol.for('props')]['frame'] = component.avgFps[1]
1541
1677
  },
1542
- function anonymous(component, elms, context, components, rootComponent, effect) {
1678
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1543
1679
  if (
1544
1680
  typeof skips === 'undefined' ||
1545
1681
  typeof skips[20] === 'undefined' ||
@@ -1547,10 +1683,10 @@ export const FPScounter = Blits.Component('FPScounter', {
1547
1683
  )
1548
1684
  elms[20].set('frame', component.avgFps[2])
1549
1685
  },
1550
- function anonymous(component, elms, context, components, rootComponent, effect) {
1686
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1551
1687
  elms[21][Symbol.for('props')]['frame'] = component.avgFps[2]
1552
1688
  },
1553
- function anonymous(component, elms, context, components, rootComponent, effect) {
1689
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1554
1690
  if (
1555
1691
  typeof skips === 'undefined' ||
1556
1692
  typeof skips[26] === 'undefined' ||
@@ -1558,10 +1694,10 @@ export const FPScounter = Blits.Component('FPScounter', {
1558
1694
  )
1559
1695
  elms[26].set('frame', component.minFps[0])
1560
1696
  },
1561
- function anonymous(component, elms, context, components, rootComponent, effect) {
1697
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1562
1698
  elms[27][Symbol.for('props')]['frame'] = component.minFps[0]
1563
1699
  },
1564
- function anonymous(component, elms, context, components, rootComponent, effect) {
1700
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1565
1701
  if (
1566
1702
  typeof skips === 'undefined' ||
1567
1703
  typeof skips[28] === 'undefined' ||
@@ -1569,10 +1705,10 @@ export const FPScounter = Blits.Component('FPScounter', {
1569
1705
  )
1570
1706
  elms[28].set('frame', component.minFps[1])
1571
1707
  },
1572
- function anonymous(component, elms, context, components, rootComponent, effect) {
1708
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1573
1709
  elms[29][Symbol.for('props')]['frame'] = component.minFps[1]
1574
1710
  },
1575
- function anonymous(component, elms, context, components, rootComponent, effect) {
1711
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1576
1712
  if (
1577
1713
  typeof skips === 'undefined' ||
1578
1714
  typeof skips[30] === 'undefined' ||
@@ -1580,10 +1716,10 @@ export const FPScounter = Blits.Component('FPScounter', {
1580
1716
  )
1581
1717
  elms[30].set('frame', component.minFps[2])
1582
1718
  },
1583
- function anonymous(component, elms, context, components, rootComponent, effect) {
1719
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1584
1720
  elms[31][Symbol.for('props')]['frame'] = component.minFps[2]
1585
1721
  },
1586
- function anonymous(component, elms, context, components, rootComponent, effect) {
1722
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1587
1723
  if (
1588
1724
  typeof skips === 'undefined' ||
1589
1725
  typeof skips[36] === 'undefined' ||
@@ -1591,10 +1727,10 @@ export const FPScounter = Blits.Component('FPScounter', {
1591
1727
  )
1592
1728
  elms[36].set('frame', component.maxFps[0])
1593
1729
  },
1594
- function anonymous(component, elms, context, components, rootComponent, effect) {
1730
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1595
1731
  elms[37][Symbol.for('props')]['frame'] = component.maxFps[0]
1596
1732
  },
1597
- function anonymous(component, elms, context, components, rootComponent, effect) {
1733
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1598
1734
  if (
1599
1735
  typeof skips === 'undefined' ||
1600
1736
  typeof skips[38] === 'undefined' ||
@@ -1602,10 +1738,10 @@ export const FPScounter = Blits.Component('FPScounter', {
1602
1738
  )
1603
1739
  elms[38].set('frame', component.maxFps[1])
1604
1740
  },
1605
- function anonymous(component, elms, context, components, rootComponent, effect) {
1741
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1606
1742
  elms[39][Symbol.for('props')]['frame'] = component.maxFps[1]
1607
1743
  },
1608
- function anonymous(component, elms, context, components, rootComponent, effect) {
1744
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1609
1745
  if (
1610
1746
  typeof skips === 'undefined' ||
1611
1747
  typeof skips[40] === 'undefined' ||
@@ -1613,7 +1749,7 @@ export const FPScounter = Blits.Component('FPScounter', {
1613
1749
  )
1614
1750
  elms[40].set('frame', component.maxFps[2])
1615
1751
  },
1616
- function anonymous(component, elms, context, components, rootComponent, effect) {
1752
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1617
1753
  elms[41][Symbol.for('props')]['frame'] = component.maxFps[2]
1618
1754
  },
1619
1755
  ],
@@ -32,6 +32,48 @@ export default () =>
32
32
  code: {
33
33
  render: function anonymous(parent, component, context, components, effect, getRaw, Log) {
34
34
  const elms = []
35
+ const validAttributes = [
36
+ 'parent',
37
+ 'rotation',
38
+ 'w',
39
+ 'width',
40
+ 'h',
41
+ 'height',
42
+ 'x',
43
+ 'y',
44
+ 'z',
45
+ 'zIndex',
46
+ 'color',
47
+ 'src',
48
+ 'texture',
49
+ 'fit',
50
+ 'rtt',
51
+ 'mount',
52
+ 'pivot',
53
+ 'scale',
54
+ 'show',
55
+ 'alpha',
56
+ 'rounded',
57
+ 'border',
58
+ 'shadow',
59
+ 'shader',
60
+ 'clipping',
61
+ 'overflow',
62
+ 'font',
63
+ 'size',
64
+ 'maxwidth',
65
+ 'maxheight',
66
+ 'maxlines',
67
+ 'textoverflow',
68
+ 'letterspacing',
69
+ 'lineheight',
70
+ 'contain',
71
+ 'align',
72
+ 'content',
73
+ 'placement',
74
+ 'inspector-data',
75
+ 'holder',
76
+ ]
35
77
  const elementConfigs = []
36
78
  const forloops = []
37
79
  const props = []
@@ -53,8 +95,8 @@ export default () =>
53
95
  inSlot === true ? slotComponent : component
54
96
  )
55
97
 
56
- elementConfigs[0]['w'] = parent.node.width * (100 / 100)
57
- elementConfigs[0]['height'] = parent.node.height * (100 / 100)
98
+ elementConfigs[0]['w'] = parent.node.w * (100 / 100)
99
+ elementConfigs[0]['height'] = parent.node.h * (100 / 100)
58
100
  elms[0].populate(elementConfigs[0])
59
101
 
60
102
  if (inSlot === true) {
@@ -77,6 +119,7 @@ export default () =>
77
119
  props.length = 0
78
120
  skips.length = 0
79
121
  },
122
+ skips,
80
123
  }
81
124
  },
82
125
  effects: [],
@@ -89,9 +132,11 @@ export default () =>
89
132
  },
90
133
  hooks: {
91
134
  async ready() {
92
- if (this.parent[symbols.routerHooks] && this.parent[symbols.routerHooks].init) {
93
- await this.parent[symbols.routerHooks].init.apply(this.parent)
135
+ const parent = this[symbols.parent]
136
+ if (parent && parent[symbols.routerHooks] && parent[symbols.routerHooks].init) {
137
+ await parent[symbols.routerHooks].init.apply(parent)
94
138
  }
139
+
95
140
  hashchangeHandler = () => Router.navigate.apply(this)
96
141
  Router.navigate.apply(this)
97
142
  window.addEventListener('hashchange', hashchangeHandler)
@@ -107,13 +152,20 @@ export default () =>
107
152
  },
108
153
  input: {
109
154
  back(e) {
155
+ const parent = this[symbols.parent]
156
+
110
157
  if (routerState.backNavigation === false) {
111
- this.parent.$input(e)
158
+ if (parent && parent.$input) {
159
+ parent.$input(e)
160
+ }
112
161
  return
113
162
  }
163
+
114
164
  const navigating = Router.back.call(this)
115
165
  if (navigating === false) {
116
- this.parent.$focus(e)
166
+ if (parent && parent.$focus) {
167
+ parent.$focus(e)
168
+ }
117
169
  }
118
170
  },
119
171
  },