@lightningjs/blits 0.6.12 → 0.7.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 +16 -0
- package/package.json +2 -2
- package/src/component.js +2 -4
- package/src/components/FPScounter.js +64 -34
- package/src/components/FPScounter.orig.js +0 -2
- package/src/components/Text.js +5 -1
- package/src/components/Text.orig.js +3 -1
- package/src/element.js +1 -10
- package/src/focus.js +1 -1
- package/src/launch.d.ts +10 -0
- package/src/launch.js +2 -1
- package/src/lib/codegenerator/generator.js +4 -4
- package/src/router/router.js +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
# v0.7.0
|
|
4
|
+
|
|
5
|
+
- Added support for dynamic components through the `is`-attribute (`<Component is="Poster" />` or `<Component is="$dynamicComponent" />`)
|
|
6
|
+
- Added functionality to pass extra data / props when navigating to a new route ( _breaking change_ in signature of `router.to()` method - previously: `router.to(path, options)`, now: `router.to(path, data, options)`)
|
|
7
|
+
- Added configuration option to set the canvas color (aka clear color)
|
|
8
|
+
|
|
9
|
+
# v0.6.13
|
|
10
|
+
|
|
11
|
+
_16 feb 2024_
|
|
12
|
+
|
|
13
|
+
- Upgraded to 0.7.2 of the renderer
|
|
14
|
+
- Introduced new `maxheight` attribute (besided the existing `maxlines` attribute) for the `<Text />` component
|
|
15
|
+
- Fixed issue with order of lifecycle event emits
|
|
16
|
+
- Fixed logic to not unfoces a parent when it passes focus to a child
|
|
17
|
+
- Removed temporary fix for renderer issue [#123](https://github.com/lightning-js/renderer/issues/123)
|
|
18
|
+
|
|
3
19
|
# v0.6.12
|
|
4
20
|
|
|
5
21
|
_9 feb 2024_
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightningjs/blits",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Blits: The Lightning 3 App Development Framework",
|
|
5
5
|
"bin": "bin/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"tape": "^5.5.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@lightningjs/renderer": "^0.7.
|
|
48
|
+
"@lightningjs/renderer": "^0.7.2",
|
|
49
49
|
"@lightningjs/vite-plugin-import-chunk-url": "^0.3.0",
|
|
50
50
|
"execa": "^8.0.1",
|
|
51
51
|
"kolorist": "^1.8.0",
|
package/src/component.js
CHANGED
|
@@ -97,15 +97,13 @@ const Component = (name = required('name'), config = required('config')) => {
|
|
|
97
97
|
},
|
|
98
98
|
set state(v) {
|
|
99
99
|
if (states.indexOf(v) > -1 && v !== this.current) {
|
|
100
|
-
Log.debug(
|
|
101
|
-
`Setting lifecycle state from ${this.previous} to ${v} for ${scope.componentId}`
|
|
102
|
-
)
|
|
100
|
+
Log.debug(`Setting lifecycle state from ${this.current} to ${v} for ${scope.componentId}`)
|
|
103
101
|
this.previous = this.current
|
|
102
|
+
this.current = v
|
|
104
103
|
// emit 'private' hook
|
|
105
104
|
privateEmit(v, name, scope)
|
|
106
105
|
// emit 'public' hook
|
|
107
106
|
emit(v, name, scope)
|
|
108
|
-
this.current = v
|
|
109
107
|
}
|
|
110
108
|
},
|
|
111
109
|
}
|
|
@@ -19,8 +19,6 @@ import Component from '../component.js'
|
|
|
19
19
|
import { renderer } from '../launch.js'
|
|
20
20
|
import fps_sprite from '../../public/assets/fps_sprite.base64.js'
|
|
21
21
|
|
|
22
|
-
console.log(fps_sprite)
|
|
23
|
-
|
|
24
22
|
export default () =>
|
|
25
23
|
Component('FPScounter', {
|
|
26
24
|
/* eslint-disable no-unused-vars */
|
|
@@ -98,9 +96,11 @@ export default () =>
|
|
|
98
96
|
props4['frame'] = 'fps'
|
|
99
97
|
|
|
100
98
|
if (!elms[4]) {
|
|
99
|
+
const componentType = props4['is'] || 'Sprite'
|
|
100
|
+
|
|
101
101
|
elms[4] = (
|
|
102
|
-
(context.components && context.components[
|
|
103
|
-
component[Symbol.for('components')][
|
|
102
|
+
(context.components && context.components[componentType]) ||
|
|
103
|
+
component[Symbol.for('components')][componentType] ||
|
|
104
104
|
(() => {
|
|
105
105
|
console.error('component Sprite not found')
|
|
106
106
|
})
|
|
@@ -164,9 +164,11 @@ export default () =>
|
|
|
164
164
|
props7['frame'] = component.fps[0]
|
|
165
165
|
|
|
166
166
|
if (!elms[7]) {
|
|
167
|
+
const componentType = props7['is'] || 'Sprite'
|
|
168
|
+
|
|
167
169
|
elms[7] = (
|
|
168
|
-
(context.components && context.components[
|
|
169
|
-
component[Symbol.for('components')][
|
|
170
|
+
(context.components && context.components[componentType]) ||
|
|
171
|
+
component[Symbol.for('components')][componentType] ||
|
|
170
172
|
(() => {
|
|
171
173
|
console.error('component Sprite not found')
|
|
172
174
|
})
|
|
@@ -216,9 +218,11 @@ export default () =>
|
|
|
216
218
|
props9['frame'] = component.fps[1]
|
|
217
219
|
|
|
218
220
|
if (!elms[9]) {
|
|
221
|
+
const componentType = props9['is'] || 'Sprite'
|
|
222
|
+
|
|
219
223
|
elms[9] = (
|
|
220
|
-
(context.components && context.components[
|
|
221
|
-
component[Symbol.for('components')][
|
|
224
|
+
(context.components && context.components[componentType]) ||
|
|
225
|
+
component[Symbol.for('components')][componentType] ||
|
|
222
226
|
(() => {
|
|
223
227
|
console.error('component Sprite not found')
|
|
224
228
|
})
|
|
@@ -268,9 +272,11 @@ export default () =>
|
|
|
268
272
|
props11['frame'] = component.fps[2]
|
|
269
273
|
|
|
270
274
|
if (!elms[11]) {
|
|
275
|
+
const componentType = props11['is'] || 'Sprite'
|
|
276
|
+
|
|
271
277
|
elms[11] = (
|
|
272
|
-
(context.components && context.components[
|
|
273
|
-
component[Symbol.for('components')][
|
|
278
|
+
(context.components && context.components[componentType]) ||
|
|
279
|
+
component[Symbol.for('components')][componentType] ||
|
|
274
280
|
(() => {
|
|
275
281
|
console.error('component Sprite not found')
|
|
276
282
|
})
|
|
@@ -334,9 +340,11 @@ export default () =>
|
|
|
334
340
|
props14['frame'] = 'avg'
|
|
335
341
|
|
|
336
342
|
if (!elms[14]) {
|
|
343
|
+
const componentType = props14['is'] || 'Sprite'
|
|
344
|
+
|
|
337
345
|
elms[14] = (
|
|
338
|
-
(context.components && context.components[
|
|
339
|
-
component[Symbol.for('components')][
|
|
346
|
+
(context.components && context.components[componentType]) ||
|
|
347
|
+
component[Symbol.for('components')][componentType] ||
|
|
340
348
|
(() => {
|
|
341
349
|
console.error('component Sprite not found')
|
|
342
350
|
})
|
|
@@ -400,9 +408,11 @@ export default () =>
|
|
|
400
408
|
props17['frame'] = component.avgFps[0]
|
|
401
409
|
|
|
402
410
|
if (!elms[17]) {
|
|
411
|
+
const componentType = props17['is'] || 'Sprite'
|
|
412
|
+
|
|
403
413
|
elms[17] = (
|
|
404
|
-
(context.components && context.components[
|
|
405
|
-
component[Symbol.for('components')][
|
|
414
|
+
(context.components && context.components[componentType]) ||
|
|
415
|
+
component[Symbol.for('components')][componentType] ||
|
|
406
416
|
(() => {
|
|
407
417
|
console.error('component Sprite not found')
|
|
408
418
|
})
|
|
@@ -452,9 +462,11 @@ export default () =>
|
|
|
452
462
|
props19['frame'] = component.avgFps[1]
|
|
453
463
|
|
|
454
464
|
if (!elms[19]) {
|
|
465
|
+
const componentType = props19['is'] || 'Sprite'
|
|
466
|
+
|
|
455
467
|
elms[19] = (
|
|
456
|
-
(context.components && context.components[
|
|
457
|
-
component[Symbol.for('components')][
|
|
468
|
+
(context.components && context.components[componentType]) ||
|
|
469
|
+
component[Symbol.for('components')][componentType] ||
|
|
458
470
|
(() => {
|
|
459
471
|
console.error('component Sprite not found')
|
|
460
472
|
})
|
|
@@ -504,9 +516,11 @@ export default () =>
|
|
|
504
516
|
props21['frame'] = component.avgFps[2]
|
|
505
517
|
|
|
506
518
|
if (!elms[21]) {
|
|
519
|
+
const componentType = props21['is'] || 'Sprite'
|
|
520
|
+
|
|
507
521
|
elms[21] = (
|
|
508
|
-
(context.components && context.components[
|
|
509
|
-
component[Symbol.for('components')][
|
|
522
|
+
(context.components && context.components[componentType]) ||
|
|
523
|
+
component[Symbol.for('components')][componentType] ||
|
|
510
524
|
(() => {
|
|
511
525
|
console.error('component Sprite not found')
|
|
512
526
|
})
|
|
@@ -571,9 +585,11 @@ export default () =>
|
|
|
571
585
|
props24['frame'] = 'min'
|
|
572
586
|
|
|
573
587
|
if (!elms[24]) {
|
|
588
|
+
const componentType = props24['is'] || 'Sprite'
|
|
589
|
+
|
|
574
590
|
elms[24] = (
|
|
575
|
-
(context.components && context.components[
|
|
576
|
-
component[Symbol.for('components')][
|
|
591
|
+
(context.components && context.components[componentType]) ||
|
|
592
|
+
component[Symbol.for('components')][componentType] ||
|
|
577
593
|
(() => {
|
|
578
594
|
console.error('component Sprite not found')
|
|
579
595
|
})
|
|
@@ -637,9 +653,11 @@ export default () =>
|
|
|
637
653
|
props27['frame'] = component.minFps[0]
|
|
638
654
|
|
|
639
655
|
if (!elms[27]) {
|
|
656
|
+
const componentType = props27['is'] || 'Sprite'
|
|
657
|
+
|
|
640
658
|
elms[27] = (
|
|
641
|
-
(context.components && context.components[
|
|
642
|
-
component[Symbol.for('components')][
|
|
659
|
+
(context.components && context.components[componentType]) ||
|
|
660
|
+
component[Symbol.for('components')][componentType] ||
|
|
643
661
|
(() => {
|
|
644
662
|
console.error('component Sprite not found')
|
|
645
663
|
})
|
|
@@ -689,9 +707,11 @@ export default () =>
|
|
|
689
707
|
props29['frame'] = component.minFps[1]
|
|
690
708
|
|
|
691
709
|
if (!elms[29]) {
|
|
710
|
+
const componentType = props29['is'] || 'Sprite'
|
|
711
|
+
|
|
692
712
|
elms[29] = (
|
|
693
|
-
(context.components && context.components[
|
|
694
|
-
component[Symbol.for('components')][
|
|
713
|
+
(context.components && context.components[componentType]) ||
|
|
714
|
+
component[Symbol.for('components')][componentType] ||
|
|
695
715
|
(() => {
|
|
696
716
|
console.error('component Sprite not found')
|
|
697
717
|
})
|
|
@@ -741,9 +761,11 @@ export default () =>
|
|
|
741
761
|
props31['frame'] = component.minFps[2]
|
|
742
762
|
|
|
743
763
|
if (!elms[31]) {
|
|
764
|
+
const componentType = props31['is'] || 'Sprite'
|
|
765
|
+
|
|
744
766
|
elms[31] = (
|
|
745
|
-
(context.components && context.components[
|
|
746
|
-
component[Symbol.for('components')][
|
|
767
|
+
(context.components && context.components[componentType]) ||
|
|
768
|
+
component[Symbol.for('components')][componentType] ||
|
|
747
769
|
(() => {
|
|
748
770
|
console.error('component Sprite not found')
|
|
749
771
|
})
|
|
@@ -806,9 +828,11 @@ export default () =>
|
|
|
806
828
|
props34['frame'] = 'max'
|
|
807
829
|
|
|
808
830
|
if (!elms[34]) {
|
|
831
|
+
const componentType = props34['is'] || 'Sprite'
|
|
832
|
+
|
|
809
833
|
elms[34] = (
|
|
810
|
-
(context.components && context.components[
|
|
811
|
-
component[Symbol.for('components')][
|
|
834
|
+
(context.components && context.components[componentType]) ||
|
|
835
|
+
component[Symbol.for('components')][componentType] ||
|
|
812
836
|
(() => {
|
|
813
837
|
console.error('component Sprite not found')
|
|
814
838
|
})
|
|
@@ -872,9 +896,11 @@ export default () =>
|
|
|
872
896
|
props37['frame'] = component.maxFps[0]
|
|
873
897
|
|
|
874
898
|
if (!elms[37]) {
|
|
899
|
+
const componentType = props37['is'] || 'Sprite'
|
|
900
|
+
|
|
875
901
|
elms[37] = (
|
|
876
|
-
(context.components && context.components[
|
|
877
|
-
component[Symbol.for('components')][
|
|
902
|
+
(context.components && context.components[componentType]) ||
|
|
903
|
+
component[Symbol.for('components')][componentType] ||
|
|
878
904
|
(() => {
|
|
879
905
|
console.error('component Sprite not found')
|
|
880
906
|
})
|
|
@@ -924,9 +950,11 @@ export default () =>
|
|
|
924
950
|
props39['frame'] = component.maxFps[1]
|
|
925
951
|
|
|
926
952
|
if (!elms[39]) {
|
|
953
|
+
const componentType = props39['is'] || 'Sprite'
|
|
954
|
+
|
|
927
955
|
elms[39] = (
|
|
928
|
-
(context.components && context.components[
|
|
929
|
-
component[Symbol.for('components')][
|
|
956
|
+
(context.components && context.components[componentType]) ||
|
|
957
|
+
component[Symbol.for('components')][componentType] ||
|
|
930
958
|
(() => {
|
|
931
959
|
console.error('component Sprite not found')
|
|
932
960
|
})
|
|
@@ -976,9 +1004,11 @@ export default () =>
|
|
|
976
1004
|
props41['frame'] = component.maxFps[2]
|
|
977
1005
|
|
|
978
1006
|
if (!elms[41]) {
|
|
1007
|
+
const componentType = props41['is'] || 'Sprite'
|
|
1008
|
+
|
|
979
1009
|
elms[41] = (
|
|
980
|
-
(context.components && context.components[
|
|
981
|
-
component[Symbol.for('components')][
|
|
1010
|
+
(context.components && context.components[componentType]) ||
|
|
1011
|
+
component[Symbol.for('components')][componentType] ||
|
|
982
1012
|
(() => {
|
|
983
1013
|
console.error('component Sprite not found')
|
|
984
1014
|
})
|
package/src/components/Text.js
CHANGED
|
@@ -67,6 +67,9 @@ export default () =>
|
|
|
67
67
|
function anonymous(component, elms, context) {
|
|
68
68
|
elms[0].set('maxLines', component.maxlines)
|
|
69
69
|
},
|
|
70
|
+
function anonymous(component, elms, context) {
|
|
71
|
+
elms[0].set('h', component.maxheight)
|
|
72
|
+
},
|
|
70
73
|
function anonymous(component, elms, context) {
|
|
71
74
|
elms[0].set('textAlign', component.align)
|
|
72
75
|
},
|
|
@@ -95,6 +98,7 @@ export default () =>
|
|
|
95
98
|
'align',
|
|
96
99
|
'wordwrap',
|
|
97
100
|
'maxlines',
|
|
101
|
+
'maxheight',
|
|
98
102
|
'lineheight',
|
|
99
103
|
'contain',
|
|
100
104
|
'@loaded',
|
|
@@ -105,7 +109,7 @@ export default () =>
|
|
|
105
109
|
_contain() {
|
|
106
110
|
return (
|
|
107
111
|
this.contain ||
|
|
108
|
-
(this.
|
|
112
|
+
(this.maxheight && this.wordwrap ? 'both' : this.wordwrap ? 'width' : 'none')
|
|
109
113
|
)
|
|
110
114
|
},
|
|
111
115
|
_lineheight() {
|
|
@@ -35,6 +35,7 @@ export default () =>
|
|
|
35
35
|
contain="$_contain"
|
|
36
36
|
:wordWrap="$wordwrap"
|
|
37
37
|
:maxLines="$maxlines"
|
|
38
|
+
:h="$maxheight"
|
|
38
39
|
:textAlign="$align"
|
|
39
40
|
:overflowSuffix="$textoverflow"
|
|
40
41
|
@loaded="$@loaded"
|
|
@@ -59,6 +60,7 @@ export default () =>
|
|
|
59
60
|
'align',
|
|
60
61
|
'wordwrap',
|
|
61
62
|
'maxlines',
|
|
63
|
+
'maxheight',
|
|
62
64
|
'lineheight',
|
|
63
65
|
'contain',
|
|
64
66
|
'@loaded',
|
|
@@ -69,7 +71,7 @@ export default () =>
|
|
|
69
71
|
_contain() {
|
|
70
72
|
return (
|
|
71
73
|
this.contain ||
|
|
72
|
-
(this.
|
|
74
|
+
(this.maxheight && this.wordwrap ? 'both' : this.wordwrap ? 'width' : 'none')
|
|
73
75
|
)
|
|
74
76
|
},
|
|
75
77
|
_lineheight() {
|
package/src/element.js
CHANGED
|
@@ -51,8 +51,6 @@ const unpackTransition = (obj) => {
|
|
|
51
51
|
return obj
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
let firstNode = false
|
|
55
|
-
|
|
56
54
|
const Props = {
|
|
57
55
|
set parent(v) {
|
|
58
56
|
this._props.parent = v === 'root' ? renderer.root : v.node
|
|
@@ -201,7 +199,7 @@ const Props = {
|
|
|
201
199
|
this._props.contain = v
|
|
202
200
|
},
|
|
203
201
|
set maxLines(v) {
|
|
204
|
-
this.
|
|
202
|
+
this._props.maxLines = v
|
|
205
203
|
},
|
|
206
204
|
set overflowSuffix(v) {
|
|
207
205
|
this._props.overflowSuffix = v === false ? ' ' : v === true ? undefined : v
|
|
@@ -247,13 +245,6 @@ const Element = {
|
|
|
247
245
|
this.props._set.has('src') || this.props._set.has('texture') ? 0xffffffff : 0
|
|
248
246
|
}
|
|
249
247
|
|
|
250
|
-
// temporary workaround for renderer issue https://github.com/lightning-js/renderer/issues/123
|
|
251
|
-
if (!firstNode) {
|
|
252
|
-
this.props._props.src =
|
|
253
|
-
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII='
|
|
254
|
-
firstNode = true
|
|
255
|
-
}
|
|
256
|
-
|
|
257
248
|
this.node = props.__textnode
|
|
258
249
|
? renderer.createTextNode(this.props._props)
|
|
259
250
|
: renderer.createNode(this.props._props)
|
package/src/focus.js
CHANGED
|
@@ -35,7 +35,7 @@ export default {
|
|
|
35
35
|
},
|
|
36
36
|
set(component, event) {
|
|
37
37
|
clearTimeout(setFocusTimeout)
|
|
38
|
-
focusedComponent && focusedComponent.unfocus()
|
|
38
|
+
focusedComponent && focusedComponent !== component.parent && focusedComponent.unfocus()
|
|
39
39
|
focusChain.reverse().forEach((cmp) => cmp.unfocus())
|
|
40
40
|
if (component !== focusedComponent) {
|
|
41
41
|
setFocusTimeout = setTimeout(
|
package/src/launch.d.ts
CHANGED
|
@@ -162,6 +162,16 @@ export interface Settings {
|
|
|
162
162
|
* `navigator.hardwareConcurrency` (or 2 if `navigator.hardwareConcurrency` is not supported)
|
|
163
163
|
*/
|
|
164
164
|
webWorkersLimit?: number
|
|
165
|
+
/**
|
|
166
|
+
* Background color of the canvas (also known as the clearColor)
|
|
167
|
+
*
|
|
168
|
+
* Can be a color name (red, blue, silver), a hexadecimal color (`#000000`, `#ccc`),
|
|
169
|
+
* or a color number in rgba order (`0xff0033ff`)
|
|
170
|
+
*
|
|
171
|
+
* Defauls to transparent (`0x00000000`)
|
|
172
|
+
*
|
|
173
|
+
*/
|
|
174
|
+
canvasColor?: string,
|
|
165
175
|
}
|
|
166
176
|
|
|
167
177
|
/**
|
package/src/launch.js
CHANGED
|
@@ -20,7 +20,7 @@ import { MainCoreDriver, RendererMain } from '@lightningjs/renderer'
|
|
|
20
20
|
import Settings from './settings.js'
|
|
21
21
|
import { initLog, Log } from './lib/log.js'
|
|
22
22
|
import { screenResolutions } from './lib/utils.js'
|
|
23
|
-
|
|
23
|
+
import colors from './lib/colors/colors.js'
|
|
24
24
|
|
|
25
25
|
export let renderer
|
|
26
26
|
|
|
@@ -51,6 +51,7 @@ export default (App, target, settings) => {
|
|
|
51
51
|
'webWorkersLimit' in settings
|
|
52
52
|
? settings.webWorkersLimit
|
|
53
53
|
: window.navigator.hardwareConcurrency || 2,
|
|
54
|
+
clearColor: (settings.canvasColor && colors.normalize(settings.canvasColor)) || 0x00000000,
|
|
54
55
|
},
|
|
55
56
|
target,
|
|
56
57
|
driver
|
|
@@ -169,11 +169,11 @@ const generateComponentCode = function (
|
|
|
169
169
|
|
|
170
170
|
renderCode.push(`
|
|
171
171
|
if(!${elm}) {
|
|
172
|
-
${
|
|
172
|
+
const componentType = props${counter}['is'] || '${
|
|
173
173
|
templateObject[Symbol.for('componentType')]
|
|
174
|
-
}'
|
|
175
|
-
|
|
176
|
-
}'] || (() => { console.error('component ${
|
|
174
|
+
}'
|
|
175
|
+
|
|
176
|
+
${elm} = (context.components && context.components[componentType] || component[Symbol.for('components')][componentType] || (() => { console.error('component ${
|
|
177
177
|
templateObject[Symbol.for('componentType')]
|
|
178
178
|
} not found')})).call(null, {props: props${counter}}, ${parent}, component)
|
|
179
179
|
if (${elm}[Symbol.for('slots')][0]) {
|
package/src/router/router.js
CHANGED
|
@@ -28,7 +28,9 @@ export let navigating = false
|
|
|
28
28
|
|
|
29
29
|
const cacheMap = new WeakMap()
|
|
30
30
|
const history = []
|
|
31
|
+
|
|
31
32
|
let overrideOptions = {}
|
|
33
|
+
let navigationData = {}
|
|
32
34
|
let navigatingBack = false
|
|
33
35
|
let previousFocus
|
|
34
36
|
|
|
@@ -133,7 +135,8 @@ export const navigate = async function () {
|
|
|
133
135
|
holder.set('w', '100%')
|
|
134
136
|
holder.set('h', '100%')
|
|
135
137
|
// merge props with potential route params to be injected into the component instance
|
|
136
|
-
const props = { ...this[symbols.props], ...route.params }
|
|
138
|
+
const props = { ...this[symbols.props], ...route.params, ...navigationData }
|
|
139
|
+
|
|
137
140
|
view = await route.component({ props }, holder, this)
|
|
138
141
|
if (view[Symbol.toStringTag] === 'Module') {
|
|
139
142
|
if (view.default && typeof view.default === 'function') {
|
|
@@ -250,7 +253,8 @@ const setOrAnimate = (node, transition, shouldAnimate = true) => {
|
|
|
250
253
|
: node.set(transition.prop, transition.value)
|
|
251
254
|
}
|
|
252
255
|
|
|
253
|
-
export const to = (location, options = {}) => {
|
|
256
|
+
export const to = (location, data = {}, options = {}) => {
|
|
257
|
+
navigationData = data
|
|
254
258
|
overrideOptions = options
|
|
255
259
|
window.location.hash = `#${location}`
|
|
256
260
|
}
|