From e1918a3e0d03e57bc788ea7fabc4c2896529b4ba Mon Sep 17 00:00:00 2001 From: bordun Date: Mon, 6 Apr 2020 16:31:38 +0200 Subject: [PATCH] inspector: choices in help modal docs: continue --- .../docs/docs/widgets/general-mechanics.md | 2 +- .../docs/docs/widgets/properties-reference.md | 48 +++++++++---------- scripts/build-widgets-reference.js | 4 +- src/client/ui/ui-inspector.js | 5 ++ 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/resources/docs/docs/widgets/general-mechanics.md b/resources/docs/docs/widgets/general-mechanics.md index f1cdeacb..febc9529 100644 --- a/resources/docs/docs/widgets/general-mechanics.md +++ b/resources/docs/docs/widgets/general-mechanics.md @@ -48,7 +48,7 @@ Within a single client's scope, there are multiple ways to synchronize widgets: - If they share the same `id`: in this case, the synchronized widget doesn't send any osc/midi message. This case is mostly used for widget cloning. - If they share a `linkId`: in this case, the synchronized widget sends its osc/midi message normally. -- If their `value` properties depend on each other using the [advanced syntaxes](./advances-syntaxes.md) +- If their `value` properties depend on each other using the [advanced syntaxes](./advanced-syntaxes.md) - Using [scripting](./scripting.md) ## Client synchronization diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index cecab37d..ab7e8777 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -55,7 +55,7 @@ |
button#
|||| |
on#
| `*` | 1 | Set to `null` to send send no argument in the osc message | |
off#
| `*` | 0 | Set to `null` to send send no argument in the osc message. Must be different from `on`. | -|
mode#
| `string` | "toggle" | Interraction mode:
- `toggle` (classic on/off switch)
- `push` (press & release)
- `tap` (no release)

Possible values: toggle, push, tap | +|
mode#
| `string` | "toggle" | Interraction mode:
- `toggle` (classic on/off switch)
- `push` (press & release)
- `tap` (no release)

Choices: `toggle`, `push`, `tap` | |
doubleTap#
| `boolean` | false | Set to `true` to make the button require a double tap to be pushed instead of a single tap | |
colorTextOn#
| `string` | "auto" | Defines the widget's text color when active. | @@ -70,10 +70,10 @@ | property | type |default | description | | --- | --- | --- | --- | |
switch#
|||| -|
layout#
| `string` | "vertical" | Possible values: vertical, horizontal, grid | +|
layout#
| `string` | "vertical" | Choices: `vertical`, `horizontal`, `grid` | |
gridTemplate#
| `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | |
values#
| `array`|
`object` | \{
 "Value 1": 1,
 "Value 2": 2
}
| `Array` of possible values to switch between : `[1,2,3]`

`Object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept | -|
mode#
| `string` | "tap" | Interraction mode:
- `tap`: activates when the pointer is down but prevents further scrolling
- `slide`: same as `tap` but allows sliding between values
- `click`: activates upon click only and allows further scrolling

Possible values: tap, slide, click | +|
mode#
| `string` | "tap" | Interraction mode:
- `tap`: activates when the pointer is down but prevents further scrolling
- `slide`: same as `tap` but allows sliding between values
- `click`: activates upon click only and allows further scrolling

Choices: `tap`, `slide`, `click` | |
colorTextOn#
| `string` | "auto" | Defines the widget's text color when active. | @@ -87,7 +87,7 @@ | property | type |default | description | | --- | --- | --- | --- | | |||| -| | `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Possible values: center, left, right | +| | `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Choices: `center`, `left`, `right` | | | `array`|
`object` | \{
 "Value 1": 1,
 "Value 2": 2
}
| `Array` of possible values to switch between : `[1,2,3]`

`Object` of label:value pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept | @@ -102,8 +102,8 @@ | --- | --- | --- | --- | | |||| | | `number`|
`array` | 200 | - If `layout` is `circular`: diameter (in px)
- Else: square size or `[width, height]` array | -| | `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Possible values: center, left, right | -| | `string` | "circular" | Defines whether the menu's layout should be rendered in a circle or in a box

Possible values: circular, horizontal, vertical, grid | +| | `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Choices: `center`, `left`, `right` | +| | `string` | "circular" | Defines whether the menu's layout should be rendered in a circle or in a box

