@lightningjs/blits 0.9.9 → 1.0.0

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 +27 -0
  2. package/boilerplate/common/public/fonts/Lato-Regular.ttf +0 -0
  3. package/boilerplate/common/public/fonts/Raleway-ExtraBold.ttf +0 -0
  4. package/docs/essentials/displaying_text.md +1 -1
  5. package/package.json +3 -4
  6. package/src/component/base/events.js +1 -1
  7. package/src/component/base/utils.js +34 -1
  8. package/src/component/setup/props.js +3 -1
  9. package/src/component/setup/props.test.js +51 -19
  10. package/src/component.d.ts +2 -1
  11. package/src/component.js +20 -13
  12. package/src/components/Circle.js +13 -12
  13. package/src/components/FPScounter.js +413 -465
  14. package/src/components/Image.js +7 -9
  15. package/src/components/Layout.js +49 -0
  16. package/src/components/Layout.orig.js +34 -0
  17. package/src/components/RouterView.js +6 -10
  18. package/src/components/Sprite.js +10 -12
  19. package/src/components/index.js +2 -2
  20. package/src/components/index.orig.js +2 -2
  21. package/src/engine.js +1 -1
  22. package/src/engines/L3/element.js +193 -180
  23. package/src/engines/L3/element.test.js +170 -0
  24. package/src/engines/L3/fontLoader.js +20 -7
  25. package/src/engines/L3/index.js +2 -2
  26. package/src/engines/L3/launch.js +7 -13
  27. package/src/engines/L3/shaderLoader.js +12 -0
  28. package/src/engines/index.js +1 -1
  29. package/src/launch.d.ts +19 -2
  30. package/src/lib/codegenerator/generator.js +214 -77
  31. package/src/lib/codegenerator/generator.test.js +657 -942
  32. package/src/lib/colors/colors.js +59 -46
  33. package/src/lib/precompiler/precompiler.js +2 -1
  34. package/src/lib/reactivity/effect.js +10 -13
  35. package/src/lib/reactivity/reactive.js +24 -14
  36. package/src/lib/symbols.js +1 -0
  37. package/src/router/router.js +17 -3
  38. package/vite/msdfGenerator.js +52 -53
  39. package/boilerplate/common/public/fonts/Lato-Regular.msdf.json +0 -5383
  40. package/boilerplate/common/public/fonts/Lato-Regular.msdf.png +0 -0
  41. package/boilerplate/common/public/fonts/Raleway-ExtraBold.msdf.json +0 -10838
  42. package/boilerplate/common/public/fonts/Raleway-ExtraBold.msdf.png +0 -0
  43. package/boilerplate/js/default/src/renderer.js +0 -4
  44. package/src/components/Text.js +0 -119
  45. package/src/components/Text.orig.js +0 -81
@@ -23,52 +23,37 @@ export default () =>
23
23
  Component('FPScounter', {
24
24
  /* eslint-disable no-unused-vars */
25
25
  code: {
26
- render: function anonymous(parent, component, context, components) {
26
+ render: function anonymous(parent, component, context, components, effect, getRaw) {
27
27
  const elms = []
28
-
29
- if (!elms[0]) {
30
- elms[0] = this.element({ parent: parent || 'root' }, component)
31
- }
28
+ let componentType
29
+ const rootComponent = component
32
30
  const elementConfig0 = {}
33
31
 
34
- if (!elms[0].nodeId) {
35
- elms[0].populate(elementConfig0)
36
- }
32
+ elms[0] = this.element({ parent: parent || 'root' }, component)
37
33
 
34
+ elms[0].populate(elementConfig0)
38
35
  parent = elms[0]
39
-
40
- if (!elms[1]) {
41
- elms[1] = this.element({ parent: parent || 'root' }, component)
42
- }
43
36
  const elementConfig1 = {}
44
37
 
38
+ elms[1] = this.element({ parent: parent || 'root' }, component)
39
+
45
40
  elementConfig1['y'] = 15
46
41
  elementConfig1['x'] = 20
47
-
48
- if (!elms[1].nodeId) {
49
- elms[1].populate(elementConfig1)
50
- }
51
-
42
+ elms[1].populate(elementConfig1)
52
43
  parent = elms[1]
53
-
54
- if (!elms[2]) {
55
- elms[2] = this.element({ parent: parent || 'root' }, component)
56
- }
57
44
  const elementConfig2 = {}
58
45
 
59
- if (!elms[2].nodeId) {
60
- elms[2].populate(elementConfig2)
61
- }
46
+ elms[2] = this.element({ parent: parent || 'root' }, component)
47
+
48
+ elms[2].populate(elementConfig2)
62
49
 
63
50
  const cmp3 = (context.components && context.components['Sprite']) || components['Sprite']
64
51
 
65
52
  parent = elms[2]
66
-
67
- if (!elms[3]) {
68
- elms[3] = this.element({ parent: parent || 'root' }, component)
69
- }
70
53
  const elementConfig3 = {}
71
54
 
55
+ elms[3] = this.element({ parent: parent || 'root' }, component)
56
+
72
57
  elementConfig3['image'] = component.image
73
58
  elementConfig3['w'] = 43
74
59
  elementConfig3['h'] = 25
@@ -81,10 +66,7 @@ export default () =>
81
66
  }
82
67
  }
83
68
 
84
- if (!elms[3].nodeId) {
85
- elms[3].populate(elementConfig3)
86
- }
87
-
69
+ elms[3].populate(elementConfig3)
88
70
  parent = elms[3]
89
71
  const props4 = {}
90
72
  props4['image'] = component.image
@@ -93,52 +75,50 @@ export default () =>
93
75
  props4['map'] = component.sprite
94
76
  props4['frame'] = 'fps'
95
77
 
96
- if (!elms[4]) {
97
- const componentType = props4['is'] || 'Sprite'
98
-
99
- elms[4] = (
100
- (context.components && context.components[componentType]) ||
101
- components[componentType] ||
102
- (() => {
103
- console.error('component Sprite not found')
104
- })
105
- ).call(null, { props: props4 }, elms[3], component)
106
- if (elms[4][Symbol.for('slots')][0]) {
107
- parent = elms[4][Symbol.for('slots')][0]
108
- component = elms[4]
109
- } else {
110
- parent = elms[4][Symbol.for('children')][0]
78
+ componentType = props4['is'] || 'Sprite'
79
+
80
+ let component4
81
+ if (typeof componentType === 'string') {
82
+ component4 =
83
+ (context.components && context.components[componentType]) || components[componentType]
84
+ if (!component4) {
85
+ throw new Error('Component "Sprite" not found')
111
86
  }
87
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
88
+ component4 = componentType
112
89
  }
113
90
 
114
- parent = elms[2]
91
+ elms[4] = component4.call(null, { props: props4 }, elms[3], component)
115
92
 
116
- if (!elms[5]) {
117
- elms[5] = this.element({ parent: parent || 'root' }, component)
93
+ if (elms[4][Symbol.for('slots')][0]) {
94
+ parent = elms[4][Symbol.for('slots')][0]
95
+ component = elms[4]
96
+ } else {
97
+ parent = elms[4][Symbol.for('children')][0]
118
98
  }
99
+
100
+ parent = elms[2]
119
101
  const elementConfig5 = {}
120
102
 
103
+ elms[5] = this.element({ parent: parent || 'root' }, component)
104
+
121
105
  elementConfig5['x'] = 58
122
106
  elementConfig5['y'] = 2
123
-
124
- if (!elms[5].nodeId) {
125
- elms[5].populate(elementConfig5)
126
- }
107
+ elms[5].populate(elementConfig5)
127
108
 
128
109
  const cmp6 = (context.components && context.components['Sprite']) || components['Sprite']
129
110
 
130
111
  parent = elms[5]
131
-
132
- if (!elms[6]) {
133
- elms[6] = this.element({ parent: parent || 'root' }, component)
134
- }
135
112
  const elementConfig6 = {}
136
113
 
114
+ elms[6] = this.element({ parent: parent || 'root' }, component)
115
+
137
116
  elementConfig6['image'] = component.image
138
117
  elementConfig6['x'] = 0
139
118
  elementConfig6['h'] = 20
140
119
  elementConfig6['w'] = 20
141
120
  elementConfig6['map'] = component.sprite
121
+ elementConfig6['frame'] = component.fps[0]
142
122
 
143
123
  if (typeof cmp6 !== 'undefined') {
144
124
  for (let key in cmp6.config.props) {
@@ -146,10 +126,7 @@ export default () =>
146
126
  }
147
127
  }
148
128
 
149
- if (!elms[6].nodeId) {
150
- elms[6].populate(elementConfig6)
151
- }
152
-
129
+ elms[6].populate(elementConfig6)
153
130
  parent = elms[6]
154
131
  const props7 = {}
155
132
  props7['image'] = component.image
@@ -159,38 +136,41 @@ export default () =>
159
136
  props7['map'] = component.sprite
160
137
  props7['frame'] = component.fps[0]
161
138
 
162
- if (!elms[7]) {
163
- const componentType = props7['is'] || 'Sprite'
164
-
165
- elms[7] = (
166
- (context.components && context.components[componentType]) ||
167
- components[componentType] ||
168
- (() => {
169
- console.error('component Sprite not found')
170
- })
171
- ).call(null, { props: props7 }, elms[6], component)
172
- if (elms[7][Symbol.for('slots')][0]) {
173
- parent = elms[7][Symbol.for('slots')][0]
174
- component = elms[7]
175
- } else {
176
- parent = elms[7][Symbol.for('children')][0]
139
+ componentType = props7['is'] || 'Sprite'
140
+
141
+ let component7
142
+ if (typeof componentType === 'string') {
143
+ component7 =
144
+ (context.components && context.components[componentType]) || components[componentType]
145
+ if (!component7) {
146
+ throw new Error('Component "Sprite" not found')
177
147
  }
148
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
149
+ component7 = componentType
150
+ }
151
+
152
+ elms[7] = component7.call(null, { props: props7 }, elms[6], component)
153
+
154
+ if (elms[7][Symbol.for('slots')][0]) {
155
+ parent = elms[7][Symbol.for('slots')][0]
156
+ component = elms[7]
157
+ } else {
158
+ parent = elms[7][Symbol.for('children')][0]
178
159
  }
179
160
 
180
161
  const cmp8 = (context.components && context.components['Sprite']) || components['Sprite']
181
162
 
182
163
  parent = elms[5]
183
-
184
- if (!elms[8]) {
185
- elms[8] = this.element({ parent: parent || 'root' }, component)
186
- }
187
164
  const elementConfig8 = {}
188
165
 
166
+ elms[8] = this.element({ parent: parent || 'root' }, component)
167
+
189
168
  elementConfig8['image'] = component.image
190
169
  elementConfig8['x'] = 18
191
170
  elementConfig8['h'] = 20
192
171
  elementConfig8['w'] = 20
193
172
  elementConfig8['map'] = component.sprite
173
+ elementConfig8['frame'] = component.fps[1]
194
174
 
195
175
  if (typeof cmp8 !== 'undefined') {
196
176
  for (let key in cmp8.config.props) {
@@ -198,10 +178,7 @@ export default () =>
198
178
  }
199
179
  }
200
180
 
201
- if (!elms[8].nodeId) {
202
- elms[8].populate(elementConfig8)
203
- }
204
-
181
+ elms[8].populate(elementConfig8)
205
182
  parent = elms[8]
206
183
  const props9 = {}
207
184
  props9['image'] = component.image
@@ -211,38 +188,41 @@ export default () =>
211
188
  props9['map'] = component.sprite
212
189
  props9['frame'] = component.fps[1]
213
190
 
214
- if (!elms[9]) {
215
- const componentType = props9['is'] || 'Sprite'
216
-
217
- elms[9] = (
218
- (context.components && context.components[componentType]) ||
219
- components[componentType] ||
220
- (() => {
221
- console.error('component Sprite not found')
222
- })
223
- ).call(null, { props: props9 }, elms[8], component)
224
- if (elms[9][Symbol.for('slots')][0]) {
225
- parent = elms[9][Symbol.for('slots')][0]
226
- component = elms[9]
227
- } else {
228
- parent = elms[9][Symbol.for('children')][0]
191
+ componentType = props9['is'] || 'Sprite'
192
+
193
+ let component9
194
+ if (typeof componentType === 'string') {
195
+ component9 =
196
+ (context.components && context.components[componentType]) || components[componentType]
197
+ if (!component9) {
198
+ throw new Error('Component "Sprite" not found')
229
199
  }
200
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
201
+ component9 = componentType
202
+ }
203
+
204
+ elms[9] = component9.call(null, { props: props9 }, elms[8], component)
205
+
206
+ if (elms[9][Symbol.for('slots')][0]) {
207
+ parent = elms[9][Symbol.for('slots')][0]
208
+ component = elms[9]
209
+ } else {
210
+ parent = elms[9][Symbol.for('children')][0]
230
211
  }
231
212
 
232
213
  const cmp10 = (context.components && context.components['Sprite']) || components['Sprite']
233
214
 
234
215
  parent = elms[5]
235
-
236
- if (!elms[10]) {
237
- elms[10] = this.element({ parent: parent || 'root' }, component)
238
- }
239
216
  const elementConfig10 = {}
240
217
 
218
+ elms[10] = this.element({ parent: parent || 'root' }, component)
219
+
241
220
  elementConfig10['image'] = component.image
242
221
  elementConfig10['x'] = 36
243
222
  elementConfig10['h'] = 20
244
223
  elementConfig10['w'] = 20
245
224
  elementConfig10['map'] = component.sprite
225
+ elementConfig10['frame'] = component.fps[2]
246
226
 
247
227
  if (typeof cmp10 !== 'undefined') {
248
228
  for (let key in cmp10.config.props) {
@@ -250,10 +230,7 @@ export default () =>
250
230
  }
251
231
  }
252
232
 
253
- if (!elms[10].nodeId) {
254
- elms[10].populate(elementConfig10)
255
- }
256
-
233
+ elms[10].populate(elementConfig10)
257
234
  parent = elms[10]
258
235
  const props11 = {}
259
236
  props11['image'] = component.image
@@ -263,46 +240,43 @@ export default () =>
263
240
  props11['map'] = component.sprite
264
241
  props11['frame'] = component.fps[2]
265
242
 
266
- if (!elms[11]) {
267
- const componentType = props11['is'] || 'Sprite'
268
-
269
- elms[11] = (
270
- (context.components && context.components[componentType]) ||
271
- components[componentType] ||
272
- (() => {
273
- console.error('component Sprite not found')
274
- })
275
- ).call(null, { props: props11 }, elms[10], component)
276
- if (elms[11][Symbol.for('slots')][0]) {
277
- parent = elms[11][Symbol.for('slots')][0]
278
- component = elms[11]
279
- } else {
280
- parent = elms[11][Symbol.for('children')][0]
243
+ componentType = props11['is'] || 'Sprite'
244
+
245
+ let component11
246
+ if (typeof componentType === 'string') {
247
+ component11 =
248
+ (context.components && context.components[componentType]) || components[componentType]
249
+ if (!component11) {
250
+ throw new Error('Component "Sprite" not found')
281
251
  }
252
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
253
+ component11 = componentType
282
254
  }
283
255
 
284
- parent = elms[1]
256
+ elms[11] = component11.call(null, { props: props11 }, elms[10], component)
285
257
 
286
- if (!elms[12]) {
287
- elms[12] = this.element({ parent: parent || 'root' }, component)
258
+ if (elms[11][Symbol.for('slots')][0]) {
259
+ parent = elms[11][Symbol.for('slots')][0]
260
+ component = elms[11]
261
+ } else {
262
+ parent = elms[11][Symbol.for('children')][0]
288
263
  }
264
+
265
+ parent = elms[1]
289
266
  const elementConfig12 = {}
290
267
 
291
- elementConfig12['x'] = 150
268
+ elms[12] = this.element({ parent: parent || 'root' }, component)
292
269
 
293
- if (!elms[12].nodeId) {
294
- elms[12].populate(elementConfig12)
295
- }
270
+ elementConfig12['x'] = 150
271
+ elms[12].populate(elementConfig12)
296
272
 
297
273
  const cmp13 = (context.components && context.components['Sprite']) || components['Sprite']
298
274
 
299
275
  parent = elms[12]
300
-
301
- if (!elms[13]) {
302
- elms[13] = this.element({ parent: parent || 'root' }, component)
303
- }
304
276
  const elementConfig13 = {}
305
277
 
278
+ elms[13] = this.element({ parent: parent || 'root' }, component)
279
+
306
280
  elementConfig13['image'] = component.image
307
281
  elementConfig13['y'] = 2
308
282
  elementConfig13['w'] = 48
@@ -316,10 +290,7 @@ export default () =>
316
290
  }
317
291
  }
318
292
 
319
- if (!elms[13].nodeId) {
320
- elms[13].populate(elementConfig13)
321
- }
322
-
293
+ elms[13].populate(elementConfig13)
323
294
  parent = elms[13]
324
295
  const props14 = {}
325
296
  props14['image'] = component.image
@@ -329,52 +300,50 @@ export default () =>
329
300
  props14['map'] = component.sprite
330
301
  props14['frame'] = 'avg'
331
302
 
332
- if (!elms[14]) {
333
- const componentType = props14['is'] || 'Sprite'
334
-
335
- elms[14] = (
336
- (context.components && context.components[componentType]) ||
337
- components[componentType] ||
338
- (() => {
339
- console.error('component Sprite not found')
340
- })
341
- ).call(null, { props: props14 }, elms[13], component)
342
- if (elms[14][Symbol.for('slots')][0]) {
343
- parent = elms[14][Symbol.for('slots')][0]
344
- component = elms[14]
345
- } else {
346
- parent = elms[14][Symbol.for('children')][0]
303
+ componentType = props14['is'] || 'Sprite'
304
+
305
+ let component14
306
+ if (typeof componentType === 'string') {
307
+ component14 =
308
+ (context.components && context.components[componentType]) || components[componentType]
309
+ if (!component14) {
310
+ throw new Error('Component "Sprite" not found')
347
311
  }
312
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
313
+ component14 = componentType
348
314
  }
349
315
 
350
- parent = elms[12]
316
+ elms[14] = component14.call(null, { props: props14 }, elms[13], component)
351
317
 
352
- if (!elms[15]) {
353
- elms[15] = this.element({ parent: parent || 'root' }, component)
318
+ if (elms[14][Symbol.for('slots')][0]) {
319
+ parent = elms[14][Symbol.for('slots')][0]
320
+ component = elms[14]
321
+ } else {
322
+ parent = elms[14][Symbol.for('children')][0]
354
323
  }
324
+
325
+ parent = elms[12]
355
326
  const elementConfig15 = {}
356
327
 
328
+ elms[15] = this.element({ parent: parent || 'root' }, component)
329
+
357
330
  elementConfig15['x'] = 63
358
331
  elementConfig15['y'] = 2
359
-
360
- if (!elms[15].nodeId) {
361
- elms[15].populate(elementConfig15)
362
- }
332
+ elms[15].populate(elementConfig15)
363
333
 
364
334
  const cmp16 = (context.components && context.components['Sprite']) || components['Sprite']
365
335
 
366
336
  parent = elms[15]
367
-
368
- if (!elms[16]) {
369
- elms[16] = this.element({ parent: parent || 'root' }, component)
370
- }
371
337
  const elementConfig16 = {}
372
338
 
339
+ elms[16] = this.element({ parent: parent || 'root' }, component)
340
+
373
341
  elementConfig16['image'] = component.image
374
342
  elementConfig16['x'] = 0
375
343
  elementConfig16['h'] = 20
376
344
  elementConfig16['w'] = 20
377
345
  elementConfig16['map'] = component.sprite
346
+ elementConfig16['frame'] = component.avgFps[0]
378
347
 
379
348
  if (typeof cmp16 !== 'undefined') {
380
349
  for (let key in cmp16.config.props) {
@@ -382,10 +351,7 @@ export default () =>
382
351
  }
383
352
  }
384
353
 
385
- if (!elms[16].nodeId) {
386
- elms[16].populate(elementConfig16)
387
- }
388
-
354
+ elms[16].populate(elementConfig16)
389
355
  parent = elms[16]
390
356
  const props17 = {}
391
357
  props17['image'] = component.image
@@ -395,38 +361,41 @@ export default () =>
395
361
  props17['map'] = component.sprite
396
362
  props17['frame'] = component.avgFps[0]
397
363
 
398
- if (!elms[17]) {
399
- const componentType = props17['is'] || 'Sprite'
400
-
401
- elms[17] = (
402
- (context.components && context.components[componentType]) ||
403
- components[componentType] ||
404
- (() => {
405
- console.error('component Sprite not found')
406
- })
407
- ).call(null, { props: props17 }, elms[16], component)
408
- if (elms[17][Symbol.for('slots')][0]) {
409
- parent = elms[17][Symbol.for('slots')][0]
410
- component = elms[17]
411
- } else {
412
- parent = elms[17][Symbol.for('children')][0]
364
+ componentType = props17['is'] || 'Sprite'
365
+
366
+ let component17
367
+ if (typeof componentType === 'string') {
368
+ component17 =
369
+ (context.components && context.components[componentType]) || components[componentType]
370
+ if (!component17) {
371
+ throw new Error('Component "Sprite" not found')
413
372
  }
373
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
374
+ component17 = componentType
375
+ }
376
+
377
+ elms[17] = component17.call(null, { props: props17 }, elms[16], component)
378
+
379
+ if (elms[17][Symbol.for('slots')][0]) {
380
+ parent = elms[17][Symbol.for('slots')][0]
381
+ component = elms[17]
382
+ } else {
383
+ parent = elms[17][Symbol.for('children')][0]
414
384
  }
415
385
 
416
386
  const cmp18 = (context.components && context.components['Sprite']) || components['Sprite']
417
387
 
418
388
  parent = elms[15]
419
-
420
- if (!elms[18]) {
421
- elms[18] = this.element({ parent: parent || 'root' }, component)
422
- }
423
389
  const elementConfig18 = {}
424
390
 
391
+ elms[18] = this.element({ parent: parent || 'root' }, component)
392
+
425
393
  elementConfig18['image'] = component.image
426
394
  elementConfig18['x'] = 18
427
395
  elementConfig18['h'] = 20
428
396
  elementConfig18['w'] = 20
429
397
  elementConfig18['map'] = component.sprite
398
+ elementConfig18['frame'] = component.avgFps[1]
430
399
 
431
400
  if (typeof cmp18 !== 'undefined') {
432
401
  for (let key in cmp18.config.props) {
@@ -434,10 +403,7 @@ export default () =>
434
403
  }
435
404
  }
436
405
 
437
- if (!elms[18].nodeId) {
438
- elms[18].populate(elementConfig18)
439
- }
440
-
406
+ elms[18].populate(elementConfig18)
441
407
  parent = elms[18]
442
408
  const props19 = {}
443
409
  props19['image'] = component.image
@@ -447,38 +413,41 @@ export default () =>
447
413
  props19['map'] = component.sprite
448
414
  props19['frame'] = component.avgFps[1]
449
415
 
450
- if (!elms[19]) {
451
- const componentType = props19['is'] || 'Sprite'
452
-
453
- elms[19] = (
454
- (context.components && context.components[componentType]) ||
455
- components[componentType] ||
456
- (() => {
457
- console.error('component Sprite not found')
458
- })
459
- ).call(null, { props: props19 }, elms[18], component)
460
- if (elms[19][Symbol.for('slots')][0]) {
461
- parent = elms[19][Symbol.for('slots')][0]
462
- component = elms[19]
463
- } else {
464
- parent = elms[19][Symbol.for('children')][0]
416
+ componentType = props19['is'] || 'Sprite'
417
+
418
+ let component19
419
+ if (typeof componentType === 'string') {
420
+ component19 =
421
+ (context.components && context.components[componentType]) || components[componentType]
422
+ if (!component19) {
423
+ throw new Error('Component "Sprite" not found')
465
424
  }
425
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
426
+ component19 = componentType
427
+ }
428
+
429
+ elms[19] = component19.call(null, { props: props19 }, elms[18], component)
430
+
431
+ if (elms[19][Symbol.for('slots')][0]) {
432
+ parent = elms[19][Symbol.for('slots')][0]
433
+ component = elms[19]
434
+ } else {
435
+ parent = elms[19][Symbol.for('children')][0]
466
436
  }
467
437
 
468
438
  const cmp20 = (context.components && context.components['Sprite']) || components['Sprite']
469
439
 
470
440
  parent = elms[15]
471
-
472
- if (!elms[20]) {
473
- elms[20] = this.element({ parent: parent || 'root' }, component)
474
- }
475
441
  const elementConfig20 = {}
476
442
 
443
+ elms[20] = this.element({ parent: parent || 'root' }, component)
444
+
477
445
  elementConfig20['image'] = component.image
478
446
  elementConfig20['x'] = 36
479
447
  elementConfig20['h'] = 20
480
448
  elementConfig20['w'] = 20
481
449
  elementConfig20['map'] = component.sprite
450
+ elementConfig20['frame'] = component.avgFps[2]
482
451
 
483
452
  if (typeof cmp20 !== 'undefined') {
484
453
  for (let key in cmp20.config.props) {
@@ -486,10 +455,7 @@ export default () =>
486
455
  }
487
456
  }
488
457
 
489
- if (!elms[20].nodeId) {
490
- elms[20].populate(elementConfig20)
491
- }
492
-
458
+ elms[20].populate(elementConfig20)
493
459
  parent = elms[20]
494
460
  const props21 = {}
495
461
  props21['image'] = component.image
@@ -499,47 +465,44 @@ export default () =>
499
465
  props21['map'] = component.sprite
500
466
  props21['frame'] = component.avgFps[2]
501
467
 
502
- if (!elms[21]) {
503
- const componentType = props21['is'] || 'Sprite'
504
-
505
- elms[21] = (
506
- (context.components && context.components[componentType]) ||
507
- components[componentType] ||
508
- (() => {
509
- console.error('component Sprite not found')
510
- })
511
- ).call(null, { props: props21 }, elms[20], component)
512
- if (elms[21][Symbol.for('slots')][0]) {
513
- parent = elms[21][Symbol.for('slots')][0]
514
- component = elms[21]
515
- } else {
516
- parent = elms[21][Symbol.for('children')][0]
468
+ componentType = props21['is'] || 'Sprite'
469
+
470
+ let component21
471
+ if (typeof componentType === 'string') {
472
+ component21 =
473
+ (context.components && context.components[componentType]) || components[componentType]
474
+ if (!component21) {
475
+ throw new Error('Component "Sprite" not found')
517
476
  }
477
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
478
+ component21 = componentType
518
479
  }
519
480
 
520
- parent = elms[1]
481
+ elms[21] = component21.call(null, { props: props21 }, elms[20], component)
521
482
 
522
- if (!elms[22]) {
523
- elms[22] = this.element({ parent: parent || 'root' }, component)
483
+ if (elms[21][Symbol.for('slots')][0]) {
484
+ parent = elms[21][Symbol.for('slots')][0]
485
+ component = elms[21]
486
+ } else {
487
+ parent = elms[21][Symbol.for('children')][0]
524
488
  }
489
+
490
+ parent = elms[1]
525
491
  const elementConfig22 = {}
526
492
 
493
+ elms[22] = this.element({ parent: parent || 'root' }, component)
494
+
527
495
  elementConfig22['x'] = 0
528
496
  elementConfig22['y'] = 40
529
-
530
- if (!elms[22].nodeId) {
531
- elms[22].populate(elementConfig22)
532
- }
497
+ elms[22].populate(elementConfig22)
533
498
 
534
499
  const cmp23 = (context.components && context.components['Sprite']) || components['Sprite']
535
500
 
536
501
  parent = elms[22]
537
-
538
- if (!elms[23]) {
539
- elms[23] = this.element({ parent: parent || 'root' }, component)
540
- }
541
502
  const elementConfig23 = {}
542
503
 
504
+ elms[23] = this.element({ parent: parent || 'root' }, component)
505
+
543
506
  elementConfig23['image'] = component.image
544
507
  elementConfig23['x'] = -2
545
508
  elementConfig23['w'] = 47
@@ -553,10 +516,7 @@ export default () =>
553
516
  }
554
517
  }
555
518
 
556
- if (!elms[23].nodeId) {
557
- elms[23].populate(elementConfig23)
558
- }
559
-
519
+ elms[23].populate(elementConfig23)
560
520
  parent = elms[23]
561
521
  const props24 = {}
562
522
  props24['image'] = component.image
@@ -566,52 +526,50 @@ export default () =>
566
526
  props24['map'] = component.sprite
567
527
  props24['frame'] = 'min'
568
528
 
569
- if (!elms[24]) {
570
- const componentType = props24['is'] || 'Sprite'
571
-
572
- elms[24] = (
573
- (context.components && context.components[componentType]) ||
574
- components[componentType] ||
575
- (() => {
576
- console.error('component Sprite not found')
577
- })
578
- ).call(null, { props: props24 }, elms[23], component)
579
- if (elms[24][Symbol.for('slots')][0]) {
580
- parent = elms[24][Symbol.for('slots')][0]
581
- component = elms[24]
582
- } else {
583
- parent = elms[24][Symbol.for('children')][0]
529
+ componentType = props24['is'] || 'Sprite'
530
+
531
+ let component24
532
+ if (typeof componentType === 'string') {
533
+ component24 =
534
+ (context.components && context.components[componentType]) || components[componentType]
535
+ if (!component24) {
536
+ throw new Error('Component "Sprite" not found')
584
537
  }
538
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
539
+ component24 = componentType
585
540
  }
586
541
 
587
- parent = elms[22]
542
+ elms[24] = component24.call(null, { props: props24 }, elms[23], component)
588
543
 
589
- if (!elms[25]) {
590
- elms[25] = this.element({ parent: parent || 'root' }, component)
544
+ if (elms[24][Symbol.for('slots')][0]) {
545
+ parent = elms[24][Symbol.for('slots')][0]
546
+ component = elms[24]
547
+ } else {
548
+ parent = elms[24][Symbol.for('children')][0]
591
549
  }
550
+
551
+ parent = elms[22]
592
552
  const elementConfig25 = {}
593
553
 
554
+ elms[25] = this.element({ parent: parent || 'root' }, component)
555
+
594
556
  elementConfig25['x'] = 58
595
557
  elementConfig25['y'] = 2
596
-
597
- if (!elms[25].nodeId) {
598
- elms[25].populate(elementConfig25)
599
- }
558
+ elms[25].populate(elementConfig25)
600
559
 
601
560
  const cmp26 = (context.components && context.components['Sprite']) || components['Sprite']
602
561
 
603
562
  parent = elms[25]
604
-
605
- if (!elms[26]) {
606
- elms[26] = this.element({ parent: parent || 'root' }, component)
607
- }
608
563
  const elementConfig26 = {}
609
564
 
565
+ elms[26] = this.element({ parent: parent || 'root' }, component)
566
+
610
567
  elementConfig26['image'] = component.image
611
568
  elementConfig26['x'] = 0
612
569
  elementConfig26['h'] = 20
613
570
  elementConfig26['w'] = 20
614
571
  elementConfig26['map'] = component.sprite
572
+ elementConfig26['frame'] = component.minFps[0]
615
573
 
616
574
  if (typeof cmp26 !== 'undefined') {
617
575
  for (let key in cmp26.config.props) {
@@ -619,10 +577,7 @@ export default () =>
619
577
  }
620
578
  }
621
579
 
622
- if (!elms[26].nodeId) {
623
- elms[26].populate(elementConfig26)
624
- }
625
-
580
+ elms[26].populate(elementConfig26)
626
581
  parent = elms[26]
627
582
  const props27 = {}
628
583
  props27['image'] = component.image
@@ -632,38 +587,41 @@ export default () =>
632
587
  props27['map'] = component.sprite
633
588
  props27['frame'] = component.minFps[0]
634
589
 
635
- if (!elms[27]) {
636
- const componentType = props27['is'] || 'Sprite'
637
-
638
- elms[27] = (
639
- (context.components && context.components[componentType]) ||
640
- components[componentType] ||
641
- (() => {
642
- console.error('component Sprite not found')
643
- })
644
- ).call(null, { props: props27 }, elms[26], component)
645
- if (elms[27][Symbol.for('slots')][0]) {
646
- parent = elms[27][Symbol.for('slots')][0]
647
- component = elms[27]
648
- } else {
649
- parent = elms[27][Symbol.for('children')][0]
590
+ componentType = props27['is'] || 'Sprite'
591
+
592
+ let component27
593
+ if (typeof componentType === 'string') {
594
+ component27 =
595
+ (context.components && context.components[componentType]) || components[componentType]
596
+ if (!component27) {
597
+ throw new Error('Component "Sprite" not found')
650
598
  }
599
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
600
+ component27 = componentType
601
+ }
602
+
603
+ elms[27] = component27.call(null, { props: props27 }, elms[26], component)
604
+
605
+ if (elms[27][Symbol.for('slots')][0]) {
606
+ parent = elms[27][Symbol.for('slots')][0]
607
+ component = elms[27]
608
+ } else {
609
+ parent = elms[27][Symbol.for('children')][0]
651
610
  }
652
611
 
653
612
  const cmp28 = (context.components && context.components['Sprite']) || components['Sprite']
654
613
 
655
614
  parent = elms[25]
656
-
657
- if (!elms[28]) {
658
- elms[28] = this.element({ parent: parent || 'root' }, component)
659
- }
660
615
  const elementConfig28 = {}
661
616
 
617
+ elms[28] = this.element({ parent: parent || 'root' }, component)
618
+
662
619
  elementConfig28['image'] = component.image
663
620
  elementConfig28['x'] = 18
664
621
  elementConfig28['h'] = 20
665
622
  elementConfig28['w'] = 20
666
623
  elementConfig28['map'] = component.sprite
624
+ elementConfig28['frame'] = component.minFps[1]
667
625
 
668
626
  if (typeof cmp28 !== 'undefined') {
669
627
  for (let key in cmp28.config.props) {
@@ -671,10 +629,7 @@ export default () =>
671
629
  }
672
630
  }
673
631
 
674
- if (!elms[28].nodeId) {
675
- elms[28].populate(elementConfig28)
676
- }
677
-
632
+ elms[28].populate(elementConfig28)
678
633
  parent = elms[28]
679
634
  const props29 = {}
680
635
  props29['image'] = component.image
@@ -684,38 +639,41 @@ export default () =>
684
639
  props29['map'] = component.sprite
685
640
  props29['frame'] = component.minFps[1]
686
641
 
687
- if (!elms[29]) {
688
- const componentType = props29['is'] || 'Sprite'
689
-
690
- elms[29] = (
691
- (context.components && context.components[componentType]) ||
692
- components[componentType] ||
693
- (() => {
694
- console.error('component Sprite not found')
695
- })
696
- ).call(null, { props: props29 }, elms[28], component)
697
- if (elms[29][Symbol.for('slots')][0]) {
698
- parent = elms[29][Symbol.for('slots')][0]
699
- component = elms[29]
700
- } else {
701
- parent = elms[29][Symbol.for('children')][0]
642
+ componentType = props29['is'] || 'Sprite'
643
+
644
+ let component29
645
+ if (typeof componentType === 'string') {
646
+ component29 =
647
+ (context.components && context.components[componentType]) || components[componentType]
648
+ if (!component29) {
649
+ throw new Error('Component "Sprite" not found')
702
650
  }
651
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
652
+ component29 = componentType
653
+ }
654
+
655
+ elms[29] = component29.call(null, { props: props29 }, elms[28], component)
656
+
657
+ if (elms[29][Symbol.for('slots')][0]) {
658
+ parent = elms[29][Symbol.for('slots')][0]
659
+ component = elms[29]
660
+ } else {
661
+ parent = elms[29][Symbol.for('children')][0]
703
662
  }
704
663
 
705
664
  const cmp30 = (context.components && context.components['Sprite']) || components['Sprite']
706
665
 
707
666
  parent = elms[25]
708
-
709
- if (!elms[30]) {
710
- elms[30] = this.element({ parent: parent || 'root' }, component)
711
- }
712
667
  const elementConfig30 = {}
713
668
 
669
+ elms[30] = this.element({ parent: parent || 'root' }, component)
670
+
714
671
  elementConfig30['image'] = component.image
715
672
  elementConfig30['x'] = 36
716
673
  elementConfig30['h'] = 20
717
674
  elementConfig30['w'] = 20
718
675
  elementConfig30['map'] = component.sprite
676
+ elementConfig30['frame'] = component.minFps[2]
719
677
 
720
678
  if (typeof cmp30 !== 'undefined') {
721
679
  for (let key in cmp30.config.props) {
@@ -723,10 +681,7 @@ export default () =>
723
681
  }
724
682
  }
725
683
 
726
- if (!elms[30].nodeId) {
727
- elms[30].populate(elementConfig30)
728
- }
729
-
684
+ elms[30].populate(elementConfig30)
730
685
  parent = elms[30]
731
686
  const props31 = {}
732
687
  props31['image'] = component.image
@@ -736,47 +691,44 @@ export default () =>
736
691
  props31['map'] = component.sprite
737
692
  props31['frame'] = component.minFps[2]
738
693
 
739
- if (!elms[31]) {
740
- const componentType = props31['is'] || 'Sprite'
741
-
742
- elms[31] = (
743
- (context.components && context.components[componentType]) ||
744
- components[componentType] ||
745
- (() => {
746
- console.error('component Sprite not found')
747
- })
748
- ).call(null, { props: props31 }, elms[30], component)
749
- if (elms[31][Symbol.for('slots')][0]) {
750
- parent = elms[31][Symbol.for('slots')][0]
751
- component = elms[31]
752
- } else {
753
- parent = elms[31][Symbol.for('children')][0]
694
+ componentType = props31['is'] || 'Sprite'
695
+
696
+ let component31
697
+ if (typeof componentType === 'string') {
698
+ component31 =
699
+ (context.components && context.components[componentType]) || components[componentType]
700
+ if (!component31) {
701
+ throw new Error('Component "Sprite" not found')
754
702
  }
703
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
704
+ component31 = componentType
755
705
  }
756
706
 
757
- parent = elms[1]
707
+ elms[31] = component31.call(null, { props: props31 }, elms[30], component)
758
708
 
759
- if (!elms[32]) {
760
- elms[32] = this.element({ parent: parent || 'root' }, component)
709
+ if (elms[31][Symbol.for('slots')][0]) {
710
+ parent = elms[31][Symbol.for('slots')][0]
711
+ component = elms[31]
712
+ } else {
713
+ parent = elms[31][Symbol.for('children')][0]
761
714
  }
715
+
716
+ parent = elms[1]
762
717
  const elementConfig32 = {}
763
718
 
719
+ elms[32] = this.element({ parent: parent || 'root' }, component)
720
+
764
721
  elementConfig32['x'] = 150
765
722
  elementConfig32['y'] = 40
766
-
767
- if (!elms[32].nodeId) {
768
- elms[32].populate(elementConfig32)
769
- }
723
+ elms[32].populate(elementConfig32)
770
724
 
771
725
  const cmp33 = (context.components && context.components['Sprite']) || components['Sprite']
772
726
 
773
727
  parent = elms[32]
774
-
775
- if (!elms[33]) {
776
- elms[33] = this.element({ parent: parent || 'root' }, component)
777
- }
778
728
  const elementConfig33 = {}
779
729
 
730
+ elms[33] = this.element({ parent: parent || 'root' }, component)
731
+
780
732
  elementConfig33['image'] = component.image
781
733
  elementConfig33['w'] = 53
782
734
  elementConfig33['h'] = 25
@@ -789,10 +741,7 @@ export default () =>
789
741
  }
790
742
  }
791
743
 
792
- if (!elms[33].nodeId) {
793
- elms[33].populate(elementConfig33)
794
- }
795
-
744
+ elms[33].populate(elementConfig33)
796
745
  parent = elms[33]
797
746
  const props34 = {}
798
747
  props34['image'] = component.image
@@ -801,52 +750,50 @@ export default () =>
801
750
  props34['map'] = component.sprite
802
751
  props34['frame'] = 'max'
803
752
 
804
- if (!elms[34]) {
805
- const componentType = props34['is'] || 'Sprite'
806
-
807
- elms[34] = (
808
- (context.components && context.components[componentType]) ||
809
- components[componentType] ||
810
- (() => {
811
- console.error('component Sprite not found')
812
- })
813
- ).call(null, { props: props34 }, elms[33], component)
814
- if (elms[34][Symbol.for('slots')][0]) {
815
- parent = elms[34][Symbol.for('slots')][0]
816
- component = elms[34]
817
- } else {
818
- parent = elms[34][Symbol.for('children')][0]
753
+ componentType = props34['is'] || 'Sprite'
754
+
755
+ let component34
756
+ if (typeof componentType === 'string') {
757
+ component34 =
758
+ (context.components && context.components[componentType]) || components[componentType]
759
+ if (!component34) {
760
+ throw new Error('Component "Sprite" not found')
819
761
  }
762
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
763
+ component34 = componentType
820
764
  }
821
765
 
822
- parent = elms[32]
766
+ elms[34] = component34.call(null, { props: props34 }, elms[33], component)
823
767
 
824
- if (!elms[35]) {
825
- elms[35] = this.element({ parent: parent || 'root' }, component)
768
+ if (elms[34][Symbol.for('slots')][0]) {
769
+ parent = elms[34][Symbol.for('slots')][0]
770
+ component = elms[34]
771
+ } else {
772
+ parent = elms[34][Symbol.for('children')][0]
826
773
  }
774
+
775
+ parent = elms[32]
827
776
  const elementConfig35 = {}
828
777
 
778
+ elms[35] = this.element({ parent: parent || 'root' }, component)
779
+
829
780
  elementConfig35['x'] = 63
830
781
  elementConfig35['y'] = 2
831
-
832
- if (!elms[35].nodeId) {
833
- elms[35].populate(elementConfig35)
834
- }
782
+ elms[35].populate(elementConfig35)
835
783
 
836
784
  const cmp36 = (context.components && context.components['Sprite']) || components['Sprite']
837
785
 
838
786
  parent = elms[35]
839
-
840
- if (!elms[36]) {
841
- elms[36] = this.element({ parent: parent || 'root' }, component)
842
- }
843
787
  const elementConfig36 = {}
844
788
 
789
+ elms[36] = this.element({ parent: parent || 'root' }, component)
790
+
845
791
  elementConfig36['image'] = component.image
846
792
  elementConfig36['x'] = 0
847
793
  elementConfig36['h'] = 20
848
794
  elementConfig36['w'] = 20
849
795
  elementConfig36['map'] = component.sprite
796
+ elementConfig36['frame'] = component.maxFps[0]
850
797
 
851
798
  if (typeof cmp36 !== 'undefined') {
852
799
  for (let key in cmp36.config.props) {
@@ -854,10 +801,7 @@ export default () =>
854
801
  }
855
802
  }
856
803
 
857
- if (!elms[36].nodeId) {
858
- elms[36].populate(elementConfig36)
859
- }
860
-
804
+ elms[36].populate(elementConfig36)
861
805
  parent = elms[36]
862
806
  const props37 = {}
863
807
  props37['image'] = component.image
@@ -867,38 +811,41 @@ export default () =>
867
811
  props37['map'] = component.sprite
868
812
  props37['frame'] = component.maxFps[0]
869
813
 
870
- if (!elms[37]) {
871
- const componentType = props37['is'] || 'Sprite'
872
-
873
- elms[37] = (
874
- (context.components && context.components[componentType]) ||
875
- components[componentType] ||
876
- (() => {
877
- console.error('component Sprite not found')
878
- })
879
- ).call(null, { props: props37 }, elms[36], component)
880
- if (elms[37][Symbol.for('slots')][0]) {
881
- parent = elms[37][Symbol.for('slots')][0]
882
- component = elms[37]
883
- } else {
884
- parent = elms[37][Symbol.for('children')][0]
814
+ componentType = props37['is'] || 'Sprite'
815
+
816
+ let component37
817
+ if (typeof componentType === 'string') {
818
+ component37 =
819
+ (context.components && context.components[componentType]) || components[componentType]
820
+ if (!component37) {
821
+ throw new Error('Component "Sprite" not found')
885
822
  }
823
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
824
+ component37 = componentType
825
+ }
826
+
827
+ elms[37] = component37.call(null, { props: props37 }, elms[36], component)
828
+
829
+ if (elms[37][Symbol.for('slots')][0]) {
830
+ parent = elms[37][Symbol.for('slots')][0]
831
+ component = elms[37]
832
+ } else {
833
+ parent = elms[37][Symbol.for('children')][0]
886
834
  }
887
835
 
888
836
  const cmp38 = (context.components && context.components['Sprite']) || components['Sprite']
889
837
 
890
838
  parent = elms[35]
891
-
892
- if (!elms[38]) {
893
- elms[38] = this.element({ parent: parent || 'root' }, component)
894
- }
895
839
  const elementConfig38 = {}
896
840
 
841
+ elms[38] = this.element({ parent: parent || 'root' }, component)
842
+
897
843
  elementConfig38['image'] = component.image
898
844
  elementConfig38['x'] = 18
899
845
  elementConfig38['h'] = 20
900
846
  elementConfig38['w'] = 20
901
847
  elementConfig38['map'] = component.sprite
848
+ elementConfig38['frame'] = component.maxFps[1]
902
849
 
903
850
  if (typeof cmp38 !== 'undefined') {
904
851
  for (let key in cmp38.config.props) {
@@ -906,10 +853,7 @@ export default () =>
906
853
  }
907
854
  }
908
855
 
909
- if (!elms[38].nodeId) {
910
- elms[38].populate(elementConfig38)
911
- }
912
-
856
+ elms[38].populate(elementConfig38)
913
857
  parent = elms[38]
914
858
  const props39 = {}
915
859
  props39['image'] = component.image
@@ -919,38 +863,41 @@ export default () =>
919
863
  props39['map'] = component.sprite
920
864
  props39['frame'] = component.maxFps[1]
921
865
 
922
- if (!elms[39]) {
923
- const componentType = props39['is'] || 'Sprite'
924
-
925
- elms[39] = (
926
- (context.components && context.components[componentType]) ||
927
- components[componentType] ||
928
- (() => {
929
- console.error('component Sprite not found')
930
- })
931
- ).call(null, { props: props39 }, elms[38], component)
932
- if (elms[39][Symbol.for('slots')][0]) {
933
- parent = elms[39][Symbol.for('slots')][0]
934
- component = elms[39]
935
- } else {
936
- parent = elms[39][Symbol.for('children')][0]
866
+ componentType = props39['is'] || 'Sprite'
867
+
868
+ let component39
869
+ if (typeof componentType === 'string') {
870
+ component39 =
871
+ (context.components && context.components[componentType]) || components[componentType]
872
+ if (!component39) {
873
+ throw new Error('Component "Sprite" not found')
937
874
  }
875
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
876
+ component39 = componentType
877
+ }
878
+
879
+ elms[39] = component39.call(null, { props: props39 }, elms[38], component)
880
+
881
+ if (elms[39][Symbol.for('slots')][0]) {
882
+ parent = elms[39][Symbol.for('slots')][0]
883
+ component = elms[39]
884
+ } else {
885
+ parent = elms[39][Symbol.for('children')][0]
938
886
  }
939
887
 
940
888
  const cmp40 = (context.components && context.components['Sprite']) || components['Sprite']
941
889
 
942
890
  parent = elms[35]
943
-
944
- if (!elms[40]) {
945
- elms[40] = this.element({ parent: parent || 'root' }, component)
946
- }
947
891
  const elementConfig40 = {}
948
892
 
893
+ elms[40] = this.element({ parent: parent || 'root' }, component)
894
+
949
895
  elementConfig40['image'] = component.image
950
896
  elementConfig40['x'] = 36
951
897
  elementConfig40['h'] = 20
952
898
  elementConfig40['w'] = 20
953
899
  elementConfig40['map'] = component.sprite
900
+ elementConfig40['frame'] = component.maxFps[2]
954
901
 
955
902
  if (typeof cmp40 !== 'undefined') {
956
903
  for (let key in cmp40.config.props) {
@@ -958,10 +905,7 @@ export default () =>
958
905
  }
959
906
  }
960
907
 
961
- if (!elms[40].nodeId) {
962
- elms[40].populate(elementConfig40)
963
- }
964
-
908
+ elms[40].populate(elementConfig40)
965
909
  parent = elms[40]
966
910
  const props41 = {}
967
911
  props41['image'] = component.image
@@ -971,97 +915,101 @@ export default () =>
971
915
  props41['map'] = component.sprite
972
916
  props41['frame'] = component.maxFps[2]
973
917
 
974
- if (!elms[41]) {
975
- const componentType = props41['is'] || 'Sprite'
976
-
977
- elms[41] = (
978
- (context.components && context.components[componentType]) ||
979
- components[componentType] ||
980
- (() => {
981
- console.error('component Sprite not found')
982
- })
983
- ).call(null, { props: props41 }, elms[40], component)
984
- if (elms[41][Symbol.for('slots')][0]) {
985
- parent = elms[41][Symbol.for('slots')][0]
986
- component = elms[41]
987
- } else {
988
- parent = elms[41][Symbol.for('children')][0]
918
+ componentType = props41['is'] || 'Sprite'
919
+
920
+ let component41
921
+ if (typeof componentType === 'string') {
922
+ component41 =
923
+ (context.components && context.components[componentType]) || components[componentType]
924
+ if (!component41) {
925
+ throw new Error('Component "Sprite" not found')
989
926
  }
927
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
928
+ component41 = componentType
929
+ }
930
+
931
+ elms[41] = component41.call(null, { props: props41 }, elms[40], component)
932
+
933
+ if (elms[41][Symbol.for('slots')][0]) {
934
+ parent = elms[41][Symbol.for('slots')][0]
935
+ component = elms[41]
936
+ } else {
937
+ parent = elms[41][Symbol.for('children')][0]
990
938
  }
991
939
 
992
940
  return elms
993
941
  },
994
942
  effects: [
995
- function anonymous(component, elms, context, components) {
943
+ function anonymous(component, elms, context, components, rootComponent, effect) {
996
944
  elms[6].set('frame', component.fps[0])
997
945
  },
998
- function anonymous(component, elms, context, components) {
946
+ function anonymous(component, elms, context, components, rootComponent, effect) {
999
947
  elms[7][Symbol.for('props')]['frame'] = component.fps[0]
1000
948
  },
1001
- function anonymous(component, elms, context, components) {
949
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1002
950
  elms[8].set('frame', component.fps[1])
1003
951
  },
1004
- function anonymous(component, elms, context, components) {
952
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1005
953
  elms[9][Symbol.for('props')]['frame'] = component.fps[1]
1006
954
  },
1007
- function anonymous(component, elms, context, components) {
955
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1008
956
  elms[10].set('frame', component.fps[2])
1009
957
  },
1010
- function anonymous(component, elms, context, components) {
958
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1011
959
  elms[11][Symbol.for('props')]['frame'] = component.fps[2]
1012
960
  },
1013
- function anonymous(component, elms, context, components) {
961
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1014
962
  elms[16].set('frame', component.avgFps[0])
1015
963
  },
1016
- function anonymous(component, elms, context, components) {
964
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1017
965
  elms[17][Symbol.for('props')]['frame'] = component.avgFps[0]
1018
966
  },
1019
- function anonymous(component, elms, context, components) {
967
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1020
968
  elms[18].set('frame', component.avgFps[1])
1021
969
  },
1022
- function anonymous(component, elms, context, components) {
970
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1023
971
  elms[19][Symbol.for('props')]['frame'] = component.avgFps[1]
1024
972
  },
1025
- function anonymous(component, elms, context, components) {
973
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1026
974
  elms[20].set('frame', component.avgFps[2])
1027
975
  },
1028
- function anonymous(component, elms, context, components) {
976
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1029
977
  elms[21][Symbol.for('props')]['frame'] = component.avgFps[2]
1030
978
  },
1031
- function anonymous(component, elms, context, components) {
979
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1032
980
  elms[26].set('frame', component.minFps[0])
1033
981
  },
1034
- function anonymous(component, elms, context, components) {
982
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1035
983
  elms[27][Symbol.for('props')]['frame'] = component.minFps[0]
1036
984
  },
1037
- function anonymous(component, elms, context, components) {
985
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1038
986
  elms[28].set('frame', component.minFps[1])
1039
987
  },
1040
- function anonymous(component, elms, context, components) {
988
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1041
989
  elms[29][Symbol.for('props')]['frame'] = component.minFps[1]
1042
990
  },
1043
- function anonymous(component, elms, context, components) {
991
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1044
992
  elms[30].set('frame', component.minFps[2])
1045
993
  },
1046
- function anonymous(component, elms, context, components) {
994
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1047
995
  elms[31][Symbol.for('props')]['frame'] = component.minFps[2]
1048
996
  },
1049
- function anonymous(component, elms, context, components) {
997
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1050
998
  elms[36].set('frame', component.maxFps[0])
1051
999
  },
1052
- function anonymous(component, elms, context, components) {
1000
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1053
1001
  elms[37][Symbol.for('props')]['frame'] = component.maxFps[0]
1054
1002
  },
1055
- function anonymous(component, elms, context, components) {
1003
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1056
1004
  elms[38].set('frame', component.maxFps[1])
1057
1005
  },
1058
- function anonymous(component, elms, context, components) {
1006
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1059
1007
  elms[39][Symbol.for('props')]['frame'] = component.maxFps[1]
1060
1008
  },
1061
- function anonymous(component, elms, context, components) {
1009
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1062
1010
  elms[40].set('frame', component.maxFps[2])
1063
1011
  },
1064
- function anonymous(component, elms, context, components) {
1012
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1065
1013
  elms[41][Symbol.for('props')]['frame'] = component.maxFps[2]
1066
1014
  },
1067
1015
  ],