@lightningjs/blits 2.0.0-beta.5 → 2.0.0-beta.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/index.d.ts CHANGED
@@ -400,12 +400,17 @@ declare module '@lightningjs/blits' {
400
400
  */
401
401
  readonly $hasFocus: boolean,
402
402
 
403
+ /**
404
+ * Parent component instance. Undefined for the root Application component or after destroy.
405
+ */
406
+ readonly $parent: ComponentBase | null | undefined,
407
+
403
408
  /**
404
409
  * Indicates whether the component currently is hovered
405
410
  *
406
411
  * @returns Boolean
407
412
  */
408
- isHovered: boolean,
413
+ $isHovered: boolean,
409
414
 
410
415
  /**
411
416
  * Listen to events emitted by other components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "2.0.0-beta.5",
3
+ "version": "2.0.0-beta.7",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.js",
6
6
  "exports": {
@@ -76,7 +76,7 @@
76
76
  "tape": "^5.5.0"
77
77
  },
78
78
  "dependencies": {
79
- "@lightningjs/renderer": "3.0.0-beta22",
79
+ "@lightningjs/renderer": "^3.0.0-beta23",
80
80
  "magic-string": "^0.30.21"
81
81
  },
82
82
  "repository": {
@@ -37,7 +37,7 @@ export default (component, state = () => {}) => {
37
37
  stateKeys.push('$hasFocus')
38
38
  }
39
39
  // add built-in isHovered key
40
- stateKeys.push(['isHovered'])
40
+ stateKeys.push(['$isHovered'])
41
41
  const stateKeysLength = stateKeys.length
42
42
 
43
43
  for (let i = 0; i < stateKeysLength; i++) {
package/src/component.js CHANGED
@@ -246,8 +246,8 @@ const Component = (name = required('name'), config = required('config')) => {
246
246
  // add $hasFocus key in
247
247
  this[symbols.originalState]['$hasFocus'] = false
248
248
 
249
- // add isHovered key in
250
- this[symbols.originalState]['isHovered'] = false
249
+ // add $isHovered key in
250
+ this[symbols.originalState]['$isHovered'] = false
251
251
 
252
252
  // generate a reactive state (using the result of previously execute state function)
253
253
  // and store it
@@ -93,8 +93,8 @@ export default {
93
93
  }
94
94
  }
95
95
  // update the built-in isHovered state variable
96
- if (v === 'hover') this.component[symbols.state].isHovered = true
97
- if (v === 'unhover') this.component[symbols.state].isHovered = false
96
+ if (v === 'hover') this.component[symbols.state].$isHovered = true
97
+ if (v === 'unhover') this.component[symbols.state].$isHovered = false
98
98
  if (v === 'focus') {
99
99
  this.component[symbols.state].$hasFocus = true
100
100
  if (