@lightningjs/blits 2.0.0-beta.1 → 2.0.0-beta.4

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/CHANGELOG.md +76 -0
  2. package/README.md +2 -0
  3. package/element-test-full.txt +0 -0
  4. package/index.d.ts +106 -13
  5. package/package.json +25 -4
  6. package/scripts/prepublishOnly.js +13 -4
  7. package/scripts/prepush.js +21 -1
  8. package/src/announcer/announcer.js +50 -4
  9. package/src/announcer/speechSynthesis.js +156 -37
  10. package/src/application.js +95 -3
  11. package/src/component/base/methods.js +5 -2
  12. package/src/component/base/router.js +6 -0
  13. package/src/component/base/timeouts_intervals.js +56 -0
  14. package/src/component/setup/routes.js +5 -0
  15. package/src/component/setup/state.js +2 -0
  16. package/src/component.js +64 -24
  17. package/src/components/Circle.js +5 -3
  18. package/src/components/FPScounter.js +1591 -1577
  19. package/src/components/RouterView.js +141 -124
  20. package/src/components/Sprite.js +29 -8
  21. package/src/components/index.js +0 -2
  22. package/src/engines/L3/element.js +101 -7
  23. package/src/engines/L3/launch.js +4 -1
  24. package/src/{focus.js → focus/focus.js} +6 -18
  25. package/src/focus/helpers.js +31 -0
  26. package/src/focus/hover.js +94 -0
  27. package/src/launch.js +1 -0
  28. package/src/lib/codegenerator/generator.js +44 -8
  29. package/src/lib/lifecycle.js +34 -3
  30. package/src/lib/log.js +4 -4
  31. package/src/lib/precompiler/precompiler.js +23 -14
  32. package/src/lib/reactivity/effect.js +3 -2
  33. package/src/lib/reactivityguard/computedprops.js +86 -15
  34. package/src/lib/shaders/shaders.js +2 -1
  35. package/src/lib/symbols.js +2 -0
  36. package/src/plugins/appstate.d.ts +26 -0
  37. package/src/plugins/index.d.ts +28 -0
  38. package/src/plugins/language.d.ts +37 -0
  39. package/src/plugins/storage/storage.d.ts +31 -0
  40. package/src/plugins/theme.d.ts +43 -0
  41. package/src/plugins/theme.js +30 -3
  42. package/src/router/router.js +78 -14
  43. package/test-output.txt +0 -0
  44. package/vite/preCompiler.js +15 -5
  45. package/vscode/data/template-attributes.json +335 -86
@@ -15,1785 +15,1799 @@
15
15
  * SPDX-License-Identifier: Apache-2.0
16
16
  */
17
17
 
18
- import Component from '../component.js'
18
+ import Blits from '../../index.js'
19
19
  import { renderer } from '../launch.js'
20
20
  import fps_sprite from '../../public/assets/fps_sprite.base64.js'
21
21
 
22
- export default () =>
23
- Component('FPScounter', {
24
- /* eslint-disable no-unused-vars */
25
- code: {
26
- render: function anonymous(parent, component, context, components, effect, getRaw, Log) {
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
- ]
69
- const elementConfigs = []
70
- const forloops = []
71
- const props = []
72
- const created = []
73
- const effects = {}
74
- const skips = []
75
- let componentType
76
- let rootComponent = component
77
- let propData
78
- let slotComponent
79
- let inSlot = false
80
- let slotChildCounter = 0
81
- let cmps = []
82
- elementConfigs[0] = {}
83
-
84
- elms[0] = this.element(
85
- { parent: parent || 'root' },
86
- inSlot === true ? slotComponent : component
87
- )
88
-
89
- elms[0].populate(elementConfigs[0])
90
-
91
- if (inSlot === true) {
92
- slotChildCounter -= 1
93
- }
94
-
95
- parent = elms[0]
96
- elementConfigs[1] = {}
97
-
98
- elms[1] = this.element(
99
- { parent: parent || 'root' },
100
- inSlot === true ? slotComponent : component
101
- )
102
-
103
- elementConfigs[1]['y'] = 15
104
- elementConfigs[1]['x'] = 20
105
- elms[1].populate(elementConfigs[1])
106
-
107
- if (inSlot === true) {
108
- slotChildCounter -= 1
109
- }
110
-
111
- parent = elms[1]
112
- elementConfigs[2] = {}
113
-
114
- elms[2] = this.element(
115
- { parent: parent || 'root' },
116
- inSlot === true ? slotComponent : component
117
- )
118
-
119
- elms[2].populate(elementConfigs[2])
120
-
121
- if (inSlot === true) {
122
- slotChildCounter -= 1
123
- }
22
+ // exporting as named export to allow selective importing
23
+ export const FPScounter = Blits.Component('FPScounter', {
24
+ /* eslint-disable no-unused-vars */
25
+ code: {
26
+ render: function anonymous(parent, component, context, components, effect, getRaw, Log) {
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
+ ]
70
+ const elementConfigs = []
71
+ const forloops = []
72
+ const props = []
73
+ const created = []
74
+ const effects = {}
75
+ const skips = []
76
+ let componentType
77
+ let rootComponent = component
78
+ let propData
79
+ let slotComponent
80
+ let inSlot = false
81
+ let slotChildCounter = 0
82
+ let cmps = []
83
+ elementConfigs[0] = {}
84
+ elementConfigs[0]['___wrapper'] = true
85
+
86
+ elms[0] = this.element(
87
+ { parent: parent || 'root' },
88
+ inSlot === true ? slotComponent : component
89
+ )
90
+
91
+ elms[0].populate(elementConfigs[0])
92
+
93
+ if (inSlot === true) {
94
+ slotChildCounter -= 1
95
+ }
124
96
 
125
- cmps[3] = (context.components && context.components['Sprite']) || components['Sprite']
97
+ parent = elms[0]
98
+ elementConfigs[1] = {}
126
99
 
127
- parent = elms[2]
128
- elementConfigs[3] = {}
100
+ elms[1] = this.element(
101
+ { parent: parent || 'root' },
102
+ inSlot === true ? slotComponent : component
103
+ )
129
104
 
130
- elms[3] = this.element(
131
- { parent: parent || 'root' },
132
- inSlot === true ? slotComponent : component
133
- )
105
+ elementConfigs[1]['y'] = 15
106
+ elementConfigs[1]['x'] = 20
107
+ elms[1].populate(elementConfigs[1])
134
108
 
135
- elementConfigs[3]['image'] = component.image
136
- elementConfigs[3]['w'] = 43
137
- elementConfigs[3]['h'] = 25
138
- elementConfigs[3]['map'] = component.sprite
139
- elementConfigs[3]['frame'] = 'fps'
140
-
141
- skips[3] = []
142
- if (typeof cmps[3] !== 'undefined' && cmps[3][Symbol.for('config')].props !== undefined) {
143
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
144
- let props = cmps[3][Symbol.for('config')].props
145
- if (Array.isArray(props) === false)
146
- props = Object.keys(cmps[3][Symbol.for('config')].props)
147
- for (let k = 0; k < props.length; k++) {
148
- const key = props[k]
149
- if (validAttributes.indexOf(key) !== -1) continue
150
- delete elementConfigs[3][key]
151
- skips[3].push(key)
152
- }
153
- }
154
-
155
- elms[3].populate(elementConfigs[3])
109
+ if (inSlot === true) {
110
+ slotChildCounter -= 1
111
+ }
156
112
 
157
- if (inSlot === true) {
158
- slotChildCounter -= 1
159
- }
113
+ parent = elms[1]
114
+ elementConfigs[2] = {}
160
115
 
161
- parent = elms[3]
162
- props[4] = {}
163
- props[4]['image'] = component.image
164
- props[4]['w'] = 43
165
- props[4]['h'] = 25
166
- props[4]['map'] = component.sprite
167
- props[4]['frame'] = 'fps'
168
-
169
- componentType = props[4]['is'] || 'Sprite'
170
-
171
- components[4]
172
- if (typeof componentType === 'string') {
173
- components[4] =
174
- (context.components && context.components[componentType]) || components[componentType]
175
- if (!components[4]) {
176
- throw new Error('Component "Sprite" not found')
177
- }
178
- } else if (
179
- typeof componentType === 'function' &&
180
- componentType[Symbol.for('isComponent')] === true
181
- ) {
182
- components[4] = componentType
183
- }
116
+ elms[2] = this.element(
117
+ { parent: parent || 'root' },
118
+ inSlot === true ? slotComponent : component
119
+ )
184
120
 
185
- elms[4] = components[4].call(null, { props: props[4] }, elms[3], component)
121
+ elms[2].populate(elementConfigs[2])
186
122
 
187
- if (elms[4][Symbol.for('slots')][0]) {
188
- parent = elms[4][Symbol.for('slots')][0]
189
- slotComponent = elms[4]
190
- inSlot = true
191
- } else {
192
- parent = elms[4][Symbol.for('children')][0]
193
- }
123
+ if (inSlot === true) {
124
+ slotChildCounter -= 1
125
+ }
194
126
 
195
- if (inSlot === true && slotChildCounter === 0) {
196
- inSlot = false
127
+ cmps[3] = (context.components && context.components['Sprite']) || components['Sprite']
128
+
129
+ parent = elms[2]
130
+ elementConfigs[3] = {}
131
+
132
+ elms[3] = this.element(
133
+ { parent: parent || 'root' },
134
+ inSlot === true ? slotComponent : component
135
+ )
136
+
137
+ elementConfigs[3]['holder'] = true
138
+ elementConfigs[3]['image'] = component.image
139
+ elementConfigs[3]['w'] = 43
140
+ elementConfigs[3]['h'] = 25
141
+ elementConfigs[3]['map'] = component.sprite
142
+ elementConfigs[3]['frame'] = 'fps'
143
+
144
+ skips[3] = []
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)
197
154
  }
155
+ }
198
156
 
199
- parent = elms[2]
200
- elementConfigs[5] = {}
201
-
202
- elms[5] = this.element(
203
- { parent: parent || 'root' },
204
- inSlot === true ? slotComponent : component
205
- )
206
-
207
- elementConfigs[5]['x'] = 58
208
- elementConfigs[5]['y'] = 2
209
- elms[5].populate(elementConfigs[5])
157
+ elms[3].populate(elementConfigs[3])
210
158
 
211
- if (inSlot === true) {
212
- slotChildCounter -= 1
213
- }
214
-
215
- cmps[6] = (context.components && context.components['Sprite']) || components['Sprite']
159
+ if (inSlot === true) {
160
+ slotChildCounter -= 1
161
+ }
216
162
 
217
- parent = elms[5]
218
- elementConfigs[6] = {}
163
+ parent = elms[3]
164
+ props[4] = {}
165
+ props[4]['image'] = component.image
166
+ props[4]['w'] = 43
167
+ props[4]['h'] = 25
168
+ props[4]['map'] = component.sprite
169
+ props[4]['frame'] = 'fps'
170
+
171
+ componentType = props[4]['is'] || 'Sprite'
172
+
173
+ components[4]
174
+ if (typeof componentType === 'string') {
175
+ components[4] =
176
+ (context.components && context.components[componentType]) || components[componentType]
177
+ if (!components[4]) {
178
+ throw new Error('Component "Sprite" not found')
179
+ }
180
+ } else if (
181
+ typeof componentType === 'function' &&
182
+ componentType[Symbol.for('isComponent')] === true
183
+ ) {
184
+ components[4] = componentType
185
+ }
219
186
 
220
- elms[6] = this.element(
221
- { parent: parent || 'root' },
222
- inSlot === true ? slotComponent : component
223
- )
187
+ elms[4] = components[4].call(null, { props: props[4] }, elms[3], component)
224
188
 
225
- elementConfigs[6]['image'] = component.image
226
- elementConfigs[6]['x'] = 0
227
- elementConfigs[6]['h'] = 20
228
- elementConfigs[6]['w'] = 20
229
- elementConfigs[6]['map'] = component.sprite
230
- elementConfigs[6]['frame'] = component.fps[0]
231
-
232
- skips[6] = []
233
- if (typeof cmps[6] !== 'undefined' && cmps[6][Symbol.for('config')].props !== undefined) {
234
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
235
- let props = cmps[6][Symbol.for('config')].props
236
- if (Array.isArray(props) === false)
237
- props = Object.keys(cmps[6][Symbol.for('config')].props)
238
- for (let k = 0; k < props.length; k++) {
239
- const key = props[k]
240
- if (validAttributes.indexOf(key) !== -1) continue
241
- delete elementConfigs[6][key]
242
- skips[6].push(key)
243
- }
244
- }
189
+ if (elms[4][Symbol.for('slots')][0]) {
190
+ parent = elms[4][Symbol.for('slots')][0]
191
+ slotComponent = elms[4]
192
+ inSlot = true
193
+ } else {
194
+ parent = elms[4][Symbol.for('children')][0]
195
+ }
245
196
 
246
- elms[6].populate(elementConfigs[6])
197
+ if (inSlot === true && slotChildCounter === 0) {
198
+ inSlot = false
199
+ }
247
200
 
248
- if (inSlot === true) {
249
- slotChildCounter -= 1
250
- }
201
+ parent = elms[2]
202
+ elementConfigs[5] = {}
251
203
 
252
- parent = elms[6]
253
- props[7] = {}
254
- props[7]['image'] = component.image
255
- props[7]['x'] = 0
256
- props[7]['h'] = 20
257
- props[7]['w'] = 20
258
- props[7]['map'] = component.sprite
259
-
260
- propData = component.fps[0]
261
- if (Array.isArray(propData) === true) {
262
- propData = getRaw(propData).slice(0)
263
- }
264
- props[7]['frame'] = propData
265
-
266
- componentType = props[7]['is'] || 'Sprite'
267
-
268
- components[7]
269
- if (typeof componentType === 'string') {
270
- components[7] =
271
- (context.components && context.components[componentType]) || components[componentType]
272
- if (!components[7]) {
273
- throw new Error('Component "Sprite" not found')
274
- }
275
- } else if (
276
- typeof componentType === 'function' &&
277
- componentType[Symbol.for('isComponent')] === true
278
- ) {
279
- components[7] = componentType
280
- }
204
+ elms[5] = this.element(
205
+ { parent: parent || 'root' },
206
+ inSlot === true ? slotComponent : component
207
+ )
281
208
 
282
- elms[7] = components[7].call(null, { props: props[7] }, elms[6], component)
209
+ elementConfigs[5]['x'] = 58
210
+ elementConfigs[5]['y'] = 2
211
+ elms[5].populate(elementConfigs[5])
283
212
 
284
- if (elms[7][Symbol.for('slots')][0]) {
285
- parent = elms[7][Symbol.for('slots')][0]
286
- slotComponent = elms[7]
287
- inSlot = true
288
- } else {
289
- parent = elms[7][Symbol.for('children')][0]
290
- }
213
+ if (inSlot === true) {
214
+ slotChildCounter -= 1
215
+ }
291
216
 
292
- if (inSlot === true && slotChildCounter === 0) {
293
- inSlot = false
217
+ cmps[6] = (context.components && context.components['Sprite']) || components['Sprite']
218
+
219
+ parent = elms[5]
220
+ elementConfigs[6] = {}
221
+
222
+ elms[6] = this.element(
223
+ { parent: parent || 'root' },
224
+ inSlot === true ? slotComponent : component
225
+ )
226
+
227
+ elementConfigs[6]['holder'] = true
228
+ elementConfigs[6]['image'] = component.image
229
+ elementConfigs[6]['x'] = 0
230
+ elementConfigs[6]['h'] = 20
231
+ elementConfigs[6]['w'] = 20
232
+ elementConfigs[6]['map'] = component.sprite
233
+ elementConfigs[6]['frame'] = component.fps[0]
234
+
235
+ skips[6] = []
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)
294
245
  }
246
+ }
295
247
 
296
- cmps[8] = (context.components && context.components['Sprite']) || components['Sprite']
297
-
298
- parent = elms[5]
299
- elementConfigs[8] = {}
300
-
301
- elms[8] = this.element(
302
- { parent: parent || 'root' },
303
- inSlot === true ? slotComponent : component
304
- )
248
+ elms[6].populate(elementConfigs[6])
305
249
 
306
- elementConfigs[8]['image'] = component.image
307
- elementConfigs[8]['x'] = 18
308
- elementConfigs[8]['h'] = 20
309
- elementConfigs[8]['w'] = 20
310
- elementConfigs[8]['map'] = component.sprite
311
- elementConfigs[8]['frame'] = component.fps[1]
312
-
313
- skips[8] = []
314
- if (typeof cmps[8] !== 'undefined' && cmps[8][Symbol.for('config')].props !== undefined) {
315
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
316
- let props = cmps[8][Symbol.for('config')].props
317
- if (Array.isArray(props) === false)
318
- props = Object.keys(cmps[8][Symbol.for('config')].props)
319
- for (let k = 0; k < props.length; k++) {
320
- const key = props[k]
321
- if (validAttributes.indexOf(key) !== -1) continue
322
- delete elementConfigs[8][key]
323
- skips[8].push(key)
324
- }
325
- }
250
+ if (inSlot === true) {
251
+ slotChildCounter -= 1
252
+ }
326
253
 
327
- elms[8].populate(elementConfigs[8])
254
+ parent = elms[6]
255
+ props[7] = {}
256
+ props[7]['image'] = component.image
257
+ props[7]['x'] = 0
258
+ props[7]['h'] = 20
259
+ props[7]['w'] = 20
260
+ props[7]['map'] = component.sprite
261
+
262
+ propData = component.fps[0]
263
+ if (Array.isArray(propData) === true) {
264
+ propData = getRaw(propData).slice(0)
265
+ }
266
+ props[7]['frame'] = propData
267
+
268
+ componentType = props[7]['is'] || 'Sprite'
269
+
270
+ components[7]
271
+ if (typeof componentType === 'string') {
272
+ components[7] =
273
+ (context.components && context.components[componentType]) || components[componentType]
274
+ if (!components[7]) {
275
+ throw new Error('Component "Sprite" not found')
276
+ }
277
+ } else if (
278
+ typeof componentType === 'function' &&
279
+ componentType[Symbol.for('isComponent')] === true
280
+ ) {
281
+ components[7] = componentType
282
+ }
328
283
 
329
- if (inSlot === true) {
330
- slotChildCounter -= 1
331
- }
284
+ elms[7] = components[7].call(null, { props: props[7] }, elms[6], component)
332
285
 
333
- parent = elms[8]
334
- props[9] = {}
335
- props[9]['image'] = component.image
336
- props[9]['x'] = 18
337
- props[9]['h'] = 20
338
- props[9]['w'] = 20
339
- props[9]['map'] = component.sprite
340
-
341
- propData = component.fps[1]
342
- if (Array.isArray(propData) === true) {
343
- propData = getRaw(propData).slice(0)
344
- }
345
- props[9]['frame'] = propData
346
-
347
- componentType = props[9]['is'] || 'Sprite'
348
-
349
- components[9]
350
- if (typeof componentType === 'string') {
351
- components[9] =
352
- (context.components && context.components[componentType]) || components[componentType]
353
- if (!components[9]) {
354
- throw new Error('Component "Sprite" not found')
355
- }
356
- } else if (
357
- typeof componentType === 'function' &&
358
- componentType[Symbol.for('isComponent')] === true
359
- ) {
360
- components[9] = componentType
361
- }
362
-
363
- elms[9] = components[9].call(null, { props: props[9] }, elms[8], component)
286
+ if (elms[7][Symbol.for('slots')][0]) {
287
+ parent = elms[7][Symbol.for('slots')][0]
288
+ slotComponent = elms[7]
289
+ inSlot = true
290
+ } else {
291
+ parent = elms[7][Symbol.for('children')][0]
292
+ }
364
293
 
365
- if (elms[9][Symbol.for('slots')][0]) {
366
- parent = elms[9][Symbol.for('slots')][0]
367
- slotComponent = elms[9]
368
- inSlot = true
369
- } else {
370
- parent = elms[9][Symbol.for('children')][0]
371
- }
294
+ if (inSlot === true && slotChildCounter === 0) {
295
+ inSlot = false
296
+ }
372
297
 
373
- if (inSlot === true && slotChildCounter === 0) {
374
- inSlot = false
298
+ cmps[8] = (context.components && context.components['Sprite']) || components['Sprite']
299
+
300
+ parent = elms[5]
301
+ elementConfigs[8] = {}
302
+
303
+ elms[8] = this.element(
304
+ { parent: parent || 'root' },
305
+ inSlot === true ? slotComponent : component
306
+ )
307
+
308
+ elementConfigs[8]['holder'] = true
309
+ elementConfigs[8]['image'] = component.image
310
+ elementConfigs[8]['x'] = 18
311
+ elementConfigs[8]['h'] = 20
312
+ elementConfigs[8]['w'] = 20
313
+ elementConfigs[8]['map'] = component.sprite
314
+ elementConfigs[8]['frame'] = component.fps[1]
315
+
316
+ skips[8] = []
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)
375
326
  }
327
+ }
376
328
 
