@lightningjs/blits 0.5.2 → 0.5.3

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,4 +1,11 @@
1
1
  # Changelog
2
+
3
+ # v0.5.3
4
+
5
+ _4 dec 2023_
6
+
7
+ - Added transition `start` and tranition `end` callbacks
8
+
2
9
  # v0.5.2
3
10
 
4
11
  _30 nov 2023_
@@ -31,6 +31,6 @@
31
31
  "vite": "^4.0.4"
32
32
  },
33
33
  "dependencies": {
34
- "@lightningjs/blits": "^0.5.2"
34
+ "@lightningjs/blits": "^0.5.3"
35
35
  }
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.cjs",
6
6
  "exports": {
package/src/element.js CHANGED
@@ -284,9 +284,17 @@ const Element = {
284
284
  v: props[prop],
285
285
  f,
286
286
  timeout: setTimeout(() => {
287
+ value.start &&
288
+ typeof value.start === 'function' &&
289
+ value.start.call(this.component, this, prop, props[prop])
287
290
  f.start()
288
291
  .waitUntilStopped()
289
292
  .then(() => delete this.scheduledTransitions[prop])
293
+ .then(() => {
294
+ value.end &&
295
+ typeof value.end === 'function' &&
296
+ value.end.call(this.component, this, prop, props[prop])
297
+ })
290
298
  .then(resolve)
291
299
  }, value.delay || 0),
292
300
  }
@@ -295,11 +303,12 @@ const Element = {
295
303
  },
296
304
  }
297
305
 
298
- export default (config) =>
306
+ export default (config, component) =>
299
307
  Object.assign(Object.create(Element), {
300
308
  node: null,
301
309
  setProperties: [],
302
310
  scheduledTransitions: {},
303
311
  initData: {},
304
312
  config,
313
+ component,
305
314
  })
@@ -56,7 +56,7 @@ const generateElementCode = function (
56
56
 
57
57
  renderCode.push(`
58
58
  if(!${elm}) {
59
- ${elm} = this.element({componentId: component[Symbol.for('id')], parent: parent || 'root'})
59
+ ${elm} = this.element({componentId: component[Symbol.for('id')], parent: parent || 'root'}, component)
60
60
  }
61
61
  const elementConfig${counter} = {}
62
62
  `)