@gamelearn/arcade-components 0.25.38 → 0.26.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.
package/dist/components/conversational-pro-component/components/ConversationalProComponent.js
CHANGED
|
@@ -68,6 +68,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
68
68
|
finished = _useState4[0],
|
|
69
69
|
setFinished = _useState4[1];
|
|
70
70
|
|
|
71
|
+
var emitEventRef = (0, _react.useRef)(emitEvent);
|
|
71
72
|
var backgroundImage = (background === null || background === void 0 ? void 0 : (_background$img = background.img) === null || _background$img === void 0 ? void 0 : _background$img.url) || null;
|
|
72
73
|
var currentLineData = lines[currentLine];
|
|
73
74
|
var voiceOverSlots = [];
|
|
@@ -75,11 +76,11 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
75
76
|
decision = currentLineData.decision;
|
|
76
77
|
var isFlex = currentLineData.flex;
|
|
77
78
|
var translate = (0, _react.useCallback)(function (id) {
|
|
78
|
-
return
|
|
79
|
+
return emitEventRef.current({
|
|
79
80
|
type: 'translate',
|
|
80
81
|
payload: id
|
|
81
82
|
});
|
|
82
|
-
}, [
|
|
83
|
+
}, []);
|
|
83
84
|
var getCurrentMessage = (0, _react.useCallback)(function () {
|
|
84
85
|
if (voiceOver) {
|
|
85
86
|
return currentLineData;
|
|
@@ -140,7 +141,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
140
141
|
}
|
|
141
142
|
|
|
142
143
|
_context.next = 5;
|
|
143
|
-
return
|
|
144
|
+
return emitEventRef.current({
|
|
144
145
|
type: 'playSpeech',
|
|
145
146
|
payload: payload
|
|
146
147
|
});
|
|
@@ -155,7 +156,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
}, _callee);
|
|
158
|
-
})), [currentLineData.voice,
|
|
159
|
+
})), [currentLineData.voice, currentMessage.text, getVoice, playSound]); // Recupera la antigua linea de la conversacion para conservar los personajes en voice-over
|
|
159
160
|
|
|
160
161
|
var leftWithSlots = lines.slice(0, currentLine + 1).reverse().find(function (line) {
|
|
161
162
|
return line.slots;
|
|
@@ -241,7 +242,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
241
242
|
setCurrentLine(line + 1);
|
|
242
243
|
} else {
|
|
243
244
|
setFinished(true);
|
|
244
|
-
|
|
245
|
+
emitEventRef.current({
|
|
245
246
|
type: 'success'
|
|
246
247
|
});
|
|
247
248
|
}
|
|
@@ -101,7 +101,6 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
101
101
|
backgroundRepeat: "no-repeat",
|
|
102
102
|
backgroundPosition: "center center"
|
|
103
103
|
};
|
|
104
|
-
console.log('re-render control');
|
|
105
104
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
106
105
|
className: "video media-visor",
|
|
107
106
|
style: isAudio ? configForAudio : null
|
|
@@ -76,8 +76,7 @@ var getRecursiveJSX = function getRecursiveJSX(jsx) {
|
|
|
76
76
|
return /*#__PURE__*/_react.default.createElement(Type, _extends({
|
|
77
77
|
key: "".concat(jsx.type, "_").concat(i)
|
|
78
78
|
}, props), getRecursiveJSX(children, i, slide, onClick, onHover));
|
|
79
|
-
}
|
|
80
|
-
|
|
79
|
+
}
|
|
81
80
|
|
|
82
81
|
if (((_jsx$props3 = jsx.props) === null || _jsx$props3 === void 0 ? void 0 : _jsx$props3.children) !== null) {
|
|
83
82
|
return jsx.split(' ').filter(function (word) {
|