@gamelearn/arcade-components 0.25.36 → 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.
@@ -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 emitEvent({
79
+ return emitEventRef.current({
79
80
  type: 'translate',
80
81
  payload: id
81
82
  });
82
- }, [emitEvent]);
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 emitEvent({
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, getVoice, currentMessage, emitEvent, playSound]); // Recupera la antigua linea de la conversacion para conservar los personajes en voice-over
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
- emitEvent({
245
+ emitEventRef.current({
245
246
  type: 'success'
246
247
  });
247
248
  }
@@ -117,7 +117,7 @@ var LecturesComponent = function LecturesComponent(_ref) {
117
117
  var formatTime = limit - time;
118
118
  var minutes = Math.floor(formatTime / 60);
119
119
  var seconds = formatTime % 60;
120
- return /*#__PURE__*/_react.default.createElement("div", {
120
+ return visible ? /*#__PURE__*/_react.default.createElement("div", {
121
121
  className: "".concat(viewed ? 'notes--results' : 'readings--container')
122
122
  }, /*#__PURE__*/_react.default.createElement("div", {
123
123
  className: viewed ? 'notes--results__text' : 'readings'
@@ -131,7 +131,7 @@ var LecturesComponent = function LecturesComponent(_ref) {
131
131
  minutes: minutes,
132
132
  seconds: seconds,
133
133
  btnText: translate('screens.continue')
134
- }) : null));
134
+ }) : null)) : null;
135
135
  };
136
136
 
137
137
  LecturesComponent.defaultProps = {
@@ -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
- } // console.log('🐮', jsx);
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) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "license": "Gamelearn",
4
- "version": "0.25.36",
4
+ "version": "0.26.0",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist",