@gamelearn/arcade-components 1.3.9 → 1.3.11

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.
Files changed (36) hide show
  1. package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +8 -4
  2. package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +0 -4
  3. package/dist/components/chained-image-click-puzzle-component/components/ChainedImageClickPuzzleComponent.js +2 -4
  4. package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +8 -4
  5. package/dist/components/chained-image-click-puzzle-component/mocks/mockForStory.js +0 -2
  6. package/dist/components/comic-component/mocks/mockForStory.js +0 -1
  7. package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +16 -7
  8. package/dist/components/conversational-pro-component/mocks/mockForStory.js +0 -6
  9. package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +13 -4
  10. package/dist/components/cracker-puzzle-component/mocks/mockForStory.js +0 -5
  11. package/dist/components/decision-component/mocks/mockForStory.js +0 -2
  12. package/dist/components/dialog-component/components/DialogComponent.js +34 -35
  13. package/dist/components/dialog-component/mocks/mockForStory.js +0 -1
  14. package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +8 -4
  15. package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +2 -0
  16. package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +0 -3
  17. package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +17 -10
  18. package/dist/components/hacker-puzzle-component/mocks/mockForStory.js +0 -3
  19. package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +13 -4
  20. package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +0 -1
  21. package/dist/components/image-click-puzzle-component/components/ImageClickPuzzleComponent.js +2 -0
  22. package/dist/components/image-click-puzzle-component/mocks/mockForStory.js +0 -4
  23. package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +0 -3
  24. package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +8 -4
  25. package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +0 -1
  26. package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +16 -7
  27. package/dist/components/login-puzzle-component/mocks/mockForStory.js +0 -1
  28. package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +13 -4
  29. package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +0 -2
  30. package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +14 -5
  31. package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +0 -2
  32. package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +14 -5
  33. package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +0 -1
  34. package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +2 -0
  35. package/dist/components/writer-puzzle-component/mocks/mockForStory.js +0 -8
  36. package/package.json +1 -1
@@ -46,7 +46,6 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
46
46
  disableExit = _ref.disableExit,
47
47
  setResolveAction = _ref.setResolveAction,
48
48
  soundActions = _ref.soundActions,
49
- setShowPoints = _ref.setShowPoints,
50
49
  bgImg = _ref.bgImg;
51
50
 
52
51
  var _useState = (0, _react.useState)(false),
@@ -101,8 +100,13 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
101
100
  type: 'hidePuzzleButtons',
102
101
  payload: false
103
102
  });
104
- setShowPoints(rewardsData);
105
- }, [emitEvent, setShowPoints]);
103
+ emitEvent({
104
+ type: 'addPoints',
105
+ complex: true,
106
+ finish: true,
107
+ payload: rewardsData
108
+ });
109
+ }, [emitEvent]);
106
110
 
107
111
  var _endPuzzle = function endPuzzle() {
108
112
  emitEvent({
@@ -190,7 +194,7 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
190
194
  closeFeedbackAndShowPoints(rewardsData);
191
195
  }, 2000);
192
196
  });
193
- }, [setResolveAction, disableExit, accRewards, info.resolve.rewards, emitEvent, setShowPoints, closeFeedbackAndShowPoints]);
197
+ }, [setResolveAction, disableExit, accRewards, info.resolve.rewards, emitEvent, closeFeedbackAndShowPoints]);
194
198
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
195
199
  className: "cards-selector",