Choices: `circular`, `horizontal`, `vertical`, `grid` | | | `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | | | `boolean` | false | Set to `true` to make the menu stay opened after mouse/touch release | | | `boolean` | false | Set to `true` to make the menu require a double tap to be opened instead of a single tap | @@ -121,7 +121,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
input#
|||| -|
align#
| `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Possible values: center, left, right | +|
align#
| `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Choices: `center`, `left`, `right` | |
unit#
| `string` | "" | Unit will be appended to the displayed widget's value (it doesn't affect osc messages) | |
asYouType#
| `boolean` | false | Set to `true` to make the input send its value at each keystroke | @@ -136,7 +136,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
input#
|||| -|
align#
| `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Possible values: center, left, right | +|
align#
| `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Choices: `center`, `left`, `right` | |
directory#
| `string` | "auto" | Default browsing directory | |
extension#
| `string` | "*" | Only display files with this extension | |
hidePath#
| `boolean` | false | Set to `true` to only display the filename (the whole path will still be used as value) | @@ -156,8 +156,8 @@ | --- | --- | --- | --- | |
panel#
|||| |
colorPanel#
| `string` | "auto" | Panel background color. Set to "auto" to inherit from parent widget. | -|
layout#
| `string` | "default" | Defines how children are laid out.

Possible values: default, vertical, horizontal, grid | -|
justify#
| `string` | "start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.

Possible values: start, end, center, space-around, space-between | +|
layout#
| `string` | "default" | Defines how children are laid out.

Choices: `default`, `vertical`, `horizontal`, `grid` | +|
justify#
| `string` | "start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.

Choices: `start`, `end`, `center`, `space-around`, `space-between` | |
gridTemplate#
| `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | |
verticalTabs#
| `boolean` | false | Set to `true` to display for vertical tab layout | |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | @@ -187,7 +187,7 @@ | | `number`|
`percentage` | "auto" | Modal popup's position | | | `number`|
`percentage` | "auto" | Modal popup's position | | | `string` | "auto" | Panel background color. Set to "auto" to inherit from parent widget. | -| | `string` | "default" | Defines how children are laid out.

Possible values: default, vertical, horizontal, grid | +| | `string` | "default" | Defines how children are laid out.

Choices: `default`, `vertical`, `horizontal`, `grid` | | | `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | | | `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | | | `boolean` | true | Set to `false` to disable scrollbars | @@ -225,7 +225,7 @@ |
matrix#
|||| |
widgetType#
| `string` | "button" | Defines the type of the widgets in the matrix | |
colorPanel#
| `string` | "auto" | Panel background color. Set to "auto" to inherit from parent widget. | -|
layout#
| `string` | "horizontal" | Defines how children are laid out.

Possible values: horizontal, vertical, grid | +|
layout#
| `string` | "horizontal" | Defines how children are laid out.

Choices: `horizontal`, `vertical`, `grid` | |
gridTemplate#
| `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | |
quantity#
| `number` | 4 | Defines the number of widgets in the matrix | |
start#
| `integer` | 0 | First widget's index | @@ -280,8 +280,8 @@ | --- | --- | --- | --- | |
panel#
|||| |
colorPanel#
| `string` | "auto" | Panel background color. Set to "auto" to inherit from parent widget. | -|
layout#
| `string` | "default" | Defines how children are laid out.

Possible values: default, vertical, horizontal, grid | -|
justify#
| `string` | "start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.

Possible values: start, end, center, space-around, space-between | +|
layout#
| `string` | "default" | Defines how children are laid out.

Choices: `default`, `vertical`, `horizontal`, `grid` | +|
justify#
| `string` | "start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.

Choices: `start`, `end`, `center`, `space-around`, `space-between` | |
gridTemplate#
| `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | |
verticalTabs#
| `boolean` | false | Set to `true` to display for vertical tab layout | |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | @@ -305,8 +305,8 @@ | --- | --- | --- | --- | |
tab#
|||| |
colorPanel#
| `string` | "auto" | Panel background color. Set to "auto" to inherit from parent widget. | -|
layout#
| `string` | "default" | Defines how children are laid out.

Possible values: default, vertical, horizontal, grid | -|
justify#
| `string` | "start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.

Possible values: start, end, center, space-around, space-between | +|
layout#
| `string` | "default" | Defines how children are laid out.

Choices: `default`, `vertical`, `horizontal`, `grid` | +|
justify#
| `string` | "start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.

