@dreamtree-org/twreact-ui 1.1.4 → 1.1.5
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.
- package/dist/index.esm.js +46 -2
- package/dist/index.js +46 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -15915,7 +15915,7 @@ function LocationPicker(_ref) {
|
|
|
15915
15915
|
|
|
15916
15916
|
var SpeechToText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
15917
15917
|
var _ref$lang = _ref.lang,
|
|
15918
|
-
lang = _ref$lang === void 0 ? "
|
|
15918
|
+
lang = _ref$lang === void 0 ? "ne-NP" : _ref$lang,
|
|
15919
15919
|
_ref$continuous = _ref.continuous,
|
|
15920
15920
|
continuous = _ref$continuous === void 0 ? true : _ref$continuous,
|
|
15921
15921
|
_ref$interimResults = _ref.interimResults,
|
|
@@ -16083,6 +16083,50 @@ var SpeechToText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
16083
16083
|
}, _isListening ? "Stop" : "Start");
|
|
16084
16084
|
});
|
|
16085
16085
|
|
|
16086
|
+
var TextToSpeech = function TextToSpeech(_ref) {
|
|
16087
|
+
var _ref$text = _ref.text,
|
|
16088
|
+
text = _ref$text === void 0 ? "" : _ref$text,
|
|
16089
|
+
_ref$rate = _ref.rate,
|
|
16090
|
+
rate = _ref$rate === void 0 ? 1 : _ref$rate,
|
|
16091
|
+
_ref$pitch = _ref.pitch,
|
|
16092
|
+
pitch = _ref$pitch === void 0 ? 0.5 : _ref$pitch,
|
|
16093
|
+
_ref$onSpeak = _ref.onSpeak,
|
|
16094
|
+
onSpeak = _ref$onSpeak === void 0 ? function () {} : _ref$onSpeak,
|
|
16095
|
+
renderButton = _ref.renderButton;
|
|
16096
|
+
var _useState = useState(text),
|
|
16097
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16098
|
+
inputText = _useState2[0];
|
|
16099
|
+
_useState2[1];
|
|
16100
|
+
var _useState3 = useState(false),
|
|
16101
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
16102
|
+
isSpeaking = _useState4[0],
|
|
16103
|
+
setIsSpeaking = _useState4[1];
|
|
16104
|
+
var handleSpeak = function handleSpeak() {
|
|
16105
|
+
var utterance = new SpeechSynthesisUtterance(inputText);
|
|
16106
|
+
utterance.rate = rate;
|
|
16107
|
+
utterance.pitch = pitch;
|
|
16108
|
+
utterance.onstart = function () {
|
|
16109
|
+
onSpeak(inputText);
|
|
16110
|
+
setIsSpeaking(true);
|
|
16111
|
+
};
|
|
16112
|
+
utterance.onend = function () {
|
|
16113
|
+
setIsSpeaking(false);
|
|
16114
|
+
};
|
|
16115
|
+
if (isSpeaking) {
|
|
16116
|
+
window.speechSynthesis.cancel();
|
|
16117
|
+
setIsSpeaking(false);
|
|
16118
|
+
} else {
|
|
16119
|
+
window.speechSynthesis.speak(utterance);
|
|
16120
|
+
}
|
|
16121
|
+
};
|
|
16122
|
+
return /*#__PURE__*/React__default.createElement("div", null, renderButton && typeof renderButton === "function" ? renderButton({
|
|
16123
|
+
onClick: handleSpeak,
|
|
16124
|
+
isSpeaking: isSpeaking
|
|
16125
|
+
}) : /*#__PURE__*/React__default.createElement("button", {
|
|
16126
|
+
onClick: handleSpeak
|
|
16127
|
+
}, isSpeaking ? "Stop" : "Speak"));
|
|
16128
|
+
};
|
|
16129
|
+
|
|
16086
16130
|
var _excluded$d = ["items", "collapsed", "onToggle", "className", "logo", "user", "onUserClick", "drawerPosition", "isMobileOpen", "setIsMobileOpen", "showCollapsedTooltips", "tooltipOptions"];
|
|
16087
16131
|
|
|
16088
16132
|
/**
|
|
@@ -26755,4 +26799,4 @@ var StoreProvider = function StoreProvider(_ref) {
|
|
|
26755
26799
|
}, children));
|
|
26756
26800
|
};
|
|
26757
26801
|
|
|
26758
|
-
export { Accordion, Alert, Avatar, Badge, Breadcrumbs, Button, Card, Carousel, Checkbox, ColorPicker, Condition, DatePicker, DateRangePicker, Dialog, EmitterClass as Emitter, FileUpload, FootNav, Form, Helpers, Input, Loader, LocationPicker, Navbar, Pagination, PriceRangePicker, ProgressBar, Radio, Rate, RoundedTag, Select, Sidebar, Skeleton, SpeechToText, Stepper, StoreProvider, Switch, Table, Tabs, ThemeProvider, ThreeDotPopoverSimple as ThreeDotPopover, Toast, ToastContainer, Tooltip, cn$1 as cn, useApi, useMixins, useTheme, useToast };
|
|
26802
|
+
export { Accordion, Alert, Avatar, Badge, Breadcrumbs, Button, Card, Carousel, Checkbox, ColorPicker, Condition, DatePicker, DateRangePicker, Dialog, EmitterClass as Emitter, FileUpload, FootNav, Form, Helpers, Input, Loader, LocationPicker, Navbar, Pagination, PriceRangePicker, ProgressBar, Radio, Rate, RoundedTag, Select, Sidebar, Skeleton, SpeechToText, Stepper, StoreProvider, Switch, Table, Tabs, TextToSpeech, ThemeProvider, ThreeDotPopoverSimple as ThreeDotPopover, Toast, ToastContainer, Tooltip, cn$1 as cn, useApi, useMixins, useTheme, useToast };
|
package/dist/index.js
CHANGED
|
@@ -15935,7 +15935,7 @@ function LocationPicker(_ref) {
|
|
|
15935
15935
|
|
|
15936
15936
|
var SpeechToText = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
15937
15937
|
var _ref$lang = _ref.lang,
|
|
15938
|
-
lang = _ref$lang === void 0 ? "
|
|
15938
|
+
lang = _ref$lang === void 0 ? "ne-NP" : _ref$lang,
|
|
15939
15939
|
_ref$continuous = _ref.continuous,
|
|
15940
15940
|
continuous = _ref$continuous === void 0 ? true : _ref$continuous,
|
|
15941
15941
|
_ref$interimResults = _ref.interimResults,
|
|
@@ -16103,6 +16103,50 @@ var SpeechToText = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
16103
16103
|
}, _isListening ? "Stop" : "Start");
|
|
16104
16104
|
});
|
|
16105
16105
|
|
|
16106
|
+
var TextToSpeech = function TextToSpeech(_ref) {
|
|
16107
|
+
var _ref$text = _ref.text,
|
|
16108
|
+
text = _ref$text === void 0 ? "" : _ref$text,
|
|
16109
|
+
_ref$rate = _ref.rate,
|
|
16110
|
+
rate = _ref$rate === void 0 ? 1 : _ref$rate,
|
|
16111
|
+
_ref$pitch = _ref.pitch,
|
|
16112
|
+
pitch = _ref$pitch === void 0 ? 0.5 : _ref$pitch,
|
|
16113
|
+
_ref$onSpeak = _ref.onSpeak,
|
|
16114
|
+
onSpeak = _ref$onSpeak === void 0 ? function () {} : _ref$onSpeak,
|
|
16115
|
+
renderButton = _ref.renderButton;
|
|
16116
|
+
var _useState = React.useState(text),
|
|
16117
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16118
|
+
inputText = _useState2[0];
|
|
16119
|
+
_useState2[1];
|
|
16120
|
+
var _useState3 = React.useState(false),
|
|
16121
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
16122
|
+
isSpeaking = _useState4[0],
|
|
16123
|
+
setIsSpeaking = _useState4[1];
|
|
16124
|
+
var handleSpeak = function handleSpeak() {
|
|
16125
|
+
var utterance = new SpeechSynthesisUtterance(inputText);
|
|
16126
|
+
utterance.rate = rate;
|
|
16127
|
+
utterance.pitch = pitch;
|
|
16128
|
+
utterance.onstart = function () {
|
|
16129
|
+
onSpeak(inputText);
|
|
16130
|
+
setIsSpeaking(true);
|
|
16131
|
+
};
|
|
16132
|
+
utterance.onend = function () {
|
|
16133
|
+
setIsSpeaking(false);
|
|
16134
|
+
};
|
|
16135
|
+
if (isSpeaking) {
|
|
16136
|
+
window.speechSynthesis.cancel();
|
|
16137
|
+
setIsSpeaking(false);
|
|
16138
|
+
} else {
|
|
16139
|
+
window.speechSynthesis.speak(utterance);
|
|
16140
|
+
}
|
|
16141
|
+
};
|
|
16142
|
+
return /*#__PURE__*/React.createElement("div", null, renderButton && typeof renderButton === "function" ? renderButton({
|
|
16143
|
+
onClick: handleSpeak,
|
|
16144
|
+
isSpeaking: isSpeaking
|
|
16145
|
+
}) : /*#__PURE__*/React.createElement("button", {
|
|
16146
|
+
onClick: handleSpeak
|
|
16147
|
+
}, isSpeaking ? "Stop" : "Speak"));
|
|
16148
|
+
};
|
|
16149
|
+
|
|
16106
16150
|
var _excluded$d = ["items", "collapsed", "onToggle", "className", "logo", "user", "onUserClick", "drawerPosition", "isMobileOpen", "setIsMobileOpen", "showCollapsedTooltips", "tooltipOptions"];
|
|
16107
16151
|
|
|
16108
16152
|
/**
|
|
@@ -26813,6 +26857,7 @@ exports.StoreProvider = StoreProvider;
|
|
|
26813
26857
|
exports.Switch = Switch;
|
|
26814
26858
|
exports.Table = Table;
|
|
26815
26859
|
exports.Tabs = Tabs;
|
|
26860
|
+
exports.TextToSpeech = TextToSpeech;
|
|
26816
26861
|
exports.ThemeProvider = ThemeProvider;
|
|
26817
26862
|
exports.ThreeDotPopover = ThreeDotPopoverSimple;
|
|
26818
26863
|
exports.Toast = Toast;
|