377
- cmps[10] = (context.components && context.components['Sprite']) || components['Sprite']
378
-
379
- parent = elms[5]
380
- elementConfigs[10] = {}
381
-
382
- elms[10] = this.element(
383
- { parent: parent || 'root' },
384
- inSlot === true ? slotComponent : component
385
- )
386
-
387
- elementConfigs[10]['image'] = component.image
388
- elementConfigs[10]['x'] = 36
389
- elementConfigs[10]['h'] = 20
390
- elementConfigs[10]['w'] = 20
391
- elementConfigs[10]['map'] = component.sprite
392
- elementConfigs[10]['frame'] = component.fps[2]
393
-
394
- skips[10] = []
395
- if (typeof cmps[10] !== 'undefined' && cmps[10][Symbol.for('config')].props !== undefined) {
396
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
397
- let props = cmps[10][Symbol.for('config')].props
398
- if (Array.isArray(props) === false)
399
- props = Object.keys(cmps[10][Symbol.for('config')].props)
400
- for (let k = 0; k < props.length; k++) {
401
- const key = props[k]
402
- if (validAttributes.indexOf(key) !== -1) continue
403
- delete elementConfigs[10][key]
404
- skips[10].push(key)
405
- }
406
- }
329
+ elms[8].populate(elementConfigs[8])
407
330
 
408
- elms[10].populate(elementConfigs[10])
331
+ if (inSlot === true) {
332
+ slotChildCounter -= 1
333
+ }
409
334
 
410
- if (inSlot === true) {
411
- slotChildCounter -= 1
412
- }
335
+ parent = elms[8]
336
+ props[9] = {}
337
+ props[9]['image'] = component.image
338
+ props[9]['x'] = 18
339
+ props[9]['h'] = 20
340
+ props[9]['w'] = 20
341
+ props[9]['map'] = component.sprite
342
+
343
+ propData = component.fps[1]
344
+ if (Array.isArray(propData) === true) {
345
+ propData = getRaw(propData).slice(0)
346
+ }
347
+ props[9]['frame'] = propData
348
+
349
+ componentType = props[9]['is'] || 'Sprite'
350
+
351
+ components[9]
352
+ if (typeof componentType === 'string') {
353
+ components[9] =
354
+ (context.components && context.components[componentType]) || components[componentType]
355
+ if (!components[9]) {
356
+ throw new Error('Component "Sprite" not found')
357
+ }
358
+ } else if (
359
+ typeof componentType === 'function' &&
360
+ componentType[Symbol.for('isComponent')] === true
361
+ ) {
362
+ components[9] = componentType
363
+ }
413
364
 
414
- parent = elms[10]
415
- props[11] = {}
416
- props[11]['image'] = component.image
417
- props[11]['x'] = 36
418
- props[11]['h'] = 20
419
- props[11]['w'] = 20
420
- props[11]['map'] = component.sprite
421
-
422
- propData = component.fps[2]
423
- if (Array.isArray(propData) === true) {
424
- propData = getRaw(propData).slice(0)
425
- }
426
- props[11]['frame'] = propData
427
-
428
- componentType = props[11]['is'] || 'Sprite'
429
-
430
- components[11]
431
- if (typeof componentType === 'string') {
432
- components[11] =
433
- (context.components && context.components[componentType]) || components[componentType]
434
- if (!components[11]) {
435
- throw new Error('Component "Sprite" not found')
436
- }
437
- } else if (
438
- typeof componentType === 'function' &&
439
- componentType[Symbol.for('isComponent')] === true
440
- ) {
441
- components[11] = componentType
442
- }
365
+ elms[9] = components[9].call(null, { props: props[9] }, elms[8], component)
443
366
 
444
- elms[11] = components[11].call(null, { props: props[11] }, elms[10], component)
367
+ if (elms[9][Symbol.for('slots')][0]) {
368
+ parent = elms[9][Symbol.for('slots')][0]
369
+ slotComponent = elms[9]
370
+ inSlot = true
371
+ } else {
372
+ parent = elms[9][Symbol.for('children')][0]
373
+ }
445
374
 
446
- if (elms[11][Symbol.for('slots')][0]) {
447
- parent = elms[11][Symbol.for('slots')][0]
448
- slotComponent = elms[11]
449
- inSlot = true
450
- } else {
451
- parent = elms[11][Symbol.for('children')][0]
452
- }
375
+ if (inSlot === true && slotChildCounter === 0) {
376
+ inSlot = false
377
+ }
453
378
 
454
- if (inSlot === true && slotChildCounter === 0) {
455
- inSlot = false
379
+ cmps[10] = (context.components && context.components['Sprite']) || components['Sprite']
380
+
381
+ parent = elms[5]
382
+ elementConfigs[10] = {}
383
+
384
+ elms[10] = this.element(
385
+ { parent: parent || 'root' },
386
+ inSlot === true ? slotComponent : component
387
+ )
388
+
389
+ elementConfigs[10]['holder'] = true
390
+ elementConfigs[10]['image'] = component.image
391
+ elementConfigs[10]['x'] = 36
392
+ elementConfigs[10]['h'] = 20
393
+ elementConfigs[10]['w'] = 20
394
+ elementConfigs[10]['map'] = component.sprite
395
+ elementConfigs[10]['frame'] = component.fps[2]
396
+
397
+ skips[10] = []
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)
456
408
  }
409
+ }
457
410
 
458
- parent = elms[1]
459
- elementConfigs[12] = {}
460
-
461
- elms[12] = this.element(
462
- { parent: parent || 'root' },
463
- inSlot === true ? slotComponent : component
464
- )
465
-
466
- elementConfigs[12]['x'] = 150
467
- elms[12].populate(elementConfigs[12])
468
-
469
- if (inSlot === true) {
470
- slotChildCounter -= 1
471
- }
411
+ elms[10].populate(elementConfigs[10])
472
412
 
473
- cmps[13] = (context.components && context.components['Sprite']) || components['Sprite']
413
+ if (inSlot === true) {
414
+ slotChildCounter -= 1
415
+ }
474
416
 
475
- parent = elms[12]
476
- elementConfigs[13] = {}
417
+ parent = elms[10]
418
+ props[11] = {}
419
+ props[11]['image'] = component.image
420
+ props[11]['x'] = 36
421
+ props[11]['h'] = 20
422
+ props[11]['w'] = 20
423
+ props[11]['map'] = component.sprite
424
+
425
+ propData = component.fps[2]
426
+ if (Array.isArray(propData) === true) {
427
+ propData = getRaw(propData).slice(0)
428
+ }
429
+ props[11]['frame'] = propData
430
+
431
+ componentType = props[11]['is'] || 'Sprite'
432
+
433
+ components[11]
434
+ if (typeof componentType === 'string') {
435
+ components[11] =
436
+ (context.components && context.components[componentType]) || components[componentType]
437
+ if (!components[11]) {
438
+ throw new Error('Component "Sprite" not found')
439
+ }
440
+ } else if (
441
+ typeof componentType === 'function' &&
442
+ componentType[Symbol.for('isComponent')] === true
443
+ ) {
444
+ components[11] = componentType
445
+ }
477
446
 
478
- elms[13] = this.element(
479
- { parent: parent || 'root' },
480
- inSlot === true ? slotComponent : component
481
- )
447
+ elms[11] = components[11].call(null, { props: props[11] }, elms[10], component)
482
448
 
483
- elementConfigs[13]['image'] = component.image
484
- elementConfigs[13]['y'] = 2
485
- elementConfigs[13]['w'] = 48
486
- elementConfigs[13]['h'] = 25
487
- elementConfigs[13]['map'] = component.sprite
488
- elementConfigs[13]['frame'] = 'avg'
489
-
490
- skips[13] = []
491
- if (typeof cmps[13] !== 'undefined' && cmps[13][Symbol.for('config')].props !== undefined) {
492
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
493
- let props = cmps[13][Symbol.for('config')].props
494
- if (Array.isArray(props) === false)
495
- props = Object.keys(cmps[13][Symbol.for('config')].props)
496
- for (let k = 0; k < props.length; k++) {
497
- const key = props[k]
498
- if (validAttributes.indexOf(key) !== -1) continue
499
- delete elementConfigs[13][key]
500
- skips[13].push(key)
501
- }
502
- }
449
+ if (elms[11][Symbol.for('slots')][0]) {
450
+ parent = elms[11][Symbol.for('slots')][0]
451
+ slotComponent = elms[11]
452
+ inSlot = true
453
+ } else {
454
+ parent = elms[11][Symbol.for('children')][0]
455
+ }
503
456
 
