@lightningjs/blits 2.1.0 → 2.1.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
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.1.2
4
+
5
+ _10 apr 2026_
6
+
7
+ - Bumped renderer to 3.0.1
8
+ - Removed `@updated`-calls for Layout when dimensions haven't changed
9
+
10
+ ## v2.1.1
11
+
12
+ _9 apr 2026_
13
+
14
+ - Fixed import file extension issue
15
+
3
16
  ## v2.1.0
4
17
 
5
18
  _9 apr 2026_
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.js",
6
6
  "exports": {
@@ -75,7 +75,7 @@
75
75
  "tape": "^5.5.0"
76
76
  },
77
77
  "dependencies": {
78
- "@lightningjs/renderer": "^3.0.0",
78
+ "@lightningjs/renderer": "^3.0.1",
79
79
  "magic-string": "^0.30.21"
80
80
  },
81
81
  "repository": {
@@ -85,7 +85,11 @@ const createPaddingObject = (padding, direction) => {
85
85
  * @param {object} config - The layout configuration object.
86
86
  * @this {import('../../component.js').BlitsElement}
87
87
  */
88
+
88
89
  const layoutFn = function (config) {
90
+ const w = this.node.w
91
+ const h = this.node.h
92
+
89
93
  const position = config.direction === 'vertical' ? 'y' : 'x'
90
94
  const oppositePosition = config.direction === 'vertical' ? 'x' : 'y'
91
95
  const oppositeMount = config.direction === 'vertical' ? 'mountX' : 'mountY'
@@ -98,6 +102,7 @@ const layoutFn = function (config) {
98
102
  const children = this.node.children
99
103
  const childrenLength = children.length
100
104
  const elementChildren = this.children
105
+
101
106
  let otherDimension = 0
102
107
  const gap = config.gap || 0
103
108
  for (let i = 0; i < childrenLength; i++) {
@@ -137,7 +142,7 @@ const layoutFn = function (config) {
137
142
  }
138
143
 
139
144
  // emit an updated event
140
- if (config['@updated'] !== undefined) {
145
+ if ((config['@updated'] !== undefined) & (this.node.w !== w || this.node.h !== h)) {
141
146
  config['@updated']({ w: this.node.w, h: this.node.h }, this)
142
147
  }
143
148
 
@@ -1,4 +1,4 @@
1
- import symbols from '../symbols'
1
+ import symbols from '../symbols.js'
2
2
 
3
3
  /**
4
4
  * Internal keyboard event class that extends the native KeyboardEvent.