@lightningjs/blits 1.30.1 → 1.31.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/package.json +4 -3
  3. package/src/router/router.js +2 -0
  4. package/vite/preCompiler.js +6 -1
  5. package/.editorconfig +0 -7
  6. package/.eslintignore +0 -1
  7. package/.eslintrc.cjs +0 -65
  8. package/.github/workflows/comment-lint-results.yml +0 -125
  9. package/.github/workflows/comment-test-results.yml +0 -109
  10. package/.github/workflows/deploy-docs.yml +0 -27
  11. package/.github/workflows/run-blits-tests.yml +0 -142
  12. package/.github/workflows/run-lint.yml +0 -128
  13. package/.husky/pre-commit +0 -1
  14. package/.husky/pre-push +0 -1
  15. package/.vscode/extensions.json +0 -7
  16. package/.vscode/settings.json +0 -9
  17. package/banner.png +0 -0
  18. package/docs/.nojekyll +0 -0
  19. package/docs/README.md +0 -19
  20. package/docs/_sidebar.md +0 -37
  21. package/docs/built-in/directives.md +0 -50
  22. package/docs/built-in/for-loop.md +0 -204
  23. package/docs/built-in/layout.md +0 -168
  24. package/docs/components/component_state.md +0 -90
  25. package/docs/components/computed_properties.md +0 -45
  26. package/docs/components/lifecycle_events.md +0 -42
  27. package/docs/components/methods.md +0 -45
  28. package/docs/components/props.md +0 -56
  29. package/docs/components/user_input.md +0 -186
  30. package/docs/components/utility_methods.md +0 -320
  31. package/docs/components/watchers.md +0 -34
  32. package/docs/essentials/application_root.md +0 -19
  33. package/docs/essentials/components.md +0 -68
  34. package/docs/essentials/displaying_images.md +0 -67
  35. package/docs/essentials/displaying_text.md +0 -135
  36. package/docs/essentials/element_attributes.md +0 -195
  37. package/docs/essentials/settings.md +0 -117
  38. package/docs/essentials/template_syntax.md +0 -83
  39. package/docs/getting_started/file_structure.md +0 -58
  40. package/docs/getting_started/getting_started.md +0 -45
  41. package/docs/getting_started/intro.md +0 -20
  42. package/docs/index.html +0 -47
  43. package/docs/performance/lazy-loading.md +0 -161
  44. package/docs/plugins/global_app_state.md +0 -98
  45. package/docs/plugins/language.md +0 -172
  46. package/docs/plugins/text-to-speech-announcer.md +0 -120
  47. package/docs/plugins/theme.md +0 -176
  48. package/docs/router/basics.md +0 -175
  49. package/docs/router/hooks.md +0 -70
  50. package/docs/router/transitions.md +0 -146
  51. package/docs/sidebar.json +0 -171
  52. package/docs/transitions_animations/transitions.md +0 -150
  53. package/jsconfig.json +0 -12
  54. package/src/component/setup/props.test.js +0 -238
  55. package/src/component.test.js +0 -388
  56. package/src/components/Circle.orig.js +0 -31
  57. package/src/components/FPScounter.orig.js +0 -121
  58. package/src/components/RouterView.orig.js +0 -54
  59. package/src/components/Sprite.orig.js +0 -58
  60. package/src/components/index.orig.js +0 -28
  61. package/src/engines/L3/element.test.js +0 -579
  62. package/src/helpers/deepEqualArray.test.js +0 -127
  63. package/src/lib/codegenerator/generator.test.js +0 -3801
  64. package/src/lib/colors/colors.test.js +0 -290
  65. package/src/lib/componentId.test.js +0 -84
  66. package/src/lib/eventListeners.test.js +0 -236
  67. package/src/lib/reactivity/effect.test.js +0 -35
  68. package/src/lib/reactivity/reactive.test.js +0 -27
  69. package/src/lib/templateparser/parser.test.js +0 -1411
  70. package/src/router/router.test.js +0 -473