504
- elms[13].populate(elementConfigs[13])
457
+ if (inSlot === true && slotChildCounter === 0) {
458
+ inSlot = false
459
+ }
505
460
 
506
- if (inSlot === true) {
507
- slotChildCounter -= 1
508
- }
461
+ parent = elms[1]
462
+ elementConfigs[12] = {}
509
463
 
510
- parent = elms[13]
511
- props[14] = {}
512
- props[14]['image'] = component.image
513
- props[14]['y'] = 2
514
- props[14]['w'] = 48
515
- props[14]['h'] = 25
516
- props[14]['map'] = component.sprite
517
- props[14]['frame'] = 'avg'
518
-
519
- componentType = props[14]['is'] || 'Sprite'
520
-
521
- components[14]
522
- if (typeof componentType === 'string') {
523
- components[14] =
524
- (context.components && context.components[componentType]) || components[componentType]
525
- if (!components[14]) {
526
- throw new Error('Component "Sprite" not found')
527
- }
528
- } else if (
529
- typeof componentType === 'function' &&
530
- componentType[Symbol.for('isComponent')] === true
531
- ) {
532
- components[14] = componentType
533
- }
464
+ elms[12] = this.element(
465
+ { parent: parent || 'root' },
466
+ inSlot === true ? slotComponent : component
467
+ )
534
468
 
535
- elms[14] = components[14].call(null, { props: props[14] }, elms[13], component)
469
+ elementConfigs[12]['x'] = 150
470
+ elms[12].populate(elementConfigs[12])
536
471
 
537
- if (elms[14][Symbol.for('slots')][0]) {
538
- parent = elms[14][Symbol.for('slots')][0]
539
- slotComponent = elms[14]
540
- inSlot = true
541
- } else {
542
- parent = elms[14][Symbol.for('children')][0]
543
- }
472
+ if (inSlot === true) {
473
+ slotChildCounter -= 1
474
+ }
544
475
 
545
- if (inSlot === true && slotChildCounter === 0) {
546
- inSlot = false
476
+ cmps[13] = (context.components && context.components['Sprite']) || components['Sprite']
477
+
478
+ parent = elms[12]
479
+ elementConfigs[13] = {}
480
+
481
+ elms[13] = this.element(
482
+ { parent: parent || 'root' },
483
+ inSlot === true ? slotComponent : component
484
+ )
485
+
486
+ elementConfigs[13]['holder'] = true
487
+ elementConfigs[13]['image'] = component.image
488
+ elementConfigs[13]['y'] = 2
489
+ elementConfigs[13]['w'] = 48
490
+ elementConfigs[13]['h'] = 25
491
+ elementConfigs[13]['map'] = component.sprite
492
+ elementConfigs[13]['frame'] = 'avg'
493
+
494
+ skips[13] = []
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)
547
505
  }
506
+ }
548
507
 
549
- parent = elms[12]
550
- elementConfigs[15] = {}
551
-
552
- elms[15] = this.element(
553
- { parent: parent || 'root' },
554
- inSlot === true ? slotComponent : component
555
- )
556
-
557
- elementConfigs[15]['x'] = 63
558
- elementConfigs[15]['y'] = 2
559
- elms[15].populate(elementConfigs[15])
508
+ elms[13].populate(elementConfigs[13])
560
509
 
561
- if (inSlot === true) {
562
- slotChildCounter -= 1
563
- }
510
+ if (inSlot === true) {
511
+ slotChildCounter -= 1
512
+ }
564
513
 
565
- cmps[16] = (context.components && context.components['Sprite']) || components['Sprite']
514
+ parent = elms[13]
515
+ props[14] = {}
516
+ props[14]['image'] = component.image
517
+ props[14]['y'] = 2
518
+ props[14]['w'] = 48
519
+ props[14]['h'] = 25
520
+ props[14]['map'] = component.sprite
521
+ props[14]['frame'] = 'avg'
522
+
523
+ componentType = props[14]['is'] || 'Sprite'
524
+
525
+ components[14]
526
+ if (typeof componentType === 'string') {
527
+ components[14] =
528
+ (context.components && context.components[componentType]) || components[componentType]
529
+ if (!components[14]) {
530
+ throw new Error('Component "Sprite" not found')
531
+ }
532
+ } else if (
533
+ typeof componentType === 'function' &&
534
+ componentType[Symbol.for('isComponent')] === true
535
+ ) {
536
+ components[14] = componentType
537
+ }
566
538
 
567
- parent = elms[15]
568
- elementConfigs[16] = {}
539
+ elms[14] = components[14].call(null, { props: props[14] }, elms[13], component)
569
540
 
570
- elms[16] = this.element(
571
- { parent: parent || 'root' },
572
- inSlot === true ? slotComponent : component
573
- )
574
-
575
- elementConfigs[16]['image'] = component.image
576
- elementConfigs[16]['x'] = 0
577
- elementConfigs[16]['h'] = 20
578
- elementConfigs[16]['w'] = 20
579
- elementConfigs[16]['map'] = component.sprite
580
- elementConfigs[16]['frame'] = component.avgFps[0]
581
-
582
- skips[16] = []
583
- if (typeof cmps[16] !== 'undefined' && cmps[16][Symbol.for('config')].props !== undefined) {
584
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
585
- let props = cmps[16][Symbol.for('config')].props
586
- if (Array.isArray(props) === false)
587
- props = Object.keys(cmps[16][Symbol.for('config')].props)
588
- for (let k = 0; k < props.length; k++) {
589
- const key = props[k]
590
- if (validAttributes.indexOf(key) !== -1) continue
591
- delete elementConfigs[16][key]
592
- skips[16].push(key)
593
- }
594
- }
541
+ if (elms[14][Symbol.for('slots')][0]) {
542
+ parent = elms[14][Symbol.for('slots')][0]
543
+ slotComponent = elms[14]
544
+ inSlot = true
545
+ } else {
546
+ parent = elms[14][Symbol.for('children')][0]
547
+ }
595
548
 
596
- elms[16].populate(elementConfigs[16])
549
+ if (inSlot === true && slotChildCounter === 0) {
550
+ inSlot = false
551
+ }
597
552
 
598
- if (inSlot === true) {
599
- slotChildCounter -= 1
600
- }
553
+ parent = elms[12]
554
+ elementConfigs[15] = {}
601
555
 
602
- parent = elms[16]
603
- props[17] = {}
604
- props[17]['image'] = component.image
605
- props[17]['x'] = 0
606
- props[17]['h'] = 20
607
- props[17]['w'] = 20
608
- props[17]['map'] = component.sprite
609
-
610
- propData = component.avgFps[0]
611
- if (Array.isArray(propData) === true) {
612
- propData = getRaw(propData).slice(0)
613
- }
614
- props[17]['frame'] = propData
615
-
616
- componentType = props[17]['is'] || 'Sprite'
617
-
618
- components[17]
619
- if (typeof componentType === 'string') {
620
- components[17] =
621
- (context.components && context.components[componentType]) || components[componentType]
622
- if (!components[17]) {
623
- throw new Error('Component "Sprite" not found')
624
- }
625
- } else if (
626
- typeof componentType === 'function' &&
627
- componentType[Symbol.for('isComponent')] === true
628
- ) {
629
- components[17] = componentType
630
- }
556
+ elms[15] = this.element(
557
+ { parent: parent || 'root' },
558
+ inSlot === true ? slotComponent : component
559
+ )
631
560
 
632
- elms[17] = components[17].call(null, { props: props[17] }, elms[16], component)
561
+ elementConfigs[15]['x'] = 63
562
+ elementConfigs[15]['y'] = 2
563
+ elms[15].populate(elementConfigs[15])
633
564
 
634
- if (elms[17][Symbol.for('slots')][0]) {
635
- parent = elms[17][Symbol.for('slots')][0]
636
- slotComponent = elms[17]
637
- inSlot = true
638
- } else {
639
- parent = elms[17][Symbol.for('children')][0]
640
- }
565
+ if (inSlot === true) {
566
+ slotChildCounter -= 1
567
+ }
641
568
 
642
- if (inSlot === true && slotChildCounter === 0) {
643
- inSlot = false
569
+ cmps[16] = (context.components && context.components['Sprite']) || components['Sprite']
570
+
571
+ parent = elms[15]
572
+ elementConfigs[16] = {}
573
+
574
+ elms[16] = this.element(
575
+ { parent: parent || 'root' },
576
+ inSlot === true ? slotComponent : component
577
+ )
578
+
579
+ elementConfigs[16]['holder'] = true
580
+ elementConfigs[16]['image'] = component.image
581
+ elementConfigs[16]['x'] = 0
582
+ elementConfigs[16]['h'] = 20
583
+ elementConfigs[16]['w'] = 20
584
+ elementConfigs[16]['map'] = component.sprite
585
+ elementConfigs[16]['frame'] = component.avgFps[0]
586
+
587
+ skips[16] = []
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)
644
598
  }
599
+ }
645
600
 
646
- cmps[18] = (context.components && context.components['Sprite']) || components['Sprite']
647
-
648
- parent = elms[15]
649
- elementConfigs[18] = {}
650
-
651
- elms[18] = this.element(
652
- { parent: parent || 'root' },
653
- inSlot === true ? slotComponent : component
654
- )
655
-
656
- elementConfigs[18]['image'] = component.image
657
- elementConfigs[18]['x'] = 18
658
- elementConfigs[18]['h'] = 20
659
- elementConfigs[18]['w'] = 20
660
- elementConfigs[18]['map'] = component.sprite
661
- elementConfigs[18]['frame'] = component.avgFps[1]
662
-
663
- skips[18] = []
664
- if (typeof cmps[18] !== 'undefined' && cmps[18][Symbol.for('config')].props !== undefined) {
665
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
666
- let props = cmps[18][Symbol.for('config')].props
667
- if (Array.isArray(props) === false)
668
- props = Object.keys(cmps[18][Symbol.for('config')].props)
669
- for (let k = 0; k < props.length; k++) {
670
- const key = props[k]
671
- if (validAttributes.indexOf(key) !== -1) continue
672
- delete elementConfigs[18][key]
673
- skips[18].push(key)
674
- }
675
- }
601
+ elms[16].populate(elementConfigs[16])
676
602
 
677
- elms[18].populate(elementConfigs[18])
603
+ if (inSlot === true) {
604
+ slotChildCounter -= 1
605
+ }
678
606
 
679
- if (inSlot === true) {
680
- slotChildCounter -= 1
681
- }
607
+ parent = elms[16]
608
+ props[17] = {}
609
+ props[17]['image'] = component.image
610
+ props[17]['x'] = 0
611
+ props[17]['h'] = 20
612
+ props[17]['w'] = 20
613
+ props[17]['map'] = component.sprite
614
+
615
+ propData = component.avgFps[0]
616
+ if (Array.isArray(propData) === true) {
617
+ propData = getRaw(propData).slice(0)
618
+ }
619
+ props[17]['frame'] = propData
620
+
621
+ componentType = props[17]['is'] || 'Sprite'
622
+
623
+ components[17]
624
+ if (typeof componentType === 'string') {
625
+ components[17] =
626
+ (context.components && context.components[componentType]) || components[componentType]
627
+ if (!components[17]) {
628
+ throw new Error('Component "Sprite" not found')
629
+ }
630
+ } else if (
631
+ typeof componentType === 'function' &&
632
+ componentType[Symbol.for('isComponent')] === true
633
+ ) {
634
+ components[17] = componentType
635
+ }
682
636
 
683
- parent = elms[18]
684
- props[19] = {}
685
- props[19]['image'] = component.image
686
- props[19]['x'] = 18
687
- props[19]['h'] = 20
688
- props[19]['w'] = 20
689
- props[19]['map'] = component.sprite
690
-
691
- propData = component.avgFps[1]
692
- if (Array.isArray(propData) === true) {
693
- propData = getRaw(propData).slice(0)
694
- }
695
- props[19]['frame'] = propData
696
-
697
- componentType = props[19]['is'] || 'Sprite'
698
-
699
- components[19]
700
- if (typeof componentType === 'string') {
701
- components[19] =
702
- (context.components && context.components[componentType]) || components[componentType]
703
- if (!components[19]) {
704
- throw new Error('Component "Sprite" not found')
705
- }
706
- } else if (
707
- typeof componentType === 'function' &&
708
- componentType[Symbol.for('isComponent')] === true
709
- ) {
710
- components[19] = componentType
711
- }
637
+ elms[17] = components[17].call(null, { props: props[17] }, elms[16], component)
712
638
 
713
- elms[19] = components[19].call(null, { props: props[19] }, elms[18], component)
639
+ if (elms[17][Symbol.for('slots')][0]) {
640
+ parent = elms[17][Symbol.for('slots')][0]
641
+ slotComponent = elms[17]
642
+ inSlot = true
643
+ } else {
644
+ parent = elms[17][Symbol.for('children')][0]
645
+ }
714
646
 
715
- if (elms[19][Symbol.for('slots')][0]) {
716
- parent = elms[19][Symbol.for('slots')][0]
717
- slotComponent = elms[19]
718
- inSlot = true
719
- } else {
720
- parent = elms[19][Symbol.for('children')][0]
721
- }
647
+ if (inSlot === true && slotChildCounter === 0) {
648
+ inSlot = false
649
+ }
722
650
 
723
- if (inSlot === true && slotChildCounter === 0) {
724
- inSlot = false
651
+ cmps[18] = (context.components && context.components['Sprite']) || components['Sprite']
652
+
653
+ parent = elms[15]
654
+ elementConfigs[18] = {}
655
+
656
+ elms[18] = this.element(
657
+ { parent: parent || 'root' },
658
+ inSlot === true ? slotComponent : component
659
+ )
660
+
661
+ elementConfigs[18]['holder'] = true
662
+ elementConfigs[18]['image'] = component.image
663
+ elementConfigs[18]['x'] = 18
664
+ elementConfigs[18]['h'] = 20
665
+ elementConfigs[18]['w'] = 20
666
+ elementConfigs[18]['map'] = component.sprite
667
+ elementConfigs[18]['frame'] = component.avgFps[1]
668
+
669
+ skips[18] = []
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)
725
680
  }
