@lightningjs/blits 0.8.1 → 0.9.1

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 (47) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/boilerplate/js/default/src/index.js +2 -8
  3. package/docs/README.md +0 -21
  4. package/docs/_sidebar.md +25 -13
  5. package/docs/built-in/directives.md +44 -0
  6. package/docs/{component_state.md → components/component_state.md} +37 -5
  7. package/docs/components/computed_properties.md +48 -0
  8. package/docs/{lifecycle_events.md → components/lifecycle_events.md} +4 -2
  9. package/docs/components/methods.md +47 -0
  10. package/docs/components/props.md +58 -0
  11. package/docs/{user_input.md → components/user_input.md} +31 -26
  12. package/docs/components/utilities.md +4 -0
  13. package/docs/components/watchers.md +36 -0
  14. package/docs/essentials/application_root.md +21 -0
  15. package/docs/{components.md → essentials/components.md} +17 -5
  16. package/docs/{displaying_images.md → essentials/displaying_images.md} +7 -7
  17. package/docs/essentials/displaying_text.md +77 -0
  18. package/docs/{element_attributes.md → essentials/element_attributes.md} +17 -12
  19. package/docs/essentials/template_syntax.md +85 -0
  20. package/docs/getting_started/file_structure.md +61 -0
  21. package/docs/getting_started/getting_started.md +47 -0
  22. package/docs/{introduction.md → getting_started/intro.md} +2 -1
  23. package/docs/sidebar.json +70 -26
  24. package/docs/transitions_animations/transitions.md +132 -0
  25. package/package.json +2 -2
  26. package/src/component.js +12 -3
  27. package/src/element.js +8 -5
  28. package/src/fontLoader.js +20 -21
  29. package/src/launch.d.ts +22 -7
  30. package/src/launch.js +13 -2
  31. package/src/lib/codegenerator/generator.js +8 -7
  32. package/src/lib/codegenerator/generator.test.js +11 -16
  33. package/src/lib/hooks.js +7 -7
  34. package/src/lib/lifecycle.js +3 -2
  35. package/src/lib/reactivity/effect.js +23 -0
  36. package/src/lib/reactivity/reactive.js +59 -46
  37. package/src/lib/setup/base.js +18 -10
  38. package/src/lib/setup/state.js +1 -1
  39. package/src/lib/symbols.js +3 -0
  40. package/src/router/router.js +6 -6
  41. package/boilerplate/js/default/src/fontloader.js +0 -4
  42. package/docs/computed_properties.md +0 -18
  43. package/docs/getting_started.md +0 -40
  44. package/docs/props.md +0 -46
  45. package/docs/template_syntax.md +0 -65
  46. package/docs/watchers.md +0 -38
  47. /package/docs/{text-to-speech-announcer.md → plugins/text-to-speech-announcer.md} +0 -0
@@ -2,12 +2,11 @@
2
2
 
3
3
  ## Displaying Images
4
4
 
5
-
6
5
  Now that we've covered the basics of creating Elements, as well as styling and positioning them, it's time to move away from these boring rectangles and explore how you can incorporate _images_ into your App.
7
6
 
8
7
  In Blits is very easy to display an image. Simply add the `src` attribute to an Element, specifying the image's location.
9
8
 
10
- For local images, make sure to place them in the `public` folder (e.g., `public/assets/background.jpg` or `public/images/logo.png`) and refer to them with a _relative_ path (omitting the `public` folder as root).
9
+ For local images, make sure to place them in the `public` folder of your App (e.g., `public/assets/background.jpg` or `public/images/logo.png`) and refer to them with a _relative_ path (but omitting the `public` folder as root).
11
10
 
12
11
  Remote images are also supported and can be linked directly (e.g., `http://mycdn.com/artists/jimi_hendrix/woodstock.jpg`).
13
12
 
