@lightningjs/blits 1.41.0 → 1.42.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 +18 -0
- package/package.json +2 -2
- package/src/components/Sprite.js +5 -1
- package/src/engines/L3/element.js +2 -1
- package/src/router/router.js +15 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.42.1
|
|
4
|
+
|
|
5
|
+
_28 Oct 2025_
|
|
6
|
+
|
|
7
|
+
- Updated to version 2.19.1 of the renderer
|
|
8
|
+
- Fixed scale animation snapping issue when using object notation with transitions (again)
|
|
9
|
+
|
|
10
|
+
## v1.42.0
|
|
11
|
+
|
|
12
|
+
_24 Oct 2025_
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
- Added effects prop support to Sprite component
|
|
16
|
+
- Added support for redirecting in before hooks returning a route object (with updated path)
|
|
17
|
+
- Fixed meta options on routes functionality
|
|
18
|
+
- Enhanced router hook test coverage
|
|
19
|
+
- Fixed scale animation snapping issue when using object notation with transitions
|
|
20
|
+
|
|
3
21
|
## v1.41.0
|
|
4
22
|
|
|
5
23
|
_16 Oct 2025_
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightningjs/blits",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.1",
|
|
4
4
|
"description": "Blits: The Lightning 3 App Development Framework",
|
|
5
5
|
"bin": "bin/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@lightningjs/msdf-generator": "^1.2.0",
|
|
58
|
-
"@lightningjs/renderer": "^2.
|
|
58
|
+
"@lightningjs/renderer": "^2.19.1"
|
|
59
59
|
},
|
|
60
60
|
"repository": {
|
|
61
61
|
"type": "git",
|
package/src/components/Sprite.js
CHANGED
|
@@ -49,6 +49,7 @@ export default () =>
|
|
|
49
49
|
elementConfigs[0]['h'] = parent.node.height * (100 / 100)
|
|
50
50
|
elementConfigs[0]['texture'] = component.texture
|
|
51
51
|
elementConfigs[0]['color'] = component.color
|
|
52
|
+
elementConfigs[0]['effects'] = component.effects
|
|
52
53
|
elms[0].populate(elementConfigs[0])
|
|
53
54
|
|
|
54
55
|
if (inSlot === true) {
|
|
@@ -80,10 +81,13 @@ export default () =>
|
|
|
80
81
|
function anonymous(component, elms, context, components, rootComponent, effect) {
|
|
81
82
|
elms[0].set('color', component.color)
|
|
82
83
|
},
|
|
84
|
+
function anonymous(component, elms, context, components, rootComponent, effect) {
|
|
85
|
+
elms[0].set('effects', component.effects)
|
|
86
|
+
},
|
|
83
87
|
],
|
|
84
88
|
context: {},
|
|
85
89
|
},
|
|
86
|
-
props: ['image', 'map', 'frame', 'color'],
|
|
90
|
+
props: ['image', 'map', 'frame', 'color', 'effects'],
|
|
87
91
|
state() {
|
|
88
92
|
return {
|
|
89
93
|
spriteTexture: null,
|
package/src/router/router.js
CHANGED
|
@@ -220,6 +220,7 @@ const makeRouteObject = (route, overrides) => {
|
|
|
220
220
|
hooks: route.hooks || {},
|
|
221
221
|
data: { ...route.data, ...navigationData, ...overrides.queryParams },
|
|
222
222
|
params: overrides.params || {},
|
|
223
|
+
meta: route.meta || {},
|
|
223
224
|
}
|
|
224
225
|
|
|
225
226
|
return cleanRoute
|
|
@@ -249,21 +250,25 @@ export const navigate = async function () {
|
|
|
249
250
|
currentRoute = route
|
|
250
251
|
|
|
251
252
|
if (route) {
|
|
253
|
+
const currentPath = currentRoute.path
|
|
252
254
|
let beforeEachResult
|
|
253
255
|
if (this.parent[symbols.routerHooks]) {
|
|
254
256
|
const hooks = this.parent[symbols.routerHooks]
|
|
255
257
|
if (hooks.beforeEach) {
|
|
256
258
|
beforeEachResult = await hooks.beforeEach.call(this.parent, route, previousRoute)
|
|
257
259
|
if (isString(beforeEachResult)) {
|
|
260
|
+
currentRoute = previousRoute
|
|
258
261
|
to(beforeEachResult)
|
|
259
262
|
return
|
|
260
263
|
}
|
|
264
|
+
// If the resolved result is an object, redirect if the path in the object was changed
|
|
265
|
+
if (isObject(beforeEachResult) === true && beforeEachResult.path !== currentPath) {
|
|
266
|
+
currentRoute = previousRoute
|
|
267
|
+
to(beforeEachResult.path, beforeEachResult.data, beforeEachResult.options)
|
|
268
|
+
return
|
|
269
|
+
}
|
|
261
270
|
}
|
|
262
271
|
}
|
|
263
|
-
// If the resolved result is an object, assign it to the target route object
|
|
264
|
-
if (isObject(beforeEachResult) === true) {
|
|
265
|
-
route = beforeEachResult
|
|
266
|
-
}
|
|
267
272
|
|
|
268
273
|
let beforeHookOutput
|
|
269
274
|
if (route.hooks.before) {
|
|
@@ -273,10 +278,12 @@ export const navigate = async function () {
|
|
|
273
278
|
to(beforeHookOutput)
|
|
274
279
|
return
|
|
275
280
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
281
|
+
// If the resolved result is an object, redirect if the path in the object was changed
|
|
282
|
+
if (isObject(beforeHookOutput) === true && beforeHookOutput.path !== currentPath) {
|
|
283
|
+
currentRoute = previousRoute
|
|
284
|
+
to(beforeHookOutput.path, beforeHookOutput.data, beforeHookOutput.options)
|
|
285
|
+
return
|
|
286
|
+
}
|
|
280
287
|
}
|
|
281
288
|
// add the previous route (technically still the current route at this point)
|
|
282
289
|
// into the history stack when inHistory is true and we're not navigating back
|