Skip to content

Commit

Permalink
[Doc] Minor fixes
Browse files Browse the repository at this point in the history
Add a space before <br/> tags in api json files. In the generated JsDoc
the <br/> tags are completely ignored by VS code, not even adding a
space.

Fix some links to JSX.md, not renamed declarative-ui.md

Various typos.

Change-Id: I9dac10e2043fc29498e7b05b1a0b110f08a2308e
  • Loading branch information
tbuschto committed Oct 1, 2020
1 parent a93f7ca commit fe22c64
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion doc/api/Camera.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
}
},
"optional": true,
"description": "A set of capture options to apply when taking a picture.<br/><br/>If `flash` is set to `'auto'` the device will decide (based on the lighting conditions) whether to activate the flashlight."
"description": "A set of capture options to apply when taking a picture. <br/><br/>If `flash` is set to `'auto'` the device will decide (based on the lighting conditions) whether to activate the flashlight."
}
],
"returns": {
Expand Down
2 changes: 1 addition & 1 deletion doc/api/Cell.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
]
},
"namespace": false,
"description": "This widget is expected by [`ListView`](./ListView.md) as a child (in JSX) or turn value of `createCell`. It's data-binding enabled by default. It's children can also [not be selected](../selector.md#encapsulation) from the outside, except for using `apply` directly on the instance. This allows using it as a function component as demonstrated in [this example](https://github.com/eclipsesource/tabris-decorators/tree/v${moduleversion}/examples/listview-cells-js).",
"description": "This widget is expected by [`ListView`](./ListView.md) as a child (in JSX) or return value of `createCell`. It supports data-binding via JSX by default. Its children can also [not be selected](../selector.md#encapsulation) from the outside, except for using `apply` directly on the instance. This allows using it as a function component as demonstrated in [this example](https://github.com/eclipsesource/tabris-decorators/tree/v${moduleversion}/examples/listview-cells-js).",
"properties": {
"item": {
"type": "ItemType",
Expand Down
6 changes: 3 additions & 3 deletions doc/api/Composite.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
"name": "options",
"type": "{<br/>&nbsp;&nbsp;mode?: 'default'&#124;'strict',<br/>&nbsp;&nbsp;trigger?: string<br/>}",
"ts_type": "{mode?: 'default'|'strict', trigger?: ListenersKeysOf<Target> | 'update' | symbol}",
"description": "If mode is set to `'strict'` the function checks that all selector match at least one widget, and that id selector match exactly one widget.<br/>A `trigger` is string to be associated with the given rulset. If set to `'update'`, the ruleset will be applied once immediately and then again every time `apply('update')` is called. If set to any event-attribute name, such as `'onTap'`, it will automatically re-apply the ruleset when this event is triggered."
"description": "If mode is set to `'strict'` the function checks that all selector match at least one widget, and that id selector match exactly one widget. <br/>A `trigger` is string to be associated with the given rulset. If set to `'update'`, the ruleset will be applied once immediately and then again every time `apply('update')` is called. If set to any event-attribute name, such as `'onTap'`, it will automatically re-apply the ruleset when this event is triggered."
},
{
"name": "rules",
Expand All @@ -223,7 +223,7 @@
}
],
"returns": "this",
"description": "Applies the given attributes to all descendants that match the associated selector(s). Each attributes object may contain properties to be set and listeners to be registered. An entry will be treated as a listener if it follows the naming scheme \"onEventType\". IMPORTANT: Listeners previously registered (for the same type) via the `apply` method, a [JSX](../declarative-ui.md) element attribute or a [widget factory](./utils.md#asfactoryconstructor) call will be de-registered. This means you can call apply repeatedly and have a deterministic outcome. Listeners registered programmatically (e.g. `widget.onTap(...)` are not affected by this.)<br/><br/>For better type safety enable [strict mode](#applymode-rules) and use the [`Set`](./utils.md#settarget-attributes) to create properties objects.\n\nIf you wish to always exclude specific \"internal\" children from this, overwrite the `children` method on their parent. See \"[Encapsulation](../selector.md#encapsulation)\"."
"description": "Applies the given attributes to all descendants that match the associated selector(s). Each attributes object may contain properties to be set and listeners to be registered. An entry will be treated as a listener if it follows the naming scheme \"onEventType\". IMPORTANT: Listeners previously registered (for the same type) via the `apply` method, a [JSX](../declarative-ui.md) element attribute or a [widget factory](./utils.md#asfactoryconstructor) call will be de-registered. This means you can call apply repeatedly and have a deterministic outcome. Listeners registered programmatically (e.g. `widget.onTap(...)` are not affected by this.) <br/><br/>For better type safety enable [strict mode](#applymode-rules) and use the [`Set`](./utils.md#settarget-attributes) to create properties objects.\n\nIf you wish to always exclude specific \"internal\" children from this, overwrite the `children` method on their parent. See \"[Encapsulation](../selector.md#encapsulation)\"."
},
{
"parameters": [
Expand Down Expand Up @@ -285,7 +285,7 @@
"name": "options",
"type": "{<br/>&nbsp;&nbsp;mode?: 'default'&#124;'strict',<br/>&nbsp;&nbsp;trigger?: string<br/>}",
"ts_type": "{mode?: 'default'|'strict', trigger?: ListenersKeysOf<Target> | 'update' | symbol}",
"description": "If mode is set to `'strict'` the function checks that all selector match at least one widget, and that id selector match exactly one widget.<br/>A `trigger` is string to be associated with the given rulset. If set to `'update'`, the ruleset will be applied once immediately and then again every time `apply('update')` is called. If set to any event-attribute name, such as `'onTap'`, it will automatically re-apply the ruleset when this event is triggered."
"description": "If mode is set to `'strict'` the function checks that all selector match at least one widget, and that id selector match exactly one widget. <br/>A `trigger` is string to be associated with the given rulset. If set to `'update'`, the ruleset will be applied once immediately and then again every time `apply('update')` is called. If set to any event-attribute name, such as `'onTap'`, it will automatically re-apply the ruleset when this event is triggered."
},
{
"name": "rules",
Expand Down
2 changes: 1 addition & 1 deletion doc/api/File.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"lastModified": {"type": "number", "optional": true}
}
},
"description": "`type` represents the MIME type of the blob content. Defaults to empty string.<br/><br/>`lastModified` is a unix timestamp of the last known modification of the file. Defaults to the current time.",
"description": "`type` represents the MIME type of the blob content. Defaults to empty string. <br/><br/>`lastModified` is a unix timestamp of the last known modification of the file. Defaults to the current time.",
"optional": true
}
]
Expand Down
2 changes: 1 addition & 1 deletion doc/api/ListView.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
},
"action": {
"type": "number",
"description": "A general-purpose parameter passed on when the event was triggered by one of the [static `select` methods](#selectev-action). This is meant to be used by the application to differentiate between different kind of interactions. It can be safely ignored if there is only one kind of selection, such as tapping a cell.<br/><br/>`tabris-decorators` exports a `ItemAction` enum defining 4 pre-defined values for use with this property: `Primary`, `Secondary`, `Toggle` and `Dismiss`. These are set when using the corresponding [trigger methods](#selectprimaryev)."
"description": "A general-purpose parameter passed on when the event was triggered by one of the [static `select` methods](#selectev-action). This is meant to be used by the application to differentiate between different kind of interactions. It can be safely ignored if there is only one kind of selection, such as tapping a cell. <br/><br/>`tabris-decorators` exports a `ItemAction` enum defining 4 pre-defined values for use with this property: `Primary`, `Secondary`, `Toggle` and `Dismiss`. These are set when using the corresponding [trigger methods](#selectprimaryev)."
}
},
"description": "An event that may be triggered by a `Cell` as the result of any kind of user interaction. By default cells do not trigger `select` events, they have to be explicitly configured to do so. This can be done via the [`selectable`](./Cell.md#selectable) property on `Cell` or the static [`select`](#selectprimaryev) trigger methods."
Expand Down
2 changes: 1 addition & 1 deletion doc/api/RowLayout.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
]
},
"description": "Row based layout manager. Can be set on the `layout` property of any `Composite` or widget extending `Composite` like `Page` or `Tab` widget. The `Row` uses it as the default `layout`.<br/><br/> All children of the composite are automatically arranged in one horizontal row, starting from the left.",
"description": "Row based layout manager. Can be set on the `layout` property of any `Composite` or widget extending `Composite` like `Page` or `Tab` widget. The `Row` uses it as the default `layout`. <br/><br/> All children of the composite are automatically arranged in one horizontal row, starting from the left.",
"properties": {
"spacing": {
"type": "number",
Expand Down
2 changes: 1 addition & 1 deletion doc/api/StackLayout.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
]
},
"description": "Stack based layout manager. Can be set on the `layout` property of any `Composite` or widget extending `Composite` like `Page` or `Tab` widget. The `Stack` uses it as the default `layout`.<br/><br/> All children of the composite are automatically arranged in one vertical stack, starting from the top.",
"description": "Stack based layout manager. Can be set on the `layout` property of any `Composite` or widget extending `Composite` like `Page` or `Tab` widget. The `Stack` uses it as the default `layout`. <br/><br/> All children of the composite are automatically arranged in one vertical stack, starting from the top.",
"properties": {
"spacing": {
"type": "number",
Expand Down
2 changes: 1 addition & 1 deletion doc/api/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
}
}
},
"description": "The data to share. The object must contain at least one of the properties: `title`, `text`, `url` or `files`. The files need to have a `name` and mime `type` set.<br/><br/>On iOS the content of the `url` is previewed in the native share dialog. On Android it is treated as regular text. When both `text` and `url` are given on Android the two strings are concatenated with a blank space as defined in the [W3C Web Share API](https://www.w3.org/TR/web-share/)."
"description": "The data to share. The object must contain at least one of the properties: `title`, `text`, `url` or `files`. The files need to have a `name` and mime `type` set. <br/><br/>On iOS the content of the `url` is previewed in the native share dialog. On Android it is treated as regular text. When both `text` and `url` are given on Android the two strings are concatenated with a blank space as defined in the [W3C Web Share API](https://www.w3.org/TR/web-share/)."
}
],
"returns": {
Expand Down
4 changes: 2 additions & 2 deletions doc/api/utils.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
"WidgetType"
]
},
"description": "Creates a attributes object for the given widget type. This is meant to be used to creates rule sets for the [`apply`](./Composite##applyrules) method. The benefit of using this method as opposed to passing the object directly is twofold:<br/><br/>1 - The IDE and/or TypeScript compiler can check that the attributes are matching the given widget type.<br/>2 - The `apply` method will only set the attributes if the selected widget matches the type given here. If there is a mismatch an error will be thrown."
"description": "Creates a attributes object for the given widget type. This is meant to be used to creates rule sets for the [`apply`](./Composite##applyrules) method. The benefit of using this method as opposed to passing the object directly is twofold: <br/><br/>1 - The IDE and/or TypeScript compiler can check that the attributes are matching the given widget type. <br/>2 - The `apply` method will only set the attributes if the selected widget matches the type given here. If there is a mismatch an error will be thrown."
},
{
"ts_only": true,
Expand Down Expand Up @@ -455,7 +455,7 @@
}
],
"returns": "Attributes<WidgetConstructor['prototype']>",
"description": "Creates a attributes object for the given widget type. This is meant to be used to creates rule sets for the [`apply`](./Composite##applyproperties) method. The benefit of using this method as opposed to passing the object directly is twofold:<br/><br/>1 - The IDE and/or TypeScript compiler can check that the properties are matching the given widget type.<br/>2 - The `apply` method will only set the properties if the selected widget matches the type given here. If there is a mismatch an error will be thrown."
"description": "Creates a attributes object for the given widget type. This is meant to be used to creates rule sets for the [`apply`](./Composite##applyproperties) method. The benefit of using this method as opposed to passing the object directly is twofold: <br/><br/>1 - The IDE and/or TypeScript compiler can check that the properties are matching the given widget type. <br/>2 - The `apply` method will only set the properties if the selected widget matches the type given here. If there is a mismatch an error will be thrown."
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion doc/selector.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ page.apply({

> :point_right: The order of the properties in the object literal is meaningless. According to the EcmaScript standard the members of a JavaScript object do not have a defined order. The priority of two selectors with the same specificity is undefined.
To ensure `apply` addresses the right widgets it can be executed in 'strict' mode and use the [`Set`](./api/utils.md#settarget-attributes) helper function to create the properties object. The kind of the selector then determines how many widgets must match (exactly one for id, at least one for any other), and `Set` determines what type the widget must have. If these conditions are not met an error will be thrown.
To ensure `apply` addresses the right widgets, it can be executed in 'strict' mode and the [`Set`](./api/utils.md#settarget-attributes) helper function can be used to create the properties object. The kind of the selector then determines how many widgets must match (exactly one for id, at least one for any other), and `Set` determines what type the widget must have. If these conditions are not met, an error will be thrown.

```js
page.apply('strict', {
Expand Down
6 changes: 3 additions & 3 deletions doc/widget-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ After a widget has been disposed `isDisposed()` returns `true` while almost all
## Custom Components
Custom components are user-defined subclasses of [`Composite`](./api/composite.md) (or other [`Component`](./api/composite.md) subclasses such as [`Page`](./api/Page.md) and [`Tab`](./api/composite.md)). They are composed of built-in widgets (or other custom components) to form a discrete part of the UI which can then be used (and re-used) to form the application UI as a whole. Custom components can define new properties and events to interaction with other parts of the application.
Custom components are user-defined subclasses of [`Composite`](./api/composite.md) (or other [`Component`](./api/composite.md) subclasses such as [`Page`](./api/Page.md) and [`Tab`](./api/composite.md)). They are composed of built-in widgets (or other custom components) to form a discrete part of the UI which can then be used (and re-used) to form the application UI as a whole. Custom components can define new properties and events for interaction with other parts of the application.
Typically a custom component creates its own children in its constructor and "hides" them from the public API by [overriding the `children` method](./selector.md#encapsulation) or applying the [`@component`](./databinding/@component.md) decorator (TypeScript only). The children are then modified using the protected selector API (eg [`_find`](./api/composite.md#_findselector)) as a to reaction to property changes.
Typically a custom component creates its own children in its constructor and "hides" them from the public API by [overriding the `children` method](./selector.md#encapsulation) or applying the [`@component`](./databinding/@component.md) decorator (TypeScript only). The children are then modified using the protected selector API (e.g. [`_find`](./api/composite.md#_findselector)) as a reaction to property changes.
A custom component with a custom `text` property and custom event `myEvent` may look like this in plain JavaScript:
Expand Down Expand Up @@ -384,7 +384,7 @@ export class ExampleComponent extends Composite {
## Functional Components
A functional component is the term used for functions that return a widget or `WidgetCollection`, a.k.a a widget factory. Its name typically starts with an upper case, and it should take a single `properties` or `attributes` parameter object. In the latter latter case it needs to create widgets using [declarative UI syntax](./declarative-ui.md#functional-components).
A functional component is the term used for functions that return a widget or `WidgetCollection`, a.k.a a widget factory. Its name typically starts with an upper case, and it should take a single `properties` or `attributes` parameter object. In the latter case it needs to create widgets using [declarative UI syntax](./declarative-ui.md#functional-components).
A common use case for this is to create widgets that have different default values, such as a different background or text color.
Expand Down

0 comments on commit fe22c64

Please sign in to comment.