@lightningjs/blits 2.0.0 → 2.0.1
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,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v2.0.1
|
|
4
|
+
|
|
5
|
+
_23 mar 2026_
|
|
6
|
+
|
|
7
|
+
- Fixed issue with height dimension of router view
|
|
8
|
+
- Fixed issue with array or rounded corners not being reactive
|
|
9
|
+
- Fixed issue with font not being mapped correctly when using `png` in the font config
|
|
10
|
+
- Removed obselete key config
|
|
11
|
+
- Fixed reactivity guard in computed props to handle deep nested references more safely
|
|
12
|
+
|
|
3
13
|
## v2.0.0
|
|
4
14
|
|
|
5
15
|
_20 mar 2026_
|
package/package.json
CHANGED
|
@@ -94,7 +94,7 @@ export default () =>
|
|
|
94
94
|
)
|
|
95
95
|
|
|
96
96
|
elementConfigs[0]['w'] = parent.node.w * (100 / 100)
|
|
97
|
-
elementConfigs[0]['
|
|
97
|
+
elementConfigs[0]['h'] = parent.node.h * (100 / 100)
|
|
98
98
|
elms[0].populate(elementConfigs[0])
|
|
99
99
|
|
|
100
100
|
if (inSlot === true) {
|
package/src/constants.js
CHANGED
|
@@ -18,14 +18,6 @@
|
|
|
18
18
|
export const DEFAULT_HOLD_TIMEOUT_MS = 50
|
|
19
19
|
|
|
20
20
|
export const DEFAULT_KEYMAP = {
|
|
21
|
-
ArrowLeft: 'left',
|
|
22
|
-
ArrowRight: 'right',
|
|
23
|
-
ArrowUp: 'up',
|
|
24
|
-
ArrowDown: 'down',
|
|
25
|
-
Enter: 'enter',
|
|
26
|
-
' ': 'space',
|
|
27
|
-
Backspace: 'back',
|
|
28
|
-
Escape: 'escape',
|
|
29
21
|
37: 'left',
|
|
30
22
|
39: 'right',
|
|
31
23
|
38: 'up',
|
|
@@ -362,7 +362,10 @@ const propsTransformer = {
|
|
|
362
362
|
set rounded(v) {
|
|
363
363
|
this.props['rounded'] = v
|
|
364
364
|
if (this.element.node !== undefined && this.elementShader === true) {
|
|
365
|
-
if (
|
|
365
|
+
if (
|
|
366
|
+
Array.isArray(v) === false &&
|
|
367
|
+
(typeof v === 'object' || (isObjectString(v) === true && (v = parseToObject(v))))
|
|
368
|
+
) {
|
|
366
369
|
this.element.node.props['shader'].props = v
|
|
367
370
|
} else {
|
|
368
371
|
if (isArrayString(v) === true) {
|
|
@@ -36,7 +36,7 @@ export default () => {
|
|
|
36
36
|
if (type === 'sdf') {
|
|
37
37
|
stage.loadFont('sdf', {
|
|
38
38
|
fontFamily: font.family,
|
|
39
|
-
atlasUrl: font.
|
|
39
|
+
atlasUrl: font.png || (font.file && font.file.replace(/\.[^.]+$/, `.${font.type}.png`)),
|
|
40
40
|
atlasDataUrl:
|
|
41
41
|
font.json || (font.file && font.file.replace(/\.[^.]+$/, `.${font.type}.json`)),
|
|
42
42
|
})
|
|
@@ -196,14 +196,19 @@ export default (code) => {
|
|
|
196
196
|
// Skip if already modified
|
|
197
197
|
if (
|
|
198
198
|
prop.body.includes(commentText.trim()) ||
|
|
199
|
-
Array.from(thisRefs).some((ref) =>
|
|
199
|
+
Array.from(thisRefs).some((ref) => {
|
|
200
|
+
if (prop.body.startsWith(ref)) return true
|
|
201
|
+
// stripped && guard: body starts with the first segment, e.g. 'this.media &&'
|
|
202
|
+
const firstSegEnd = ref.indexOf('.', 5)
|
|
203
|
+
return firstSegEnd !== -1 && prop.body.startsWith(ref.substring(0, firstSegEnd))
|
|
204
|
+
})
|
|
200
205
|
) {
|
|
201
206
|
continue
|
|
202
207
|
}
|
|
203
208
|
|
|
204
209
|
// reactivity code
|
|
205
210
|
const refCode = Array.from(thisRefs)
|
|
206
|
-
.map((ref) => `${ref};`)
|
|
211
|
+
.map((ref) => `${toSafeRef(ref)};`)
|
|
207
212
|
.join(' ')
|
|
208
213
|
|
|
209
214
|
// replacement with the same whitespace
|
|
@@ -290,6 +295,18 @@ export default (code) => {
|
|
|
290
295
|
return null
|
|
291
296
|
}
|
|
292
297
|
|
|
298
|
+
const toSafeRef = (ref) => {
|
|
299
|
+
// Converts 'this.a.b.c' to 'this.a && this.a.b && this.a.b.c'
|
|
300
|
+
const normalized = ref.replace(/\?\./g, '.')
|
|
301
|
+
const segments = normalized.split('.')
|
|
302
|
+
if (segments.length <= 2) return normalized
|
|
303
|
+
const parts = []
|
|
304
|
+
for (let i = 2; i <= segments.length; i++) {
|
|
305
|
+
parts.push(segments.slice(0, i).join('.'))
|
|
306
|
+
}
|
|
307
|
+
return parts.join(' && ')
|
|
308
|
+
}
|
|
309
|
+
|
|
293
310
|
const extractThisReferences = (funcBody) => {
|
|
294
311
|
const thisRefs = new Set()
|
|
295
312
|
|