@lightningjs/blits 1.8.2 → 1.9.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.
- package/CHANGELOG.md +15 -1
- package/docs/_sidebar.md +1 -0
- package/docs/built-in/layout.md +76 -0
- package/docs/sidebar.json +4 -0
- package/index.d.ts +23 -23
- package/package.json +1 -1
- package/src/components/index.js +0 -2
- package/src/components/index.orig.js +0 -2
- package/src/engines/L3/element.js +51 -9
- package/src/lib/codegenerator/generator.js +5 -4
- package/src/lib/codegenerator/generator.test.js +633 -609
- package/src/components/Layout.js +0 -50
- package/src/components/Layout.orig.js +0 -34
package/src/components/Layout.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import Component from '../component.js'
|
|
2
|
-
|
|
3
|
-
export default () => {
|
|
4
|
-
return Component('Layout', {
|
|
5
|
-
/* eslint-disable no-unused-vars */
|
|
6
|
-
code: {
|
|
7
|
-
render: function anonymous(parent, component, context, components, effect, getRaw) {
|
|
8
|
-
const elms = []
|
|
9
|
-
let componentType
|
|
10
|
-
const rootComponent = component
|
|
11
|
-
let propData
|
|
12
|
-
const elementConfig0 = {}
|
|
13
|
-
|
|
14
|
-
elms[0] = this.element({ parent: parent || 'root' }, component)
|
|
15
|
-
|
|
16
|
-
elementConfig0[Symbol.for('isSlot')] = true
|
|
17
|
-
elementConfig0['ref'] = 'slot'
|
|
18
|
-
elms[0].populate(elementConfig0)
|
|
19
|
-
return elms
|
|
20
|
-
},
|
|
21
|
-
effects: [],
|
|
22
|
-
context: {},
|
|
23
|
-
},
|
|
24
|
-
props: [
|
|
25
|
-
'direction',
|
|
26
|
-
{
|
|
27
|
-
key: 'gap',
|
|
28
|
-
default: 0,
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
hooks: {
|
|
32
|
-
ready() {
|
|
33
|
-
this.___layout()
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
methods: {
|
|
37
|
-
// todo: review naming
|
|
38
|
-
___layout() {
|
|
39
|
-
let offset = 0
|
|
40
|
-
|
|
41
|
-
this.$select('slot').children.forEach((el) => {
|
|
42
|
-
el.set(this.direction === 'vertical' ? 'y' : 'x', offset)
|
|
43
|
-
// todo: grab width from interface, not directly from node
|
|
44
|
-
offset +=
|
|
45
|
-
(el.node[this.direction === 'vertical' ? 'height' : 'width'] || 0) + (this.gap || 0)
|
|
46
|
-
})
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
})
|
|
50
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import Component from '../component.js'
|
|
2
|
-
|
|
3
|
-
export default () => {
|
|
4
|
-
return Component('Layout', {
|
|
5
|
-
template: `
|
|
6
|
-
<Slot ref="slot" />
|
|
7
|
-
`,
|
|
8
|
-
props: [
|
|
9
|
-
'direction',
|
|
10
|
-
{
|
|
11
|
-
key: 'gap',
|
|
12
|
-
default: 0,
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
hooks: {
|
|
16
|
-
ready() {
|
|
17
|
-
this.___layout()
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
methods: {
|
|
21
|
-
// todo: review naming
|
|
22
|
-
___layout() {
|
|
23
|
-
let offset = 0
|
|
24
|
-
|
|
25
|
-
this.$select('slot').children.forEach((el) => {
|
|
26
|
-
el.set(this.direction === 'vertical' ? 'y' : 'x', offset)
|
|
27
|
-
// todo: grab width from interface, not directly from node
|
|
28
|
-
offset +=
|
|
29
|
-
(el.node[this.direction === 'vertical' ? 'height' : 'width'] || 0) + (this.gap || 0)
|
|
30
|
-
})
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
})
|
|
34
|
-
}
|