From c73d9826397f271dd2a26d969eed6bf836fa67f3 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 31 Aug 2018 14:26:31 +0200 Subject: [PATCH] docs: missing items in widgets ref --- .../js/app/widgets/containers/modal.js | 5 ++++- .../js/app/widgets/containers/strip.js | 7 ++++++- .../js/app/widgets/inputs/gyroscope.js | 19 +++++++++++++++++++ .../js/app/widgets/matrices/keyboard.js | 5 +++++ .../js/app/widgets/switchers/crossfader.js | 8 +++----- .../js/app/widgets/switchers/switcher.js | 5 +++-- 6 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/browser/js/app/widgets/containers/modal.js b/src/browser/js/app/widgets/containers/modal.js index cb6898f1..a58fcd0f 100644 --- a/src/browser/js/app/widgets/containers/modal.js +++ b/src/browser/js/app/widgets/containers/modal.js @@ -24,7 +24,10 @@ module.exports = class Modal extends Panel { _chidlren:'children', variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'}, - widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object'} + widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object'}, + value: {type: 'integer', value: '', help: [ + 'Defines the modal\'s state:`0` for closed, `1` for opened' + ]}, }) diff --git a/src/browser/js/app/widgets/containers/strip.js b/src/browser/js/app/widgets/containers/strip.js index 724d5f8a..a6608047 100644 --- a/src/browser/js/app/widgets/containers/strip.js +++ b/src/browser/js/app/widgets/containers/strip.js @@ -20,7 +20,12 @@ module.exports = class Strip extends Panel { _children:'children', variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'}, - widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object'} + widgets: {type: 'array', value: [], help: [ + 'Each element of the array must be a widget object', + '- By default, children widgets that don\'t have an explicit `width`/`height` set will be shrinked to respect the sizes specified by others', + '- Adding `flex:1;` to a children\'s `css` will give it the ability the fill the remaining space', + '- Multiple children can have a `flex:x;` css property (`x` will ponderate their expansion)' + ]} }) diff --git a/src/browser/js/app/widgets/inputs/gyroscope.js b/src/browser/js/app/widgets/inputs/gyroscope.js index 9a5305be..f54952ff 100644 --- a/src/browser/js/app/widgets/inputs/gyroscope.js +++ b/src/browser/js/app/widgets/inputs/gyroscope.js @@ -16,6 +16,25 @@ class Gyroscope extends Widget { compass: {type: 'boolean', value: false, help: 'Set to `true` to return the orientation values with respect to the actual north direction of the world instead of the head direction of the device'}, screenAdjusted: {type: 'boolean', value: false, help: 'Set to `true` to return screen adjusted values'} + }, [], { + + value: {type: 'object', value: '', help: [ + 'The gyroscope\'s value is an object containing multiple values, which can be used by other widgets via the property maths syntax', + '- `value.do.alpha`: deviceorientation event alpha', + '- `value.do.beta`: deviceorientation event beta', + '- `value.do.gamma`: deviceorientation event gamma', + '- `value.do.absolute`: deviceorientation event absolute', + '- `value.dm.x`: devicemotion event acceleration x', + '- `value.dm.y`: devicemotion event acceleration y', + '- `value.dm.z`: devicemotion event acceleration z', + '- `value.dm.gx`: devicemotion event accelerationIncludingGravity x', + '- `value.dm.gy`: devicemotion event accelerationIncludingGravity y', + '- `value.dm.gz`: devicemotion event accelerationIncludingGravity z', + '- `value.dm.alpha`: devicemotion event rotationRate alpha', + '- `value.dm.beta`: devicemotion event rotationRate beta', + '- `value.dm.gamma`: devicemotion event rotationRate gamma' + ]}, + }) } diff --git a/src/browser/js/app/widgets/matrices/keyboard.js b/src/browser/js/app/widgets/matrices/keyboard.js index 0d321cbb..703ad3df 100644 --- a/src/browser/js/app/widgets/matrices/keyboard.js +++ b/src/browser/js/app/widgets/matrices/keyboard.js @@ -32,6 +32,11 @@ module.exports = class Keyboard extends _matrix_base { '`false`: it will be prepended to the widget\'s preArgs', '`string`: will be used to define the widgets\' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\\$`))' ]}, + css: {type: 'string', value: '', help: [ + 'Available CSS variables:', + '- `--color-white:color;` (white keys color)', + '- `--color-black:color;` (black keys color)' + ]} }) diff --git a/src/browser/js/app/widgets/switchers/crossfader.js b/src/browser/js/app/widgets/switchers/crossfader.js index b3e0d7a8..d51558df 100644 --- a/src/browser/js/app/widgets/switchers/crossfader.js +++ b/src/browser/js/app/widgets/switchers/crossfader.js @@ -18,12 +18,10 @@ module.exports = class Crossfader extends Switcher { '- `String`: a widget\'s `id` whose state changes will be stored', '- `Array`: a list of widget `id` string' ]}, - horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display values horizontally'}, - values: {type: 'array|object', value: {'Value 1':1,'Value 2':2}, help: [ - '`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', - ]} + horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display values horizontally'} + }) + } constructor(options) { diff --git a/src/browser/js/app/widgets/switchers/switcher.js b/src/browser/js/app/widgets/switchers/switcher.js index ac504a8f..e5a8516c 100644 --- a/src/browser/js/app/widgets/switchers/switcher.js +++ b/src/browser/js/app/widgets/switchers/switcher.js @@ -17,8 +17,9 @@ module.exports = class Switcher extends _switchers_base { ]}, horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display values horizontally'}, values: {type: 'array|object', value: {'Value 1':1,'Value 2':2}, help: [ - '`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', + 'Each item represents a bank that stores the values from the widgets listed in `linkedWidgets`', + '- `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', ]} })