@lightningjs/blits 1.41.0 → 1.42.0

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,16 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.42.0
4
+
5
+ _24 Oct 2025_
6
+
7
+
8
+ - Added effects prop support to Sprite component
9
+ - Added support for redirecting in before hooks returning a route object (with updated path)
10
+ - Fixed meta options on routes functionality
11
+ - Enhanced router hook test coverage
12
+ - Fixed scale animation snapping issue when using object notation with transitions
13
+
3
14
  ## v1.41.0
4
15
 
5
16
  _16 Oct 2025_
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "1.41.0",
3
+ "version": "1.42.0",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.js",
6
6
  "exports": {
@@ -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,
@@ -357,7 +357,8 @@ const propsTransformer = {
357
357
  this.props['scaleY'] = v.y
358
358
  }
359
359
  } else {
360
- this.props['scale'] = v
360
+ this.props['scaleX'] = v
361
+ this.props['scaleY'] = v
361
362
  }
362
363
  },
363
364
  set show(v) {
@@ -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
- // If the resolved result is an object, assign it to the target route object
278
- if (isObject(beforeHookOutput) === true) {
279
- route = beforeHookOutput
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