@@ -1,121 +0,0 @@
1
- /*
2
- * Copyright 2023 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
-
18
- import Component from '../component.js'
19
- import { renderer } from '../launch.js'
20
- import fps_sprite from '../../public/assets/fps_sprite.base64.js'
21
-
22
- export default () =>
23
- Component('FPScounter', {
24
- template: `
25
- <Element>
26
- <Element y="15" x="20">
27
- <Element>
28
- <Sprite image="$image" w="43" h="25" map="$sprite" frame="fps" />
29
- <Element x="58" y="2">
30
- <Sprite image="$image" x="0" h="20" w="20" map="$sprite" :frame="$fps[0]" />
31
- <Sprite image="$image" x="18" h="20" w="20" map="$sprite" :frame="$fps[1]" />
32
- <Sprite image="$image" x="36" h="20" w="20" map="$sprite" :frame="$fps[2]" />
33
- </Element>
34
- </Element>
35
-
36
- <Element x="150">
37
- <Sprite image="$image" y="2" w="48" h="25" map="$sprite" frame="avg" />
38
- <Element x="63" y="2">
39
- <Sprite image="$image" x="0" h="20" w="20" map="$sprite" :frame="$avgFps[0]" />
40
- <Sprite image="$image" x="18" h="20" w="20" map="$sprite" :frame="$avgFps[1]" />
41
- <Sprite image="$image" x="36" h="20" w="20" map="$sprite" :frame="$avgFps[2]" />
42
- </Element>
43
- </Element>
44
-
45
- <Element x="0" y="40" >
46
- <Sprite image="$image" x="-2" w="47" h="25" map="$sprite" frame="min" />
47
- <Element x="58" y="2">
48
- <Sprite image="$image" x="0" h="20" w="20" map="$sprite" :frame="$minFps[0]" />
49
- <Sprite image="$image" x="18" h="20" w="20" map="$sprite" :frame="$minFps[1]" />
50
- <Sprite image="$image" x="36" h="20" w="20" map="$sprite" :frame="$minFps[2]" />
51
- </Element>
52
- </Element>
53
-
54
- <Element x="150" y="40">
55
- <Sprite image="$image" w="53" h="25" map="$sprite" frame="max" />
56
- <Element x="63" y="2">
57
- <Sprite image="$image" x="0" h="20" w="20" map="$sprite" :frame="$maxFps[0]" />
58
- <Sprite image="$image" x="18" h="20" w="20" map="$sprite" :frame="$maxFps[1]" />
59
- <Sprite image="$image" x="36" h="20" w="20" map="$sprite" :frame="$maxFps[2]" />
60
- </Element>
61
- </Element>
62
- </Element>
63
- </Element>
64
- `,
65
- state() {
66
- return {
67
- image: fps_sprite,
68
- sprite: {
69
- defaults: {
70
- y: 1,
71
- w: 20,
72
- h: 20,
73
- },
74
- frames: {
75
- '-': { x: -1000 },
76
- 0: { x: 1 },
77
- 1: { x: 23 },
78
- 2: { x: 45 },
79
- 3: { x: 67 },
80
- 4: { x: 89 },
81
- 5: { x: 111 },
82
- 6: { x: 133 },
83
- 7: { x: 155 },
84
- 8: { x: 177 },
85
- 9: { x: 199 },
86
- avg: { x: 221, w: 48, h: 25 },
87
- fps: { x: 271, w: 43, h: 25 },
88
- max: { x: 316, w: 53, h: 25 },
89
- min: { x: 371, w: 47, h: 25 },
90
- },
91
- },
92
- fps: '---',
93
- avgFps: '---',
94
- minFps: '---',
95
- maxFps: '---',
96
- }
97
- },
98
- hooks: {
99
- ready() {
100
- let minFps = 10000
101
- let maxFps = 0
102
- let avgFps = 0
103
- let totalFps = 0
104
- let fpsUpdateCounter = 0
105
-
106
- // This leaks - might be L3 SubTexture issue
107
- // renderer.on('fpsUpdate', (rM, { fps }) => {
108
- // minFps = Math.min(fps, minFps)
109
- // maxFps = Math.max(fps, maxFps)
110
- // totalFps += fps
111
- // fpsUpdateCounter++
112
- // avgFps = Math.round(totalFps / fpsUpdateCounter)
113
-
114
- // this.fps = fps.toString().padStart(3, '0')
115
- // this.avgFps = avgFps.toString().padStart(3, '0')
116
- // this.minFps = minFps.toString().padStart(3, '0')
117
- // this.maxFps = maxFps.toString().padStart(3, '0')
118
- // })
119
- },
120
- },
121
- })
@@ -1,54 +0,0 @@
1
- /*
2
- * Copyright 2023 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
-
18
- import Component from '../component.js'
19
- import Router from '../router/router.js'
20
-
21
- let hashchangeHandler = null
22
-
23
- export default () =>
24
- Component('RouterView', {
25
- template: `
26
- <Element w="100%" height="100%"></Element>
27
- `,
28
- state() {
29
- return {
30
- activeView: null,
31
- }
32
- },
33
- hooks: {
34
- ready() {
35
- hashchangeHandler = () => Router.navigate.apply(this)
36
- Router.navigate.apply(this)
37
- window.addEventListener('hashchange', hashchangeHandler)
38
- },
39
- destroy() {
40
- window.removeEventListener('hashchange', hashchangeHandler, false)
41
- },
42
- focus() {
43
- this.activeView && this.activeView.$focus()
44
- },
45
- },
46
- input: {
47
- back(e) {
48
- const navigating = Router.back.call(this)
49
- if (navigating === false) {
50
- this.parent.$focus(e)
51
- }
52
- },
53
- },
54
- })
@@ -1,58 +0,0 @@
1
- /*
2
- * Copyright 2023 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
-
18
- import Component from '../component.js'
19
-
20
- import symbols from '../lib/symbols.js'
21
-
22
- export default () =>
23
- Component('Sprite', {
24
- template: `
25
- <Element w="100%" h="100%" :texture="$texture" :color="$color" />
26
- `,
27
- props: ['image', 'map', 'frame', 'color'],
28
- state() {
29
- return {
30
- spriteTexture: null,
31
- }
32
- },
33
- computed: {
34
- texture() {
35
- const options =
36
- 'frames' in this.map
37
- ? Object.assign({}, this.map.defaults || {}, this.map.frames[this.frame])
38
- : this.map[this.frame]
39
-
40
- if (this.spriteTexture !== null && options) {
41
- return this[symbols.renderer]().createTexture('SubTexture', {
42
- texture: this.spriteTexture,
43
- x: options.x,
44
- y: options.y,
45
- width: options.w,
46
- height: options.h,
47
- })
48
- }
49
- },
50
- },
51
- hooks: {
52
- ready() {
53
- this.spriteTexture = this[symbols.renderer]().createTexture('ImageTexture', {
54
- src: this.image,
55
- })
56
- },
57
- },
58
- })
@@ -1,28 +0,0 @@
1
- /*
2
- * Copyright 2024 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
-
18
- import Circle from './Circle.js'
19
- import RouterView from './RouterView.js'
20
- import Sprite from './Sprite.js'
21
- import FPScounter from './FPScounter.js'
22
-
23
- export default () => ({
24
- Circle: Circle(),
25
- RouterView: RouterView(),
26
- Sprite: Sprite(),
27
- FPScounter: FPScounter(),
28
- })