196
200
  style: bgImg ? {
@@ -16,7 +16,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
16
16
  var mockProps = {
17
17
  emitEvent: _mocker.emitEvent,
18
18
  soundActions: _mocker.soundActions,
19
- setShowPoints: _mocker.setShowPoints,
20
19
  disableExit: function disableExit() {},
21
20
  setResolveAction: function setResolveAction() {},
22
21
  cards: [{
@@ -93,7 +92,6 @@ exports.mockProps = mockProps;
93
92
  var mockProps2 = {
94
93
  emitEvent: _mocker.emitEvent,
95
94
  soundActions: _mocker.soundActions,
96
- setShowPoints: _mocker.setShowPoints,
97
95
  disableExit: function disableExit() {},
98
96
  setResolveAction: function setResolveAction() {},
99
97
  cards: [{
@@ -170,7 +168,6 @@ exports.mockProps2 = mockProps2;
170
168
  var mockProps3 = {
171
169
  emitEvent: _mocker.emitEvent,
172
170
  soundActions: _mocker.soundActions,
173
- setShowPoints: _mocker.setShowPoints,
174
171
  disableExit: function disableExit() {},
175
172
  setResolveAction: function setResolveAction() {},
176
173
  cards: [{
@@ -275,7 +272,6 @@ exports.mockProps3 = mockProps3;
275
272
  var mockProps4 = {
276
273
  emitEvent: _mocker.emitEvent,
277
274
  soundActions: _mocker.soundActions,
278
- setShowPoints: _mocker.setShowPoints,
279
275
  disableExit: function disableExit() {},
280
276
  setResolveAction: function setResolveAction() {},
281
277
  cards: [{
@@ -38,8 +38,7 @@ var ChainedImageClickPuzzleComponent = function ChainedImageClickPuzzleComponent
38
38
  soundActions = props.soundActions,
39
39
  showFrames = props.showFrames,
40
40
  disableExit = props.disableExit,
41
- setResolveAction = props.setResolveAction,
42
- setShowPoints = props.setShowPoints;
41
+ setResolveAction = props.setResolveAction;
43
42
 
44
43
  var _useState = (0, _react.useState)(0),
45
44
  _useState2 = _slicedToArray(_useState, 2),
@@ -56,8 +55,7 @@ var ChainedImageClickPuzzleComponent = function ChainedImageClickPuzzleComponent
56
55
  soundActions: soundActions,
57
56
  setInfo: setInfo,
58
57
  setSelected: setSelected,
59
- selected: selected,
60
- setShowPoints: setShowPoints
58
+ selected: selected
61
59
  };
62
60
  var totalCorrects = list.reduce(function (acc, current) {
63
61
  return acc + current.areas.length;
@@ -55,8 +55,7 @@ var CurrentImageClickPuzzle = function CurrentImageClickPuzzle(_ref) {
55
55
  setResolveAction = _ref.setResolveAction,
56
56
  soundActions = _ref.soundActions,
57
57
  setSelected = _ref.setSelected,
58
- selected = _ref.selected,
59
- setShowPoints = _ref.setShowPoints;
58
+ selected = _ref.selected;
60
59
  var accRewards = (0, _react.useRef)([]);
61
60
  var correctClicked = (0, _react.useRef)(0);
62
61
 
@@ -87,8 +86,13 @@ var CurrentImageClickPuzzle = function CurrentImageClickPuzzle(_ref) {
87
86
  type: 'hidePuzzleButtons',
88
87
  payload: false
89
88
  });
90
- setShowPoints([].concat(_toConsumableArray(accRewards.current), _toConsumableArray(rewards)));
91
- }, [playSound, emitEvent, setShowPoints]);
89
+ emitEvent({
90
+ type: 'addPoints',
91
+ complex: true,
92
+ finish: true,
93
+ payload: [].concat(_toConsumableArray(accRewards.current), _toConsumableArray(rewards))
94
+ });
95
+ }, [playSound, emitEvent]);
92
96
  var currentImageProps = list[index];
93
97
  var info = currentImageProps.info,
94
98
  specificFeedbacks = currentImageProps.specificFeedbacks;
@@ -13,7 +13,6 @@ var mockProps = {
13
13
  description: 'Dale al arma',
14
14
  showFrames: true,
15
15
  setInfo: function setInfo() {},
16
- setShowPoints: _mocker.setShowPoints,
17
16
  emitEvent: _mocker.emitEvent,
18
17
  soundActions: _mocker.soundActions,
19
18
  disableExit: function disableExit() {},
@@ -170,7 +169,6 @@ var mockProps2 = {
170
169
  soundActions: _mocker.soundActions,
171
170
  disableExit: function disableExit() {},
172
171
  setResolveAction: function setResolveAction() {},
173
- setShowPoints: _mocker.setShowPoints,
174
172
  list: [{
175
173
  info: {
176
174
  hint: {
@@ -11,7 +11,6 @@ var _mocker = require("helpers/mocker");
11
11
  var comicProps = {
12
12
  emitEvent: _mocker.emitEvent,
13
13
  soundActions: _mocker.soundActions,
14
- setShowPoints: _mocker.setShowPoints,
15
14
  slides: [{
16
15
  slideOrder: 1,
17
16
  transitionEffects: null,
@@ -121,13 +121,13 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
121
121
  return !decision ? getCurrentMessage() : {};
122
122
  }, [getCurrentMessage, decision]);
123
123
  var playSpeech = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
124
- var payload;
124
+ var payload, url;
125
125
  return regeneratorRuntime.wrap(function _callee$(_context) {
126
126
  while (1) {
127
127
  switch (_context.prev = _context.next) {
128
128
  case 0:
129
129
  if (!(currentLineData.voice.id && currentMessage)) {
130
- _context.next = 5;
130
+ _context.next = 7;
131
131
  break;
132
132
  }
133
133
 
@@ -137,23 +137,27 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
137
137
  };
138
138
 
139
139
  if (!(payload.voiceId && payload.text)) {
140
- _context.next = 5;
140
+ _context.next = 7;
141
141
  break;
142
142
  }
143
143
 
144
144
  _context.next = 5;
145
145
  return emitEvent({
146
- type: 'playSpeech',
146
+ type: 'getSpeech',
147
147
  payload: payload
148
148
  });
149
149
 
150
150
  case 5:
151
+ url = _context.sent;
152
+ playSound(url, 'tts');
153
+
154
+ case 7:
151
155
  case "end":
152
156
  return _context.stop();
153
157
  }
154
158
  }
155
159
  }, _callee);
156
- })), [currentLineData.voice, currentMessage, emitEvent, getVoice]); // Recupera la antigua linea de la conversacion para conservar los personajes en voice-over
160
+ })), [currentLineData.voice, currentMessage, emitEvent, getVoice, playSound]); // Recupera la antigua linea de la conversacion para conservar los personajes en voice-over
157
161
 
158
162
  var leftWithSlots = lines.slice(0, currentLine + 1).reverse().find(function (line) {
159
163
  return line.slots;
@@ -261,13 +265,18 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
261
265
  } else if (currentLineData !== null && currentLineData !== void 0 && (_currentLineData$audi = currentLineData.audio) !== null && _currentLineData$audi !== void 0 && _currentLineData$audi.url) {
262
266
  var _currentLineData$audi2;
263
267
 
264
- playSound(currentLineData === null || currentLineData === void 0 ? void 0 : (_currentLineData$audi2 = currentLineData.audio) === null || _currentLineData$audi2 === void 0 ? void 0 : _currentLineData$audi2.url);
268
+ playSound(currentLineData === null || currentLineData === void 0 ? void 0 : (_currentLineData$audi2 = currentLineData.audio) === null || _currentLineData$audi2 === void 0 ? void 0 : _currentLineData$audi2.url, 'tts');
265
269
  }
266
270
 
267
271
  return function () {
268
- stop();
272
+ stop('tts');
269
273
  };
270
274
  }, [currentLineData, currentMessage, finished, lines, playSound, playSpeech, stop]);
275
+ (0, _react.useEffect)(function () {
276
+ return function () {
277
+ stop('tts');
278
+ };
279
+ }, [stop]);
271
280
 
272
281
  var decisionPayload = _objectSpread(_objectSpread({}, currentLineData.payload), {}, {
273
282
  onFinish: handleClickNext,
@@ -22,7 +22,6 @@ var animations = {
22
22
  var converOld = {
23
23
  emitEvent: _mocker.emitEvent,
24
24
  soundActions: _mocker.soundActions,
25
- setShowPoints: _mocker.setShowPoints,
26
25
  messages: [{
27
26
  character: 'Puerta',
28
27
  emotion: 'neutral',
@@ -77,7 +76,6 @@ exports.converOld = converOld;
77
76
  var conversationProps = {
78
77
  emitEvent: _mocker.emitEvent,
79
78
  soundActions: _mocker.soundActions,
80
- setShowPoints: _mocker.setShowPoints,
81
79
  lines: [{
82
80
  flex: true,
83
81
  slots: [{
@@ -344,7 +342,6 @@ exports.conversationProps = conversationProps;
344
342
  var voiceOverProps = {
345
343
  emitEvent: _mocker.emitEvent,
346
344
  soundActions: _mocker.soundActions,
347
- setShowPoints: _mocker.setShowPoints,
348
345
  lines: [{
349
346
  flex: false,
350
347
  slots: [{
@@ -478,7 +475,6 @@ exports.voiceOverProps = voiceOverProps;
478
475
  var withoutBackground = {
479
476
  emitEvent: _mocker.emitEvent,
480
477
  soundActions: _mocker.soundActions,
481
- setShowPoints: _mocker.setShowPoints,
482
478
  lines: [{
483
479
  flex: false,
484
480
  slots: [{
@@ -608,7 +604,6 @@ exports.withoutBackground = withoutBackground;
608
604
  var conversationPropsNoFeedbackNoRewards = {
609
605
  emitEvent: _mocker.emitEvent,
610
606
  soundActions: _mocker.soundActions,
611
- setShowPoints: _mocker.setShowPoints,
612
607
  lines: [{
613
608
  flex: true,
614
609
  slots: [{
@@ -869,7 +864,6 @@ exports.conversationPropsNoFeedbackNoRewards = conversationPropsNoFeedbackNoRewa
869
864
  var conversationPropsLodSettings = {
870
865
  emitEvent: _mocker.emitEvent,
871
866
  soundActions: _mocker.soundActions,
872
- setShowPoints: _mocker.setShowPoints,
873
867
  lodSettings: {
874
868
  currentLOD: 'original',
875
869
  rgbSimulation: true,
@@ -74,8 +74,7 @@ var CrackerPuzzleComponent = function CrackerPuzzleComponent(_ref) {
74
74
  password = _ref.password,
75
75
  disableExit = _ref.disableExit,
76
76
  difficulty = _ref.difficulty,
77
- setResolveAction = _ref.setResolveAction,
78
- setShowPoints = _ref.setShowPoints;
77
+ setResolveAction = _ref.setResolveAction;
79
78
 
80
79
  var _soundActions = _slicedToArray(soundActions, 1),
81
80
  playSound = _soundActions[0];
@@ -147,7 +146,12 @@ var CrackerPuzzleComponent = function CrackerPuzzleComponent(_ref) {
147
146
  type: 'hidePuzzleButtons',
148
147
  payload: false
149
148
  });
150
- setShowPoints(info.resolve.rewards);
149
+ emitEvent({
150
+ type: 'addPoints',
151
+ complex: true,
152
+ finish: true,
153
+ payload: info.resolve.rewards
154
+ });
151
155
  }, 0);
152
156
  });
153
157
  }, [setResolveAction, playSound]);
@@ -155,7 +159,12 @@ var CrackerPuzzleComponent = function CrackerPuzzleComponent(_ref) {
155
159
  var handleFinish = function handleFinish() {
156
160
  playSound('click-ui');
157
161
  var rewards = solution.right.rewards;
158
- setShowPoints(rewards);
162
+ emitEvent({
163
+ type: 'addPoints',
164
+ complex: true,
165
+ finish: true,
166
+ payload: rewards
167
+ });
159
168
  };
160
169
 
161
170
  var generatePasswordPositions = function generatePasswordPositions() {
@@ -10,7 +10,6 @@ var _mocker = require("helpers/mocker");
10
10
  var mockProps = {
11
11
  emitEvent: _mocker.emitEvent,
12
12
  soundActions: _mocker.soundActions,
13
- setShowPoints: _mocker.setShowPoints,
14
13
  disableExit: function disableExit() {},
15
14
  setResolveAction: function setResolveAction() {},
16
15
  velocity: 'slow',
@@ -64,7 +63,6 @@ exports.mockProps = mockProps;
64
63
  var mockProps2 = {
65
64
  emitEvent: _mocker.emitEvent,
66
65
  soundActions: _mocker.soundActions,
67
- setShowPoints: _mocker.setShowPoints,
68
66
  disableExit: function disableExit() {},
69
67
  setResolveAction: function setResolveAction() {},
70
68
  velocity: 'fast',
@@ -118,7 +116,6 @@ exports.mockProps2 = mockProps2;
118
116
  var mockProps3 = {
119
117
  emitEvent: _mocker.emitEvent,
120
118
  soundActions: _mocker.soundActions,
121
- setShowPoints: _mocker.setShowPoints,
122
119
  disableExit: function disableExit() {},
123
120
  setResolveAction: function setResolveAction() {},
124
121
  velocity: 'fastest',
@@ -172,7 +169,6 @@ exports.mockProps3 = mockProps3;
172
169
  var mockProps4 = {
173
170
  emitEvent: _mocker.emitEvent,
174
171
  soundActions: _mocker.soundActions,
175
- setShowPoints: _mocker.setShowPoints,
176
172
  disableExit: function disableExit() {},
177
173
  setResolveAction: function setResolveAction() {},
178
174
  velocity: 'fastest',
@@ -226,7 +222,6 @@ exports.mockProps4 = mockProps4;
226
222
  var mockProps5 = {
227
223
  emitEvent: _mocker.emitEvent,
228
224
  soundActions: _mocker.soundActions,
229
- setShowPoints: _mocker.setShowPoints,
230
225
  disableExit: function disableExit() {},
231
226
  setResolveAction: function setResolveAction() {},
232
227
  velocity: 'slow',
@@ -10,7 +10,6 @@ var _mocker = require("helpers/mocker");
10
10
  var decisionProps = {
11
11
  emitEvent: _mocker.emitEvent,
12
12
  soundActions: _mocker.soundActions,
13
- setShowPoints: _mocker.setShowPoints,
14
13
  onFinish: function onFinish() {
15
14
  return (0, _mocker.onFinish)('decision-component');
16
15
  },
@@ -129,7 +128,6 @@ exports.decisionProps = decisionProps;
129
128
  var decisionPropsWithRadios = {
130
129
  emitEvent: _mocker.emitEvent,
131
130
  soundActions: _mocker.soundActions,
132
- setShowPoints: _mocker.setShowPoints,
133
131
  options: [{
134
132
  id: 0,
135
133
  right: false,
@@ -149,13 +149,13 @@ var DialogComponent = function DialogComponent(_ref) {
149
149
  return null;
150
150
  }, [translate]);
151
151
  var playSpeech = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
152
- var payload;
152
+ var payload, url;
153
153
  return regeneratorRuntime.wrap(function _callee$(_context) {
154
154
  while (1) {
155
155
  switch (_context.prev = _context.next) {
156
156
  case 0:
157
157
  if (!currentLine.voice.id) {
158
- _context.next = 5;
158
+ _context.next = 7;
159
159
  break;
160
160
  }
161
161
 
@@ -165,23 +165,32 @@ var DialogComponent = function DialogComponent(_ref) {
165
165
  };
166
166
 
167
167
  if (!(payload.voiceId && payload.text)) {
168
- _context.next = 5;
168
+ _context.next = 7;
169
169
  break;
170
170
  }
171
171
 
172
172
  _context.next = 5;
173
173
  return emitEvent({
174
- type: 'playSpeech',
174
+ type: 'getSpeech',
175
175
  payload: payload
176
176
  });
177
177
 
178
178
  case 5:
179
+ url = _context.sent;
180
+ playSound(url, 'tts');
181
+
182
+ case 7:
183
+ return _context.abrupt("return", function () {
184
+ stop('tts');
185
+ });
186
+
187
+ case 8:
179
188
  case "end":
180
189
  return _context.stop();
181
190
  }
182
191
  }
183
192
  }, _callee);
184
- })), [currentLine === null || currentLine === void 0 ? void 0 : currentLine.voice, getVoice, currentMessage.text, emitEvent]);
193
+ })), [currentLine === null || currentLine === void 0 ? void 0 : currentLine.voice, getVoice, currentMessage.text, playSound, emitEvent, stop]);
185
194
  var getCurrentVisible = (0, _react.useCallback)(function (uid) {
186
195
  var object;
187
196
  scene.traverseVisible(function (node) {
@@ -227,7 +236,7 @@ var DialogComponent = function DialogComponent(_ref) {
227
236
  } else {
228
237
  onLoadAnim();
229
238
  }
230
- }, [loader]); // Reset currentEmotion to defaultAnim
239
+ }, [loader]);
231
240
 
232
241
  var executeAnimation = function executeAnimation(element) {
233
242
  var mixer = element.userData.mixer;
@@ -244,30 +253,16 @@ var DialogComponent = function DialogComponent(_ref) {
244
253
 
245
254
  element.userData.currentEmotion = defaultAction;
246
255
  }
247
- };
248
-
249
- var resetAnims = (0, _react.useCallback)(function () {
250
- var end = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
256
+ }; // Reset currentEmotion to defaultAnim
251
257
 
252
- if (end) {
253
- scene.traverseVisible(function (node) {
254
- if (node.userData.mixer && node.userData.currentEmotion) {
255
- executeAnimation(node);
256
- }
257
- });
258
- } else if (lastLine !== null && lastLine !== void 0 && lastLine.slots) {
259
- var slottedCharacters = lastLine.slots.filter(function (slot) {
260
- return slot.uid;
261
- });
262
- slottedCharacters.forEach(function (slot) {
263
- var element = getCurrentVisible(slot.uid);
264
258
 
265
- if (element && element.userData.currentEmotion) {
266
- executeAnimation(element);
267
- }
268
- });
269
- }
270
- }, [getCurrentVisible, lastLine === null || lastLine === void 0 ? void 0 : lastLine.slots, scene]);
259
+ var resetAnims = (0, _react.useCallback)(function () {
260
+ scene.traverseVisible(function (node) {
261
+ if (node.userData.mixer && node.userData.currentEmotion) {
262
+ executeAnimation(node);
263
+ }
264
+ });
265
+ }, [scene]);
271
266
  var resetCameraView = (0, _react.useCallback)(function () {
272
267
  messagePosition.current.child = null;
273
268
  messagePosition.current.parent = null;
@@ -284,7 +279,7 @@ var DialogComponent = function DialogComponent(_ref) {
284
279
  setCurrentMessage({});
285
280
  changeLine(line + 1);
286
281
  } else {
287
- resetAnims(true);
282
+ resetAnims();
288
283
  lastSet.current = true;
289
284
  setCurrentMessage({});
290
285
  resetCameraView();
@@ -318,8 +313,7 @@ var DialogComponent = function DialogComponent(_ref) {
318
313
  });
319
314
  var slottedCharacters = currentLine.slots.filter(function (slot) {
320
315
  return slot.uid && !slot.talking;
321
- });
322
- resetAnims(false); // Check not talking elements emotion
316
+ }); // Check not talking elements emotion
323
317
 
324
318
  slottedCharacters.forEach(function (slot) {
325
319
  var element = getCurrentVisible(slot.uid);
@@ -408,7 +402,7 @@ var DialogComponent = function DialogComponent(_ref) {
408
402
  });
409
403
  }
410
404
  }
411
- }, [actors, camera, currentLine, zoomInActor, getCurrentVisible, translate, getAvatarURL, loadEmotion, resetAnims, resetCameraView]); // Sound logic
405
+ }, [actors, camera, currentLine, zoomInActor, getCurrentVisible, translate, getAvatarURL, loadEmotion, resetCameraView]); // Sound logic
412
406
 
413
407
  (0, _react.useEffect)(function () {
414
408
  var _currentLine$audio;
@@ -418,13 +412,18 @@ var DialogComponent = function DialogComponent(_ref) {
418
412
  } else if (currentLine !== null && currentLine !== void 0 && (_currentLine$audio = currentLine.audio) !== null && _currentLine$audio !== void 0 && _currentLine$audio.url) {
419
413
  var _currentLine$audio2;
420
414
 
421
- playSound(currentLine === null || currentLine === void 0 ? void 0 : (_currentLine$audio2 = currentLine.audio) === null || _currentLine$audio2 === void 0 ? void 0 : _currentLine$audio2.url);
415
+ playSound(currentLine === null || currentLine === void 0 ? void 0 : (_currentLine$audio2 = currentLine.audio) === null || _currentLine$audio2 === void 0 ? void 0 : _currentLine$audio2.url, 'tts');
422
416
  }
423
417
 
424
418
  return function () {
425
- stop();
419
+ stop('tts');
420
+ };
421
+ }, [currentLine === null || currentLine === void 0 ? void 0 : (_currentLine$audio3 = currentLine.audio) === null || _currentLine$audio3 === void 0 ? void 0 : _currentLine$audio3.url, currentLine === null || currentLine === void 0 ? void 0 : currentLine.audioType, currentMessage, lines, playSound, playSpeech, stop]);
422
+ (0, _react.useEffect)(function () {
423
+ return function () {
424
+ stop('tts');
426
425
  };
427
- }, [currentLine === null || currentLine === void 0 ? void 0 : (_currentLine$audio3 = currentLine.audio) === null || _currentLine$audio3 === void 0 ? void 0 : _currentLine$audio3.url, currentLine === null || currentLine === void 0 ? void 0 : currentLine.audioType, currentMessage, lines, playSound, playSpeech, stop]); // Autoplay logic
426
+ }, [stop]); // Autoplay logic
428
427
 
429
428
  (0, _react.useEffect)(function () {
430
429
  var timeout;
@@ -28,7 +28,6 @@ var animations = {
28
28
  var mockProps = {
29
29
  emitEvent: _mocker.emitEvent,
30
30
  soundActions: _mocker.soundActions,
31
- setShowPoints: _mocker.setShowPoints,
32
31
  autoPlay: false,
33
32
  lines: [{
34
33
  flex: true,
@@ -62,8 +62,7 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
62
62
  consume = _ref.consume,
63
63
  disableExit = _ref.disableExit,
64
64
  emitEvent = _ref.emitEvent,
65
- soundActions = _ref.soundActions,
66
- setShowPoints = _ref.setShowPoints;
65
+ soundActions = _ref.soundActions;
67
66
  var solution = info.solution;
68
67
  var areaRef = (0, _react.useRef)();
69
68
  var areaTextRef = (0, _react.useRef)();
@@ -169,7 +168,12 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
169
168
  type: 'hidePuzzleButtons',
170
169
  payload: false
171
170
  });
172
- setShowPoints(accRewards.current);
171
+ emitEvent({
172
+ type: 'addPoints',
173
+ complex: true,
174
+ finish: true,
175
+ payload: accRewards.current
176
+ });
173
177
 
174
178
  if (consume) {
175
179
  emitEvent({
@@ -186,7 +190,7 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
186
190
  type: 'closeUI',
187
191
  ui: 'inventory'
188
192
  });
189
- }, [consume, emitEvent, resolveObject.name, resolveObject.uid, setShowPoints]);
193
+ }, [consume, emitEvent, resolveObject.name, resolveObject.uid]);
190
194
  var handleClose = (0, _react.useCallback)(function () {
191
195
  playSound('score');
192
196
  setResolveClass('success');
@@ -92,6 +92,8 @@ var FrameImageClickComponent = function FrameImageClickComponent(_ref) {
92
92
  var handleFinish = (0, _react.useCallback)(function (rewards) {
93
93
  emitEvent({
94
94
  type: 'addPoints',
95
+ complex: true,
96
+ finish: true,
95
97
  payload: [].concat(_toConsumableArray(accRewards.current), _toConsumableArray(rewards))
96
98
  });
97
99
  }, [emitEvent]);
@@ -16,7 +16,6 @@ var mockProps = {
16
16
  setInfo: function setInfo() {},
17
17
  emitEvent: _mocker.emitEvent,
18
18
  soundActions: _mocker.soundActions,
19
- setShowPoints: _mocker.setShowPoints,
20
19
  disableExit: function disableExit() {},
21
20
  setResolveAction: function setResolveAction() {},
22
21
  list: [{
@@ -171,7 +170,6 @@ var mockPropsOnce = {
171
170
  setInfo: function setInfo() {},
172
171
  emitEvent: _mocker.emitEvent,
173
172
  soundActions: _mocker.soundActions,
174
- setShowPoints: _mocker.setShowPoints,
175
173
  disableExit: function disableExit() {},
176
174
  setResolveAction: function setResolveAction() {},
177
175
  list: [{
@@ -323,7 +321,6 @@ var mockProps2 = {
323
321
  setInfo: function setInfo() {},
324
322
  emitEvent: _mocker.emitEvent,
325
323
  soundActions: _mocker.soundActions,
326
- setShowPoints: _mocker.setShowPoints,
327
324
  disableExit: function disableExit() {},
328
325
  setResolveAction: function setResolveAction() {},
329
326
  list: [{
@@ -77,8 +77,7 @@ var HackerPuzzleComponent = function HackerPuzzleComponent(_ref) {
77
77
  type = _ref.type,
78
78
  writingSpeed = _ref.writingSpeed,
79
79
  disableExit = _ref.disableExit,
80
- setResolveAction = _ref.setResolveAction,
81
- setShowPoints = _ref.setShowPoints;
80
+ setResolveAction = _ref.setResolveAction;
82
81
 
83
82
  var translate = function translate(id) {
84
83
  return emitEvent({
@@ -133,7 +132,12 @@ var HackerPuzzleComponent = function HackerPuzzleComponent(_ref) {
133
132
  var handleFinish = function handleFinish() {
134
133
  playSound('click-ui');
135
134
  var rewards = solution.right.rewards;
136
- setShowPoints(rewards);
135
+ emitEvent({
136
+ type: 'addPoints',
137
+ complex: true,
138
+ finish: true,
139
+ payload: rewards
140
+ });
137
141
  };
138
142
 
139
143
  (0, _react.useEffect)(function () {
@@ -145,13 +149,16 @@ var HackerPuzzleComponent = function HackerPuzzleComponent(_ref) {
145
149
  setResolveAction(function () {
146
150
  playSound('score');
147
151
  setFinished(true);
148
- setTimeout(function () {
149
- emitEvent({
150
- type: 'hidePuzzleButtons',
151
- payload: false
152
- });
153
- setShowPoints(info.resolve.rewards);
154
- }, 0);
152
+ emitEvent({
153
+ type: 'hidePuzzleButtons',
154
+ payload: false
155
+ });
156
+ emitEvent({
157
+ type: 'addPoints',
158
+ complex: true,
159
+ finish: true,
160
+ payload: info.resolve.rewards
161
+ });
155
162
  });
156
163
  }, [setResolveAction]);
157
164
 
@@ -10,7 +10,6 @@ var _mocker = require("helpers/mocker");
10
10
  var mockProps = {
11
11
  emitEvent: _mocker.emitEvent,
12
12
  soundActions: _mocker.soundActions,
13
- setShowPoints: _mocker.setShowPoints,
14
13
  disableExit: function disableExit() {},
15
14
  setResolveAction: function setResolveAction() {},
16
15
  type: 'js',
@@ -42,7 +41,6 @@ exports.mockProps = mockProps;
42
41
  var mockProps2 = {
43
42
  emitEvent: _mocker.emitEvent,
44
43
  soundActions: _mocker.soundActions,
45
- setShowPoints: _mocker.setShowPoints,
46
44
  disableExit: function disableExit() {},
47
45
  setResolveAction: function setResolveAction() {},
48
46
  type: 'python',
@@ -74,7 +72,6 @@ exports.mockProps2 = mockProps2;
74
72
  var mockProps3 = {
75
73
  emitEvent: _mocker.emitEvent,
76
74
  soundActions: _mocker.soundActions,
77
- setShowPoints: _mocker.setShowPoints,
78
75
  disableExit: function disableExit() {},
79
76
  setResolveAction: function setResolveAction() {},
80
77
  type: 'lua',
@@ -102,7 +102,6 @@ var HangedPuzzleComponent = function HangedPuzzleComponent(_ref4) {
102
102
  info = _ref4.info,
103
103
  answer = _ref4.answer,
104
104
  hintUsed = _ref4.hintUsed,
105
- setShowPoints = _ref4.setShowPoints,
106
105
  setResolveAction = _ref4.setResolveAction;
107
106
 
108
107
  var _soundActions = _slicedToArray(soundActions, 1),
@@ -327,7 +326,12 @@ var HangedPuzzleComponent = function HangedPuzzleComponent(_ref4) {
327
326
  type: 'hidePuzzleButtons',
328
327
  payload: false
329
328
  });
330
- setShowPoints(rewardsData);
329
+ emitEvent({
330
+ type: 'addPoints',
331
+ complex: true,
332
+ finish: true,
333
+ payload: rewardsData
334
+ });
331
335
  };
332
336
 
333
337
  var handleFail = function handleFail() {
@@ -407,10 +411,15 @@ var HangedPuzzleComponent = function HangedPuzzleComponent(_ref4) {
407
411
  type: 'hidePuzzleButtons',
408
412
  payload: false
409
413
  });
410
- setShowPoints(rewardsData);
414
+ emitEvent({
415
+ type: 'addPoints',
416
+ complex: true,
417
+ finish: true,
418
+ payload: rewardsData
419
+ });
411
420
  }, 2000);
412
421
  });
413
- }, [setHiddenAnswer, mounted, answer, setResolveAction, emitEvent, accRewards, info.resolve.rewards, setShowPoints]);
422
+ }, [setHiddenAnswer, mounted, answer, setResolveAction, emitEvent, accRewards, info.resolve.rewards]);
414
423
  return /*#__PURE__*/_react.default.createElement("div", {
415
424
  className: "puzzle--hanged",
416
425
  style: {
@@ -14,7 +14,6 @@ var disableExit = function disableExit(attr) {
14
14
  var mockProps = {
15
15
  emitEvent: _mocker.emitEvent,
16
16
  soundActions: _mocker.soundActions,
17
- setShowPoints: _mocker.setShowPoints,
18
17
  disableExit: disableExit,
19
18
  setResolveAction: function setResolveAction() {},
20
19
  image: {
@@ -18,6 +18,8 @@ var ImageClickPuzzleComponent = function ImageClickPuzzleComponent(props) {
18
18
  if (success) {
19
19
  props.emitEvent({
20
20
  type: 'addPoints',
21
+ complex: true,
22
+ finish: true,
21
23
  payload: rw
22
24
  });
23
25
  } else {
@@ -10,7 +10,6 @@ var _mocker = require("helpers/mocker");
10
10
  var mockProps = {
11
11
  emitEvent: _mocker.emitEvent,
12
12
  soundActions: _mocker.soundActions,
13
- setShowPoints: _mocker.setShowPoints,
14
13
  disableExit: function disableExit() {},
15
14
  setResolveAction: function setResolveAction() {},
16
15
  info: {
@@ -115,7 +114,6 @@ exports.mockProps = mockProps;
115
114
  var mockProps2 = {
116
115
  emitEvent: _mocker.emitEvent,
117
116
  soundActions: _mocker.soundActions,
118
- setShowPoints: _mocker.setShowPoints,
119
117
  disableExit: function disableExit() {},
120
118
  setResolveAction: function setResolveAction() {},
121
119
  info: {
@@ -220,7 +218,6 @@ exports.mockProps2 = mockProps2;
220
218
  var mockProps3 = {
221
219
  emitEvent: _mocker.emitEvent,
222
220
  soundActions: _mocker.soundActions,
223
- setShowPoints: _mocker.setShowPoints,
224
221
  disableExit: function disableExit() {},
225
222
  setResolveAction: function setResolveAction() {},
226
223
  info: {
@@ -325,7 +322,6 @@ exports.mockProps3 = mockProps3;
325
322
  var mockProps4 = {
326
323
  emitEvent: _mocker.emitEvent,
327
324
  soundActions: _mocker.soundActions,
328
- setShowPoints: _mocker.setShowPoints,
329
325
  disableExit: function disableExit() {},
330
326
  setResolveAction: function setResolveAction() {},
331
327
  info: {
@@ -12,7 +12,6 @@ var mockProps = {
12
12
  disableExit: function disableExit() {},
13
13
  setResolveAction: function setResolveAction() {},
14
14
  soundActions: _mocker.soundActions,
15
- setShowPoints: _mocker.setShowPoints,
16
15
  transitionEffects: null,
17
16
  audioId: '',
18
17
  itemOrder: 1,
@@ -186,7 +185,6 @@ exports.mockProps2 = mockProps2;
186
185
  var mockProps3 = {
187
186
  emitEvent: _mocker.emitEvent,
188
187
  soundActions: _mocker.soundActions,
189
- setShowPoints: _mocker.setShowPoints,
190
188
  disableExit: function disableExit() {},
191
189
  setResolveAction: function setResolveAction() {},
192
190
  transitionEffects: null,
@@ -335,7 +333,6 @@ exports.mockProps4 = mockProps4;
335
333
  var mockPropsOnce = {
336
334
  emitEvent: _mocker.emitEvent,
337
335
  soundActions: _mocker.soundActions,
338
- setShowPoints: _mocker.setShowPoints,
339
336
  disableExit: function disableExit() {},
340
337
  setResolveAction: function setResolveAction() {},
341
338
  transitionEffects: null,
@@ -49,8 +49,7 @@ var KeyboardPuzzleComponent = function KeyboardPuzzleComponent(_ref) {
49
49
  info = _ref.info,
50
50
  disableExit = _ref.disableExit,
51
51
  soundActions = _ref.soundActions,
52
- setResolveAction = _ref.setResolveAction,
53
- setShowPoints = _ref.setShowPoints;
52
+ setResolveAction = _ref.setResolveAction;
54
53
 
55
54
  var _useState = (0, _react.useState)(false),
56
55
  _useState2 = _slicedToArray(_useState, 2),
@@ -106,8 +105,13 @@ var KeyboardPuzzleComponent = function KeyboardPuzzleComponent(_ref) {
106
105
  type: 'hidePuzzleButtons',
107
106
  payload: false
108
107
  });
109
- setShowPoints(rewardsData);
110
- }, [emitEvent, setShowPoints]);
108
+ emitEvent({
109
+ type: 'addPoints',
110
+ complex: true,
111
+ finish: true,
112
+ payload: rewardsData
113
+ });
114
+ }, [emitEvent]);
111
115
 
112
116
  var handleFeedbackFuncionOnClose = function handleFeedbackFuncionOnClose() {
113
117
  if (feedbackResult) {
@@ -12,7 +12,6 @@ var mockProps = {
12
12
  disableExit: function disableExit() {},
13
13
  setResolveAction: function setResolveAction() {},
14
14
  soundActions: _mocker.soundActions,
15
- setShowPoints: _mocker.setShowPoints,
16
15
  password: '1234',
17
16
  keyboard: [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9'], ['*', '0', '#']],
18
17
  image: {
@@ -45,7 +45,6 @@ var LoginPuzzleComponent = function LoginPuzzleComponent(_ref) {
45
45
  login = _ref.login,
46
46
  password = _ref.password,
47
47
  image = _ref.image,
48
- setShowPoints = _ref.setShowPoints,
49
48
  setResolveAction = _ref.setResolveAction;
50
49
 
51
50
  var translate = function translate(id) {
@@ -108,7 +107,12 @@ var LoginPuzzleComponent = function LoginPuzzleComponent(_ref) {
108
107
  var handleFinish = function handleFinish() {
109
108
  var rewards = info.solution.right.rewards;
110
109
  var rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(rewards));
111
- setShowPoints(rewardsData);
110
+ emitEvent({
111
+ type: 'addPoints',
112
+ complex: true,
113
+ finish: true,
114
+ payload: rewardsData
115
+ });
112
116
  };
113
117
 
114
118
  var checkInput = function checkInput() {
@@ -162,10 +166,15 @@ var LoginPuzzleComponent = function LoginPuzzleComponent(_ref) {
162
166
  type: 'hidePuzzleButtons',
163
167
  payload: false
164
168
  });
165
- setShowPoints(rewardsData);
169
+ emitEvent({
170
+ type: 'addPoints',
171
+ complex: true,
172
+ finish: true,
173
+ payload: rewardsData
174
+ });
166
175
  }, 2000);
167
176
  });
168
- }, [accRewards, info.resolve.rewards, emitEvent, setShowPoints, setResolveAction]);
177
+ }, [accRewards, info.resolve.rewards, emitEvent, setResolveAction]);
169
178
  return /*#__PURE__*/_react.default.createElement("div", {
170
179
  className: "puzzle--layer",
171
180
  style: {
@@ -203,12 +212,12 @@ var LoginPuzzleComponent = function LoginPuzzleComponent(_ref) {
203
212
  className: "icon-circle-check"
204
213
  }, " "))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
205
214
  className: "puzzle--login__label"
206
- }, /*#__PURE__*/_react.default.createElement("span", null, translate('puzzle.password'), " ", password)), /*#__PURE__*/_react.default.createElement("div", {
215
+ }, /*#__PURE__*/_react.default.createElement("span", null, translate('puzzle.password'))), /*#__PURE__*/_react.default.createElement("div", {
207
216
  className: "puzzle--login__group"
208
217
  }, showCorrectSolution ? /*#__PURE__*/_react.default.createElement("input", {
209
- disabled: finished,
218
+ disabled: true,
210
219
  "data-testid": "password",
211
- className: "puzzle--login__input puzzle--login__input--fakepassword ".concat(successClass),
220
+ className: "puzzle--login__input puzzle--login__input--fakepassword success",
212
221
  type: "text",
213
222
  placeholder: password,
214
223
  value: password
@@ -10,7 +10,6 @@ var _mocker = require("helpers/mocker");
10
10
  var mockProps = {
11
11
  emitEvent: _mocker.emitEvent,
12
12
  setResolveAction: function setResolveAction() {},
13
- setShowPoints: _mocker.setShowPoints,
14
13
  soundActions: _mocker.soundActions,
15
14
  user: 'pepe',
16
15
  password: '1234',
@@ -67,7 +67,6 @@ var TerminalPuzzleComponent = function TerminalPuzzleComponent(_ref) {
67
67
  info = _ref.info,
68
68
  disableExit = _ref.disableExit,
69
69
  soundActions = _ref.soundActions,
70
- setShowPoints = _ref.setShowPoints,
71
70
  setResolveAction = _ref.setResolveAction;
72
71
 
73
72
  // todo: PREPROCESS BACKGROUND IMAGE IN ARCADE
@@ -148,9 +147,14 @@ var TerminalPuzzleComponent = function TerminalPuzzleComponent(_ref) {
148
147
  type: 'hidePuzzleButtons',
149
148
  payload: false
150
149
  });
151
- setShowPoints(rewards);
150
+ emitEvent({
151
+ type: 'addPoints',
152
+ complex: true,
153
+ finish: true,
154
+ payload: rewards
155
+ });
152
156
  });
153
- }, [setResolveAction, info.resolve.rewards, emitEvent, setShowPoints]);
157
+ }, [setResolveAction, info.resolve.rewards, emitEvent]);
154
158
 
155
159
  var backFile = function backFile() {
156
160
  accRewards.current = [].concat(_toConsumableArray(accRewards.current), _toConsumableArray(info.solution.wrong.rewards));
@@ -201,7 +205,12 @@ var TerminalPuzzleComponent = function TerminalPuzzleComponent(_ref) {
201
205
  payload: false
202
206
  });
203
207
  playSound('score');
204
- setShowPoints(rewards);
208
+ emitEvent({
209
+ type: 'addPoints',
210
+ complex: true,
211
+ finish: true,
212
+ payload: rewards
213
+ });
205
214
  };
206
215
 
207
216
  var backgroundURL = (backgroundImage === null || backgroundImage === void 0 ? void 0 : backgroundImage.url) || DEFAULT_IMG;
@@ -12,7 +12,6 @@ var mockProps = {
12
12
  emitEvent: _mocker.emitEvent,
13
13
  disableExit: function disableExit() {},
14
14
  setResolveAction: function setResolveAction() {},
15
- setShowPoints: _mocker.setShowPoints,
16
15
  soundActions: _mocker.soundActions,
17
16
  items: [{
18
17
  children: [{
@@ -112,7 +111,6 @@ var realMockProps = {
112
111
  emitEvent: _mocker.emitEvent,
113
112
  disableExit: function disableExit() {},
114
113
  setResolveAction: function setResolveAction() {},
115
- setShowPoints: _mocker.setShowPoints,
116
114
  soundActions: _mocker.soundActions,
117
115
  backgroundImage: {
118
116
  url: 'https://min.gamelearn.io/css-resources/gamelearn/resources/cosmos-bg-min.jpg'
@@ -55,7 +55,6 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
55
55
  soundActions = _ref.soundActions,
56
56
  description = _ref.description,
57
57
  setInfo = _ref.setInfo,
58
- setShowPoints = _ref.setShowPoints,
59
58
  setResolveAction = _ref.setResolveAction;
60
59
 
61
60
  var _useState = (0, _react.useState)({
@@ -132,7 +131,12 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
132
131
 
133
132
  return acc;
134
133
  }, []);
135
- setShowPoints(totalRewards);
134
+ emitEvent({
135
+ type: 'addPoints',
136
+ complex: true,
137
+ finish: true,
138
+ payload: totalRewards
139
+ });
136
140
  } else {
137
141
  parsedText.current = null;
138
142
  setCurrentSlide(currentSlide + 1);
@@ -142,7 +146,7 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
142
146
  }, 1200);
143
147
  }
144
148
  }
145
- }, [isCompleted, correctTextFragmentsAccumulated, numberAllCorrectFragments, setShowPoints, currentSlide]);
149
+ }, [isCompleted, correctTextFragmentsAccumulated, numberAllCorrectFragments, emitEvent, currentSlide]);
146
150
  var handleFeedbackFuncionOnClose = (0, _react.useCallback)(function () {
147
151
  emitEvent({
148
152
  type: 'hidePuzzleButtons',
@@ -383,10 +387,15 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
383
387
  type: 'hidePuzzleButtons',
384
388
  payload: false
385
389
  });
386
- setShowPoints(resolveRewards);
390
+ emitEvent({
391
+ type: 'addPoints',
392
+ complex: true,
393
+ finish: true,
394
+ payload: resolveRewards
395
+ });
387
396
  }, 2000);
388
397
  });
389
- }, [setResolveAction, emitEvent, setShowPoints, list, currentSlide]);
398
+ }, [setResolveAction, emitEvent, list, currentSlide]);
390
399
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
391
400
  className: "text-click text-click--".concat(styles),
392
401
  style: feedbackData.show ? {
@@ -17,7 +17,6 @@ exports.messages = messages;
17
17
  var mockProps = {
18
18
  emitEvent: _mocker.emitEvent,
19
19
  setResolveAction: function setResolveAction() {},
20
- setShowPoints: _mocker.setShowPoints,
21
20
  showFrames: true,
22
21
  soundActions: _mocker.soundActions,
23
22
  styles: 'chalkboard',
@@ -252,7 +251,6 @@ exports.mockProps = mockProps;
252
251
  var mockPropsOnce = {
253
252
  emitEvent: _mocker.emitEvent,
254
253
  setResolveAction: function setResolveAction() {},
255
- setShowPoints: _mocker.setShowPoints,
256
254
  showFrames: true,
257
255
  soundActions: _mocker.soundActions,
258
256
  styles: 'chalkboard',
@@ -77,8 +77,7 @@ var WebBuilderPuzzleComponent = function WebBuilderPuzzleComponent(_ref) {
77
77
  emitEvent = _ref.emitEvent,
78
78
  setResolveAction = _ref.setResolveAction,
79
79
  soundActions = _ref.soundActions,
80
- disableExit = _ref.disableExit,
81
- setShowPoints = _ref.setShowPoints;
80
+ disableExit = _ref.disableExit;
82
81
 
83
82
  var _useState = (0, _react.useState)(false),
84
83
  _useState2 = _slicedToArray(_useState, 2),
@@ -175,7 +174,12 @@ var WebBuilderPuzzleComponent = function WebBuilderPuzzleComponent(_ref) {
175
174
  var rewards = info.solution.right.rewards;
176
175
  var wrongRewards = info.solution.wrong.rewards;
177
176
  playSound(failed ? 'fail' : 'score');
178
- setShowPoints(failed ? wrongRewards : rewards);
177
+ emitEvent({
178
+ type: 'addPoints',
179
+ complex: true,
180
+ finish: true,
181
+ payload: failed ? wrongRewards : rewards
182
+ });
179
183
  }
180
184
  };
181
185
 
@@ -304,11 +308,16 @@ var WebBuilderPuzzleComponent = function WebBuilderPuzzleComponent(_ref) {
304
308
  showReference(false);
305
309
  setTimeout(function () {
306
310
  showCurrentFeed('');
307
- setShowPoints(info.resolve.rewards);
311
+ emitEvent({
312
+ type: 'addPoints',
313
+ complex: true,
314
+ finish: true,
315
+ payload: info.resolve.rewards
316
+ });
308
317
  }, 4000);
309
318
  });
310
319
  disableExit(true);
311
- }, [setResolveAction, disableExit, setShowPoints, info.resolve.rewards]);
320
+ }, [setResolveAction, disableExit, info.resolve.rewards, emitEvent]);
312
321
  var props = {
313
322
  showingReference: showingReference || resolved,
314
323
  isFacebook: isFacebook,
@@ -21,7 +21,6 @@ var mockProps = {
21
21
  },
22
22
  emitEvent: _mocker.emitEvent,
23
23
  soundActions: _mocker.soundActions,
24
- setShowPoints: _mocker.setShowPoints,
25
24
  setResolveAction: noop,
26
25
  disableExit: noop
27
26
  };
@@ -274,6 +274,8 @@ var WriterPuzzleComponent = function WriterPuzzleComponent(_ref) {
274
274
 
275
275
  emitEvent({
276
276
  type: 'addPoints',
277
+ complex: true,
278
+ finish: true,
277
279
  payload: pointsToEmit
278
280
  });
279
281
  };
@@ -56,7 +56,6 @@ exports.messages = messages;
56
56
  var mock = {
57
57
  emitEvent: _mocker.emitEvent,
58
58
  soundActions: _mocker.soundActions,
59
- setShowPoints: _mocker.setShowPoints,
60
59
  texts: [{
61
60
  type: 'fixed',
62
61
  fullText: messages.fullText1
@@ -165,7 +164,6 @@ exports.mock = mock;
165
164
  var mock2 = {
166
165
  emitEvent: _mocker.emitEvent,
167
166
  soundActions: _mocker.soundActions,
168
- setShowPoints: _mocker.setShowPoints,
169
167
  texts: [{
170
168
  type: 'fixed',
171
169
  fullText: messages.fullText1
@@ -351,7 +349,6 @@ exports.mock2 = mock2;
351
349
  var mock3 = {
352
350
  emitEvent: _mocker.emitEvent,
353
351
  soundActions: _mocker.soundActions,
354
- setShowPoints: _mocker.setShowPoints,
355
352
  texts: [{
356
353
  type: 'fixed',
357
354
  fullText: messages.fullText1
@@ -507,7 +504,6 @@ exports.mock3 = mock3;
507
504
  var mock4 = {
508
505
  emitEvent: _mocker.emitEvent,
509
506
  soundActions: _mocker.soundActions,
510
- setShowPoints: _mocker.setShowPoints,
511
507
  texts: [{
512
508
  type: 'fixed',
513
509
  fullText: messages.fullText1
@@ -693,7 +689,6 @@ exports.mock4 = mock4;
693
689
  var mock5 = {
694
690
  emitEvent: _mocker.emitEvent,
695
691
  soundActions: _mocker.soundActions,
696
- setShowPoints: _mocker.setShowPoints,
697
692
  texts: [{
698
693
  type: 'fixed',
699
694
  fullText: messages.fullText11
@@ -780,7 +775,6 @@ exports.mock5 = mock5;
780
775
  var mock6 = {
781
776
  emitEvent: _mocker.emitEvent,
782
777
  soundActions: _mocker.soundActions,
783
- setShowPoints: _mocker.setShowPoints,
784
778
  texts: [{
785
779
  type: 'fixed',
786
780
  fullText: messages.fullText11
@@ -867,7 +861,6 @@ exports.mock6 = mock6;
867
861
  var mock7 = {
868
862
  emitEvent: _mocker.emitEvent,
869
863
  soundActions: _mocker.soundActions,
870
- setShowPoints: _mocker.setShowPoints,
871
864
  texts: [{
872
865
  type: 'fixed',
873
866
  fullText: messages.fullText11
@@ -954,7 +947,6 @@ exports.mock7 = mock7;
954
947
  var mock8 = {
955
948
  emitEvent: _mocker.emitEvent,
956
949
  soundActions: _mocker.soundActions,
957
- setShowPoints: _mocker.setShowPoints,
958
950
  texts: [{
959
951
  type: 'fixed',
960
952
  fullText: messages.fullText11
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "license": "Gamelearn",
4
- "version": "1.3.9",
4
+ "version": "1.3.11",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist",