@lightningjs/blits 0.9.4 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -38
- package/docs/components/utilities.md +0 -6
- package/package.json +2 -2
- package/src/application.d.ts +25 -0
- package/src/component.d.ts +27 -1
- package/src/component.js +32 -1
- package/src/components/Circle.js +27 -30
- package/src/components/Circle.orig.js +29 -3
- package/src/components/FPScounter.js +1024 -1078
- package/src/components/FPScounter.orig.js +1024 -41
- package/src/components/Image.js +18 -21
- package/src/components/Image.orig.js +20 -2
- package/src/components/RouterView.js +17 -20
- package/src/components/RouterView.orig.js +19 -3
- package/src/components/Sprite.js +23 -27
- package/src/components/Sprite.orig.js +25 -3
- package/src/components/Text.js +53 -57
- package/src/components/Text.orig.js +55 -21
- package/src/engines/L3/element.js +27 -28
- package/src/lib/codegenerator/generator.js +8 -5
- package/src/lib/lifecycle.js +11 -1
- package/src/lib/symbols.js +1 -0
- package/src/router/router.js +26 -8
package/src/components/Image.js
CHANGED
|
@@ -19,29 +19,26 @@ import Component from '../component.js'
|
|
|
19
19
|
|
|
20
20
|
export default () =>
|
|
21
21
|
Component('Image', {
|
|
22
|
-
/* eslint-disable no-unused-vars */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
/* eslint-disable no-unused-vars */
|
|
23
|
+
code: { render: function anonymous(parent,component,context
|
|
24
|
+
) {
|
|
25
|
+
const elms = []
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (!elms[0].nodeId) {
|
|
33
|
-
elms[0].populate(elementConfig0)
|
|
34
|
-
}
|
|
27
|
+
if(!elms[0]) {
|
|
28
|
+
elms[0] = this.element({parent: parent || 'root'}, component)
|
|
29
|
+
}
|
|
30
|
+
const elementConfig0 = {}
|
|
31
|
+
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
if(!elms[0].nodeId) {
|
|
34
|
+
elms[0].populate(elementConfig0)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return elms
|
|
38
|
+
}, effects: [function anonymous(component,elms,context
|
|
39
|
+
) {
|
|
40
|
+
elms[0].set('imageSource', component.imageSource)
|
|
41
|
+
}], context: {}},
|
|
45
42
|
props: ['src'],
|
|
46
43
|
computed: {
|
|
47
44
|
imageSource() {
|
|
@@ -19,8 +19,26 @@ import Component from '../component.js'
|
|
|
19
19
|
|
|
20
20
|
export default () =>
|
|
21
21
|
Component('Image', {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/* eslint-disable no-unused-vars */
|
|
23
|
+
code: { render: function anonymous(parent,component,context
|
|
24
|
+
) {
|
|
25
|
+
const elms = []
|
|
26
|
+
|
|
27
|
+
if(!elms[0]) {
|
|
28
|
+
elms[0] = this.element({parent: parent || 'root'}, component)
|
|
29
|
+
}
|
|
30
|
+
const elementConfig0 = {}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if(!elms[0].nodeId) {
|
|
34
|
+
elms[0].populate(elementConfig0)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return elms
|
|
38
|
+
}, effects: [function anonymous(component,elms,context
|
|
39
|
+
) {
|
|
40
|
+
elms[0].set('imageSource', component.imageSource)
|
|
41
|
+
}], context: {}},
|
|
24
42
|
props: ['src'],
|
|
25
43
|
computed: {
|
|
26
44
|
imageSource() {
|
|
@@ -22,28 +22,25 @@ let handler
|
|
|
22
22
|
|
|
23
23
|
export default () =>
|
|
24
24
|
Component('RouterView', {
|
|
25
|
-
/* eslint-disable no-unused-vars */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
/* eslint-disable no-unused-vars */
|
|
26
|
+
code: { render: function anonymous(parent,component,context
|
|
27
|
+
) {
|
|
28
|
+
const elms = []
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
if(!elms[0]) {
|
|
31
|
+
elms[0] = this.element({parent: parent || 'root'}, component)
|
|
32
|
+
}
|
|
33
|
+
const elementConfig0 = {}
|
|
34
|
+
|
|
35
|
+
elementConfig0['w'] = parent.node.width * (100 / 100)
|
|
36
|
+
elementConfig0['height'] = parent.node.height * (100 / 100)
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return elms
|
|
43
|
-
},
|
|
44
|
-
effects: [],
|
|
45
|
-
context: {},
|
|
46
|
-
},
|
|
38
|
+
if(!elms[0].nodeId) {
|
|
39
|
+
elms[0].populate(elementConfig0)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return elms
|
|
43
|
+
}, effects: [], context: {}},
|
|
47
44
|
state() {
|
|
48
45
|
return {
|
|
49
46
|
activeView: null,
|
|
@@ -22,9 +22,25 @@ let handler
|
|
|
22
22
|
|
|
23
23
|
export default () =>
|
|
24
24
|
Component('RouterView', {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
/* eslint-disable no-unused-vars */
|
|
26
|
+
code: { render: function anonymous(parent,component,context
|
|
27
|
+
) {
|
|
28
|
+
const elms = []
|
|
29
|
+
|
|
30
|
+
if(!elms[0]) {
|
|
31
|
+
elms[0] = this.element({parent: parent || 'root'}, component)
|
|
32
|
+
}
|
|
33
|
+
const elementConfig0 = {}
|
|
34
|
+
|
|
35
|
+
elementConfig0['w'] = parent.node.width * (100 / 100)
|
|
36
|
+
elementConfig0['height'] = parent.node.height * (100 / 100)
|
|
37
|
+
|
|
38
|
+
if(!elms[0].nodeId) {
|
|
39
|
+
elms[0].populate(elementConfig0)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return elms
|
|
43
|
+
}, effects: [], context: {}},
|
|
28
44
|
state() {
|
|
29
45
|
return {
|
|
30
46
|
activeView: null,
|
package/src/components/Sprite.js
CHANGED
|
@@ -21,35 +21,31 @@ import symbols from '../lib/symbols.js'
|
|
|
21
21
|
|
|
22
22
|
export default () =>
|
|
23
23
|
Component('Sprite', {
|
|
24
|
-
/* eslint-disable no-unused-vars */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
/* eslint-disable no-unused-vars */
|
|
25
|
+
code: { render: function anonymous(parent,component,context
|
|
26
|
+
) {
|
|
27
|
+
const elms = []
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!elms[0].nodeId) {
|
|
38
|
-
elms[0].populate(elementConfig0)
|
|
39
|
-
}
|
|
29
|
+
if(!elms[0]) {
|
|
30
|
+
elms[0] = this.element({parent: parent || 'root'}, component)
|
|
31
|
+
}
|
|
32
|
+
const elementConfig0 = {}
|
|
33
|
+
|
|
34
|
+
elementConfig0['w'] = parent.node.width * (100 / 100)
|
|
35
|
+
elementConfig0['h'] = parent.node.height * (100 / 100)
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
if(!elms[0].nodeId) {
|
|
38
|
+
elms[0].populate(elementConfig0)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return elms
|
|
42
|
+
}, effects: [function anonymous(component,elms,context
|
|
43
|
+
) {
|
|
44
|
+
elms[0].set('texture', component.texture)
|
|
45
|
+
},function anonymous(component,elms,context
|
|
46
|
+
) {
|
|
47
|
+
elms[0].set('color', component.color)
|
|
48
|
+
}], context: {}},
|
|
53
49
|
props: ['image', 'map', 'frame', 'color'],
|
|
54
50
|
state() {
|
|
55
51
|
return {
|
|
@@ -21,9 +21,31 @@ import symbols from '../lib/symbols.js'
|
|
|
21
21
|
|
|
22
22
|
export default () =>
|
|
23
23
|
Component('Sprite', {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
/* eslint-disable no-unused-vars */
|
|
25
|
+
code: { render: function anonymous(parent,component,context
|
|
26
|
+
) {
|
|
27
|
+
const elms = []
|
|
28
|
+
|
|
29
|
+
if(!elms[0]) {
|
|
30
|
+
elms[0] = this.element({parent: parent || 'root'}, component)
|
|
31
|
+
}
|
|
32
|
+
const elementConfig0 = {}
|
|
33
|
+
|
|
34
|
+
elementConfig0['w'] = parent.node.width * (100 / 100)
|
|
35
|
+
elementConfig0['h'] = parent.node.height * (100 / 100)
|
|
36
|
+
|
|
37
|
+
if(!elms[0].nodeId) {
|
|
38
|
+
elms[0].populate(elementConfig0)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return elms
|
|
42
|
+
}, effects: [function anonymous(component,elms,context
|
|
43
|
+
) {
|
|
44
|
+
elms[0].set('texture', component.texture)
|
|
45
|
+
},function anonymous(component,elms,context
|
|
46
|
+
) {
|
|
47
|
+
elms[0].set('color', component.color)
|
|
48
|
+
}], context: {}},
|
|
27
49
|
props: ['image', 'map', 'frame', 'color'],
|
|
28
50
|
state() {
|
|
29
51
|
return {
|
package/src/components/Text.js
CHANGED
|
@@ -20,65 +20,61 @@ import Settings from '../settings.js'
|
|
|
20
20
|
|
|
21
21
|
export default () =>
|
|
22
22
|
Component('Text', {
|
|
23
|
-
/* eslint-disable no-unused-vars */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
/* eslint-disable no-unused-vars */
|
|
24
|
+
code: { render: function anonymous(parent,component,context
|
|
25
|
+
) {
|
|
26
|
+
const elms = []
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
if(!elms[0]) {
|
|
29
|
+
elms[0] = this.element({parent: parent || 'root'}, component)
|
|
30
|
+
}
|
|
31
|
+
const elementConfig0 = {}
|
|
32
|
+
|
|
33
|
+
elementConfig0['__textnode'] = true
|
|
34
|
+
elementConfig0['fontFamily'] = component.font
|
|
35
|
+
elementConfig0['letterSpacing'] = component.letterspacing
|
|
36
|
+
elementConfig0['lineHeight'] = component._lineheight
|
|
37
|
+
elementConfig0['stretch'] = component.stretch
|
|
38
|
+
elementConfig0['contain'] = component._contain
|
|
39
|
+
elementConfig0['@loaded'] = component['@loaded'] && component['@loaded'].bind(component)
|
|
40
|
+
elementConfig0['@error'] = component['@error'] && component['@error'].bind(component)
|
|
32
41
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
function anonymous(component, elms, context) {
|
|
71
|
-
elms[0].set('h', component.maxheight)
|
|
72
|
-
},
|
|
73
|
-
function anonymous(component, elms, context) {
|
|
74
|
-
elms[0].set('textAlign', component.align)
|
|
75
|
-
},
|
|
76
|
-
function anonymous(component, elms, context) {
|
|
77
|
-
elms[0].set('overflowSuffix', component.textoverflow)
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
context: {},
|
|
81
|
-
},
|
|
42
|
+
if(!elms[0].nodeId) {
|
|
43
|
+
elms[0].populate(elementConfig0)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return elms
|
|
47
|
+
}, effects: [function anonymous(component,elms,context
|
|
48
|
+
) {
|
|
49
|
+
elms[0].set('text', component.content)
|
|
50
|
+
},function anonymous(component,elms,context
|
|
51
|
+
) {
|
|
52
|
+
elms[0].set('fontSize', component.size)
|
|
53
|
+
},function anonymous(component,elms,context
|
|
54
|
+
) {
|
|
55
|
+
elms[0].set('color', component.color)
|
|
56
|
+
},function anonymous(component,elms,context
|
|
57
|
+
) {
|
|
58
|
+
elms[0].set('style', component.style)
|
|
59
|
+
},function anonymous(component,elms,context
|
|
60
|
+
) {
|
|
61
|
+
elms[0].set('weight', component.weight)
|
|
62
|
+
},function anonymous(component,elms,context
|
|
63
|
+
) {
|
|
64
|
+
elms[0].set('wordWrap', component.wordwrap)
|
|
65
|
+
},function anonymous(component,elms,context
|
|
66
|
+
) {
|
|
67
|
+
elms[0].set('maxLines', component.maxlines)
|
|
68
|
+
},function anonymous(component,elms,context
|
|
69
|
+
) {
|
|
70
|
+
elms[0].set('h', component.maxheight)
|
|
71
|
+
},function anonymous(component,elms,context
|
|
72
|
+
) {
|
|
73
|
+
elms[0].set('textAlign', component.align)
|
|
74
|
+
},function anonymous(component,elms,context
|
|
75
|
+
) {
|
|
76
|
+
elms[0].set('overflowSuffix', component.textoverflow)
|
|
77
|
+
}], context: {}},
|
|
82
78
|
props: [
|
|
83
79
|
'content',
|
|
84
80
|
{
|
|
@@ -20,27 +20,61 @@ import Settings from '../settings.js'
|
|
|
20
20
|
|
|
21
21
|
export default () =>
|
|
22
22
|
Component('Text', {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
23
|
+
/* eslint-disable no-unused-vars */
|
|
24
|
+
code: { render: function anonymous(parent,component,context
|
|
25
|
+
) {
|
|
26
|
+
const elms = []
|
|
27
|
+
|
|
28
|
+
if(!elms[0]) {
|
|
29
|
+
elms[0] = this.element({parent: parent || 'root'}, component)
|
|
30
|
+
}
|
|
31
|
+
const elementConfig0 = {}
|
|
32
|
+
|
|
33
|
+
elementConfig0['__textnode'] = true
|
|
34
|
+
elementConfig0['fontFamily'] = component.font
|
|
35
|
+
elementConfig0['letterSpacing'] = component.letterspacing
|
|
36
|
+
elementConfig0['lineHeight'] = component._lineheight
|
|
37
|
+
elementConfig0['stretch'] = component.stretch
|
|
38
|
+
elementConfig0['contain'] = component._contain
|
|
39
|
+
elementConfig0['@loaded'] = component['@loaded'] && component['@loaded'].bind(component)
|
|
40
|
+
elementConfig0['@error'] = component['@error'] && component['@error'].bind(component)
|
|
41
|
+
|
|
42
|
+
if(!elms[0].nodeId) {
|
|
43
|
+
elms[0].populate(elementConfig0)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return elms
|
|
47
|
+
}, effects: [function anonymous(component,elms,context
|
|
48
|
+
) {
|
|
49
|
+
elms[0].set('text', component.content)
|
|
50
|
+
},function anonymous(component,elms,context
|
|
51
|
+
) {
|
|
52
|
+
elms[0].set('fontSize', component.size)
|
|
53
|
+
},function anonymous(component,elms,context
|
|
54
|
+
) {
|
|
55
|
+
elms[0].set('color', component.color)
|
|
56
|
+
},function anonymous(component,elms,context
|
|
57
|
+
) {
|
|
58
|
+
elms[0].set('style', component.style)
|
|
59
|
+
},function anonymous(component,elms,context
|
|
60
|
+
) {
|
|
61
|
+
elms[0].set('weight', component.weight)
|
|
62
|
+
},function anonymous(component,elms,context
|
|
63
|
+
) {
|
|
64
|
+
elms[0].set('wordWrap', component.wordwrap)
|
|
65
|
+
},function anonymous(component,elms,context
|
|
66
|
+
) {
|
|
67
|
+
elms[0].set('maxLines', component.maxlines)
|
|
68
|
+
},function anonymous(component,elms,context
|
|
69
|
+
) {
|
|
70
|
+
elms[0].set('h', component.maxheight)
|
|
71
|
+
},function anonymous(component,elms,context
|
|
72
|
+
) {
|
|
73
|
+
elms[0].set('textAlign', component.align)
|
|
74
|
+
},function anonymous(component,elms,context
|
|
75
|
+
) {
|
|
76
|
+
elms[0].set('overflowSuffix', component.textoverflow)
|
|
77
|
+
}], context: {}},
|
|
44
78
|
props: [
|
|
45
79
|
'content',
|
|
46
80
|
{
|
|
@@ -311,11 +311,10 @@ const Element = {
|
|
|
311
311
|
},
|
|
312
312
|
animate(prop, value, transition) {
|
|
313
313
|
if (this.node[prop] === value) return Promise.resolve()
|
|
314
|
-
// check if a transition is already
|
|
314
|
+
// check if a transition is already scheduled or running on the same prop
|
|
315
315
|
if (this.scheduledTransitions[prop]) {
|
|
316
|
-
// clearTimeout(this.scheduledTransitions[prop].timeout)
|
|
317
316
|
if (this.scheduledTransitions[prop].f.state === 'running') {
|
|
318
|
-
this.scheduledTransitions[prop].f.
|
|
317
|
+
this.scheduledTransitions[prop].f.stop()
|
|
319
318
|
// fastforward to final value
|
|
320
319
|
this.node[prop] = this.scheduledTransitions[prop].v
|
|
321
320
|
}
|
|
@@ -348,33 +347,33 @@ const Element = {
|
|
|
348
347
|
const startValue = this.node[prop]
|
|
349
348
|
this.scheduledTransitions[prop] = {
|
|
350
349
|
v: props[prop],
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
.
|
|
350
|
+
cancel: false,
|
|
351
|
+
f,
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
try {
|
|
355
|
+
f.start()
|
|
356
|
+
.waitUntilStarted()
|
|
357
|
+
.then((animation) => {
|
|
358
|
+
// fire transition start callback if specified
|
|
359
|
+
transition.start &&
|
|
360
|
+
typeof transition.start === 'function' &&
|
|
361
|
+
transition.start.call(this.component, this, prop, startValue)
|
|
362
|
+
// continue the chain
|
|
363
|
+
animation
|
|
364
|
+
.waitUntilStopped()
|
|
365
|
+
.then(() => delete this.scheduledTransitions[prop])
|
|
366
|
+
.then(() => {
|
|
367
|
+
// fire transition end callback if specified
|
|
368
|
+
transition.end &&
|
|
369
|
+
typeof transition.end === 'function' &&
|
|
370
|
+
transition.end.call(this.component, this, prop, this.node[prop])
|
|
371
371
|
})
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
372
|
+
.then(resolve)
|
|
373
|
+
})
|
|
374
|
+
} catch (e) {
|
|
375
|
+
Log.error(e)
|
|
376
376
|
}
|
|
377
|
-
this.scheduledTransitions[prop].f()
|
|
378
377
|
})
|
|
379
378
|
},
|
|
380
379
|
destroy() {
|
|
@@ -218,7 +218,7 @@ const generateForLoopCode = function (templateObject, parent) {
|
|
|
218
218
|
ctx.renderCode.push(`parent = ${parent}`)
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
const
|
|
221
|
+
const forStartCounter = counter
|
|
222
222
|
|
|
223
223
|
// reference all reactive attributes (except those referencing the iterator item),
|
|
224
224
|
// to ensure that reactivity is registered, even when the initial array is empty
|
|
@@ -282,12 +282,15 @@ const generateForLoopCode = function (templateObject, parent) {
|
|
|
282
282
|
ctx.renderCode = ctx.renderCode.concat(ctx.effectsCode)
|
|
283
283
|
ctx.renderCode.push('}')
|
|
284
284
|
|
|
285
|
+
const forEndCounter = counter
|
|
285
286
|
ctx.renderCode.push(`
|
|
286
|
-
if(elms[${
|
|
287
|
-
Object.keys(elms[${
|
|
287
|
+
if(elms[${forStartCounter}]) {
|
|
288
|
+
Object.keys(elms[${forStartCounter}]).forEach(key => {
|
|
288
289
|
if(keys.indexOf(key) === -1) {
|
|
289
|
-
|
|
290
|
-
|
|
290
|
+
for(let i=${forStartCounter}; i <= ${forEndCounter}; i++){
|
|
291
|
+
elms[i][key].destroy && elms[i][key].destroy()
|
|
292
|
+
delete elms[i][key]
|
|
293
|
+
}
|
|
291
294
|
}
|
|
292
295
|
})
|
|
293
296
|
}
|
package/src/lib/lifecycle.js
CHANGED
|
@@ -19,7 +19,17 @@ import { Log } from './log.js'
|
|
|
19
19
|
import { emit, privateEmit } from './hooks.js'
|
|
20
20
|
import symbols from './symbols.js'
|
|
21
21
|
|
|
22
|
-
const states = [
|
|
22
|
+
const states = [
|
|
23
|
+
'init', // fired upon component instantiation
|
|
24
|
+
'ready', // fired when component instantiated, reactivity setup done and template spawned
|
|
25
|
+
'focus', // fired when receiving focus (can occur multiple times)
|
|
26
|
+
'unfocus', // fired when losing focus (can occur multiple times)
|
|
27
|
+
'destroy', // fired when component is destroyed and removed
|
|
28
|
+
'attach', // fired when entering the viewport margin and attached to the render tree
|
|
29
|
+
'detach', // fired when leaving the viewport margin and detached from the render tree
|
|
30
|
+
'enter', // fired when entering the visible viewport
|
|
31
|
+
'exit', // fired when leaving the visible viewport
|
|
32
|
+
]
|
|
23
33
|
|
|
24
34
|
export default {
|
|
25
35
|
previous: null,
|
package/src/lib/symbols.js
CHANGED