681
+ }
726
682
 
727
- cmps[20] = (context.components && context.components['Sprite']) || components['Sprite']
728
-
729
- parent = elms[15]
730
- elementConfigs[20] = {}
731
-
732
- elms[20] = this.element(
733
- { parent: parent || 'root' },
734
- inSlot === true ? slotComponent : component
735
- )
736
-
737
- elementConfigs[20]['image'] = component.image
738
- elementConfigs[20]['x'] = 36
739
- elementConfigs[20]['h'] = 20
740
- elementConfigs[20]['w'] = 20
741
- elementConfigs[20]['map'] = component.sprite
742
- elementConfigs[20]['frame'] = component.avgFps[2]
743
-
744
- skips[20] = []
745
- if (typeof cmps[20] !== 'undefined' && cmps[20][Symbol.for('config')].props !== undefined) {
746
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
747
- let props = cmps[20][Symbol.for('config')].props
748
- if (Array.isArray(props) === false)
749
- props = Object.keys(cmps[20][Symbol.for('config')].props)
750
- for (let k = 0; k < props.length; k++) {
751
- const key = props[k]
752
- if (validAttributes.indexOf(key) !== -1) continue
753
- delete elementConfigs[20][key]
754
- skips[20].push(key)
755
- }
756
- }
683
+ elms[18].populate(elementConfigs[18])
757
684
 
758
- elms[20].populate(elementConfigs[20])
685
+ if (inSlot === true) {
686
+ slotChildCounter -= 1
687
+ }
759
688
 
760
- if (inSlot === true) {
761
- slotChildCounter -= 1
762
- }
689
+ parent = elms[18]
690
+ props[19] = {}
691
+ props[19]['image'] = component.image
692
+ props[19]['x'] = 18
693
+ props[19]['h'] = 20
694
+ props[19]['w'] = 20
695
+ props[19]['map'] = component.sprite
696
+
697
+ propData = component.avgFps[1]
698
+ if (Array.isArray(propData) === true) {
699
+ propData = getRaw(propData).slice(0)
700
+ }
701
+ props[19]['frame'] = propData
702
+
703
+ componentType = props[19]['is'] || 'Sprite'
704
+
705
+ components[19]
706
+ if (typeof componentType === 'string') {
707
+ components[19] =
708
+ (context.components && context.components[componentType]) || components[componentType]
709
+ if (!components[19]) {
710
+ throw new Error('Component "Sprite" not found')
711
+ }
712
+ } else if (
713
+ typeof componentType === 'function' &&
714
+ componentType[Symbol.for('isComponent')] === true
715
+ ) {
716
+ components[19] = componentType
717
+ }
763
718
 
764
- parent = elms[20]
765
- props[21] = {}
766
- props[21]['image'] = component.image
767
- props[21]['x'] = 36
768
- props[21]['h'] = 20
769
- props[21]['w'] = 20
770
- props[21]['map'] = component.sprite
771
-
772
- propData = component.avgFps[2]
773
- if (Array.isArray(propData) === true) {
774
- propData = getRaw(propData).slice(0)
775
- }
776
- props[21]['frame'] = propData
777
-
778
- componentType = props[21]['is'] || 'Sprite'
779
-
780
- components[21]
781
- if (typeof componentType === 'string') {
782
- components[21] =
783
- (context.components && context.components[componentType]) || components[componentType]
784
- if (!components[21]) {
785
- throw new Error('Component "Sprite" not found')
786
- }
787
- } else if (
788
- typeof componentType === 'function' &&
789
- componentType[Symbol.for('isComponent')] === true
790
- ) {
791
- components[21] = componentType
792
- }
719
+ elms[19] = components[19].call(null, { props: props[19] }, elms[18], component)
793
720
 
794
- elms[21] = components[21].call(null, { props: props[21] }, elms[20], component)
721
+ if (elms[19][Symbol.for('slots')][0]) {
722
+ parent = elms[19][Symbol.for('slots')][0]
723
+ slotComponent = elms[19]
724
+ inSlot = true
725
+ } else {
726
+ parent = elms[19][Symbol.for('children')][0]
727
+ }
795
728
 
796
- if (elms[21][Symbol.for('slots')][0]) {
797
- parent = elms[21][Symbol.for('slots')][0]
798
- slotComponent = elms[21]
799
- inSlot = true
800
- } else {
801
- parent = elms[21][Symbol.for('children')][0]
802
- }
729
+ if (inSlot === true && slotChildCounter === 0) {
730
+ inSlot = false
731
+ }
803
732
 
804
- if (inSlot === true && slotChildCounter === 0) {
805
- inSlot = false
733
+ cmps[20] = (context.components && context.components['Sprite']) || components['Sprite']
734
+
735
+ parent = elms[15]
736
+ elementConfigs[20] = {}
737
+
738
+ elms[20] = this.element(
739
+ { parent: parent || 'root' },
740
+ inSlot === true ? slotComponent : component
741
+ )
742
+
743
+ elementConfigs[20]['holder'] = true
744
+ elementConfigs[20]['image'] = component.image
745
+ elementConfigs[20]['x'] = 36
746
+ elementConfigs[20]['h'] = 20
747
+ elementConfigs[20]['w'] = 20
748
+ elementConfigs[20]['map'] = component.sprite
749
+ elementConfigs[20]['frame'] = component.avgFps[2]
750
+
751
+ skips[20] = []
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)
806
762
  }
763
+ }
807
764
 
808
- parent = elms[1]
809
- elementConfigs[22] = {}
810
-
811
- elms[22] = this.element(
812
- { parent: parent || 'root' },
813
- inSlot === true ? slotComponent : component
814
- )
815
-
816
- elementConfigs[22]['x'] = 0
817
- elementConfigs[22]['y'] = 40
818
- elms[22].populate(elementConfigs[22])
819
-
820
- if (inSlot === true) {
821
- slotChildCounter -= 1
822
- }
765
+ elms[20].populate(elementConfigs[20])
823
766
 
824
- cmps[23] = (context.components && context.components['Sprite']) || components['Sprite']
767
+ if (inSlot === true) {
768
+ slotChildCounter -= 1
769
+ }
825
770
 
826
- parent = elms[22]
827
- elementConfigs[23] = {}
771
+ parent = elms[20]
772
+ props[21] = {}
773
+ props[21]['image'] = component.image
774
+ props[21]['x'] = 36
775
+ props[21]['h'] = 20
776
+ props[21]['w'] = 20
777
+ props[21]['map'] = component.sprite
778
+
779
+ propData = component.avgFps[2]
780
+ if (Array.isArray(propData) === true) {
781
+ propData = getRaw(propData).slice(0)
782
+ }
783
+ props[21]['frame'] = propData
784
+
785
+ componentType = props[21]['is'] || 'Sprite'
786
+
787
+ components[21]
788
+ if (typeof componentType === 'string') {
789
+ components[21] =
790
+ (context.components && context.components[componentType]) || components[componentType]
791
+ if (!components[21]) {
792
+ throw new Error('Component "Sprite" not found')
793
+ }
794
+ } else if (
795
+ typeof componentType === 'function' &&
796
+ componentType[Symbol.for('isComponent')] === true
797
+ ) {
798
+ components[21] = componentType
799
+ }
828
800
 
829
- elms[23] = this.element(
830
- { parent: parent || 'root' },
831
- inSlot === true ? slotComponent : component
832
- )
801
+ elms[21] = components[21].call(null, { props: props[21] }, elms[20], component)
833
802
 
834
- elementConfigs[23]['image'] = component.image
835
- elementConfigs[23]['x'] = '-2'
836
- elementConfigs[23]['w'] = 47
837
- elementConfigs[23]['h'] = 25
838
- elementConfigs[23]['map'] = component.sprite
839
- elementConfigs[23]['frame'] = 'min'
840
-
841
- skips[23] = []
842
- if (typeof cmps[23] !== 'undefined' && cmps[23][Symbol.for('config')].props !== undefined) {
843
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
844
- let props = cmps[23][Symbol.for('config')].props
845
- if (Array.isArray(props) === false)
846
- props = Object.keys(cmps[23][Symbol.for('config')].props)
847
- for (let k = 0; k < props.length; k++) {
848
- const key = props[k]
849
- if (validAttributes.indexOf(key) !== -1) continue
850
- delete elementConfigs[23][key]
851
- skips[23].push(key)
852
- }
853
- }
803
+ if (elms[21][Symbol.for('slots')][0]) {
804
+ parent = elms[21][Symbol.for('slots')][0]
805
+ slotComponent = elms[21]
806
+ inSlot = true
807
+ } else {
808
+ parent = elms[21][Symbol.for('children')][0]
809
+ }
854
810
 
855
- elms[23].populate(elementConfigs[23])
811
+ if (inSlot === true && slotChildCounter === 0) {
812
+ inSlot = false
813
+ }
856
814
 
857
- if (inSlot === true) {
858
- slotChildCounter -= 1
859
- }
815
+ parent = elms[1]
816
+ elementConfigs[22] = {}
860
817
 
861
- parent = elms[23]
862
- props[24] = {}
863
- props[24]['image'] = component.image
864
- props[24]['x'] = '-2'
865
- props[24]['w'] = 47
866
- props[24]['h'] = 25
867
- props[24]['map'] = component.sprite
868
- props[24]['frame'] = 'min'
869
-
870
- componentType = props[24]['is'] || 'Sprite'
871
-
872
- components[24]
873
- if (typeof componentType === 'string') {
874
- components[24] =
875
- (context.components && context.components[componentType]) || components[componentType]
876
- if (!components[24]) {
877
- throw new Error('Component "Sprite" not found')
878
- }
879
- } else if (
880
- typeof componentType === 'function' &&
881
- componentType[Symbol.for('isComponent')] === true
882
- ) {
883
- components[24] = componentType
884
- }
818
+ elms[22] = this.element(
819
+ { parent: parent || 'root' },
820
+ inSlot === true ? slotComponent : component
821
+ )
885
822
 
886
- elms[24] = components[24].call(null, { props: props[24] }, elms[23], component)
823
+ elementConfigs[22]['x'] = 0
824
+ elementConfigs[22]['y'] = 40
825
+ elms[22].populate(elementConfigs[22])
887
826
 
888
- if (elms[24][Symbol.for('slots')][0]) {
889
- parent = elms[24][Symbol.for('slots')][0]
890
- slotComponent = elms[24]
891
- inSlot = true
892
- } else {
893
- parent = elms[24][Symbol.for('children')][0]
894
- }
827
+ if (inSlot === true) {
828
+ slotChildCounter -= 1
829
+ }
895
830
 
896
- if (inSlot === true && slotChildCounter === 0) {
897
- inSlot = false
831
+ cmps[23] = (context.components && context.components['Sprite']) || components['Sprite']
832
+
833
+ parent = elms[22]
834
+ elementConfigs[23] = {}
835
+
836
+ elms[23] = this.element(
837
+ { parent: parent || 'root' },
838
+ inSlot === true ? slotComponent : component
839
+ )
840
+
841
+ elementConfigs[23]['holder'] = true
842
+ elementConfigs[23]['image'] = component.image
843
+ elementConfigs[23]['x'] = '-2'
844
+ elementConfigs[23]['w'] = 47
845
+ elementConfigs[23]['h'] = 25
846
+ elementConfigs[23]['map'] = component.sprite
847
+ elementConfigs[23]['frame'] = 'min'
848
+
849
+ skips[23] = []
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)
898
860
  }
861
+ }
899
862
 
900
- parent = elms[22]
901
- elementConfigs[25] = {}
902
-
903
- elms[25] = this.element(
904
- { parent: parent || 'root' },
905
- inSlot === true ? slotComponent : component
906
- )
863
+ elms[23].populate(elementConfigs[23])
907
864
 
908
- elementConfigs[25]['x'] = 58
909
- elementConfigs[25]['y'] = 2
910
- elms[25].populate(elementConfigs[25])
865
+ if (inSlot === true) {
866
+ slotChildCounter -= 1
867
+ }
911
868
 
912
- if (inSlot === true) {
913
- slotChildCounter -= 1
914
- }
869
+ parent = elms[23]
870
+ props[24] = {}
871
+ props[24]['image'] = component.image
872
+ props[24]['x'] = '-2'
873
+ props[24]['w'] = 47
874
+ props[24]['h'] = 25
875
+ props[24]['map'] = component.sprite
876
+ props[24]['frame'] = 'min'
877
+
878
+ componentType = props[24]['is'] || 'Sprite'
879
+
880
+ components[24]
881
+ if (typeof componentType === 'string') {
882
+ components[24] =
883
+ (context.components && context.components[componentType]) || components[componentType]
884
+ if (!components[24]) {
885
+ throw new Error('Component "Sprite" not found')
886
+ }
887
+ } else if (
888
+ typeof componentType === 'function' &&
889
+ componentType[Symbol.for('isComponent')] === true
890
+ ) {
891
+ components[24] = componentType
892
+ }
915
893
 
916
- cmps[26] = (context.components && context.components['Sprite']) || components['Sprite']
894
+ elms[24] = components[24].call(null, { props: props[24] }, elms[23], component)
917
895
 
918
- parent = elms[25]
919
- elementConfigs[26] = {}
896
+ if (elms[24][Symbol.for('slots')][0]) {
897
+ parent = elms[24][Symbol.for('slots')][0]
898
+ slotComponent = elms[24]
899
+ inSlot = true
900
+ } else {
901
+ parent = elms[24][Symbol.for('children')][0]
902
+ }
920
903
 
921
- elms[26] = this.element(
922
- { parent: parent || 'root' },
923
- inSlot === true ? slotComponent : component
924
- )
904
+ if (inSlot === true && slotChildCounter === 0) {
905
+ inSlot = false
906
+ }
925
907
 
926
- elementConfigs[26]['image'] = component.image
927
- elementConfigs[26]['x'] = 0
928
- elementConfigs[26]['h'] = 20
929
- elementConfigs[26]['w'] = 20
930
- elementConfigs[26]['map'] = component.sprite
931
- elementConfigs[26]['frame'] = component.minFps[0]
932
-
933
- skips[26] = []
934
- if (typeof cmps[26] !== 'undefined' && cmps[26][Symbol.for('config')].props !== undefined) {
935
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
936
- let props = cmps[26][Symbol.for('config')].props
937
- if (Array.isArray(props) === false)
938
- props = Object.keys(cmps[26][Symbol.for('config')].props)
939
- for (let k = 0; k < props.length; k++) {
940
- const key = props[k]
941
- if (validAttributes.indexOf(key) !== -1) continue
942
- delete elementConfigs[26][key]
943
- skips[26].push(key)
944
- }
945
- }
908
+ parent = elms[22]
909
+ elementConfigs[25] = {}
946
910
 
