@gamelearn/arcade-components 1.3.4 → 1.3.5-hotfix-login-GAT-4291
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/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +21 -6
- package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +16 -7
- package/dist/components/chained-image-click-puzzle-component/components/ChainedImageClickPuzzleComponent.js +2 -4
- package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +8 -4
- package/dist/components/chained-image-click-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/comic-component/mocks/mockForStory.js +0 -1
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +15 -12
- package/dist/components/conversational-pro-component/components/scene/Panel.js +4 -1
- package/dist/components/conversational-pro-component/mocks/mockForStory.js +0 -6
- package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +13 -4
- package/dist/components/cracker-puzzle-component/mocks/mockForStory.js +0 -5
- package/dist/components/decision-component/components/DecisionBody.js +4 -4
- package/dist/components/decision-component/components/DecisionComponent.js +20 -34
- package/dist/components/decision-component/components/Feedback.js +3 -15
- package/dist/components/decision-component/components/Options.js +2 -4
- package/dist/components/decision-component/mocks/mockForStory.js +0 -2
- package/dist/components/dialog-component/components/DialogComponent.js +34 -40
- package/dist/components/dialog-component/mocks/mockForStory.js +0 -1
- package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +47 -8
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +2 -0
- package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +0 -3
- package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +17 -10
- package/dist/components/hacker-puzzle-component/mocks/mockForStory.js +0 -3
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +13 -4
- package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +1 -1
- package/dist/components/image-click-puzzle-component/components/ImageClickPuzzleComponent.js +2 -0
- package/dist/components/image-click-puzzle-component/mocks/mockForStory.js +0 -4
- package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +0 -3
- package/dist/components/index.js +8 -0
- package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +8 -4
- package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +1 -1
- package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +16 -7
- package/dist/components/login-puzzle-component/mocks/mockForStory.js +1 -1
- package/dist/components/referral-component/components/EmailPill.js +30 -0
- package/dist/components/referral-component/components/ReferralComponent.js +144 -0
- package/dist/components/referral-component/components/StepOne.js +186 -0
- package/dist/components/referral-component/components/StepTwo.js +71 -0
- package/dist/components/referral-component/index.js +13 -0
- package/dist/components/referral-component/mocks/mockForStory.js +42 -0
- package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +13 -4
- package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/test-component/components/Results.js +2 -27
- package/dist/components/test-component/components/TestComponent.js +40 -40
- package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +14 -5
- package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +14 -5
- package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +0 -1
- package/dist/components/writer-puzzle-component/components/FeedbackComponent.js +9 -27
- package/dist/components/writer-puzzle-component/components/FeedbackElement.js +8 -4
- package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +52 -55
- package/dist/components/writer-puzzle-component/mocks/mockForStory.js +0 -8
- package/package.json +1 -1
- package/dist/components/writer-puzzle-component/components/Rewards.js +0 -189
|
@@ -123,13 +123,12 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
123
123
|
var currentLine = lines[line];
|
|
124
124
|
var lastLine = lines[line - 1];
|
|
125
125
|
var lastSet = (0, _react.useRef)(false);
|
|
126
|
-
var emitRef = (0, _react.useRef)(emitEvent);
|
|
127
126
|
var translate = (0, _react.useCallback)(function (id) {
|
|
128
|
-
return
|
|
127
|
+
return emitEvent({
|
|
129
128
|
type: 'translate',
|
|
130
129
|
payload: id
|
|
131
130
|
});
|
|
132
|
-
}, []);
|
|
131
|
+
}, [emitEvent]);
|
|
133
132
|
var getVoice = (0, _react.useCallback)(function (_ref2) {
|
|
134
133
|
var id = _ref2.id,
|
|
135
134
|
_ref2$type = _ref2.type,
|
|
@@ -171,22 +170,27 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
171
170
|
}
|
|
172
171
|
|
|
173
172
|
_context.next = 5;
|
|
174
|
-
return
|
|
175
|
-
type: '
|
|
173
|
+
return emitEvent({
|
|
174
|
+
type: 'getSpeech',
|
|
176
175
|
payload: payload
|
|
177
176
|
});
|
|
178
177
|
|
|
179
178
|
case 5:
|
|
180
179
|
url = _context.sent;
|
|
181
|
-
playSound(url);
|
|
180
|
+
playSound(url, 'tts');
|
|
182
181
|
|
|
183
182
|
case 7:
|
|
183
|
+
return _context.abrupt("return", function () {
|
|
184
|
+
stop('tts');
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
case 8:
|
|
184
188
|
case "end":
|
|
185
189
|
return _context.stop();
|
|
186
190
|
}
|
|
187
191
|
}
|
|
188
192
|
}, _callee);
|
|
189
|
-
})), [currentLine === null || currentLine === void 0 ? void 0 : currentLine.voice, getVoice, currentMessage.text, playSound]);
|
|
193
|
+
})), [currentLine === null || currentLine === void 0 ? void 0 : currentLine.voice, getVoice, currentMessage.text, playSound, emitEvent, stop]);
|
|
190
194
|
var getCurrentVisible = (0, _react.useCallback)(function (uid) {
|
|
191
195
|
var object;
|
|
192
196
|
scene.traverseVisible(function (node) {
|
|
@@ -232,7 +236,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
232
236
|
} else {
|
|
233
237
|
onLoadAnim();
|
|
234
238
|
}
|
|
235
|
-
}, [loader]);
|
|
239
|
+
}, [loader]);
|
|
236
240
|
|
|
237
241
|
var executeAnimation = function executeAnimation(element) {
|
|
238
242
|
var mixer = element.userData.mixer;
|
|
@@ -249,30 +253,16 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
249
253
|
|
|
250
254
|
element.userData.currentEmotion = defaultAction;
|
|
251
255
|
}
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
var resetAnims = (0, _react.useCallback)(function () {
|
|
255
|
-
var end = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
256
|
+
}; // Reset currentEmotion to defaultAnim
|
|
256
257
|
|
|
257
|
-
if (end) {
|
|
258
|
-
scene.traverseVisible(function (node) {
|
|
259
|
-
if (node.userData.mixer && node.userData.currentEmotion) {
|
|
260
|
-
executeAnimation(node);
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
} else if (lastLine !== null && lastLine !== void 0 && lastLine.slots) {
|
|
264
|
-
var slottedCharacters = lastLine.slots.filter(function (slot) {
|
|
265
|
-
return slot.uid;
|
|
266
|
-
});
|
|
267
|
-
slottedCharacters.forEach(function (slot) {
|
|
268
|
-
var element = getCurrentVisible(slot.uid);
|
|
269
258
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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]);
|
|
276
266
|
var resetCameraView = (0, _react.useCallback)(function () {
|
|
277
267
|
messagePosition.current.child = null;
|
|
278
268
|
messagePosition.current.parent = null;
|
|
@@ -289,18 +279,18 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
289
279
|
setCurrentMessage({});
|
|
290
280
|
changeLine(line + 1);
|
|
291
281
|
} else {
|
|
292
|
-
resetAnims(
|
|
282
|
+
resetAnims();
|
|
293
283
|
lastSet.current = true;
|
|
294
284
|
setCurrentMessage({});
|
|
295
285
|
resetCameraView();
|
|
296
286
|
setTimeout(function () {
|
|
297
|
-
|
|
287
|
+
emitEvent({
|
|
298
288
|
type: 'success'
|
|
299
289
|
});
|
|
300
290
|
camera.copy(defaultCamera.current);
|
|
301
291
|
}, currentLine.decision ? 0 : 1200);
|
|
302
292
|
}
|
|
303
|
-
}, [camera, currentLine === null || currentLine === void 0 ? void 0 : currentLine.decision, line, lines.length, resetAnims, resetCameraView]); // Position bubble over talking character/and switch emotions
|
|
293
|
+
}, [camera, currentLine === null || currentLine === void 0 ? void 0 : currentLine.decision, emitEvent, line, lines.length, resetAnims, resetCameraView]); // Position bubble over talking character/and switch emotions
|
|
304
294
|
|
|
305
295
|
(0, _react.useEffect)(function () {
|
|
306
296
|
if (currentLine.decision) {
|
|
@@ -323,8 +313,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
323
313
|
});
|
|
324
314
|
var slottedCharacters = currentLine.slots.filter(function (slot) {
|
|
325
315
|
return slot.uid && !slot.talking;
|
|
326
|
-
});
|
|
327
|
-
resetAnims(false); // Check not talking elements emotion
|
|
316
|
+
}); // Check not talking elements emotion
|
|
328
317
|
|
|
329
318
|
slottedCharacters.forEach(function (slot) {
|
|
330
319
|
var element = getCurrentVisible(slot.uid);
|
|
@@ -413,7 +402,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
413
402
|
});
|
|
414
403
|
}
|
|
415
404
|
}
|
|
416
|
-
}, [actors, camera, currentLine, zoomInActor, getCurrentVisible, translate, getAvatarURL, loadEmotion,
|
|
405
|
+
}, [actors, camera, currentLine, zoomInActor, getCurrentVisible, translate, getAvatarURL, loadEmotion, resetCameraView]); // Sound logic
|
|
417
406
|
|
|
418
407
|
(0, _react.useEffect)(function () {
|
|
419
408
|
var _currentLine$audio;
|
|
@@ -423,13 +412,18 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
423
412
|
} else if (currentLine !== null && currentLine !== void 0 && (_currentLine$audio = currentLine.audio) !== null && _currentLine$audio !== void 0 && _currentLine$audio.url) {
|
|
424
413
|
var _currentLine$audio2;
|
|
425
414
|
|
|
426
|
-
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');
|
|
427
416
|
}
|
|
428
417
|
|
|
429
418
|
return function () {
|
|
430
|
-
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');
|
|
431
425
|
};
|
|
432
|
-
}, [
|
|
426
|
+
}, [stop]); // Autoplay logic
|
|
433
427
|
|
|
434
428
|
(0, _react.useEffect)(function () {
|
|
435
429
|
var timeout;
|
|
@@ -559,7 +553,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
559
553
|
disableBackground: true
|
|
560
554
|
},
|
|
561
555
|
onFinish: nextLine,
|
|
562
|
-
emitEvent:
|
|
556
|
+
emitEvent: emitEvent,
|
|
563
557
|
soundActions: soundActions
|
|
564
558
|
});
|
|
565
559
|
|
|
@@ -13,6 +13,8 @@ var _interactjs = _interopRequireDefault(require("interactjs"));
|
|
|
13
13
|
|
|
14
14
|
var _reactKonva = require("react-konva");
|
|
15
15
|
|
|
16
|
+
var _reactKonvaUtils = require("react-konva-utils");
|
|
17
|
+
|
|
16
18
|
var _Messages = require("./Messages");
|
|
17
19
|
|
|
18
20
|
var _feedbackComponent = _interopRequireDefault(require("../../feedback-component"));
|
|
@@ -60,8 +62,7 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
|
|
|
60
62
|
consume = _ref.consume,
|
|
61
63
|
disableExit = _ref.disableExit,
|
|
62
64
|
emitEvent = _ref.emitEvent,
|
|
63
|
-
soundActions = _ref.soundActions
|
|
64
|
-
setShowPoints = _ref.setShowPoints;
|
|
65
|
+
soundActions = _ref.soundActions;
|
|
65
66
|
var solution = info.solution;
|
|
66
67
|
var areaRef = (0, _react.useRef)();
|
|
67
68
|
var areaTextRef = (0, _react.useRef)();
|
|
@@ -84,9 +85,14 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
|
|
|
84
85
|
imageLoaded = _useState6[0],
|
|
85
86
|
setImageLoaded = _useState6[1];
|
|
86
87
|
|
|
87
|
-
var _useState7 = (0, _react.useState)(
|
|
88
|
-
_useState8 = _slicedToArray(_useState7,
|
|
89
|
-
|
|
88
|
+
var _useState7 = (0, _react.useState)(),
|
|
89
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
90
|
+
projectionConfig = _useState8[0],
|
|
91
|
+
setProjectionConfig = _useState8[1];
|
|
92
|
+
|
|
93
|
+
var _useState9 = (0, _react.useState)(new window.Image()),
|
|
94
|
+
_useState10 = _slicedToArray(_useState9, 1),
|
|
95
|
+
currentImage = _useState10[0];
|
|
90
96
|
|
|
91
97
|
var accRewards = (0, _react.useRef)([]);
|
|
92
98
|
|
|
@@ -162,7 +168,12 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
|
|
|
162
168
|
type: 'hidePuzzleButtons',
|
|
163
169
|
payload: false
|
|
164
170
|
});
|
|
165
|
-
|
|
171
|
+
emitEvent({
|
|
172
|
+
type: 'addPoints',
|
|
173
|
+
complex: true,
|
|
174
|
+
finish: true,
|
|
175
|
+
payload: accRewards.current
|
|
176
|
+
});
|
|
166
177
|
|
|
167
178
|
if (consume) {
|
|
168
179
|
emitEvent({
|
|
@@ -179,7 +190,7 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
|
|
|
179
190
|
type: 'closeUI',
|
|
180
191
|
ui: 'inventory'
|
|
181
192
|
});
|
|
182
|
-
}, [consume, emitEvent, resolveObject.name, resolveObject.uid
|
|
193
|
+
}, [consume, emitEvent, resolveObject.name, resolveObject.uid]);
|
|
183
194
|
var handleClose = (0, _react.useCallback)(function () {
|
|
184
195
|
playSound('score');
|
|
185
196
|
setResolveClass('success');
|
|
@@ -325,6 +336,17 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
|
|
|
325
336
|
}
|
|
326
337
|
};
|
|
327
338
|
|
|
339
|
+
(0, _react.useLayoutEffect)(function () {
|
|
340
|
+
if (areaRef.current && imageLoaded) {
|
|
341
|
+
var rect = areaRef.current.getClientRect({
|
|
342
|
+
relativeTo: areaRef.current.getParent()
|
|
343
|
+
});
|
|
344
|
+
setProjectionConfig({
|
|
345
|
+
x: rect.x + rect.width / 2,
|
|
346
|
+
y: rect.y + rect.height / 2
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
}, [imageLoaded]);
|
|
328
350
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
329
351
|
className: "puzzle--drag__mask100"
|
|
330
352
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -339,7 +361,24 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
|
|
|
339
361
|
height: canvas.current.clientHeight
|
|
340
362
|
}, /*#__PURE__*/_react.default.createElement(_reactKonva.Layer, null, /*#__PURE__*/_react.default.createElement(_reactKonva.Image, _extends({
|
|
341
363
|
image: currentImage
|
|
342
|
-
}, layerConfig.current)), /*#__PURE__*/_react.default.createElement(_reactKonva.Group, layerConfig.current, /*#__PURE__*/_react.default.createElement(
|
|
364
|
+
}, layerConfig.current)), /*#__PURE__*/_react.default.createElement(_reactKonva.Group, layerConfig.current, projectionConfig ? /*#__PURE__*/_react.default.createElement(_reactKonvaUtils.Html, {
|
|
365
|
+
transform: true,
|
|
366
|
+
groupProps: _objectSpread({
|
|
367
|
+
id: 'projection'
|
|
368
|
+
}, projectionConfig),
|
|
369
|
+
divProps: {
|
|
370
|
+
style: {
|
|
371
|
+
pointerEvents: 'none'
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
375
|
+
style: {
|
|
376
|
+
width: '50px',
|
|
377
|
+
height: '50px',
|
|
378
|
+
pointerEvents: 'none'
|
|
379
|
+
},
|
|
380
|
+
id: "object-area-projection"
|
|
381
|
+
})) : null, /*#__PURE__*/_react.default.createElement(_reactKonva.Line, _extends({
|
|
343
382
|
onMouseEnter: mouseEnterArea,
|
|
344
383
|
onMouseLeave: mouseLeaveArea,
|
|
345
384
|
ref: handleAreaRef
|
package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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,11 +14,11 @@ 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: {
|
|
21
20
|
img: {
|
|
21
|
+
// eslint-disable-next-line max-len
|
|
22
22
|
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/58dccfba26561500117caf53/image/60508f84901f3e00123a0796/holamundo.jpg'
|
|
23
23
|
}
|
|
24
24
|
},
|
|
@@ -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,
|
package/dist/components/index.js
CHANGED
|
@@ -197,6 +197,12 @@ Object.defineProperty(exports, "Poster", {
|
|
|
197
197
|
return _Poster.default;
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
|
+
Object.defineProperty(exports, "ReferralComponent", {
|
|
201
|
+
enumerable: true,
|
|
202
|
+
get: function get() {
|
|
203
|
+
return _referralComponent.default;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
200
206
|
Object.defineProperty(exports, "Scene", {
|
|
201
207
|
enumerable: true,
|
|
202
208
|
get: function get() {
|
|
@@ -348,6 +354,8 @@ var _dialogComponent = _interopRequireDefault(require("./dialog-component"));
|
|
|
348
354
|
|
|
349
355
|
var _animationComponent = _interopRequireDefault(require("./animation-component"));
|
|
350
356
|
|
|
357
|
+
var _referralComponent = _interopRequireDefault(require("./referral-component"));
|
|
358
|
+
|
|
351
359
|
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); }
|
|
352
360
|
|
|
353
361
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -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
|
-
|
|
110
|
-
|
|
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,11 +12,11 @@ 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: {
|
|
19
18
|
img: {
|
|
19
|
+
// eslint-disable-next-line max-len
|
|
20
20
|
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/58dccfba26561500117caf53/image/60508f84901f3e00123a0796/holamundo.jpg'
|
|
21
21
|
}
|
|
22
22
|
},
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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,
|
|
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')
|
|
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:
|
|
218
|
+
disabled: true,
|
|
210
219
|
"data-testid": "password",
|
|
211
|
-
className: "puzzle--login__input puzzle--login__input--fakepassword "
|
|
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',
|
|
@@ -30,6 +29,7 @@ var mockProps = {
|
|
|
30
29
|
},
|
|
31
30
|
image: {
|
|
32
31
|
img: {
|
|
32
|
+
// eslint-disable-next-line max-len
|
|
33
33
|
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/58dccfba26561500117caf53/image/60508f84901f3e00123a0796/holamundo.jpg'
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var EmailPill = function EmailPill(_ref) {
|
|
13
|
+
var text = _ref.text,
|
|
14
|
+
error = _ref.error,
|
|
15
|
+
handleClick = _ref.handleClick;
|
|
16
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
17
|
+
"data-testid": "".concat(error ? ' pill--error' : 'pill--ok'),
|
|
18
|
+
className: "email-pill ".concat(error ? ' email-pill--error' : '')
|
|
19
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, text), /*#__PURE__*/_react.default.createElement("div", {
|
|
20
|
+
className: "email-pill__delete"
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
22
|
+
tabIndex: "0",
|
|
23
|
+
role: "button",
|
|
24
|
+
onClick: handleClick,
|
|
25
|
+
className: "icon-close"
|
|
26
|
+
})));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var _default = EmailPill;
|
|
30
|
+
exports.default = _default;
|