Skip to content

Commit 1ebbc6d

Browse files
Merge branch 'master' into fix/VideoTectureIssue
2 parents f2494a5 + 242a5b8 commit 1ebbc6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2668
-3912
lines changed

CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,57 @@
11
# Changelog
22

3+
## v4.6.0
4+
5+
*16 aug 2021*
6+
7+
- Added context to Pin plugin
8+
- Added option to overwrite the font loader from platform
9+
- Added cleanup of App fonts on app close
10+
- Fixed initial focus bug
11+
- Added storeSameHash flag to accepted config flags of Router
12+
- Fixed getQueryStringParams() using active hash in Router
13+
14+
## v4.5.0
15+
16+
*12 july 2021*
17+
18+
- Router updates
19+
- Added `getQueryStringParams()`-method to public api
20+
- Fixed returning correct querystring params if bootcomponent is configured
21+
- Fixed restoring state on pages flagged as keep alive
22+
- Fixed initialization of Pin plugin
23+
- Full rewrite of documentation 🎉
24+
- Updated several NPM dependencies with (security) patches
25+
26+
## v4.4.0
27+
28+
*18 june 2021*
29+
30+
- Router updates
31+
- Added showing loading page between shared instances with `on()` provider
32+
- Fixed wrong historyState object on shared instance
33+
- Fixed hash to route mismatch on hash with trailing slash
34+
- Fixed showing bootPage before unknown hash
35+
- Fixed focus issues with shared state on routes with same page type
36+
- Fixed memoryleak on shared routes with lazyCreate disabled
37+
38+
39+
## v4.3.3
40+
41+
*7 may 2021*
42+
43+
- Removed Error being thrown in Language plugin when using default language as a fallback
44+
## v4.3.2
45+
46+
*5 may 2021*
47+
48+
- Fixed error with `null`-values in Settings
49+
50+
## v4.3.1
51+
52+
*26 april 2021*
53+
54+
- Added uid to payload to billing server in Purchase plugin
355
## v4.3.0
456