947
- elms[26].populate(elementConfigs[26])
911
+ elms[25] = this.element(
912
+ { parent: parent || 'root' },
913
+ inSlot === true ? slotComponent : component
914
+ )
948
915
 
949
- if (inSlot === true) {
950
- slotChildCounter -= 1
951
- }
916
+ elementConfigs[25]['x'] = 58
917
+ elementConfigs[25]['y'] = 2
918
+ elms[25].populate(elementConfigs[25])
952
919
 
953
- parent = elms[26]
954
- props[27] = {}
955
- props[27]['image'] = component.image
956
- props[27]['x'] = 0
957
- props[27]['h'] = 20
958
- props[27]['w'] = 20
959
- props[27]['map'] = component.sprite
960
-
961
- propData = component.minFps[0]
962
- if (Array.isArray(propData) === true) {
963
- propData = getRaw(propData).slice(0)
964
- }
965
- props[27]['frame'] = propData
966
-
967
- componentType = props[27]['is'] || 'Sprite'
968
-
969
- components[27]
970
- if (typeof componentType === 'string') {
971
- components[27] =
972
- (context.components && context.components[componentType]) || components[componentType]
973
- if (!components[27]) {
974
- throw new Error('Component "Sprite" not found')
975
- }
976
- } else if (
977
- typeof componentType === 'function' &&
978
- componentType[Symbol.for('isComponent')] === true
979
- ) {
980
- components[27] = componentType
981
- }
982
-
983
- elms[27] = components[27].call(null, { props: props[27] }, elms[26], component)
984
-
985
- if (elms[27][Symbol.for('slots')][0]) {
986
- parent = elms[27][Symbol.for('slots')][0]
987
- slotComponent = elms[27]
988
- inSlot = true
989
- } else {
990
- parent = elms[27][Symbol.for('children')][0]
991
- }
920
+ if (inSlot === true) {
921
+ slotChildCounter -= 1
922
+ }
992
923
 
993
- if (inSlot === true && slotChildCounter === 0) {
994
- inSlot = false
924
+ cmps[26] = (context.components && context.components['Sprite']) || components['Sprite']
925
+
926
+ parent = elms[25]
927
+ elementConfigs[26] = {}
928
+
929
+ elms[26] = this.element(
930
+ { parent: parent || 'root' },
931
+ inSlot === true ? slotComponent : component
932
+ )
933
+
934
+ elementConfigs[26]['holder'] = true
935
+ elementConfigs[26]['image'] = component.image
936
+ elementConfigs[26]['x'] = 0
937
+ elementConfigs[26]['h'] = 20
938
+ elementConfigs[26]['w'] = 20
939
+ elementConfigs[26]['map'] = component.sprite
940
+ elementConfigs[26]['frame'] = component.minFps[0]
941
+
942
+ skips[26] = []
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)
995
953
  }
954
+ }
996
955
 
997
- cmps[28] = (context.components && context.components['Sprite']) || components['Sprite']
998
-
999
- parent = elms[25]
1000
- elementConfigs[28] = {}
1001
-
1002
- elms[28] = this.element(
1003
- { parent: parent || 'root' },
1004
- inSlot === true ? slotComponent : component
1005
- )
956
+ elms[26].populate(elementConfigs[26])
1006
957
 
1007
- elementConfigs[28]['image'] = component.image
1008
- elementConfigs[28]['x'] = 18
1009
- elementConfigs[28]['h'] = 20
1010
- elementConfigs[28]['w'] = 20
1011
- elementConfigs[28]['map'] = component.sprite
1012
- elementConfigs[28]['frame'] = component.minFps[1]
1013
-
1014
- skips[28] = []
1015
- if (typeof cmps[28] !== 'undefined' && cmps[28][Symbol.for('config')].props !== undefined) {
1016
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
1017
- let props = cmps[28][Symbol.for('config')].props
1018
- if (Array.isArray(props) === false)
1019
- props = Object.keys(cmps[28][Symbol.for('config')].props)
1020
- for (let k = 0; k < props.length; k++) {
1021
- const key = props[k]
1022
- if (validAttributes.indexOf(key) !== -1) continue
1023
- delete elementConfigs[28][key]
1024
- skips[28].push(key)
1025
- }
1026
- }
1027
-
1028
- elms[28].populate(elementConfigs[28])
958
+ if (inSlot === true) {
959
+ slotChildCounter -= 1
960
+ }
1029
961
 
1030
- if (inSlot === true) {
1031
- slotChildCounter -= 1
1032
- }
962
+ parent = elms[26]
963
+ props[27] = {}
964
+ props[27]['image'] = component.image
965
+ props[27]['x'] = 0
966
+ props[27]['h'] = 20
967
+ props[27]['w'] = 20
968
+ props[27]['map'] = component.sprite
969
+
970
+ propData = component.minFps[0]
971
+ if (Array.isArray(propData) === true) {
972
+ propData = getRaw(propData).slice(0)
973
+ }
974
+ props[27]['frame'] = propData
975
+
976
+ componentType = props[27]['is'] || 'Sprite'
977
+
978
+ components[27]
979
+ if (typeof componentType === 'string') {
980
+ components[27] =
981
+ (context.components && context.components[componentType]) || components[componentType]
982
+ if (!components[27]) {
983
+ throw new Error('Component "Sprite" not found')
984
+ }
985
+ } else if (
986
+ typeof componentType === 'function' &&
987
+ componentType[Symbol.for('isComponent')] === true
988
+ ) {
989
+ components[27] = componentType
990
+ }
1033
991
 
1034
- parent = elms[28]
1035
- props[29] = {}
1036
- props[29]['image'] = component.image
1037
- props[29]['x'] = 18
1038
- props[29]['h'] = 20
1039
- props[29]['w'] = 20
1040
- props[29]['map'] = component.sprite
1041
-
1042
- propData = component.minFps[1]
1043
- if (Array.isArray(propData) === true) {
1044
- propData = getRaw(propData).slice(0)
1045
- }
1046
- props[29]['frame'] = propData
1047
-
1048
- componentType = props[29]['is'] || 'Sprite'
1049
-
1050
- components[29]
1051
- if (typeof componentType === 'string') {
1052
- components[29] =
1053
- (context.components && context.components[componentType]) || components[componentType]
1054
- if (!components[29]) {
1055
- throw new Error('Component "Sprite" not found')
1056
- }
1057
- } else if (
1058
- typeof componentType === 'function' &&
1059
- componentType[Symbol.for('isComponent')] === true
1060
- ) {
1061
- components[29] = componentType
1062
- }
992
+ elms[27] = components[27].call(null, { props: props[27] }, elms[26], component)
1063
993
 
1064
- elms[29] = components[29].call(null, { props: props[29] }, elms[28], component)
994
+ if (elms[27][Symbol.for('slots')][0]) {
995
+ parent = elms[27][Symbol.for('slots')][0]
996
+ slotComponent = elms[27]
997
+ inSlot = true
998
+ } else {
999
+ parent = elms[27][Symbol.for('children')][0]
1000
+ }
1065
1001
 
1066
- if (elms[29][Symbol.for('slots')][0]) {
1067
- parent = elms[29][Symbol.for('slots')][0]
1068
- slotComponent = elms[29]
1069
- inSlot = true
1070
- } else {
1071
- parent = elms[29][Symbol.for('children')][0]
1072
- }
1002
+ if (inSlot === true && slotChildCounter === 0) {
1003
+ inSlot = false
1004
+ }
1073
1005
 
1074
- if (inSlot === true && slotChildCounter === 0) {
1075
- inSlot = false
1006
+ cmps[28] = (context.components && context.components['Sprite']) || components['Sprite']
1007
+
1008
+ parent = elms[25]
1009
+ elementConfigs[28] = {}
1010
+
1011
+ elms[28] = this.element(
1012
+ { parent: parent || 'root' },
1013
+ inSlot === true ? slotComponent : component
1014
+ )
1015
+
1016
+ elementConfigs[28]['holder'] = true
1017
+ elementConfigs[28]['image'] = component.image
1018
+ elementConfigs[28]['x'] = 18
1019
+ elementConfigs[28]['h'] = 20
1020
+ elementConfigs[28]['w'] = 20
1021
+ elementConfigs[28]['map'] = component.sprite
1022
+ elementConfigs[28]['frame'] = component.minFps[1]
1023
+
1024
+ skips[28] = []
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)
1076
1035
  }
1036
+ }
1077
1037
 
1078
- cmps[30] = (context.components && context.components['Sprite']) || components['Sprite']
1079
-
1080
- parent = elms[25]
1081
- elementConfigs[30] = {}
1082
-
1083
- elms[30] = this.element(
1084
- { parent: parent || 'root' },
1085
- inSlot === true ? slotComponent : component
1086
- )
1087
-
1088
- elementConfigs[30]['image'] = component.image
1089
- elementConfigs[30]['x'] = 36
1090
- elementConfigs[30]['h'] = 20
1091
- elementConfigs[30]['w'] = 20
1092
- elementConfigs[30]['map'] = component.sprite
1093
- elementConfigs[30]['frame'] = component.minFps[2]
1094
-
1095
- skips[30] = []
1096
- if (typeof cmps[30] !== 'undefined' && cmps[30][Symbol.for('config')].props !== undefined) {
1097
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
1098
- let props = cmps[30][Symbol.for('config')].props
1099
- if (Array.isArray(props) === false)
1100
- props = Object.keys(cmps[30][Symbol.for('config')].props)
1101
- for (let k = 0; k < props.length; k++) {
1102
- const key = props[k]
1103
- if (validAttributes.indexOf(key) !== -1) continue
1104
- delete elementConfigs[30][key]
1105
- skips[30].push(key)
1106
- }
1107
- }
1038
+ elms[28].populate(elementConfigs[28])
1108
1039
 
1109
- elms[30].populate(elementConfigs[30])
1040
+ if (inSlot === true) {
1041
+ slotChildCounter -= 1
1042
+ }
1110
1043
 
1111
- if (inSlot === true) {
1112
- slotChildCounter -= 1
1113
- }
1044
+ parent = elms[28]
1045
+ props[29] = {}
1046
+ props[29]['image'] = component.image
1047
+ props[29]['x'] = 18
1048
+ props[29]['h'] = 20
1049
+ props[29]['w'] = 20
1050
+ props[29]['map'] = component.sprite
1051
+
1052
+ propData = component.minFps[1]
1053
+ if (Array.isArray(propData) === true) {
1054
+ propData = getRaw(propData).slice(0)
1055
+ }
1056
+ props[29]['frame'] = propData
1057
+
1058
+ componentType = props[29]['is'] || 'Sprite'
1059
+
1060
+ components[29]
1061
+ if (typeof componentType === 'string') {
1062
+ components[29] =
1063
+ (context.components && context.components[componentType]) || components[componentType]
1064
+ if (!components[29]) {
1065
+ throw new Error('Component "Sprite" not found')
1066
+ }
1067
+ } else if (
1068
+ typeof componentType === 'function' &&
1069
+ componentType[Symbol.for('isComponent')] === true
1070
+ ) {
1071
+ components[29] = componentType
1072
+ }
1114
1073
 
1115
- parent = elms[30]
1116
- props[31] = {}
1117
- props[31]['image'] = component.image
1118
- props[31]['x'] = 36
1119
- props[31]['h'] = 20
1120
- props[31]['w'] = 20
1121
- props[31]['map'] = component.sprite
1122
-
1123
- propData = component.minFps[2]
1124
- if (Array.isArray(propData) === true) {
1125
- propData = getRaw(propData).slice(0)
1126
- }
1127
- props[31]['frame'] = propData
1128
-
1129
- componentType = props[31]['is'] || 'Sprite'
1130
-
1131
- components[31]
1132
- if (typeof componentType === 'string') {
1133
- components[31] =
1134
- (context.components && context.components[componentType]) || components[componentType]
1135
- if (!components[31]) {
1136
- throw new Error('Component "Sprite" not found')
1137
- }
1138
- } else if (
1139
- typeof componentType === 'function' &&
1140
- componentType[Symbol.for('isComponent')] === true
1141
- ) {
1142
- components[31] = componentType
1143
- }
1074
+ elms[29] = components[29].call(null, { props: props[29] }, elms[28], component)
1144
1075
 
1145
- elms[31] = components[31].call(null, { props: props[31] }, elms[30], component)
1076
+ if (elms[29][Symbol.for('slots')][0]) {
1077
+ parent = elms[29][Symbol.for('slots')][0]
1078
+ slotComponent = elms[29]
1079
+ inSlot = true
1080
+ } else {
1081
+ parent = elms[29][Symbol.for('children')][0]
1082
+ }
1146
1083
 
1147
- if (elms[31][Symbol.for('slots')][0]) {
1148
- parent = elms[31][Symbol.for('slots')][0]
1149
- slotComponent = elms[31]
1150
- inSlot = true
1151
- } else {
1152
- parent = elms[31][Symbol.for('children')][0]
1153
- }
1084
+ if (inSlot === true && slotChildCounter === 0) {
1085
+ inSlot = false
1086
+ }
1154
1087
 
1155
- if (inSlot === true && slotChildCounter === 0) {
1156
- inSlot = false
1088
+ cmps[30] = (context.components && context.components['Sprite']) || components['Sprite']
1089
+
1090
+ parent = elms[25]
1091
+ elementConfigs[30] = {}
1092
+
1093
+ elms[30] = this.element(
1094
+ { parent: parent || 'root' },
1095
+ inSlot === true ? slotComponent : component
1096
+ )
1097
+
1098
+ elementConfigs[30]['holder'] = true
1099
+ elementConfigs[30]['image'] = component.image
1100
+ elementConfigs[30]['x'] = 36
1101
+ elementConfigs[30]['h'] = 20
1102
+ elementConfigs[30]['w'] = 20
1103
+ elementConfigs[30]['map'] = component.sprite
1104
+ elementConfigs[30]['frame'] = component.minFps[2]
1105
+
1106
+ skips[30] = []
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)
1157
1117
  }
1118
+ }
1158
1119
 
1159
- parent = elms[1]
1160
- elementConfigs[32] = {}
1161
-
1162
- elms[32] = this.element(
1163
- { parent: parent || 'root' },
1164
- inSlot === true ? slotComponent : component
1165
- )
1166
-
1167
- elementConfigs[32]['x'] = 150
1168
- elementConfigs[32]['y'] = 40
1169
- elms[32].populate(elementConfigs[32])
1170
-
1171
- if (inSlot === true) {
1172
- slotChildCounter -= 1
1173
- }
1120
+ elms[30].populate(elementConfigs[30])
1174
1121
 