Choices: `start`, `end`, `center`, `space-around`, `space-between` | |
gridTemplate#
| `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | |
verticalTabs#
| `boolean` | false | Set to `true` to display for vertical tab layout | |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | @@ -450,7 +450,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
led#
|||| -|
mode#
| `string` | "intensity" | Defines how value is interpreted (see `value`)

Possible values: intensity, color | +|
mode#
| `string` | "intensity" | Defines how value is interpreted (see `value`)

Choices: `intensity`, `color` | |
range#
| `object` | \{
 "min": 0,
 "max": 1
}
| Value range | |
alphaRange#
| `object` | \{
 "min": 0,
 "max": 1
}
| Alpha range (if `mode` is `color`) | |
logScale#
| `boolean` | false | If `mode` is `intensity`, set to `true` to use logarithmic scale. | @@ -471,7 +471,7 @@ |
text#
|||| |
vertical#
| `boolean` | false | Set to `true` to display the text vertically | |
wrap#
| `boolean` | false | Set to `true` to wrap long lines automatically.

This will not break overflowing words by default, word-breaking can be enabled by adding `word-break: break-all;` to the `css` property | -|
align#
| `string` | "center" | Css text-align property.

Possible values: center, left, right | +|
align#
| `string` | "center" | Css text-align property.

Choices: `center`, `left`, `right` | @@ -554,7 +554,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
fader#
|||| -|
design#
| `string` | "default" | Design style

Possible values: default, round, compact | +|
design#
| `string` | "default" | Design style

Choices: `default`, `round`, `compact` | |
horizontal#
| `boolean` | false | Set to `true` to display the fader horizontally | |
pips#
| `boolean` | false | Set to `true` to show range breakpoints (ignored if `design` is `compact`) | |
dashed#
| `boolean` | false | Set to `true` to display a dashed gauge | @@ -581,7 +581,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
knob#
|||| -|
mode#
| `string` | "vertical" | - `circular`: relative move in circular motion
- `snap`: snap to touch position and move in vertical motion
- `vertical`: relative move in vertical motion

Possible values: vertical, circular, snap | +|
mode#
| `string` | "vertical" | - `circular`: relative move in circular motion
- `snap`: snap to touch position and move in vertical motion
- `vertical`: relative move in vertical motion

Choices: `vertical`, `circular`, `snap` | |
spring#
| `boolean` | false | When set to `true`, the widget will go back to its `default` value when released | |
pips#
| `boolean` | false | Set to `true` to show the scale's breakpoints | |
dashed#
| `boolean` | false | Set to `true` to display a dashed gauge | @@ -610,7 +610,7 @@ |
back#
| `*` | -1 | Defines which value is sent when rotating the encoder anticlockwise | |
forth#
| `*` | 1 | Defines which value is sent when rotating the encoder clockwise | |
release#
| `number` | "" | Defines which value is sent when releasing the encoder:
- Set to `null` to send send no argument in the osc message
- Can be an `object` if the type needs to be specified | -|
mode#
| `string` | "circular" | - `circular`: relative move in circular motion
- `snap`: snap to touch position and move in vertical motion
- `vertical`: relative move in vertical motion

Possible values: circular, snap, vertical | +|
mode#
| `string` | "circular" | - `circular`: relative move in circular motion
- `snap`: snap to touch position and move in vertical motion
- `vertical`: relative move in vertical motion

Choices: `circular`, `snap`, `vertical` | |
doubleTap#
| `boolean` | false | Set to `true` to make the fader reset to its `default` value when receiving a double tap.

Can also be an osc address, in which case the widget will just send an osc message (`/ `) | |
osc#
|||| |
touchAddress#
| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1` | @@ -626,7 +626,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
fader#
|||| -|
design#
| `string` | "default" | Design style

Possible values: default, round, compact | +|
design#
| `string` | "default" | Design style

Choices: `default`, `round`, `compact` | |
horizontal#
| `boolean` | false | Set to `true` to display the fader horizontally | |
pips#
| `boolean` | false | Set to `true` to show range breakpoints (ignored if `design` is `compact`) | |
dashed#
| `boolean` | false | Set to `true` to display a dashed gauge | @@ -655,12 +655,12 @@ | property | type |default | description | | --- | --- | --- | --- | |
script#
|||| -|
event#
| `string` | "value" | Define which events trigger the script's execution.

Possible values: value, keyboard | +|
event#
| `string` | "value" | Define which events trigger the script's execution.

Choices: `value`, `keyboard` | |
script#
| `script` | "" | Script executed whenever the widget's receives the defined event. See documentation. | |
event: keyboard#
|||| |
keyBinding#
| `string`|
`array` | "" | Key combo `string` or `array` of strings (see KeyboardJS documentation) | |
keyRepeat#
| `boolean` | true | Set to `false` to prevent keydown repeats when holding the key combo pressed | -|
keyType#
| `string` | "keyDown" | Determines which key event trigger the script's execution

Possible values: keydown, keyup, both | +|
keyType#
| `string` | "keyDown" | Determines which key event trigger the script's execution

Choices: `keydown`, `keyup`, `both` | diff --git a/scripts/build-widgets-reference.js b/scripts/build-widgets-reference.js index 9f0bc855..d69018cb 100644 --- a/scripts/build-widgets-reference.js +++ b/scripts/build-widgets-reference.js @@ -35,7 +35,7 @@ for (var propName in base) { if (prop.choices) { if (help) help += '

' - help += 'Possible values: ' + prop.choices.join(', ') + help += 'Choices: ' + prop.choices.map(x=>'`' + x + '`').join(', ') } doc.push(` @@ -98,7 +98,7 @@ for (var k in widgets.categories) { if (prop.choices) { if (help) help += '

' - help += 'Possible values: ' + prop.choices.join(', ') + help += 'Choices: ' + prop.choices.map(x=>'`' + x + '`').join(', ') } doc.push(` diff --git a/src/client/ui/ui-inspector.js b/src/client/ui/ui-inspector.js index aab71b28..aded86f1 100644 --- a/src/client/ui/ui-inspector.js +++ b/src/client/ui/ui-inspector.js @@ -270,6 +270,11 @@ class UiInspector extends UiWidget {

Type: ${defaultValue.type}

Default: ${JSON.stringify(defaultValue.value)}

+ ${ + defaultValue.choices ? html` +

Choices: ${raw(defaultValue.choices.map(x=>'' + x + '').join(', '))}

+ ` :'' + }

Dynamic: ${dynamic ? 'true' : 'false'}