557
*16 april 2021*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ help you out on our [Discourse Forum](https://forum.lightningjs.io/) on [Lightni
2121

2222
## Contributing
2323

24-
The Lightning-SDK is an open course project. If you want to contribute to it, please consider the following:
24+
The Lightning-SDK is an open source project. If you want to contribute to it, please consider the following:
2525

2626
- the **master** branch is the latest stable release
2727
- the **dev** branch is used for upcoming releases

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- [Storage](/plugins/storage.md)
66
- [Settings](/plugins/settings.md)
77
- [Log](/plugins/log.md)
8+
- [Metadata](/plugins/metadata.md)
89
- [Metrics](/plugins/metrics.md)
910
- [Metadata](/plugins/metadata.md)
1011
- [Profile](/plugins/profile.md)

docs/changelog.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,57 @@
11
# Changelog
22

3+
## v4.6.0
4+
5+
*16 aug 2021*
6+
7+
- Added context to Pin plugin
8+
- Added option to overwrite the font loader from platform
9+
- Added cleanup of App fonts on app close
10+
- Fixed initial focus bug
11+
- Added storeSameHash flag to accepted config flags of Router
12+
- Fixed getQueryStringParams() using active hash in Router
13+
14+
## v4.5.0
15+
16+
*12 july 2021*
17+
18+
- Router updates
19+
- Added `getQueryStringParams()`-method to public api
20+
- Fixed returning correct querystring params if bootcomponent is configured
21+
- Fixed restoring state on pages flagged as keep alive
22+
- Fixed initialization of Pin plugin
23+
- Full rewrite of documentation 🎉
24+
- Updated several NPM dependencies with (security) patches
25+
26+
## v4.4.0
27+
28+
*18 june 2021*
29+
30+
- Router updates
31+
- Added showing loading page between shared instances with `on()` provider
32+
- Fixed wrong historyState object on shared instance
33+
- Fixed hash to route mismatch on hash with trailing slash
34+
- Fixed showing bootPage before unknown hash
35+
- Fixed focus issues with shared state on routes with same page type
36+
- Fixed memoryleak on shared routes with lazyCreate disabled
37+
38+
39+
## v4.3.3
40+
41+
*7 may 2021*
42+
43+
- Removed Error being thrown in Language plugin when using default language as a fallback
44+
## v4.3.2
45+
46+
*5 may 2021*
47+
48+
- Fixed error with `null`-values in Settings
49+
50+
## v4.3.1
51+
52+
*26 april 2021*
53+
54+
- Added uid to payload to billing server in Purchase plugin
355
## v4.3.0
456

557
*16 april 2021*

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The Lightning CLI provides a set of development tools, that enable you to:
1212

1313
Install the Lightning-CLI (globally):
1414

15-
```
15+
```js
1616
npm install -g @lightningjs/cli
1717
```
1818

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lightningjs/sdk",
3-
"version": "4.3.0",
3+
"version": "4.5.0",
44
"license": "Apache-2.0",
55
"scripts": {
66
"postinstall": "node ./scripts/postinstall.js",

docs/plugins/audioplayer.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/plugins/colors.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Colors
2+
3+
The Colors plugin is intended primarily for storing colors so that you can easily access them anywhere in your project, without the need to remember the actual color code or ARGB code. The plugin calculates the desired color and returns it in ARGB format.
4+
5+
The plugin comes with 8 standard colors: white, black, red, green, blue, yellow, cyan and magenta.
6+
7+
## Usage
8+
9+
If you want to use the Colors plugin, import it from the Lightning SDK:
10+
11+
```js
12+
import { Colors } from '@lightningjs/sdk'
13+
```
14+
15+
### Loading on Boot
16+
17+
You can automatically load and initialize the Colors plugin when your App boots, by specifying the `static` method `colors()` on the App class in the file **src/App.js**.
18+
19+
With the `colors` method, you can return a boolean *true*, an object or a string:
20+
21+
```js
22+
export default class App extends Lightning.Component {
23+
static colors() {
24+
//default
25+
return true
26+
//object
27+
return {
28+
background: '#c9deff',
29+
focus: '#276ee5'
30+
}
31+
//string
32+
return 'my/custom/colors-file.json'
33+
}
34+
}
35+
```
36+
37+
### Defining the Colors File
38+
39+
With the default and *string* option during boot, the Colors plugin expects a JSON file, named **colors.json**. (Or another JSON file at a custom location defined with the string option.) This JSON file should look like the following:
40+
41+
```json
42+
{
43+
"background": "#c9deff",
44+
"focus": "#276EE5"
45+
}
46+
```
47+
48+
### Retrieving Colors
49+
50+
To retrieve a color from the Colors plugin, you simply have to import `Colors` into your source file and use the following function to get the color. For example:
51+
52+
```js
53+
Colors('white').get()
54+
```
55+
56+
### Adjusting Color Values
57+
58+
The Colors plugin also enables you to adjust the values of a specific color before retrieving it.
59+
60+
#### Alpha
61+
If you want your color to have some opacity / alpha, you can use the following code:
62+
63+
```js
64+
Colors('red').alpha(0.4).get()
65+
```
66+
67+
The parameter of the `alpha` function expects a value with between 0 and 1.
68+
69+
#### Hue Value
70+
You can adjust the Hue value of your color using the following code:
71+
72+
```js
73+
Colors('red').hue(120).get()
74+
```
75+
76+
The parameter of the `hue` function expects a value between 0 and 360.
77+
78+
#### Lightness
79+
You can adjust the lightness of your color using the following code:
80+
81+
```js
82+
Colors('green').lightness(0.3).get()
83+
```
84+
85+
The parameter of the `lightness` function expects a value between 0 and 1.
86+
87+
#### Saturation
88+
You can adjust the saturation of your color using the following code:
89+
90+
```js
91+
Colors('blue').saturation(0.3).get()
92+
```
93+
94+
The parameter of the `saturation` function expects a value between 0 and 1.
95+
96+
#### Lighter
97+
You can also make your color lighter using the following code:
98+
99+
```js
100+
Colors('red').lighter(0.3).get()
101+
```
102+
103+
The `lighter` function takes the current `Lightness` value and changes this value based on the parameter used.
104+
105+
The parameter of the `lighter` function expects a value between 0 and 1.
106+
107+
#### Darker
108+
Similarly, you can make your color darker using the following code:
109+
110+
```js
111+
Colors('red').darker(0.3).get()
112+
```
113+
114+
The `darker` function takes the current `Brightness` value and changes this value based on the parameter.
115+
116+
The parameter of the `lighter` function expects a value between 0 and 1.
117+
118+
#### Mixing
119+
If you want to mix two different colors, you can use the `mix` function.
120+
121+
```js
122+
Colors('cyan').mix(Colors('magenta').get(), 0.5).get()
123+
```
124+
125+
The first parameter of this function can be a stored color or an ARGB color.
126+
127+
The second parameter is the mixing percentage. We normalized this percentage to a value from 0 to 1.
128+
129+
### Chaining
130+
131+
The Colors plugin also enables you to chain functions. For example, making a specific color darker and give it a certain opacity:
132+
133+
```js
134+
Colors('red').darker(0.2).alpha(0.8).get()
135+
```

docs/plugins/fpscounter.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# FPS counter
1+
# FPS Counter
22

3-
Frames per second (FPS) is an important measure for the performance of your App. A higher FPS indicates a smoother experience.
4-
When validating an App on a certain platform it's useful to get an indication of the FPS score.
3+
The number of *Frames per second (FPS)* is an important measure for the performance of your App. The higher the FPS, the smoother the experience. When you are validating your App on a certain platform, it is useful to get an indication of the *FPS score*.
54

6-
The SDK contains a built-in **FPS counter** that can be turned on or off via the [Platform Setting](/plugins/settings?id=platform) `showFps` in `settings.json`.
5+
The SDK contains a built-in *FPS counter* that can be enabled or disabled via the [Platform Setting](settings.md#platform-settings) `showFps` in `settings.json`. When it is enabled, a *real-time* counter with the current FPS will be displayed as an overlay in the top left corner of your App.
76

8-
When enabled a _real-time_ counter with the current FPS will be displayed as an overlay in the top left corner of the App.
7+
## Advanced Configuration
98

10-
## Advanced configuration
9+
If you need more control over the behavior of the FPS counter, you can pass an *object* that contains one or more of the following configuration options (instead of passing only a `boolean`):
1110

12-
If you need more control over the behaviour of the FPS counter, you can pass an `object` with more configuration instead of a `boolean`.
13-
14-
- **interval** - specifies the refresh rate in miliseconds (defaults to `500`)
15-
- **log** - whether to _also_ log the calculated FPS value to the console (defaults to `false`)
16-
- **threshold** - minimal difference between FPS values to display / log (defaults to `1`)
11+
| Name | Default | Description |
12+
|---|---|---|
13+
| `interval` | 500 | Refresh rate in milliseconds |
14+
| `log` | false | Indicates whether or not to *also* log the calculated FPS value to the console |
15+
| `threshold` | 1 | Minimum difference between FPS values to display / log |
1716

1817
```json
1918
"showFps": {

0 commit comments

Comments
 (0)