1175
- cmps[33] = (context.components && context.components['Sprite']) || components['Sprite']
1122
+ if (inSlot === true) {
1123
+ slotChildCounter -= 1
1124
+ }
1176
1125
 
1177
- parent = elms[32]
1178
- elementConfigs[33] = {}
1126
+ parent = elms[30]
1127
+ props[31] = {}
1128
+ props[31]['image'] = component.image
1129
+ props[31]['x'] = 36
1130
+ props[31]['h'] = 20
1131
+ props[31]['w'] = 20
1132
+ props[31]['map'] = component.sprite
1133
+
1134
+ propData = component.minFps[2]
1135
+ if (Array.isArray(propData) === true) {
1136
+ propData = getRaw(propData).slice(0)
1137
+ }
1138
+ props[31]['frame'] = propData
1139
+
1140
+ componentType = props[31]['is'] || 'Sprite'
1141
+
1142
+ components[31]
1143
+ if (typeof componentType === 'string') {
1144
+ components[31] =
1145
+ (context.components && context.components[componentType]) || components[componentType]
1146
+ if (!components[31]) {
1147
+ throw new Error('Component "Sprite" not found')
1148
+ }
1149
+ } else if (
1150
+ typeof componentType === 'function' &&
1151
+ componentType[Symbol.for('isComponent')] === true
1152
+ ) {
1153
+ components[31] = componentType
1154
+ }
1179
1155
 
1180
- elms[33] = this.element(
1181
- { parent: parent || 'root' },
1182
- inSlot === true ? slotComponent : component
1183
- )
1156
+ elms[31] = components[31].call(null, { props: props[31] }, elms[30], component)
1184
1157
 
1185
- elementConfigs[33]['image'] = component.image
1186
- elementConfigs[33]['w'] = 53
1187
- elementConfigs[33]['h'] = 25
1188
- elementConfigs[33]['map'] = component.sprite
1189
- elementConfigs[33]['frame'] = 'max'
1190
-
1191
- skips[33] = []
1192
- if (typeof cmps[33] !== 'undefined' && cmps[33][Symbol.for('config')].props !== undefined) {
1193
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
1194
- let props = cmps[33][Symbol.for('config')].props
1195
- if (Array.isArray(props) === false)
1196
- props = Object.keys(cmps[33][Symbol.for('config')].props)
1197
- for (let k = 0; k < props.length; k++) {
1198
- const key = props[k]
1199
- if (validAttributes.indexOf(key) !== -1) continue
1200
- delete elementConfigs[33][key]
1201
- skips[33].push(key)
1202
- }
1203
- }
1158
+ if (elms[31][Symbol.for('slots')][0]) {
1159
+ parent = elms[31][Symbol.for('slots')][0]
1160
+ slotComponent = elms[31]
1161
+ inSlot = true
1162
+ } else {
1163
+ parent = elms[31][Symbol.for('children')][0]
1164
+ }
1204
1165
 
1205
- elms[33].populate(elementConfigs[33])
1166
+ if (inSlot === true && slotChildCounter === 0) {
1167
+ inSlot = false
1168
+ }
1206
1169
 
1207
- if (inSlot === true) {
1208
- slotChildCounter -= 1
1209
- }
1170
+ parent = elms[1]
1171
+ elementConfigs[32] = {}
1210
1172
 
1211
- parent = elms[33]
1212
- props[34] = {}
1213
- props[34]['image'] = component.image
1214
- props[34]['w'] = 53
1215
- props[34]['h'] = 25
1216
- props[34]['map'] = component.sprite
1217
- props[34]['frame'] = 'max'
1218
-
1219
- componentType = props[34]['is'] || 'Sprite'
1220
-
1221
- components[34]
1222
- if (typeof componentType === 'string') {
1223
- components[34] =
1224
- (context.components && context.components[componentType]) || components[componentType]
1225
- if (!components[34]) {
1226
- throw new Error('Component "Sprite" not found')
1227
- }
1228
- } else if (
1229
- typeof componentType === 'function' &&
1230
- componentType[Symbol.for('isComponent')] === true
1231
- ) {
1232
- components[34] = componentType
1233
- }
1173
+ elms[32] = this.element(
1174
+ { parent: parent || 'root' },
1175
+ inSlot === true ? slotComponent : component
1176
+ )
1234
1177
 
1235
- elms[34] = components[34].call(null, { props: props[34] }, elms[33], component)
1178
+ elementConfigs[32]['x'] = 150
1179
+ elementConfigs[32]['y'] = 40
1180
+ elms[32].populate(elementConfigs[32])
1236
1181
 
1237
- if (elms[34][Symbol.for('slots')][0]) {
1238
- parent = elms[34][Symbol.for('slots')][0]
1239
- slotComponent = elms[34]
1240
- inSlot = true
1241
- } else {
1242
- parent = elms[34][Symbol.for('children')][0]
1243
- }
1182
+ if (inSlot === true) {
1183
+ slotChildCounter -= 1
1184
+ }
1244
1185
 
1245
- if (inSlot === true && slotChildCounter === 0) {
1246
- inSlot = false
1186
+ cmps[33] = (context.components && context.components['Sprite']) || components['Sprite']
1187
+
1188
+ parent = elms[32]
1189
+ elementConfigs[33] = {}
1190
+
1191
+ elms[33] = this.element(
1192
+ { parent: parent || 'root' },
1193
+ inSlot === true ? slotComponent : component
1194
+ )
1195
+
1196
+ elementConfigs[33]['holder'] = true
1197
+ elementConfigs[33]['image'] = component.image
1198
+ elementConfigs[33]['w'] = 53
1199
+ elementConfigs[33]['h'] = 25
1200
+ elementConfigs[33]['map'] = component.sprite
1201
+ elementConfigs[33]['frame'] = 'max'
1202
+
1203
+ skips[33] = []
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)
1247
1214
  }
1215
+ }
1248
1216
 
1249
- parent = elms[32]
1250
- elementConfigs[35] = {}
1217
+ elms[33].populate(elementConfigs[33])
1251
1218
 
1252
- elms[35] = this.element(
1253
- { parent: parent || 'root' },
1254
- inSlot === true ? slotComponent : component
1255
- )
1256
-
1257
- elementConfigs[35]['x'] = 63
1258
- elementConfigs[35]['y'] = 2
1259
- elms[35].populate(elementConfigs[35])
1219
+ if (inSlot === true) {
1220
+ slotChildCounter -= 1
1221
+ }
1260
1222
 
1261
- if (inSlot === true) {
1262
- slotChildCounter -= 1
1263
- }
1223
+ parent = elms[33]
1224
+ props[34] = {}
1225
+ props[34]['image'] = component.image
1226
+ props[34]['w'] = 53
1227
+ props[34]['h'] = 25
1228
+ props[34]['map'] = component.sprite
1229
+ props[34]['frame'] = 'max'
1230
+
1231
+ componentType = props[34]['is'] || 'Sprite'
1232
+
1233
+ components[34]
1234
+ if (typeof componentType === 'string') {
1235
+ components[34] =
1236
+ (context.components && context.components[componentType]) || components[componentType]
1237
+ if (!components[34]) {
1238
+ throw new Error('Component "Sprite" not found')
1239
+ }
1240
+ } else if (
1241
+ typeof componentType === 'function' &&
1242
+ componentType[Symbol.for('isComponent')] === true
1243
+ ) {
1244
+ components[34] = componentType
1245
+ }
1264
1246
 
1265
- cmps[36] = (context.components && context.components['Sprite']) || components['Sprite']
1247
+ elms[34] = components[34].call(null, { props: props[34] }, elms[33], component)
1266
1248
 
1267
- parent = elms[35]
1268
- elementConfigs[36] = {}
1249
+ if (elms[34][Symbol.for('slots')][0]) {
1250
+ parent = elms[34][Symbol.for('slots')][0]
1251
+ slotComponent = elms[34]
1252
+ inSlot = true
1253
+ } else {
1254
+ parent = elms[34][Symbol.for('children')][0]
1255
+ }
1269
1256
 
1270
- elms[36] = this.element(
1271
- { parent: parent || 'root' },
1272
- inSlot === true ? slotComponent : component
1273
- )
1257
+ if (inSlot === true && slotChildCounter === 0) {
1258
+ inSlot = false
1259
+ }
1274
1260
 
1275
- elementConfigs[36]['image'] = component.image
1276
- elementConfigs[36]['x'] = 0
1277
- elementConfigs[36]['h'] = 20
1278
- elementConfigs[36]['w'] = 20
1279
- elementConfigs[36]['map'] = component.sprite
1280
- elementConfigs[36]['frame'] = component.maxFps[0]
1281
-
1282
- skips[36] = []
1283
- if (typeof cmps[36] !== 'undefined' && cmps[36][Symbol.for('config')].props !== undefined) {
1284
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
1285
- let props = cmps[36][Symbol.for('config')].props
1286
- if (Array.isArray(props) === false)
1287
- props = Object.keys(cmps[36][Symbol.for('config')].props)
1288
- for (let k = 0; k < props.length; k++) {
1289
- const key = props[k]
1290
- if (validAttributes.indexOf(key) !== -1) continue
1291
- delete elementConfigs[36][key]
1292
- skips[36].push(key)
1293
- }
1294
- }
1261
+ parent = elms[32]
1262
+ elementConfigs[35] = {}
1295
1263
 
1296
- elms[36].populate(elementConfigs[36])
1264
+ elms[35] = this.element(
1265
+ { parent: parent || 'root' },
1266
+ inSlot === true ? slotComponent : component
1267
+ )
1297
1268
 
1298
- if (inSlot === true) {
1299
- slotChildCounter -= 1
1300
- }
1269
+ elementConfigs[35]['x'] = 63
1270
+ elementConfigs[35]['y'] = 2
1271
+ elms[35].populate(elementConfigs[35])
1301
1272
 
1302
- parent = elms[36]
1303
- props[37] = {}
1304
- props[37]['image'] = component.image
1305
- props[37]['x'] = 0
1306
- props[37]['h'] = 20
1307
- props[37]['w'] = 20
1308
- props[37]['map'] = component.sprite
1309
-
1310
- propData = component.maxFps[0]
1311
- if (Array.isArray(propData) === true) {
1312
- propData = getRaw(propData).slice(0)
1313
- }
1314
- props[37]['frame'] = propData
1315
-
1316
- componentType = props[37]['is'] || 'Sprite'
1317
-
1318
- components[37]
1319
- if (typeof componentType === 'string') {
1320
- components[37] =
1321
- (context.components && context.components[componentType]) || components[componentType]
1322
- if (!components[37]) {
1323
- throw new Error('Component "Sprite" not found')
1324
- }
1325
- } else if (
1326
- typeof componentType === 'function' &&
1327
- componentType[Symbol.for('isComponent')] === true
1328
- ) {
1329
- components[37] = componentType
1330
- }
1331
-
1332
- elms[37] = components[37].call(null, { props: props[37] }, elms[36], component)
1333
-
1334
- if (elms[37][Symbol.for('slots')][0]) {
1335
- parent = elms[37][Symbol.for('slots')][0]
1336
- slotComponent = elms[37]
1337
- inSlot = true
1338
- } else {
1339
- parent = elms[37][Symbol.for('children')][0]
1340
- }
1273
+ if (inSlot === true) {
1274
+ slotChildCounter -= 1
1275
+ }
1341
1276
 
1342
- if (inSlot === true && slotChildCounter === 0) {
1343
- inSlot = false
1277
+ cmps[36] = (context.components && context.components['Sprite']) || components['Sprite']
1278
+
1279
+ parent = elms[35]
1280
+ elementConfigs[36] = {}
1281
+
1282
+ elms[36] = this.element(
1283
+ { parent: parent || 'root' },
1284
+ inSlot === true ? slotComponent : component
1285
+ )
1286
+
1287
+ elementConfigs[36]['holder'] = true
1288
+ elementConfigs[36]['image'] = component.image
1289
+ elementConfigs[36]['x'] = 0
1290
+ elementConfigs[36]['h'] = 20
1291
+ elementConfigs[36]['w'] = 20
1292
+ elementConfigs[36]['map'] = component.sprite
1293
+ elementConfigs[36]['frame'] = component.maxFps[0]
1294
+
1295
+ skips[36] = []
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)
1344
1306
  }
1307
+ }
1345
1308
 
1346
- cmps[38] = (context.components && context.components['Sprite']) || components['Sprite']
1309
+ elms[36].populate(elementConfigs[36])
1347
1310
 
1348
- parent = elms[35]
1349
- elementConfigs[38] = {}
1311
+ if (inSlot === true) {
1312
+ slotChildCounter -= 1
1313
+ }
1350
1314
 
1351
- elms[38] = this.element(
1352
- { parent: parent || 'root' },
1353
- inSlot === true ? slotComponent : component
1354
- )
1315
+ parent = elms[36]
1316
+ props[37] = {}
1317
+ props[37]['image'] = component.image
1318
+ props[37]['x'] = 0
1319
+ props[37]['h'] = 20
1320
+ props[37]['w'] = 20
1321
+ props[37]['map'] = component.sprite
1322
+
1323
+ propData = component.maxFps[0]
1324
+ if (Array.isArray(propData) === true) {
1325
+ propData = getRaw(propData).slice(0)
1326
+ }
1327
+ props[37]['frame'] = propData
1328
+
1329
+ componentType = props[37]['is'] || 'Sprite'
1330
+
1331
+ components[37]
1332
+ if (typeof componentType === 'string') {
1333
+ components[37] =
1334
+ (context.components && context.components[componentType]) || components[componentType]
1335
+ if (!components[37]) {
1336
+ throw new Error('Component "Sprite" not found')
1337
+ }
1338
+ } else if (
1339
+ typeof componentType === 'function' &&
1340
+ componentType[Symbol.for('isComponent')] === true
1341
+ ) {
1342
+ components[37] = componentType
1343
+ }
1355
1344
 
