@lightningjs/blits 0.9.6 → 0.9.7
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 +10 -1
- package/boilerplate/common/eslint/.eslintrc.cjs +1 -1
- package/boilerplate/common/git/gitignore +4 -1
- package/boilerplate/js/default/.env.example +4 -0
- package/boilerplate/js/default/src/pages/Home.js +1 -1
- package/boilerplate/js/default/vite.config.js +2 -0
- package/package.json +1 -1
- package/src/component.js +1 -1
- package/src/components/Circle.js +30 -27
- package/src/components/Circle.orig.js +3 -29
- package/src/components/FPScounter.js +1078 -1024
- package/src/components/FPScounter.orig.js +41 -1024
- package/src/components/Image.js +21 -18
- package/src/components/Image.orig.js +2 -20
- package/src/components/RouterView.js +20 -17
- package/src/components/RouterView.orig.js +3 -19
- package/src/components/Sprite.js +27 -23
- package/src/components/Sprite.orig.js +3 -25
- package/src/components/Text.js +57 -53
- package/src/components/Text.orig.js +21 -55
- package/src/lib/reactivity/effect.js +1 -0
- package/src/lib/reactivity/reactive.js +10 -1
- package/src/lib/setup/state.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.9.7
|
|
4
|
+
|
|
5
|
+
_15 apr 2024_
|
|
6
|
+
|
|
7
|
+
- Added support for direct assignment of an Array element and triggering reactivity
|
|
8
|
+
- Added support for .env in boilerplate
|
|
9
|
+
- Fixed issue with Blits component being wrapped in a Proxy when assigned to a state variable
|
|
10
|
+
- Fixed built-in `hasFocus`-state to also work for components that don't have state in their config object
|
|
11
|
+
|
|
3
12
|
## v0.9.6
|
|
4
13
|
|
|
5
14
|
_4 apr 2024_
|
|
@@ -29,7 +38,7 @@ _25 mar 2024_
|
|
|
29
38
|
|
|
30
39
|
- Added support for mount / pivot on Text elements and Sprites.
|
|
31
40
|
|
|
32
|
-
|
|
41
|
+
## v0.9.2
|
|
33
42
|
|
|
34
43
|
_21 mar 2024_
|
|
35
44
|
|
package/package.json
CHANGED
package/src/component.js
CHANGED
|
@@ -68,7 +68,7 @@ const Component = (name = required('name'), config = required('config')) => {
|
|
|
68
68
|
if (config.methods) setupMethods(component, config.methods)
|
|
69
69
|
|
|
70
70
|
// setup state
|
|
71
|
-
|
|
71
|
+
setupState(component, config.state)
|
|
72
72
|
|
|
73
73
|
// setup computed
|
|
74
74
|
if (config.computed) setupComputed(component, config.computed)
|
package/src/components/Circle.js
CHANGED
|
@@ -19,35 +19,38 @@ import Component from '../component.js'
|
|
|
19
19
|
|
|
20
20
|
export default () =>
|
|
21
21
|
Component('Circle', {
|
|
22
|
-
/* eslint-disable no-unused-vars */
|
|
23
|
-
code: {
|
|
24
|
-
) {
|
|
25
|
-
const elms = []
|
|
22
|
+
/* eslint-disable no-unused-vars */
|
|
23
|
+
code: {
|
|
24
|
+
render: function anonymous(parent, component, context) {
|
|
25
|
+
const elms = []
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
if (!elms[0]) {
|
|
28
|
+
elms[0] = this.element({ parent: parent || 'root' }, component)
|
|
29
|
+
}
|
|
30
|
+
const elementConfig0 = {}
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return elms
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
32
|
+
if (!elms[0].nodeId) {
|
|
33
|
+
elms[0].populate(elementConfig0)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return elms
|
|
37
|
+
},
|
|
38
|
+
effects: [
|
|
39
|
+
function anonymous(component, elms, context) {
|
|
40
|
+
elms[0].set('color', component.color)
|
|
41
|
+
},
|
|
42
|
+
function anonymous(component, elms, context) {
|
|
43
|
+
elms[0].set('w', component.size)
|
|
44
|
+
},
|
|
45
|
+
function anonymous(component, elms, context) {
|
|
46
|
+
elms[0].set('h', component.size)
|
|
47
|
+
},
|
|
48
|
+
function anonymous(component, elms, context) {
|
|
49
|
+
elms[0].set('effects', [component.shader('radius', { radius: component.radius })])
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
context: {},
|
|
53
|
+
},
|
|
51
54
|
props: [{ key: 'size', default: 40 }, 'color'],
|
|
52
55
|
computed: {
|
|
53
56
|
radius() {
|
|
@@ -19,35 +19,9 @@ import Component from '../component.js'
|
|
|
19
19
|
|
|
20
20
|
export default () =>
|
|
21
21
|
Component('Circle', {
|
|
22
|
-
|
|
23
|
-
|
|
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('color', component.color)
|
|
41
|
-
},function anonymous(component,elms,context
|
|
42
|
-
) {
|
|
43
|
-
elms[0].set('w', component.size)
|
|
44
|
-
},function anonymous(component,elms,context
|
|
45
|
-
) {
|
|
46
|
-
elms[0].set('h', component.size)
|
|
47
|
-
},function anonymous(component,elms,context
|
|
48
|
-
) {
|
|
49
|
-
elms[0].set('effects', [component.shader('radius', {radius: component.radius})])
|
|
50
|
-
}], context: {}},
|
|
22
|
+
template: `
|
|
23
|
+
<Element :color="$color" :w="$size" :h="$size" :effects="[$shader('radius', {radius: $radius})]"></Element>
|
|
24
|
+
`,
|
|
51
25
|
props: [{ key: 'size', default: 40 }, 'color'],
|
|
52
26
|
computed: {
|
|
53
27
|
radius() {
|