@enact/webos
Advanced tools
Comparing version 2.0.0-beta.3 to 2.0.0-beta.4
@@ -5,2 +5,6 @@ # Change Log | ||
## [2.0.0-beta.4] - 2018-05-21 | ||
No significant changes. | ||
## [2.0.0-beta.3] - 2018-05-14 | ||
@@ -7,0 +11,0 @@ |
{ | ||
"name": "@enact/webos", | ||
"version": "2.0.0-beta.3", | ||
"version": "2.0.0-beta.4", | ||
"description": "webOS support library", | ||
@@ -29,3 +29,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@enact/core": "^2.0.0-beta.3", | ||
"@enact/core": "^2.0.0-beta.4", | ||
"prop-types": "^15.6.0", | ||
@@ -32,0 +32,0 @@ "react": "^16.2.0", |
@@ -23,3 +23,3 @@ "use strict"; | ||
* @param {String} string String to voice readout. | ||
* @param {Boolean} [clear=true] Clear option for TTS. If true, it will cutt off previous reading. | ||
* @param {Boolean} [clear=true] Clear option for TTS. If true, it will cut off previous reading. | ||
* @returns {undefined} | ||
@@ -26,0 +26,0 @@ * @memberof webos/speech |
@@ -37,4 +37,46 @@ "use strict"; | ||
/** | ||
* Adds a callback for voice events | ||
* VoiceControlDecorator is a Higher-order Component that adds a callback for voice event | ||
* to its wrapped component. | ||
* | ||
* By default, `onVoice` handler will be added to the node where `data-webos-voice-intent` attribute is declared. | ||
* In addition, if you need to specify a target node, `data-webos-voice-event-target` attribute can be used. | ||
* | ||
* ``` | ||
* import React from 'react'; | ||
* import Item from '@enact/moonstone/Item'; | ||
* import {VoiceControlDecorator} from '@enact/webos/speech'; | ||
* | ||
* const VoiceDiv = VoiceControlDecorator('div'); | ||
* const VoiceItem = VoiceControlDecorator(Item); | ||
* | ||
* class Sample extends React.Component { | ||
* handlePlayListControl = (e) => { | ||
* const {intent, control} = e.detail; | ||
* // Change the app status refer to the `control` value. | ||
* } | ||
* | ||
* handlePlayContent = (e) => { | ||
* const {intent, value} = e.detail; | ||
* // Play content | ||
* } | ||
* | ||
* render () { | ||
* return( | ||
* <div> | ||
* <VoiceDiv | ||
* data-webos-voice-intent='PlayListControl' | ||
* onVoice={this.handlePlayListControl} | ||
* /> | ||
* <VoiceItem | ||
* data-webos-voice-intent='Select PlayContent' | ||
* onVoice={this.handlePlayContent} | ||
* > | ||
* The Dark Knight | ||
* </VoiceItem> | ||
* </div> | ||
* ); | ||
* } | ||
* } | ||
* ``` | ||
* | ||
* @class VoiceControlDecorator | ||
@@ -41,0 +83,0 @@ * @memberof webos/speech |
41690
857
Updated@enact/core@^2.0.0-beta.4