@@ -18,13 +17,15 @@ Remote images are also supported and can be linked directly (e.g., `http://mycdn
18
17
 
19
18
  ### Sizing and Scaling
20
19
 
21
- Make sure to give your Element a width (`w` ) and a height (`h`) attribute. Blits will scale the image to fit these exact dimensions.
20
+ Make sure to give your Element a width (`w` ) and a height (`h`) attribute. Images will _not_ be rendered if they don't have both attributes present. The Lightning renderer will scale the image to fit these exact dimensions
22
21
 
23
- For the best performance, it's important to keep your source images as small as possible. If you're displaying an image at `200px x 200px`, make sure the image is exactly that size or _smaller_. The latter option may lead to some quality loss.
22
+ For the best performance, it's important to keep your source images as small as possible. If you're displaying an image at `200px x 200px`, make sure the image is exactly that size or _smaller_. The latter option may lead to some quality loss, but can positively impact the overall performance of your App.
24
23
 
25
24
  ### Colorization
26
25
 
27
- You also have the option to _colorize_ an image on the fly. Just add a `color` attribute to the Element with a `src` attribute. You can use a single color, or apply a gradient. By default all Elements with a `src` attribute get the a solid white background, which corresponds with the actual colors of the image.
26
+ You also have the option to _colorize_ an image on the fly. Just add a `color` attribute to the Element with a `src` attribute. You can use a single color, or apply a gradient.
27
+
28
+ By default all Elements with a `src` attribute get the a solid white background, with the result that the actual colors of the image will be shown.
28
29
 
29
30
  ```xml
30
31
  <Element
@@ -47,7 +48,7 @@ You can use this, for example, to only make something visible once an image is f
47
48
 
48
49
  > Note how events are prefixed with a `@` sign.
49
50
 
50
- Considering the template above, in the `methods` key of your Component configuration object, you would then do something like:
51
+ Considering the template above you would do something like the following in the `methods` key of your Component configuration object:
51
52
 
52
53
  ```js
53
54
  {
@@ -66,4 +67,3 @@ Considering the template above, in the `methods` key of your Component configura
66
67
  ```
67
68
 
68
69
  The `loaded` event receives the images dimensions as it's argument and the `error` event receives an error message explaining the failure.
69
-
@@ -0,0 +1,77 @@
1
+ # Blits - Lightning 3 App Development Framework
2
+
3
+ ## Displaying Text
4
+
5
+ Besides displaying images, it is also very common to have _texts_ in an App.
6
+
7
+ Blits comes with a built-in `<Text>`-tag for displaying and styling texts in a simple and intuitive way.
8
+
9
+ ```xml
10
+ <Text
11
+ content="Hello world"
12
+ font="ComicSans"
13
+ size="$fontSize"
14
+ :color="$changingColor"
15
+ />
16
+
17
+ ```
18
+ You can use the Text-tag anywhere in your template, without the need to explicitly import and register it in your Component.
19
+
20
+ ### Available attributes on the Text tag
21
+
22
+ The Text-tag accepts the following of attributes:
23
+
24
+ - `content` - the text to be displayed. Can be a hardcoded text, a dynamic value or a reactive value
25
+ - `font` - the font family, defaults to `lato`, or the default font specified in the launch settings
26
+ - `size` - the font size, defaults to `32`
27
+ - `color` - the color to display for the text, defaults to `white` and can be any of the supported Blits color formats (html, hexedecimal or rgb(a))
28
+ - `letterspacing` - letterspacing in pixels, defaults to `0`
29
+ - `align` - the alignment of the text, can be `left`, `right` or `center`, defaults to `left`. Centering text and aligning text to the right requires the `wordwrap` attribute to be set as well.
30
+ - `wordwrap` - the max length of a line of text in pixels, words surpassing this length will be broken and wrapped onto the next line. This atribute is required when aligning center or right
31
+ - `maxlines` - maximum number of lines that will be displayed
32
+ - `maxheight` - maximum height of a text block, lines that don't fit within this height will not be displayed
33
+ - `lineheight` - the spacing between lines in pixels
34
+ - `contain` - the strategy for containing text within the bounds, can be `none` (default), `width` or `both`. In most cases the value of this attribute will automatically be set by Blits based on the other specified attribites
35
+ - `textoverflow` - the suffix to be added when text is cropped due to bounds limits, defaults to `...`
36
+
37
+
38
+ ### SDF and Canvas2d
39
+
40
+ Compared to Lightning 2, texts have improved a lot in Lightning 3, thanks to the SDF (Signed Distance Field) Text renderer.
41
+
42
+ With the SDF text renderer, texts appear a lot _sharper_ on screen. The SDF technique also allows for better scaling of texts, without them becoming blurry - a well known painpoint in Lightning 2 Apps.
43
+
44
+ In general it's recommended to use the SDF text renderer, but Lightning 3 still has a Canvas2d text renderer as a backup, and you can use both text renderers within the same App.
45
+
46
+ ### Using custom fonts
47
+
48
+ The `font`-attribute on the `<Text>`-tag is used define which font family should be used for a certain piece of text.
49
+
50
+ When you create a new Blits app using the available [getting started boilerplate](../getting_started/getting_started.md) you'll be able to use the `lato` (Lato regular) and `raleway` (Raleway ExtraBold) fonts out of the box.
51
+
52
+ But of course you can also use any custom font that you want, to give your App the unique look and feel that fits with the design.
53
+
54
+ Adding is custom font to a Blits App is quite straightforward. First you'll need to place a `.ttf` version of your font in the `public` folder (i.e. `public/fonts/comic-sans.ttf`).
55
+
56
+ Then you'll need to register the custom font in the Launch settings of your app (in `src/index.js`). The `fonts`-key in the settings is an `Array` that specifies all available fonts in your App.
57
+
58
+ Just add a new font object with the necesarry details:
59
+
60
+ ```js
61
+ fonts: [
62
+ // ...
63
+ {
64
+ family: 'ComicSans', // the font name used in your App
65
+ type: 'msdf', // type of text renderer to use (msdf or web)
66
+ file: 'fonts/Comic-Sans.ttf', // location of the ttf file
67
+ },
68
+ // ..
69
+ ],
70
+ ```
71
+
72
+ From this moment on you'll be able to use the font `ComicSans` anywhere in your App:
73
+
74
+ ```xml
75
+ <Text font="ComicSans" content="I'm Comic Sans font!" />
76
+ ```
77
+
@@ -1,10 +1,10 @@
1
1
  # Blits - Lightning 3 App Development Framework
2
2
 
3
- ## Styling and positioning Elements
3
+ ## Supported Element attributes
4
4
 
5
- The core building block of a Blits template is the Element tag. The Element tag corresponds directly to a node in the Lightning 3 Renderer. You can style and position Elements via _attributes_, much like you would do in HTML.
5
+ The core building block of a Blits template is the `<Element>`-tag. The Element tag corresponds directly to a node in the Lightning 3 Renderer. You can style and position Elements via _attributes_, much like you would do in plain HTML.
6
6
 
7
- Blits Elements have a specific set of attributes that can be set, loosely modeled after the properties of a Lightning 3 renderer node. In certain cases Blits provides more developer friendly names or accepts a wider range of values, and transparently takes care of the translation into L3 renderer instructions.
7
+ Blits Elements have a specific set of attributes that can be used. The available attributes are loosely modeled after the properties of a Lightning 3 renderer node. In certain cases Blits provides more developer friendly names or accepts a wider range of values, and transparently takes care of the translation into L3 renderer instructions.
8
8
 
9
9
  ### Positioning and Dimensions
10
10
 
@@ -16,7 +16,7 @@ In order to position and set the dimensions of an Element, the following attribu
16
16
  - `w` - the width of the element in pixels (optionally `width` can be used as an alias)
17
17
  - `h` - the height of the element in pixels (optionally `height` can be used as an alias)
18
18
 
19
- All positioning and dimension related attributes, when not specified, default to `0`.
19
+ All positioning and dimension related attributes, when not specified, will default to `0`.
20
20
 
21
21
  ```xml
22
22
  <Element x="100" y="100" w="800" h="400">
@@ -34,16 +34,17 @@ Besides using values in pixels (i.e. `w="100" h="300"`), you can also specify _p
34
34
  <Element w="42%" h="30%" y="5%" x="1%" color="#075985" />
35
35
  </Element>
36
36
  ```
37
- The percentage specified in `w` and `x` will be calculated as the percentage of the _width_ (`w`) of the parent element.
38
- And the percentage specified in `h` and `y` will use the _height_ (`h`) of the parent element as the base of the percentage calculation.
37
+
38
+ The percentage value specified for `w` and `x` will be calculated as the percentage of the _width_ (`w`) of the parent element.
39
+ And the percentage specified for `h` and `y` will use the _height_ (`h`) of the parent element as the base of the percentage calculation.
39
40
 
40
41
  ### Colors
41
42
 
42
43
  By default Elements have a transparent background color. The `color` attribute can be used to give an Element a color.
43
44
 
44
- For those familiar with Lightning 2: colors have gotten a lot easier with Blits! Under the hood the Lightning 3 renderer still uses the somewhat unfamiliar, but efficient `0xffc0ffee` syntax. In Blits you can specify colors as you are used to in HTML and CSS.
45
+ If you are familiar with Lightning 2: colors have gotten a lot easier with Blits. Under the hood the Lightning 3 renderer still uses the somewhat unfamiliar (but efficient) `0xffc0ffee` syntax. In Blits you can specify colors as you are used to in HTML and CSS.
45
46
 
46
- Blits accepts the following color formats and makes sure that they are mapped in a way the Lightning 3 renderer can understand.
47
+ Blits accepts the following color formats and makes sure that they are converted in a way the Lightning 3 renderer can understand.
47
48
 
48
49
  - hexadecimal (i.e. `#ff4433`)
49
50
  - hexadecimal with an alpha channel (i.e `#55553380`)
@@ -52,7 +53,7 @@ Blits accepts the following color formats and makes sure that they are mapped in
52
53
  - rgba (i.e `rgba(40, 30, 180, 0.5)`)
53
54
  - html color names (i.e. `red`, `blue`, `skyblue`, `tomato`)
54
55
 
55
- HSL and HSLA formats are planned to be added in the future.
56
+ _HSL and HSLA formats are planned to be added in the future._
56
57
 
57
58
  ```xml
58
59
  <Element w="200" h="200" color="#ff4433" />
@@ -69,7 +70,9 @@ HSL and HSLA formats are planned to be added in the future.
69
70
 
70
71
  The color attribute can also be used to specify basic linear gradients.
71
72
 
72
- A linear gradient can be defined by specifying an _object literal_ as the `color` attribute instead of a single color. The object can consist of a mix of `top`, `bottom`, `left`, `right` keys, with the color to use for that side as a value. If a specific side isn't specified, it defaults to `transparent`. Again you can use "normal" notation for the colors (like hexadecimal or rgba) and you are free to mix and match formats.
73
+ A linear gradient can be defined by specifying an _object literal_ as the `color` attribute instead of a single color. The object can consist of a mix of `top`, `bottom`, `left`, `right` keys, with the color to use for that side as a value. If a specific side isn't specified, it defaults to `transparent`.
74
+
75
+ Again, you can use "normal" notation for the colors (like hexadecimal or rgba) and you are free to mix and match formats.
73
76
 
74
77
  ```xml
75
78
  <Element w="200" h="200" color="{top: 'red', bottom: 'blue'}" />
@@ -82,7 +85,7 @@ A linear gradient can be defined by specifying an _object literal_ as the `color
82
85
 
83
86
  The opacity of an Element, can be controlled by setting the `alpha` attribute. This attribute accepts a value between `0` (fully transparent) and `1` (completely visible).
84
87
 
85
- The value of alpha is also being applied recursively to the children of the Element that has its alpha set. If you just want the background color of an Element to be semi-transparent, you should set the alpha channel in the color instead of applying the alpha attribute.
88
+ The value of alpha is also being applied recursively to the children of the Element that has its alpha set. If you just want the background color of an Element to be semi-transparent, you should set the alpha channel in the `color` instead of applying the `alpha` attribute.
86
89
 
87
90
  ```xml
88
91
  <Element w="200" h="200" color="blue" alpha="0.8">
@@ -106,7 +109,7 @@ For scaling an Element the `scale` attribute is used.
106
109
 
107
110
  This attribute either accepts a single numeric value for scaling evenly accross width and height. Or an _object literal_, if you want to apply a different scaling for the `x` and the `y` axis.
108
111
 
109
- The value should start at `0` and the default value is `1`, which means no scaling.
112
+ The value should be higher than `0` and the default value is `1`, which means no scaling.
110
113
 
111
114
  Any value below `1` will scale _down_ the element and values greater than `1` will scale the element _up_.
112
115
 
@@ -152,3 +155,5 @@ In the case where the `x` and `y` values are the same, you can also just supply
152
155
  <Element w="200" h="200" x="800" y="400" pivot="{y: 1}" scale="3" />
153
156
  <Element w="200" h="200" x="800" y="700" pivot="0.9" rotation="42" />
154
157
  ```
158
+
159
+ <!-- ### Clipping -->
@@ -0,0 +1,85 @@
1
+ # Blits - Lightning 3 App Development Framework
2
+
3
+ ## Template syntax
4
+
5
+ Blits uses an easy-to-read _XML-style_ template syntax. The syntax is inspired by frameworks like VueJS, so if you are familiar with Vue, you will probably recognize certain concepts.
6
+
7
+ The `template` key in the _Component configuration object_ is used to specify a string with this XML-like template structure. Templates can often span multiple lines. In those cases it's advisable to use `template literals` (enclosed by backticks).
8
+
9
+ Similar to HTML you can use arguments and nested tags. Self-closing tags and HTML-style comments are also supported in Blits templates.
10
+
11
+ The default tag that can be used a template is the `<Element>` tag. The Element tag corresponds to a node in the Lightning 3 renderer.
12
+
13
+ For each element, there is a set of predefined render properties, such as `x`, `y`, `w`, `color` that define how the element looks and where it is positioned. Detailed information on all the attributes supported by the `<Element>` tag can be found [here](./element_attributes.md).
14
+
15
+ Now let's consider the following template example:
16
+
17
+ ```xml
18
+ <Element x="20" y="20">
19
+ <Element w="100" h="100" x="360" color="#0891b2" />
20
+ <Element w="$width" h="$height" color="$color" />
21
+ <Element :w="$changingWidth" :h="Math.floor($height / 5)" :color="$highlight" />
22
+ </Element>
23
+ ```
24
+
25
+ ### Hardcoded arguments
26
+
27
+ In the template above, you'll observe certain arguments with hardcoded values (i.e. `w="100"` and `color="#0891b2"`).
28
+ You can use hardcoded arguments to configure the parts of your template that you know will never change.
29
+
30
+ ### Dynamic arguments
31
+
32
+ Additionally, some arguments contain a value prefixed with a dollar sign (`$`). These are so called _dynamic_ arguments.
33
+
34
+ The `$`-sign used in a template refers to a (state) variable on the Component. And when the template renders, it automatically populates
35
+ these arguments with dynamic values based on the initial state of your Component.
36
+
37
+ It's important to realize that dynamic arguments are only set _once_. Changing a value used in a dynamic argument, won't be reflected
38
+ on screen. For that you will need to use _reactive_ arguments.
39
+
40
+ ### Reactive arguments
41
+
42
+ If you look at the template example above you'll notice that certain arguments are prefixed with a colon sign (`:`). Prefixing an argument
43
+ with a colon makes it not only dynamic, but also _reactive_.
44
+
45
+ Reactive arguments are set with the initial state value when your component first renders, exactly as a dynamic argument does.
46
+
47
+ The difference is that a _re-render_ of (a portion of) the template will be triggered whenever the referenced value in your Component's internal state changes.
48
+
49
+ This concept of _reactive data binding_ eliminates the need for manual template patching, and allows for a declarative way of programming.
50
+
51
+ Reactive arguments also support _interpolation_. This enables the use of simple JavaScript instructions, such as ternary conditions or basic String and Math manipulations, right inside your template arguments.
52
+
53
+ For more complex logic, it's recommended to abstract this into a [Component method](../components/methods.md) or a [Computed property](../components/computed_properties.md).
54
+
55
+ ## Abstracting template portions to custom components
56
+
57
+ As your template grows in complexity, you may want to orgnize your codebase with custom components, abstracting a complex template into smaller, resuable pieces.
58
+
59
+ When you've abstrated a portion of a template into a separate component, a _Menu_ component for example, you'll first need to `import` the file that contains the Menu component.
60
+
61
+ Next you have to _register_ the imported custom component. The `components`-key in the _configuration object_ is used for this.
62
+
63
+ The `components` key is an _object literal_, where the value is the reference to the custom Blits component and the key will correspond with the _tag_ that can be used in the template to insert the component.
64
+
65
+ Once this is done, the tag (`<Menu>` for example) is available for use in your component's template. You can use the component tag as many times as you want. For each tag a new Component instance will be created.
66
+
67
+ The example below shows how to use a custom `Menu` and `Button` (aliased to `MyButton`) component inside a template.
68
+
69
+ ```js
70
+ import Menu from './components/menu.js'
71
+ import Button from './components/button.js'
72
+
73
+ export default Blits.Component('MyComponent', {
74
+ components: {
75
+ Menu, // makes <Menu /> available for use in the template
76
+ MyButton: Button, // makes Button available as <MyButton /> in the template
77
+ },
78
+ template: `
79
+ <Element>
80
+ <Menu />
81
+ <MyButton />
82
+ </Element>
83
+ `
84
+ })
85
+ ```
@@ -0,0 +1,61 @@
1
+ # Blits - Lightning 3 App Development Framework
2
+
3
+ ## File structure
4
+
5
+ Once you have created a new Blits App using the boilerplate described in the [Getting started](getting_started.md), you should have a project with all the basics you need.
6
+
7
+ Let's review the basic file structure, and take a closer look at the important ones.
8
+
9
+ ### package.json
10
+
11
+ In the root of your newly created app you will obviously find a `package.json` with all the necessary (dev) dependencies.
12
+
13
+ In order to build a Blits based Lightning 3 app, all you need is `@lightningjs/blits` as a dependency. Blits will take care of hooking up the Lightning 3 renderer for you behind the scenes.
14
+
15
+ Feel free to install and import any custom library that your App may need. But always be mindful of the size and impact an external dependency may have - especially when developing for low powered devices (as if often the case with Lightning apps).
16
+
17
+ ### index.html
18
+
19
+ You will also find an `index.html` in the root of your project. This is where the browser will be pointed to in order to launch your Blits App.
20
+
21
+ If you inspect the source you will see some minimal html. The essential parts of the html are the `<div>` where the canvas will be injected into, and the `<script>`-tag that points to the `index.js` of the App.
22
+
23
+ ### public
24
+
25
+ There is also a `public` folder in your project. This folder is used for storing the public assets, such as App images and fonts.
26
+
27
+ During development your assets are loaded directly from this folder. And if you run a production build, the entire `public` folder is copied over to the distributable version.
28
+
29
+ ### src
30
+
31
+ The `src`-folder is where all your custom App code lives.
32
+
33
+ #### index.js
34
+
35
+ `src/index.js` is the entry point of your App. This file imports the Blits `Launch`-method which initializes the App.
36
+
37
+ The `Blits.Launch()`-method accepts 3 parameters:
38
+
39
+ 1) `app` - the root application component
40
+ 2) `target` - the html target to append the canvas to. This can either by an `id` of an html element in `index.html`, or you can pass a reference the html element itself
41
+ 3) `settings` - an `object` with settings
42
+
43
+ #### App.js
44
+
45
+ `src/App.js` is the default file where the root application component lives. It's expected to export a `Blits.Application()`-instance, which is the base component of your App.
46
+
47
+ ### components and pages folder
48
+
49
+ The rest of you App can be built out using components. You are free to organize your components as you wish, but we recommend
50
+ to use a separate file for each component, and place them in the `src/components`-folder.
51
+
52
+ The convention is to start the component file name with a capital letter, matching the name of the component (e.g. `src/components/Loader.js` or `src/components/MenuItem.js`).
53
+
54
+ Feel free to further organize and possibly nest your Component files to your own preferences.
55
+
56
+ Pages in your App are technically just Blits components as well. But to keep thing clear, we often place them in a separate `pages`-folder alongside the `components`-folder (e.g. `src/pages/Home.js` and `src/pages/Details.js`)
57
+
58
+ #### Custom code
59
+
60
+ If your App needs libraries for specific (business) logic that can be shared accross components (such as API calls) you can place them anywhere in your `src` folder. For example in a folder named `src/lib` or `src/api`.
61
+
@@ -0,0 +1,47 @@
1
+ # Blits - Lightning 3 App Development Framework
2
+
3
+ ## Getting Started
4
+
5
+ To get started with Blits, follow these simple steps to set up your development environment and create your first Lightning 3 App.
6
+
7
+ ### Installation
8
+
9
+ 1. Open your terminal or command prompt.
10
+
11
+ 2. Run the following command to start a new Blits Lightning 3 App project:
12
+
13
+ ```bash
14
+ npx @lightningjs/blits@latest
15
+ ```
16
+
17
+ You will be guided through a short series of questions to generate a new project with all the boilerplate code you need to start building your own Lightning 3 App.
18
+
19
+ 3. Navigate to the newly created project directory and install the project dependencies:
20
+
21
+ ```bash
22
+ cd my_blits_app
23
+ npm install
24
+ ```
25
+
26
+ ### Running Your App
27
+
28
+ 4. After installing the dependencies, you can start your development server by running:
29
+
30
+ ```bash
31
+ npm run dev
32
+ ```
33
+
34
+ This command will create an application bundle and launch a development server using Vite.
35
+
36
+ Once the server is up and running, open your web browser and navigate to the URL displayed in the console. Congratulations! You now have your brand new Blits Lightning 3 App up and running.
37
+
38
+ ### Coding environment
39
+
40
+ You can use any code editor of your preference to further develop your Blits App.
41
+
42
+ We recommend using VS code, since we have a dedicated [VS code extension for Blits](https://marketplace.visualstudio.com/items?itemName=LightningJS.lightning-blits) that provides better syntax highlighting, code completion, error
43
+ checking, and other features to make working with Blits easier.
44
+
45
+ ### Next steps
46
+
47
+ You are now ready to dive into the world of App development using Blits. In the following sections, we will explore the core concepts and guide you through building your TV applications step by step.
@@ -16,4 +16,5 @@ Firstly, it's short, memorable and just has a nice ring to it.
16
16
 
17
17
  "Blits" is a Dutch word (a significant portion of the Lightning Open Source teams is based in the Netherlands). It means _flashy_ and it's often used to for things that are _great_ or _cool_.
18
18
 
19
- Finally it's a nerdy reference to the computer term "Bit Blits" commonly used in graphics processing, for rapidly moving a block of data into memory - quite similar to what Lightning is doing
19
+ Finally it's a nerdy reference to the computer term "Bit Blits" commonly used in graphics processing, for rapidly moving a block of data into memory - quite similar to what Lightning is doing 🙂
20
+
package/docs/sidebar.json CHANGED
@@ -3,61 +3,105 @@
3
3
  "text": "Getting Started",
4
4
  "items": [
5
5
  {
6
- "text": "Introduction",
7
- "link": "/introduction"
6
+ "text": "Intro",
7
+ "link": "/getting_started/intro"
8
8
  },
9
9
  {
10
- "text": "Setup",
11
- "link": "/getting_started"
10
+ "text": "Getting started",
11
+ "link": "/getting_started/getting_started"
12
+ },
13
+ {
14
+ "text": "File structure",
15
+ "link": "/getting_started/file_structure"
12
16
  }
13
17
  ]
14
18
  },
15
19
  {
16
- "text": "Basics",
20
+ "text": "Essentials",
17
21
  "items": [
18
22
  {
19
- "text": "Components",
20
- "link": "/components"
23
+ "text": "Application root",
24
+ "link": "/essentials/application_root"
21
25
  },
22
26
  {
23
- "text": "Template Syntax",
24
- "link": "/template_syntax"
27
+ "text": "Component basics",
28
+ "link": "/essentials/components"
25
29
  },
26
30
  {
27
- "text": "Component State",
28
- "link": "/component_state"
31
+ "text": "Template syntax",
32
+ "link": "/essentials/template_syntax"
29
33
  },
30
34
  {
31
- "text": "Hooks",
32
- "link": "/lifecycle_events"
35
+ "text": "Supported element attributes",
36
+ "link": "/essentials/element_attributes"
33
37
  },
34
38
  {
35
- "text": "Props",
36
- "link": "/props"
39
+ "text": "Displaying images",
40
+ "link": "/essentials/displaying_images"
37
41
  },
38
42
  {
39
- "text": "User Input",
40
- "link": "/user_input"
43
+ "text": "Displaying text",
44
+ "link": "/essentials/displaying_text"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "text": "Components",
50
+ "items": [
51
+ {
52
+ "text": "State",
53
+ "link": "/components/component_state"
54
+ },
55
+ {
56
+ "text": "Props",
57
+ "link": "/components/props"
41
58
  },
42
59
  {
43
- "text": "Computed Props",
44
- "link": "/computed_properties"
60
+ "text": "Computed properties",
61
+ "link": "/components/computed_properties"
45
62
  },
46
63
  {
47
64
  "text": "Watchers",
48
- "link": "/watchers"
65
+ "link": "/components/watchers"
49
66
  },
50
67
  {
51
- "text": "Styling",
52
- "link": "/element_attributes"
68
+ "text": "Hooking into lifecycle events",
69
+ "link": "/components/lifecycle_events"
53
70
  },
54
71
  {
55
- "text": "Images",
56
- "link": "/displaying_images"
72
+ "text": "Handling User input",
73
+ "link": "/components/user_input"
57
74
  },
58
75
  {
59
- "text": "Text-to-Speech",
60
- "link": "/text-to-speech-announcer"
76
+ "text": "Methods",
77
+ "link": "/components/methods"
78
+ }
79
+ ]
80
+ },
81
+ {
82
+ "text": "Transitions and Animations",
83
+ "items": [
84
+ {
85
+ "text": "Transitions",
86
+ "link": "/transitions_animations/transitions"
87
+ }
88
+ ]
89
+ },
90
+ {
91
+ "text": "Built-in components",
92
+ "items": [
93
+ {
94
+ "text": "Directives",
95
+ "link": "/built-in/directives"
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "text": "Plugins",
101
+ "items": [
102
+ {
103
+ "text": "Text-to-Speech / Announcer",
104
+ "link": "/plugins/text-to-speech-announcer"
61
105
  }
62
106
  ]
63
107
  }