@lightningjs/blits 2.0.0-beta.9 → 2.0.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/index.d.ts +60 -30
- package/package.json +5 -6
- package/scripts/lint.js +17 -0
- package/scripts/prepublishOnly.js +2 -2
- package/scripts/prepush.js +4 -6
- package/src/application.js +1 -1
- package/src/components/Circle.js +0 -2
- package/src/components/FPScounter.js +0 -2
- package/src/components/RouterView.js +0 -2
- package/src/components/Sprite.js +0 -2
- package/src/constants.js +17 -0
- package/src/engine.js +17 -0
- package/src/engines/L3/element.js +0 -6
- package/src/engines/L3/fontLoader.js +17 -0
- package/src/engines/L3/index.js +17 -0
- package/src/engines/L3/shaderLoader.js +17 -0
- package/src/engines/index.js +17 -0
- package/src/helpers/fetchJson.js +4 -6
- package/src/lib/lifecycle.js +2 -2
- package/src/lib/reactivityguard/computedprops.js +27 -13
- package/src/lib/symbols.js +17 -0
- package/src/lib/utils.js +17 -0
- package/src/plugin.js +17 -0
- package/src/plugins/storage/localCookie.js +4 -6
- package/vite/inject-dev-config.js +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v2.0.0
|
|
4
|
+
|
|
5
|
+
_20 mar 2026_
|
|
6
|
+
|
|
7
|
+
**Blits v2 as part of the Lightning 3.1 release**
|
|
8
|
+
|
|
9
|
+
- Upgraded to Lightning renderer v3
|
|
10
|
+
- Prefixed built-in variables with `$` (i.e. `hasFocus` => `$hasFocus`)
|
|
11
|
+
- Changed array based props to object based props
|
|
12
|
+
- Removed several deprecated methods and variables (`focus`, `select`, `trigger`, `wordwrap`, `width`, `height`)
|
|
13
|
+
- Removed `effects` attribute and replaced for `border`, `rounded` and `shadow`
|
|
14
|
+
- Changed handling of props with the same name as know Element attributes
|
|
15
|
+
- Removed MSDF font generator as a blits dependency
|
|
16
|
+
- Updated key mapping to rely only on `keyCode`
|
|
17
|
+
|
|
18
|
+
|
|
3
19
|
## v1.51.0
|
|
4
20
|
|
|
5
21
|
_04 mar 2026_
|
package/index.d.ts
CHANGED
|
@@ -401,9 +401,9 @@ declare module '@lightningjs/blits' {
|
|
|
401
401
|
readonly $hasFocus: boolean,
|
|
402
402
|
|
|
403
403
|
/**
|
|
404
|
-
* Parent component instance. Undefined for the root Application component
|
|
404
|
+
* Parent component instance. Undefined for the root Application component (destroyed case not modeled).
|
|
405
405
|
*/
|
|
406
|
-
readonly $parent: ComponentBase |
|
|
406
|
+
readonly $parent: ComponentBase | undefined,
|
|
407
407
|
|
|
408
408
|
/**
|
|
409
409
|
* Indicates whether the component currently is hovered
|
|
@@ -544,6 +544,20 @@ declare module '@lightningjs/blits' {
|
|
|
544
544
|
}) => void
|
|
545
545
|
}
|
|
546
546
|
|
|
547
|
+
/**
|
|
548
|
+
* Context type for the root Application: no parent.
|
|
549
|
+
*/
|
|
550
|
+
export interface ApplicationBase extends Omit<ComponentBase, '$parent'> {
|
|
551
|
+
readonly $parent: undefined
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Context type for Components (Blits.Component): always has a parent when mounted. Destroyed case is not modeled.
|
|
556
|
+
*/
|
|
557
|
+
export interface ChildComponentBase extends Omit<ComponentBase, '$parent'> {
|
|
558
|
+
readonly $parent: ComponentBase
|
|
559
|
+
}
|
|
560
|
+
|
|
547
561
|
/**
|
|
548
562
|
* Prop object
|
|
549
563
|
*/
|
|
@@ -587,7 +601,14 @@ declare module '@lightningjs/blits' {
|
|
|
587
601
|
S,
|
|
588
602
|
M,
|
|
589
603
|
C
|
|
590
|
-
> = ThisType<Readonly<InferProps<P>> & S & M & Readonly<C> &
|
|
604
|
+
> = ThisType<Readonly<InferProps<P>> & S & M & Readonly<C> & ChildComponentBase>
|
|
605
|
+
|
|
606
|
+
export type ApplicationContext<
|
|
607
|
+
P extends Record<string, any>,
|
|
608
|
+
S,
|
|
609
|
+
M,
|
|
610
|
+
C
|
|
611
|
+
> = ThisType<Readonly<InferProps<P>> & S & M & Readonly<C> & ApplicationBase>
|
|
591
612
|
|
|
592
613
|
export interface ComponentConfig<P extends Props = {}, S, M, C, W> {
|
|
593
614
|
components?: {
|
|
@@ -645,7 +666,7 @@ declare module '@lightningjs/blits' {
|
|
|
645
666
|
* }
|
|
646
667
|
* ```
|
|
647
668
|
*/
|
|
648
|
-
state?: (this: InferProps<P
|
|
669
|
+
state?: (this: Readonly<InferProps<P>> & ChildComponentBase) => S;
|
|
649
670
|
/**
|
|
650
671
|
* Methods for abstracting more complex business logic into separate function
|
|
651
672
|
*/
|
|
@@ -716,32 +737,41 @@ declare module '@lightningjs/blits' {
|
|
|
716
737
|
backNavigation?: boolean
|
|
717
738
|
}
|
|
718
739
|
|
|
719
|
-
export type ApplicationConfig<P extends Props, S, M, C, W> =
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
740
|
+
export type ApplicationConfig<P extends Props, S, M, C, W> = Omit<
|
|
741
|
+
ComponentConfig<P, S, M, C, W>,
|
|
742
|
+
'hooks' | 'methods' | 'input' | 'computed' | 'watch' | 'state'
|
|
743
|
+
> & {
|
|
744
|
+
hooks?: Hooks & ApplicationContext<P, S, M, C>
|
|
745
|
+
methods?: M & ApplicationContext<P, S, M, C>
|
|
746
|
+
input?: Input & ApplicationContext<P, S, M, C>
|
|
747
|
+
computed?: C & ApplicationContext<P, S, M, C>
|
|
748
|
+
watch?: W & ApplicationContext<P, S, M, C>
|
|
749
|
+
state?: (this: Readonly<InferProps<P>> & ApplicationBase) => S
|
|
750
|
+
} & (
|
|
751
|
+
| {
|
|
752
|
+
/**
|
|
753
|
+
* Router Configuration
|
|
754
|
+
*/
|
|
755
|
+
router?: RouterConfig<P, S, M, C>
|
|
756
|
+
routes?: never
|
|
757
|
+
}
|
|
758
|
+
| {
|
|
759
|
+
router?: never
|
|
760
|
+
/**
|
|
761
|
+
* Routes definition
|
|
762
|
+
*
|
|
763
|
+
* @example
|
|
764
|
+
*
|
|
765
|
+
* ```js
|
|
766
|
+
* routes: [
|
|
767
|
+
* { path: '/', component: Home },
|
|
768
|
+
* { path: '/details', component: Details },
|
|
769
|
+
* { path: '/account', component: Account },
|
|
770
|
+
* ]
|
|
771
|
+
* ```
|
|
772
|
+
*/
|
|
773
|
+
routes?: Route[]
|
|
774
|
+
}
|
|
745
775
|
)
|
|
746
776
|
|
|
747
777
|
export interface Transition {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightningjs/blits",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Blits: The Lightning 3 App Development Framework",
|
|
5
5
|
"bin": "bin/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -33,10 +33,9 @@
|
|
|
33
33
|
"./components": "./src/components/FPScounter.js"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
|
-
"test": "c8
|
|
37
|
-
"test:
|
|
38
|
-
"test:run": "node -r global-jsdom/register
|
|
39
|
-
"test:run:failures": "node -r global-jsdom/register ./node_modules/.bin/tape '{,!(node_modules|packages)/**/}*.test.js' | tap-filter test-fail | tap-diff",
|
|
36
|
+
"test": "c8 npm run test:run | tap-diff",
|
|
37
|
+
"test:run": "node -r global-jsdom/register node_modules/tape/bin/tape \"scripts/**/*.test.js\" \"src/**/*.test.js\"",
|
|
38
|
+
"test:run:failures": "node -r global-jsdom/register node_modules/tape/bin/tape \"scripts/**/*.test.js\" \"src/**/*.test.js\" | tap-filter test-fail | tap-diff",
|
|
40
39
|
"lint": "node scripts/lint.js",
|
|
41
40
|
"lint:fix": "node scripts/lint.js fix",
|
|
42
41
|
"prepublishOnly": "node scripts/prepublishOnly.js",
|
|
@@ -76,7 +75,7 @@
|
|
|
76
75
|
"tape": "^5.5.0"
|
|
77
76
|
},
|
|
78
77
|
"dependencies": {
|
|
79
|
-
"@lightningjs/renderer": "3.0.0
|
|
78
|
+
"@lightningjs/renderer": "^3.0.0",
|
|
80
79
|
"magic-string": "^0.30.21"
|
|
81
80
|
},
|
|
82
81
|
"repository": {
|
package/scripts/lint.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 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
|
+
|
|
1
18
|
import fg from 'fast-glob'
|
|
2
19
|
import { resolve } from 'path'
|
|
3
20
|
import { fileURLToPath } from 'url'
|
|
@@ -62,8 +62,8 @@ function processFile(filePath) {
|
|
|
62
62
|
const newSource = typeof result === 'object' && result.code ? result.code : result
|
|
63
63
|
fs.writeFileSync(filePath, newSource)
|
|
64
64
|
|
|
65
|
-
// only format the file if it was changed
|
|
66
|
-
if (source !== newSource) {
|
|
65
|
+
// only format the file if it was changed (compiler returns undefined for non-Blits files)
|
|
66
|
+
if (newSource !== undefined && source !== newSource) {
|
|
67
67
|
formatFileWithESLint(filePath)
|
|
68
68
|
}
|
|
69
69
|
}
|
package/scripts/prepush.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2023 Comcast
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the License);
|
|
2
|
+
* Copyright 2025 Comcast Cable Communications Management, LLC
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
4
|
* you may not use this file except in compliance with the License.
|
|
9
5
|
* You may obtain a copy of the License at
|
|
10
6
|
*
|
|
@@ -15,6 +11,8 @@
|
|
|
15
11
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
12
|
* See the License for the specific language governing permissions and
|
|
17
13
|
* limitations under the License.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
18
16
|
*/
|
|
19
17
|
|
|
20
18
|
import { execSync } from 'child_process'
|
package/src/application.js
CHANGED
|
@@ -78,7 +78,7 @@ const Application = (config) => {
|
|
|
78
78
|
keyDownHandler = async (e) => {
|
|
79
79
|
const currentTime = performance.now()
|
|
80
80
|
|
|
81
|
-
const key = keyMap[e.
|
|
81
|
+
const key = keyMap[e.keyCode] || e.keyCode
|
|
82
82
|
const sameKey = lastInputKey === key
|
|
83
83
|
lastInputKey = key
|
|
84
84
|
// execute immediately when no throttle is specified or event is internal (bubbled up by focus manager)
|
package/src/components/Circle.js
CHANGED
package/src/components/Sprite.js
CHANGED
package/src/constants.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
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
|
+
|
|
1
18
|
export const DEFAULT_HOLD_TIMEOUT_MS = 50
|
|
2
19
|
|
|
3
20
|
export const DEFAULT_KEYMAP = {
|
package/src/engine.js
CHANGED
|
@@ -1 +1,18 @@
|
|
|
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
|
+
|
|
1
18
|
export { L3 as default } from './engines/index.js'
|
|
@@ -222,9 +222,6 @@ const propsTransformer = {
|
|
|
222
222
|
this.element.component[symbols.holder].set('w', parsed)
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
|
-
set width(v) {
|
|
226
|
-
this.w = v
|
|
227
|
-
},
|
|
228
225
|
set h(v) {
|
|
229
226
|
const parsed = parsePercentage.call(this, v, 'h')
|
|
230
227
|
this.props['h'] = parsed
|
|
@@ -236,9 +233,6 @@ const propsTransformer = {
|
|
|
236
233
|
this.element.component[symbols.holder].set('h', parsed)
|
|
237
234
|
}
|
|
238
235
|
},
|
|
239
|
-
set height(v) {
|
|
240
|
-
this.h = v
|
|
241
|
-
},
|
|
242
236
|
set x(v) {
|
|
243
237
|
this.props['x'] = parsePercentage.call(this, v, 'w')
|
|
244
238
|
},
|
|
@@ -1,3 +1,20 @@
|
|
|
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
|
+
|
|
1
18
|
import Settings from '../../settings.js'
|
|
2
19
|
import { renderer } from './launch.js'
|
|
3
20
|
|
package/src/engines/L3/index.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
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
|
+
|
|
1
18
|
import Element from './element.js'
|
|
2
19
|
import Launch from './launch.js'
|
|
3
20
|
|
|
@@ -1,3 +1,20 @@
|
|
|
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
|
+
|
|
1
18
|
import Settings from '../../settings.js'
|
|
2
19
|
import { renderer } from './launch.js'
|
|
3
20
|
import * as webglShaders from '@lightningjs/renderer/webgl/shaders'
|
package/src/engines/index.js
CHANGED
|
@@ -1 +1,18 @@
|
|
|
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
|
+
|
|
1
18
|
export { default as L3 } from './L3/index.js'
|
package/src/helpers/fetchJson.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2020 Metrological
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the License);
|
|
2
|
+
* Copyright 2024 Comcast Cable Communications Management, LLC
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
4
|
* you may not use this file except in compliance with the License.
|
|
9
5
|
* You may obtain a copy of the License at
|
|
10
6
|
*
|
|
@@ -15,6 +11,8 @@
|
|
|
15
11
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
12
|
* See the License for the specific language governing permissions and
|
|
17
13
|
* limitations under the License.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
18
16
|
*/
|
|
19
17
|
|
|
20
18
|
export default (file) => {
|
package/src/lib/lifecycle.js
CHANGED
|
@@ -31,8 +31,8 @@ const states = [
|
|
|
31
31
|
'ready', // fired when component instantiated, reactivity setup done and template spawned
|
|
32
32
|
'focus', // fired when receiving focus (can occur multiple times)
|
|
33
33
|
'unfocus', // fired when losing focus (can occur multiple times)
|
|
34
|
-
'hover', // fired when
|
|
35
|
-
'unhover', // fired when
|
|
34
|
+
'hover', // fired when pointer enters the component (mouse support only; can occur multiple times)
|
|
35
|
+
'unhover', // fired when pointer leaves the component (mouse support only; can occur multiple times)
|
|
36
36
|
'destroy', // fired when component is destroyed and removed
|
|
37
37
|
'attach', // fired when entering the viewport margin and attached to the render tree
|
|
38
38
|
'detach', // fired when leaving the viewport margin and detached from the render tree
|
|
@@ -293,24 +293,38 @@ export default (code) => {
|
|
|
293
293
|
const extractThisReferences = (funcBody) => {
|
|
294
294
|
const thisRefs = new Set()
|
|
295
295
|
|
|
296
|
-
//
|
|
297
|
-
const refRegex = /this
|
|
296
|
+
// Match full property chains, including optional chaining
|
|
297
|
+
const refRegex = /this(?:\.[$\w]+|\?\.[$\w]+)+/g
|
|
298
298
|
let refMatch
|
|
299
299
|
|
|
300
300
|
while ((refMatch = refRegex.exec(funcBody)) !== null) {
|
|
301
301
|
const fullRef = refMatch[0]
|
|
302
302
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
303
|
+
const segmentRegex = /(\??\.)([$\w]+)/g
|
|
304
|
+
let segMatch
|
|
305
|
+
let lastValidRef = 'this'
|
|
306
|
+
|
|
307
|
+
while ((segMatch = segmentRegex.exec(fullRef.substring(4))) !== null) {
|
|
308
|
+
const candidate = 'this' + fullRef.substring(4, 4 + segMatch.index + segMatch[0].length)
|
|
309
|
+
const afterCandidate = funcBody.substring(refMatch.index + candidate.length)
|
|
310
|
+
if (afterCandidate.match(/^\s*\(/)) {
|
|
311
|
+
break
|
|
312
|
+
}
|
|
313
|
+
lastValidRef = candidate
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if (lastValidRef !== 'this') {
|
|
317
|
+
thisRefs.add(lastValidRef)
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Remove shorter prefixes when a longer chain already covers them
|
|
322
|
+
for (const ref of [...thisRefs]) {
|
|
323
|
+
for (const other of thisRefs) {
|
|
324
|
+
if (other !== ref && other.startsWith(ref + '.')) {
|
|
325
|
+
thisRefs.delete(ref)
|
|
326
|
+
break
|
|
327
|
+
}
|
|
314
328
|
}
|
|
315
329
|
}
|
|
316
330
|
|
package/src/lib/symbols.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
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
|
+
|
|
1
18
|
/**
|
|
2
19
|
* Symbol registry for internal framework properties and generated code.
|
|
3
20
|
*
|
package/src/lib/utils.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
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
|
+
|
|
1
18
|
/**
|
|
2
19
|
* A mapping of common screen resolution names to their scale factors relative to 1080p (Full HD).
|
|
3
20
|
*
|
package/src/plugin.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
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
|
+
|
|
1
18
|
import log from './plugins/log.js'
|
|
2
19
|
|
|
3
20
|
export const plugins = {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2019 Metrological
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the License);
|
|
2
|
+
* Copyright 2025 Comcast Cable Communications Management, LLC
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
4
|
* you may not use this file except in compliance with the License.
|
|
9
5
|
* You may obtain a copy of the License at
|
|
10
6
|
*
|
|
@@ -15,6 +11,8 @@
|
|
|
15
11
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
12
|
* See the License for the specific language governing permissions and
|
|
17
13
|
* limitations under the License.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
18
16
|
*/
|
|
19
17
|
|
|
20
18
|
// LocalStorage and Cookie storage library
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 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
|
+
|
|
1
18
|
export default function injectDevFlag() {
|
|
2
19
|
return {
|
|
3
20
|
name: 'inject-dev-config',
|