1356
- elementConfigs[38]['image'] = component.image
1357
- elementConfigs[38]['x'] = 18
1358
- elementConfigs[38]['h'] = 20
1359
- elementConfigs[38]['w'] = 20
1360
- elementConfigs[38]['map'] = component.sprite
1361
- elementConfigs[38]['frame'] = component.maxFps[1]
1362
-
1363
- skips[38] = []
1364
- if (typeof cmps[38] !== 'undefined' && cmps[38][Symbol.for('config')].props !== undefined) {
1365
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
1366
- let props = cmps[38][Symbol.for('config')].props
1367
- if (Array.isArray(props) === false)
1368
- props = Object.keys(cmps[38][Symbol.for('config')].props)
1369
- for (let k = 0; k < props.length; k++) {
1370
- const key = props[k]
1371
- if (validAttributes.indexOf(key) !== -1) continue
1372
- delete elementConfigs[38][key]
1373
- skips[38].push(key)
1374
- }
1375
- }
1345
+ elms[37] = components[37].call(null, { props: props[37] }, elms[36], component)
1376
1346
 
1377
- elms[38].populate(elementConfigs[38])
1347
+ if (elms[37][Symbol.for('slots')][0]) {
1348
+ parent = elms[37][Symbol.for('slots')][0]
1349
+ slotComponent = elms[37]
1350
+ inSlot = true
1351
+ } else {
1352
+ parent = elms[37][Symbol.for('children')][0]
1353
+ }
1378
1354
 
1379
- if (inSlot === true) {
1380
- slotChildCounter -= 1
1381
- }
1355
+ if (inSlot === true && slotChildCounter === 0) {
1356
+ inSlot = false
1357
+ }
1382
1358
 
1383
- parent = elms[38]
1384
- props[39] = {}
1385
- props[39]['image'] = component.image
1386
- props[39]['x'] = 18
1387
- props[39]['h'] = 20
1388
- props[39]['w'] = 20
1389
- props[39]['map'] = component.sprite
1390
-
1391
- propData = component.maxFps[1]
1392
- if (Array.isArray(propData) === true) {
1393
- propData = getRaw(propData).slice(0)
1394
- }
1395
- props[39]['frame'] = propData
1396
-
1397
- componentType = props[39]['is'] || 'Sprite'
1398
-
1399
- components[39]
1400
- if (typeof componentType === 'string') {
1401
- components[39] =
1402
- (context.components && context.components[componentType]) || components[componentType]
1403
- if (!components[39]) {
1404
- throw new Error('Component "Sprite" not found')
1405
- }
1406
- } else if (
1407
- typeof componentType === 'function' &&
1408
- componentType[Symbol.for('isComponent')] === true
1409
- ) {
1410
- components[39] = componentType
1359
+ cmps[38] = (context.components && context.components['Sprite']) || components['Sprite']
1360
+
1361
+ parent = elms[35]
1362
+ elementConfigs[38] = {}
1363
+
1364
+ elms[38] = this.element(
1365
+ { parent: parent || 'root' },
1366
+ inSlot === true ? slotComponent : component
1367
+ )
1368
+
1369
+ elementConfigs[38]['holder'] = true
1370
+ elementConfigs[38]['image'] = component.image
1371
+ elementConfigs[38]['x'] = 18
1372
+ elementConfigs[38]['h'] = 20
1373
+ elementConfigs[38]['w'] = 20
1374
+ elementConfigs[38]['map'] = component.sprite
1375
+ elementConfigs[38]['frame'] = component.maxFps[1]
1376
+
1377
+ skips[38] = []
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)
1411
1388
  }
1389
+ }
1412
1390
 
1413
- elms[39] = components[39].call(null, { props: props[39] }, elms[38], component)
1391
+ elms[38].populate(elementConfigs[38])
1414
1392
 
1415
- if (elms[39][Symbol.for('slots')][0]) {
1416
- parent = elms[39][Symbol.for('slots')][0]
1417
- slotComponent = elms[39]
1418
- inSlot = true
1419
- } else {
1420
- parent = elms[39][Symbol.for('children')][0]
1421
- }
1393
+ if (inSlot === true) {
1394
+ slotChildCounter -= 1
1395
+ }
1422
1396
 
1423
- if (inSlot === true && slotChildCounter === 0) {
1424
- inSlot = false
1425
- }
1397
+ parent = elms[38]
1398
+ props[39] = {}
1399
+ props[39]['image'] = component.image
1400
+ props[39]['x'] = 18
1401
+ props[39]['h'] = 20
1402
+ props[39]['w'] = 20
1403
+ props[39]['map'] = component.sprite
1404
+
1405
+ propData = component.maxFps[1]
1406
+ if (Array.isArray(propData) === true) {
1407
+ propData = getRaw(propData).slice(0)
1408
+ }
1409
+ props[39]['frame'] = propData
1410
+
1411
+ componentType = props[39]['is'] || 'Sprite'
1412
+
1413
+ components[39]
1414
+ if (typeof componentType === 'string') {
1415
+ components[39] =
1416
+ (context.components && context.components[componentType]) || components[componentType]
1417
+ if (!components[39]) {
1418
+ throw new Error('Component "Sprite" not found')
1419
+ }
1420
+ } else if (
1421
+ typeof componentType === 'function' &&
1422
+ componentType[Symbol.for('isComponent')] === true
1423
+ ) {
1424
+ components[39] = componentType
1425
+ }
1426
1426
 
1427
- cmps[40] = (context.components && context.components['Sprite']) || components['Sprite']
1427
+ elms[39] = components[39].call(null, { props: props[39] }, elms[38], component)
1428
1428
 
1429
- parent = elms[35]
1430
- elementConfigs[40] = {}
1429
+ if (elms[39][Symbol.for('slots')][0]) {
1430
+ parent = elms[39][Symbol.for('slots')][0]
1431
+ slotComponent = elms[39]
1432
+ inSlot = true
1433
+ } else {
1434
+ parent = elms[39][Symbol.for('children')][0]
1435
+ }
1431
1436
 
1432
- elms[40] = this.element(
1433
- { parent: parent || 'root' },
1434
- inSlot === true ? slotComponent : component
1435
- )
1437
+ if (inSlot === true && slotChildCounter === 0) {
1438
+ inSlot = false
1439
+ }
1436
1440
 
1437
- elementConfigs[40]['image'] = component.image
1438
- elementConfigs[40]['x'] = 36
1439
- elementConfigs[40]['h'] = 20
1440
- elementConfigs[40]['w'] = 20
1441
- elementConfigs[40]['map'] = component.sprite
1442
- elementConfigs[40]['frame'] = component.maxFps[2]
1443
-
1444
- skips[40] = []
1445
- if (typeof cmps[40] !== 'undefined' && cmps[40][Symbol.for('config')].props !== undefined) {
1446
- // attributes that are a prop should be removed from element config (even if it's a know element prop)
1447
- let props = cmps[40][Symbol.for('config')].props
1448
- if (Array.isArray(props) === false)
1449
- props = Object.keys(cmps[40][Symbol.for('config')].props)
1450
- for (let k = 0; k < props.length; k++) {
1451
- const key = props[k]
1452
- if (validAttributes.indexOf(key) !== -1) continue
1453
- delete elementConfigs[40][key]
1454
- skips[40].push(key)
1455
- }
1441
+ cmps[40] = (context.components && context.components['Sprite']) || components['Sprite']
1442
+
1443
+ parent = elms[35]
1444
+ elementConfigs[40] = {}
1445
+
1446
+ elms[40] = this.element(
1447
+ { parent: parent || 'root' },
1448
+ inSlot === true ? slotComponent : component
1449
+ )
1450
+
1451
+ elementConfigs[40]['holder'] = true
1452
+ elementConfigs[40]['image'] = component.image
1453
+ elementConfigs[40]['x'] = 36
1454
+ elementConfigs[40]['h'] = 20
1455
+ elementConfigs[40]['w'] = 20
1456
+ elementConfigs[40]['map'] = component.sprite
1457
+ elementConfigs[40]['frame'] = component.maxFps[2]
1458
+
1459
+ skips[40] = []
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)
1456
1470
  }
1471
+ }
1457
1472
 
1458
- elms[40].populate(elementConfigs[40])
1473
+ elms[40].populate(elementConfigs[40])
1459
1474
 
1460
- if (inSlot === true) {
1461
- slotChildCounter -= 1
1462
- }
1475
+ if (inSlot === true) {
1476
+ slotChildCounter -= 1
1477
+ }
1463
1478
 
1464
- parent = elms[40]
1465
- props[41] = {}
1466
- props[41]['image'] = component.image
1467
- props[41]['x'] = 36
1468
- props[41]['h'] = 20
1469
- props[41]['w'] = 20
1470
- props[41]['map'] = component.sprite
1471
-
1472
- propData = component.maxFps[2]
1473
- if (Array.isArray(propData) === true) {
1474
- propData = getRaw(propData).slice(0)
1475
- }
1476
- props[41]['frame'] = propData
1477
-
1478
- componentType = props[41]['is'] || 'Sprite'
1479
-
1480
- components[41]
1481
- if (typeof componentType === 'string') {
1482
- components[41] =
1483
- (context.components && context.components[componentType]) || components[componentType]
1484
- if (!components[41]) {
1485
- throw new Error('Component "Sprite" not found')
1486
- }
1487
- } else if (
1488
- typeof componentType === 'function' &&
1489
- componentType[Symbol.for('isComponent')] === true
1490
- ) {
1491
- components[41] = componentType
1492
- }
1479
+ parent = elms[40]
1480
+ props[41] = {}
1481
+ props[41]['image'] = component.image
1482
+ props[41]['x'] = 36
1483
+ props[41]['h'] = 20
1484
+ props[41]['w'] = 20
1485
+ props[41]['map'] = component.sprite
1486
+
1487
+ propData = component.maxFps[2]
1488
+ if (Array.isArray(propData) === true) {
1489
+ propData = getRaw(propData).slice(0)
1490
+ }
1491
+ props[41]['frame'] = propData
1492
+
1493
+ componentType = props[41]['is'] || 'Sprite'
1494
+
1495
+ components[41]
1496
+ if (typeof componentType === 'string') {
1497
+ components[41] =
1498
+ (context.components && context.components[componentType]) || components[componentType]
1499
+ if (!components[41]) {
1500
+ throw new Error('Component "Sprite" not found')
1501
+ }
1502
+ } else if (
1503
+ typeof componentType === 'function' &&
1504
+ componentType[Symbol.for('isComponent')] === true
1505
+ ) {
1506
+ components[41] = componentType
1507
+ }
1493
1508
 
1494
- elms[41] = components[41].call(null, { props: props[41] }, elms[40], component)
1509
+ elms[41] = components[41].call(null, { props: props[41] }, elms[40], component)
1495
1510
 
1496
- if (elms[41][Symbol.for('slots')][0]) {
1497
- parent = elms[41][Symbol.for('slots')][0]
1498
- slotComponent = elms[41]
1499
- inSlot = true
1500
- } else {
1501
- parent = elms[41][Symbol.for('children')][0]
1502
- }
1511
+ if (elms[41][Symbol.for('slots')][0]) {
1512
+ parent = elms[41][Symbol.for('slots')][0]
1513
+ slotComponent = elms[41]
1514
+ inSlot = true
1515
+ } else {
1516
+ parent = elms[41][Symbol.for('children')][0]
1517
+ }
1503
1518
 
1504
- if (inSlot === true && slotChildCounter === 0) {
1505
- inSlot = false
1506
- }
1519
+ if (inSlot === true && slotChildCounter === 0) {
1520
+ inSlot = false
1521
+ }
1507
1522
 
