@gamelearn/arcade-components 2.16.0 → 2.17.0
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.
|
@@ -13,6 +13,8 @@ var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
|
|
|
13
13
|
|
|
14
14
|
var _LectureButtons = _interopRequireDefault(require("./LectureButtons"));
|
|
15
15
|
|
|
16
|
+
var _useEkho = _interopRequireDefault(require("../../../helpers/useEkho"));
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -45,7 +47,12 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
45
47
|
viewed = _ref.viewed,
|
|
46
48
|
soundActions = _ref.soundActions,
|
|
47
49
|
backgroundImage = _ref.backgroundImage,
|
|
48
|
-
keyboardControl = _ref.keyboardControl
|
|
50
|
+
keyboardControl = _ref.keyboardControl,
|
|
51
|
+
audio = _ref.audio,
|
|
52
|
+
audioType = _ref.audioType,
|
|
53
|
+
audioVolume = _ref.audioVolume,
|
|
54
|
+
voice = _ref.voice,
|
|
55
|
+
pause = _ref.pause;
|
|
49
56
|
|
|
50
57
|
var _useState = (0, _react.useState)(),
|
|
51
58
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -67,7 +74,24 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
67
74
|
var goToLecture = !required || required && time >= limit || required && !visible;
|
|
68
75
|
|
|
69
76
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
70
|
-
playSound = _soundActions[0];
|
|
77
|
+
playSound = _soundActions[0]; // Formateo de la prop 'text' para que Azure haga pausas después de cada tag que se requiera y para evitar que Azure lea los tags htmls
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
var regexForClosingTags = /<\/p>|<\/h1>|<\/h2>|<\/h3>|<\/h4>|<\/h5>|<\/h6>|<\/li>/gi;
|
|
81
|
+
var stringsToDelete = /"|'/gi;
|
|
82
|
+
var textWithDotsBeforeClosingTags = text.replace(regexForClosingTags, '. </p>');
|
|
83
|
+
var textWithoutStringsToDelete = textWithDotsBeforeClosingTags.replace(stringsToDelete, '');
|
|
84
|
+
var textParsedForTTSwithoutHtmlTags = textWithoutStringsToDelete.replace(/(<([^>]+)>)/gi, '');
|
|
85
|
+
(0, _useEkho.default)({
|
|
86
|
+
audioType: audioType,
|
|
87
|
+
voice: voice,
|
|
88
|
+
text: textParsedForTTSwithoutHtmlTags,
|
|
89
|
+
audio: audio,
|
|
90
|
+
soundActions: soundActions,
|
|
91
|
+
emitEvent: emitEvent,
|
|
92
|
+
volume: audioVolume,
|
|
93
|
+
pauseTTS: pause
|
|
94
|
+
});
|
|
71
95
|
|
|
72
96
|
var translate = function translate(id) {
|
|
73
97
|
return emitEvent({
|