@lightningjs/blits 0.5.1 → 0.5.2
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
CHANGED
package/boilerplate/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"lint": "eslint '**/*.js'",
|
|
10
10
|
"lint:fix": "eslint '**/*.js' --fix",
|
|
11
11
|
"build": "vite build",
|
|
12
|
-
"dev": "vite dev"
|
|
12
|
+
"dev": "vite dev --host"
|
|
13
13
|
},
|
|
14
14
|
"lint-staged": {
|
|
15
15
|
"*.js": [
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
"vite": "^4.0.4"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@lightningjs/blits": "^0.5.
|
|
34
|
+
"@lightningjs/blits": "^0.5.2"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -25,6 +25,11 @@ export default () =>
|
|
|
25
25
|
template: `
|
|
26
26
|
<Element w="100%" height="100%"></Element>
|
|
27
27
|
`,
|
|
28
|
+
state() {
|
|
29
|
+
return {
|
|
30
|
+
activeView: null,
|
|
31
|
+
}
|
|
32
|
+
},
|
|
28
33
|
hooks: {
|
|
29
34
|
ready() {
|
|
30
35
|
handler = () => Router.navigate.apply(this)
|
|
@@ -34,5 +39,8 @@ export default () =>
|
|
|
34
39
|
destroy() {
|
|
35
40
|
window.removeEventListener('hashchange', handler, false)
|
|
36
41
|
},
|
|
42
|
+
focus() {
|
|
43
|
+
this.activeView && this.activeView.focus()
|
|
44
|
+
},
|
|
37
45
|
},
|
|
38
46
|
})
|
|
@@ -182,7 +182,9 @@ const generateComponentCode = function (
|
|
|
182
182
|
`)
|
|
183
183
|
|
|
184
184
|
counter++
|
|
185
|
-
|
|
185
|
+
if (children) {
|
|
186
|
+
generateElementCode.call(this, { children }, false, { ...options })
|
|
187
|
+
}
|
|
186
188
|
}
|
|
187
189
|
|
|
188
190
|
const generateForLoopCode = function (templateObject, parent) {
|
package/src/router/router.js
CHANGED
|
@@ -123,6 +123,7 @@ export const navigate = async function () {
|
|
|
123
123
|
|
|
124
124
|
// focus the new view
|
|
125
125
|
focus ? Focus.set(focus) : view.focus()
|
|
126
|
+
this.activeView = this[symbols.children][this[symbols.children].length - 1]
|
|
126
127
|
} else {
|
|
127
128
|
Log.error(`Route ${hash} not found`)
|
|
128
129
|
}
|