1508
- return {
1509
- elms,
1510
- cleanup: () => {
1511
- rootComponent = null
1512
- propData = null
1513
- slotComponent = null
1514
- parent = null
1523
+ return {
1524
+ elms,
1525
+ cleanup: () => {
1526
+ rootComponent = null
1527
+ propData = null
1528
+ slotComponent = null
1529
+ parent = null
1515
1530
 
1516
- cmps[3] = null
1531
+ cmps[3] = null
1517
1532
 
1518
- props[4] = null
1519
- components[4] = null
1533
+ props[4] = null
1534
+ components[4] = null
1520
1535
 
1521
- cmps[6] = null
1536
+ cmps[6] = null
1522
1537
 
1523
- props[7] = null
1524
- components[7] = null
1538
+ props[7] = null
1539
+ components[7] = null
1525
1540
 
1526
- cmps[8] = null
1541
+ cmps[8] = null
1527
1542
 
1528
- props[9] = null
1529
- components[9] = null
1543
+ props[9] = null
1544
+ components[9] = null
1530
1545
 
1531
- cmps[10] = null
1546
+ cmps[10] = null
1532
1547
 
1533
- props[11] = null
1534
- components[11] = null
1548
+ props[11] = null
1549
+ components[11] = null
1535
1550
 
1536
- cmps[13] = null
1551
+ cmps[13] = null
1537
1552
 
1538
- props[14] = null
1539
- components[14] = null
1553
+ props[14] = null
1554
+ components[14] = null
1540
1555
 
1541
- cmps[16] = null
1556
+ cmps[16] = null
1542
1557
 
1543
- props[17] = null
1544
- components[17] = null
1558
+ props[17] = null
1559
+ components[17] = null
1545
1560
 
1546
- cmps[18] = null
1561
+ cmps[18] = null
1547
1562
 
1548
- props[19] = null
1549
- components[19] = null
1563
+ props[19] = null
1564
+ components[19] = null
1550
1565
 
1551
- cmps[20] = null
1566
+ cmps[20] = null
1552
1567
 
1553
- props[21] = null
1554
- components[21] = null
1568
+ props[21] = null
1569
+ components[21] = null
1555
1570
 
1556
- cmps[23] = null
1571
+ cmps[23] = null
1557
1572
 
1558
- props[24] = null
1559
- components[24] = null
1573
+ props[24] = null
1574
+ components[24] = null
1560
1575
 
1561
- cmps[26] = null
1576
+ cmps[26] = null
1562
1577
 
1563
- props[27] = null
1564
- components[27] = null
1578
+ props[27] = null
1579
+ components[27] = null
1565
1580
 
1566
- cmps[28] = null
1581
+ cmps[28] = null
1567
1582
 
1568
- props[29] = null
1569
- components[29] = null
1583
+ props[29] = null
1584
+ components[29] = null
1570
1585
 
1571
- cmps[30] = null
1586
+ cmps[30] = null
1572
1587
 
1573
- props[31] = null
1574
- components[31] = null
1588
+ props[31] = null
1589
+ components[31] = null
1575
1590
 
1576
- cmps[33] = null
1591
+ cmps[33] = null
1577
1592
 
1578
- props[34] = null
1579
- components[34] = null
1593
+ props[34] = null
1594
+ components[34] = null
1580
1595
 
1581
- cmps[36] = null
1596
+ cmps[36] = null
1582
1597
 
1583
- props[37] = null
1584
- components[37] = null
1598
+ props[37] = null
1599
+ components[37] = null
1585
1600
 
1586
- cmps[38] = null
1601
+ cmps[38] = null
1587
1602
 
1588
- props[39] = null
1589
- components[39] = null
1603
+ props[39] = null
1604
+ components[39] = null
1590
1605
 
1591
- cmps[40] = null
1606
+ cmps[40] = null
1592
1607
 
1593
- props[41] = null
1594
- components[41] = null
1595
- component = null
1596
- cmps.length = 0
1597
- elms.length = 0
1598
- components.length = 0
1599
- elementConfigs.length = 0
1600
- forloops.length = 0
1601
- props.length = 0
1602
- skips.length = 0
1603
- },
1604
- skips,
1605
- }
1606
- },
1607
- effects: [
1608
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1609
- if (
1610
- typeof skips === 'undefined' ||
1611
- typeof skips[6] === 'undefined' ||
1612
- skips[6].indexOf('frame') === -1
1613
- )
1614
- elms[6].set('frame', component.fps[0])
1615
- },
1616
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1617
- elms[7][Symbol.for('props')]['frame'] = component.fps[0]
1618
- },
1619
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1620
- if (
1621
- typeof skips === 'undefined' ||
1622
- typeof skips[8] === 'undefined' ||
1623
- skips[8].indexOf('frame') === -1
1624
- )
1625
- elms[8].set('frame', component.fps[1])
1626
- },
1627
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1628
- elms[9][Symbol.for('props')]['frame'] = component.fps[1]
1629
- },
1630
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1631
- if (
1632
- typeof skips === 'undefined' ||
1633
- typeof skips[10] === 'undefined' ||
1634
- skips[10].indexOf('frame') === -1
1635
- )
1636
- elms[10].set('frame', component.fps[2])
1637
- },
1638
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1639
- elms[11][Symbol.for('props')]['frame'] = component.fps[2]
1640
- },
1641
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1642
- if (
1643
- typeof skips === 'undefined' ||
1644
- typeof skips[16] === 'undefined' ||
1645
- skips[16].indexOf('frame') === -1
1646
- )
1647
- elms[16].set('frame', component.avgFps[0])
1648
- },
1649
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1650
- elms[17][Symbol.for('props')]['frame'] = component.avgFps[0]
1651
- },
1652
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1653
- if (
1654
- typeof skips === 'undefined' ||
1655
- typeof skips[18] === 'undefined' ||
1656
- skips[18].indexOf('frame') === -1
1657
- )
1658
- elms[18].set('frame', component.avgFps[1])
1659
- },
1660
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1661
- elms[19][Symbol.for('props')]['frame'] = component.avgFps[1]
1662
- },
1663
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1664
- if (
1665
- typeof skips === 'undefined' ||
1666
- typeof skips[20] === 'undefined' ||
1667
- skips[20].indexOf('frame') === -1
1668
- )
1669
- elms[20].set('frame', component.avgFps[2])
1670
- },
1671
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1672
- elms[21][Symbol.for('props')]['frame'] = component.avgFps[2]
1673
- },
1674
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1675
- if (
1676
- typeof skips === 'undefined' ||
1677
- typeof skips[26] === 'undefined' ||
1678
- skips[26].indexOf('frame') === -1
1679
- )
1680
- elms[26].set('frame', component.minFps[0])
1681
- },
1682
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1683
- elms[27][Symbol.for('props')]['frame'] = component.minFps[0]
1684
- },
1685
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1686
- if (
1687
- typeof skips === 'undefined' ||
1688
- typeof skips[28] === 'undefined' ||
1689
- skips[28].indexOf('frame') === -1
1690
- )
1691
- elms[28].set('frame', component.minFps[1])
1692
- },
1693
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1694
- elms[29][Symbol.for('props')]['frame'] = component.minFps[1]
1695
- },
1696
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1697
- if (
1698
- typeof skips === 'undefined' ||
1699
- typeof skips[30] === 'undefined' ||
1700
- skips[30].indexOf('frame') === -1
1701
- )
1702
- elms[30].set('frame', component.minFps[2])
1703
- },
1704
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1705
- elms[31][Symbol.for('props')]['frame'] = component.minFps[2]
1706
- },
1707
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1708
- if (
1709
- typeof skips === 'undefined' ||
1710
- typeof skips[36] === 'undefined' ||
1711
- skips[36].indexOf('frame') === -1
1712
- )
1713
- elms[36].set('frame', component.maxFps[0])
1714
- },
1715
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1716
- elms[37][Symbol.for('props')]['frame'] = component.maxFps[0]
1717
- },
1718
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1719
- if (
1720
- typeof skips === 'undefined' ||
1721
- typeof skips[38] === 'undefined' ||
1722
- skips[38].indexOf('frame') === -1
1723
- )
1724
- elms[38].set('frame', component.maxFps[1])
1725
- },
1726
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1727
- elms[39][Symbol.for('props')]['frame'] = component.maxFps[1]
1728
- },
1729
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1730
- if (
1731
- typeof skips === 'undefined' ||
1732
- typeof skips[40] === 'undefined' ||
1733
- skips[40].indexOf('frame') === -1
1734
- )
1735
- elms[40].set('frame', component.maxFps[2])
1736
- },
1737
- function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1738
- elms[41][Symbol.for('props')]['frame'] = component.maxFps[2]
1608
+ props[41] = null
1609
+ components[41] = null
1610
+ component = null
1611
+ cmps.length = 0
1612
+ elms.length = 0
1613
+ components.length = 0
1614
+ elementConfigs.length = 0
1615
+ forloops.length = 0
1616
+ props.length = 0
1617
+ skips.length = 0
1739
1618
  },
1740
- ],
1741
- context: {},
1742
- },
1743
- state() {
1744
- return {
1745
- image: fps_sprite,
1746
- sprite: {
1747
- defaults: {
1748
- y: 1,
1749
- w: 20,
1750
- h: 20,
1751
- },
1752
- frames: {
1753
- '-': { x: -1000 },
1754
- 0: { x: 1 },
1755
- 1: { x: 23 },
1756
- 2: { x: 45 },
1757
- 3: { x: 67 },
1758
- 4: { x: 89 },
1759
- 5: { x: 111 },
1760
- 6: { x: 133 },
1761
- 7: { x: 155 },
1762
- 8: { x: 177 },
1763
- 9: { x: 199 },
1764
- avg: { x: 221, w: 48, h: 25 },
1765
- fps: { x: 271, w: 43, h: 25 },
1766
- max: { x: 316, w: 53, h: 25 },
1767
- min: { x: 371, w: 47, h: 25 },
1768
- },
1769
- },
1770
- fps: '---',
1771
- avgFps: '---',
1772
- minFps: '---',
1773
- maxFps: '---',
1619
+ skips,
1774
1620
  }
1775
1621
  },
1776
- hooks: {
1777
- ready() {
1778
- let minFps = 10000
1779
- let maxFps = 0
1780
- let avgFps = 0
1781
- let totalFps = 0
1782
- let fpsUpdateCounter = 0
1783
-
1784
- // This leaks - might be L3 SubTexture issue
1785
- // renderer.on('fpsUpdate', (rM, { fps }) => {
1786
- // minFps = Math.min(fps, minFps)
1787
- // maxFps = Math.max(fps, maxFps)
1788
- // totalFps += fps
1789
- // fpsUpdateCounter++
1790
- // avgFps = Math.round(totalFps / fpsUpdateCounter)
1791
-
1792
- // this.fps = fps.toString().padStart(3, '0')
1793
- // this.avgFps = avgFps.toString().padStart(3, '0')
1794
- // this.minFps = minFps.toString().padStart(3, '0')
1795
- // this.maxFps = maxFps.toString().padStart(3, '0')
1796
- // })
1622
+ effects: [
1623
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1624
+ if (
1625
+ typeof skips === 'undefined' ||
1626
+ typeof skips[6] === 'undefined' ||
1627
+ skips[6].indexOf('frame') === -1
1628
+ )
1629
+ elms[6].set('frame', component.fps[0])
1630
+ },
1631
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1632
+ elms[7][Symbol.for('props')]['frame'] = component.fps[0]
1633
+ },
1634
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1635
+ if (
1636
+ typeof skips === 'undefined' ||
1637
+ typeof skips[8] === 'undefined' ||
1638
+ skips[8].indexOf('frame') === -1
1639
+ )
1640
+ elms[8].set('frame', component.fps[1])
1641
+ },
1642
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1643
+ elms[9][Symbol.for('props')]['frame'] = component.fps[1]
1644
+ },
1645
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1646
+ if (
1647
+ typeof skips === 'undefined' ||
1648
+ typeof skips[10] === 'undefined' ||
1649
+ skips[10].indexOf('frame') === -1
1650
+ )
1651
+ elms[10].set('frame', component.fps[2])
1652
+ },
1653
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1654
+ elms[11][Symbol.for('props')]['frame'] = component.fps[2]
1655
+ },
1656
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1657
+ if (
1658
+ typeof skips === 'undefined' ||
1659
+ typeof skips[16] === 'undefined' ||
1660
+ skips[16].indexOf('frame') === -1
1661
+ )
1662
+ elms[16].set('frame', component.avgFps[0])
1663
+ },
1664
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1665
+ elms[17][Symbol.for('props')]['frame'] = component.avgFps[0]
1666
+ },
1667
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1668
+ if (
1669
+ typeof skips === 'undefined' ||
1670
+ typeof skips[18] === 'undefined' ||
1671
+ skips[18].indexOf('frame') === -1
1672
+ )
1673
+ elms[18].set('frame', component.avgFps[1])
1674
+ },
1675
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1676
+ elms[19][Symbol.for('props')]['frame'] = component.avgFps[1]
1677
+ },
1678
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1679
+ if (
1680
+ typeof skips === 'undefined' ||
1681
+ typeof skips[20] === 'undefined' ||
1682
+ skips[20].indexOf('frame') === -1
1683
+ )
1684
+ elms[20].set('frame', component.avgFps[2])
1685
+ },
1686
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1687
+ elms[21][Symbol.for('props')]['frame'] = component.avgFps[2]
1688
+ },
1689
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1690
+ if (
1691
+ typeof skips === 'undefined' ||
1692
+ typeof skips[26] === 'undefined' ||
1693
+ skips[26].indexOf('frame') === -1
1694
+ )
1695
+ elms[26].set('frame', component.minFps[0])
1696
+ },
1697
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1698
+ elms[27][Symbol.for('props')]['frame'] = component.minFps[0]
1699
+ },
1700
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1701
+ if (
1702
+ typeof skips === 'undefined' ||
1703
+ typeof skips[28] === 'undefined' ||
1704
+ skips[28].indexOf('frame') === -1
1705
+ )
1706
+ elms[28].set('frame', component.minFps[1])
1707
+ },
1708
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1709
+ elms[29][Symbol.for('props')]['frame'] = component.minFps[1]
1710
+ },
1711
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1712
+ if (
1713
+ typeof skips === 'undefined' ||
1714
+ typeof skips[30] === 'undefined' ||
1715
+ skips[30].indexOf('frame') === -1
1716
+ )
1717
+ elms[30].set('frame', component.minFps[2])
1718
+ },
1719
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1720
+ elms[31][Symbol.for('props')]['frame'] = component.minFps[2]
1721
+ },
1722
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1723
+ if (
1724
+ typeof skips === 'undefined' ||
1725
+ typeof skips[36] === 'undefined' ||
1726
+ skips[36].indexOf('frame') === -1
1727
+ )
1728
+ elms[36].set('frame', component.maxFps[0])
1729
+ },
1730
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1731
+ elms[37][Symbol.for('props')]['frame'] = component.maxFps[0]
1732
+ },
1733
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1734
+ if (
1735
+ typeof skips === 'undefined' ||
1736
+ typeof skips[38] === 'undefined' ||
1737
+ skips[38].indexOf('frame') === -1
1738
+ )
1739
+ elms[38].set('frame', component.maxFps[1])
1740
+ },
1741
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1742
+ elms[39][Symbol.for('props')]['frame'] = component.maxFps[1]
1743
+ },
1744
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1745
+ if (
1746
+ typeof skips === 'undefined' ||
1747
+ typeof skips[40] === 'undefined' ||
1748
+ skips[40].indexOf('frame') === -1
1749
+ )
1750
+ elms[40].set('frame', component.maxFps[2])
1751
+ },
1752
+ function anonymous(component, elms, context, components, rootComponent, skips, effect) {
1753
+ elms[41][Symbol.for('props')]['frame'] = component.maxFps[2]
1754
+ },
1755
+ ],
1756
+ context: {},
1757
+ },
1758
+ state() {
1759
+ return {
1760
+ image: fps_sprite,
1761
+ sprite: {
1762
+ defaults: {
1763
+ y: 1,
1764
+ w: 20,
1765
+ h: 20,
1766
+ },
1767
+ frames: {
1768
+ '-': { x: -1000 },
1769
+ 0: { x: 1 },
1770
+ 1: { x: 23 },
1771
+ 2: { x: 45 },
1772
+ 3: { x: 67 },
1773
+ 4: { x: 89 },
1774
+ 5: { x: 111 },
1775
+ 6: { x: 133 },
1776
+ 7: { x: 155 },
1777
+ 8: { x: 177 },
1778
+ 9: { x: 199 },
1779
+ avg: { x: 221, w: 48, h: 25 },
1780
+ fps: { x: 271, w: 43, h: 25 },
1781
+ max: { x: 316, w: 53, h: 25 },
1782
+ min: { x: 371, w: 47, h: 25 },
1783
+ },
1797
1784
  },
1785
+ fps: '---',
1786
+ avgFps: '---',
1787
+ minFps: '---',
1788
+ maxFps: '---',
1789
+ }
1790
+ },
1791
+ hooks: {
1792
+ ready() {
1793
+ let minFps = 10000
1794
+ let maxFps = 0
1795
+ let avgFps = 0
1796
+ let totalFps = 0
1797
+ let fpsUpdateCounter = 0
1798
+
1799
+ renderer.on('fpsUpdate', (rM, { fps }) => {
1800
+ minFps = Math.min(fps, minFps)
1801
+ maxFps = Math.max(fps, maxFps)
1802
+ totalFps += fps
1803
+ fpsUpdateCounter++
1804
+ avgFps = Math.round(totalFps / fpsUpdateCounter)
1805
+
1806
+ this.fps = fps.toString().padStart(3, '0')
1807
+ this.avgFps = avgFps.toString().padStart(3, '0')
1808
+ this.minFps = minFps.toString().padStart(3, '0')
1809
+ this.maxFps = maxFps.toString().padStart(3, '0')
1810
+ })
1798
1811
  },
1799
- })
1812
+ },
1813
+ })