@gamelearn/arcade-components 2.9.0 → 2.11.1
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 +4 -2
- package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +4 -0
- package/dist/components/cartel-component/components/CartelComponent.js +4 -1
- package/dist/components/chained-image-click-puzzle-component/components/ChainedImageClickPuzzleComponent.js +4 -2
- package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +4 -3
- package/dist/components/chained-image-click-puzzle-component/mocks/mockForStory.js +2 -0
- package/dist/components/comic-component/components/ComicComponent.js +3 -1
- package/dist/components/comic-component/mocks/mockForStory.js +4 -0
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +4 -1
- package/dist/components/conversational-pro-component/mocks/mockForStory.js +7 -0
- package/dist/components/cracker-puzzle-component/mocks/mockForStory.js +5 -0
- package/dist/components/decision-component/components/DecisionComponent.js +86 -77
- package/dist/components/decision-component/mocks/mockForStory.js +2 -0
- package/dist/components/dialog-component/components/DialogComponent.js +5 -2
- package/dist/components/dialog-component/mocks/mockForStory.js +2 -0
- package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +4 -2
- package/dist/components/drag-item-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/feedback-component/components/FeedbackComponent.js +3 -1
- package/dist/components/feedback-component/mocks/mockForStory.js +8 -2
- package/dist/components/frame-click-puzzle-component/components/CurrentFramePuzzle.js +4 -2
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +4 -2
- package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +4 -0
- package/dist/components/hacker-puzzle-component/mocks/mockForStory.js +3 -0
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +4 -2
- package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +4 -2
- package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +5 -0
- package/dist/components/image-component/components/ImageComponent.js +3 -1
- package/dist/components/image-component/mocks/mockForStory.js +3 -0
- package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +4 -2
- package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/lectures-component/components/LecturesComponent.js +4 -3
- package/dist/components/lectures-component/mocks/mockForStory.js +1 -0
- package/dist/components/login-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/pattern-component/components/PatternComponent.js +3 -1
- package/dist/components/pattern-component/mocks/mockForStory.js +2 -0
- package/dist/components/pdf-component/components/PdfComponent.js +18 -4
- package/dist/components/pdf-component/components/PdfVisor.js +19 -5
- package/dist/components/pdf-component/mocks/mockForProps.js +1 -0
- package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +4 -2
- package/dist/components/terminal-puzzle-component/components/Visor/index.js +4 -2
- package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/test-component/components/TestComponent.js +5 -0
- package/dist/components/test-component/mocks/mockForStory.js +7 -1
- package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +4 -2
- package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +2 -0
- package/dist/components/video-component/components/VideoComponent.js +3 -1
- package/dist/components/video-component/mocks/mockForStory.js +6 -0
- package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +4 -1
- package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/writer-puzzle-component/mocks/mockForStory.js +9 -0
- package/dist/helpers/mocker.js +6 -2
- package/package.json +2 -2
package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js
CHANGED
|
@@ -49,7 +49,8 @@ var FrameImageClickComponent = function FrameImageClickComponent(_ref) {
|
|
|
49
49
|
disableExit = _ref.disableExit,
|
|
50
50
|
setResolveAction = _ref.setResolveAction,
|
|
51
51
|
setInfo = _ref.setInfo,
|
|
52
|
-
pause = _ref.pause
|
|
52
|
+
pause = _ref.pause,
|
|
53
|
+
keyboardControl = _ref.keyboardControl;
|
|
53
54
|
|
|
54
55
|
var _useState = (0, _react.useState)({}),
|
|
55
56
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -171,7 +172,8 @@ var FrameImageClickComponent = function FrameImageClickComponent(_ref) {
|
|
|
171
172
|
setPuzzlesAutoCompleted: setPuzzlesAutoCompleted,
|
|
172
173
|
puzzlesAutoCompleted: puzzlesAutoCompleted,
|
|
173
174
|
emitOpenPopupCounterInfo: onInitPuzzle,
|
|
174
|
-
pause: pause
|
|
175
|
+
pause: pause,
|
|
176
|
+
keyboardControl: keyboardControl
|
|
175
177
|
};
|
|
176
178
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
177
179
|
className: "puzzle-frame"
|
|
@@ -16,6 +16,7 @@ var mockProps = {
|
|
|
16
16
|
setInfo: function setInfo() {},
|
|
17
17
|
emitEvent: _mocker.emitEvent,
|
|
18
18
|
soundActions: _mocker.soundActions,
|
|
19
|
+
keyboardControl: _mocker.keyboardControl,
|
|
19
20
|
disableExit: function disableExit() {},
|
|
20
21
|
setResolveAction: function setResolveAction() {},
|
|
21
22
|
list: [{
|
|
@@ -170,6 +171,7 @@ var mockPropsOnce = {
|
|
|
170
171
|
setInfo: function setInfo() {},
|
|
171
172
|
emitEvent: _mocker.emitEvent,
|
|
172
173
|
soundActions: _mocker.soundActions,
|
|
174
|
+
keyboardControl: _mocker.keyboardControl,
|
|
173
175
|
disableExit: function disableExit() {},
|
|
174
176
|
setResolveAction: function setResolveAction() {},
|
|
175
177
|
list: [{
|
|
@@ -321,6 +323,7 @@ var mockProps2 = {
|
|
|
321
323
|
setInfo: function setInfo() {},
|
|
322
324
|
emitEvent: _mocker.emitEvent,
|
|
323
325
|
soundActions: _mocker.soundActions,
|
|
326
|
+
keyboardControl: _mocker.keyboardControl,
|
|
324
327
|
disableExit: function disableExit() {},
|
|
325
328
|
setResolveAction: function setResolveAction() {},
|
|
326
329
|
list: [{
|
|
@@ -572,6 +575,7 @@ var mockProps3 = {
|
|
|
572
575
|
setInfo: function setInfo() {},
|
|
573
576
|
emitEvent: _mocker.emitEvent,
|
|
574
577
|
soundActions: _mocker.soundActions,
|
|
578
|
+
keyboardControl: _mocker.keyboardControl,
|
|
575
579
|
disableExit: function disableExit() {},
|
|
576
580
|
setResolveAction: function setResolveAction() {},
|
|
577
581
|
list: [{
|
|
@@ -10,6 +10,7 @@ var _mocker = require("helpers/mocker");
|
|
|
10
10
|
var mockProps = {
|
|
11
11
|
emitEvent: _mocker.emitEvent,
|
|
12
12
|
soundActions: _mocker.soundActions,
|
|
13
|
+
keyboardControl: _mocker.keyboardControl,
|
|
13
14
|
disableExit: function disableExit() {},
|
|
14
15
|
setResolveAction: function setResolveAction() {},
|
|
15
16
|
type: 'js',
|
|
@@ -41,6 +42,7 @@ exports.mockProps = mockProps;
|
|
|
41
42
|
var mockProps2 = {
|
|
42
43
|
emitEvent: _mocker.emitEvent,
|
|
43
44
|
soundActions: _mocker.soundActions,
|
|
45
|
+
keyboardControl: _mocker.keyboardControl,
|
|
44
46
|
disableExit: function disableExit() {},
|
|
45
47
|
setResolveAction: function setResolveAction() {},
|
|
46
48
|
type: 'python',
|
|
@@ -72,6 +74,7 @@ exports.mockProps2 = mockProps2;
|
|
|
72
74
|
var mockProps3 = {
|
|
73
75
|
emitEvent: _mocker.emitEvent,
|
|
74
76
|
soundActions: _mocker.soundActions,
|
|
77
|
+
keyboardControl: _mocker.keyboardControl,
|
|
75
78
|
disableExit: function disableExit() {},
|
|
76
79
|
setResolveAction: function setResolveAction() {},
|
|
77
80
|
type: 'lua',
|
|
@@ -110,7 +110,8 @@ var HangedPuzzleComponent = function HangedPuzzleComponent(_ref4) {
|
|
|
110
110
|
answer = _ref4.answer,
|
|
111
111
|
hintUsed = _ref4.hintUsed,
|
|
112
112
|
setResolveAction = _ref4.setResolveAction,
|
|
113
|
-
setHintAction = _ref4.setHintAction
|
|
113
|
+
setHintAction = _ref4.setHintAction,
|
|
114
|
+
keyboardControl = _ref4.keyboardControl;
|
|
114
115
|
|
|
115
116
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
116
117
|
playSound = _soundActions[0];
|
|
@@ -494,7 +495,8 @@ var HangedPuzzleComponent = function HangedPuzzleComponent(_ref4) {
|
|
|
494
495
|
text: info.solution[resolvedClass === 'success' ? 'right' : 'wrong'].desc,
|
|
495
496
|
success: resolvedClass === 'success',
|
|
496
497
|
translate: translate,
|
|
497
|
-
functionOnClose: handleFeedbackFuncionOnClose
|
|
498
|
+
functionOnClose: handleFeedbackFuncionOnClose,
|
|
499
|
+
keyboardControl: keyboardControl
|
|
498
500
|
}) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
499
501
|
className: "puzzle--hanged__content"
|
|
500
502
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -14,6 +14,7 @@ var disableExit = function disableExit(attr) {
|
|
|
14
14
|
var mockProps = {
|
|
15
15
|
emitEvent: _mocker.emitEvent,
|
|
16
16
|
soundActions: _mocker.soundActions,
|
|
17
|
+
keyboardControl: _mocker.keyboardControl,
|
|
17
18
|
disableExit: disableExit,
|
|
18
19
|
setResolveAction: function setResolveAction() {},
|
|
19
20
|
setHintAction: function setHintAction() {},
|
package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js
CHANGED
|
@@ -89,7 +89,8 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
|
|
|
89
89
|
firstTryForFrame = props.firstTryForFrame,
|
|
90
90
|
puzzlesAutoCompleted = props.puzzlesAutoCompleted,
|
|
91
91
|
emitOpenPopupCounterInfo = props.emitOpenPopupCounterInfo,
|
|
92
|
-
pause = props.pause
|
|
92
|
+
pause = props.pause,
|
|
93
|
+
keyboardControl = props.keyboardControl;
|
|
93
94
|
|
|
94
95
|
var _useState = (0, _react.useState)([]),
|
|
95
96
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -482,7 +483,8 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
|
|
|
482
483
|
hasTimeout: !feedbackData.text,
|
|
483
484
|
delay: timer ? 1000 : 2000,
|
|
484
485
|
functionOnClose: handleOnClose,
|
|
485
|
-
timeExpired: timeExpired
|
|
486
|
+
timeExpired: timeExpired,
|
|
487
|
+
keyboardControl: keyboardControl
|
|
486
488
|
}) : null, /*#__PURE__*/_react.default.createElement(_KonvaMapper.default, {
|
|
487
489
|
completed: completed,
|
|
488
490
|
imageUrl: imageUrl,
|
|
@@ -12,6 +12,7 @@ var mockProps = {
|
|
|
12
12
|
disableExit: function disableExit() {},
|
|
13
13
|
setResolveAction: function setResolveAction() {},
|
|
14
14
|
soundActions: _mocker.soundActions,
|
|
15
|
+
keyboardControl: _mocker.keyboardControl,
|
|
15
16
|
transitionEffects: null,
|
|
16
17
|
audioId: '',
|
|
17
18
|
itemOrder: 1,
|
|
@@ -111,6 +112,7 @@ exports.mockProps = mockProps;
|
|
|
111
112
|
var mockProps2 = {
|
|
112
113
|
emitEvent: _mocker.emitEvent,
|
|
113
114
|
soundActions: _mocker.soundActions,
|
|
115
|
+
keyboardControl: _mocker.keyboardControl,
|
|
114
116
|
disableExit: function disableExit() {},
|
|
115
117
|
setResolveAction: function setResolveAction() {},
|
|
116
118
|
transitionEffects: null,
|
|
@@ -185,6 +187,7 @@ exports.mockProps2 = mockProps2;
|
|
|
185
187
|
var mockProps3 = {
|
|
186
188
|
emitEvent: _mocker.emitEvent,
|
|
187
189
|
soundActions: _mocker.soundActions,
|
|
190
|
+
keyboardControl: _mocker.keyboardControl,
|
|
188
191
|
disableExit: function disableExit() {},
|
|
189
192
|
setResolveAction: function setResolveAction() {},
|
|
190
193
|
transitionEffects: null,
|
|
@@ -259,6 +262,7 @@ exports.mockProps3 = mockProps3;
|
|
|
259
262
|
var mockProps4 = {
|
|
260
263
|
emitEvent: _mocker.emitEvent,
|
|
261
264
|
soundActions: _mocker.soundActions,
|
|
265
|
+
keyboardControl: _mocker.keyboardControl,
|
|
262
266
|
disableExit: function disableExit() {},
|
|
263
267
|
setResolveAction: function setResolveAction() {},
|
|
264
268
|
transitionEffects: null,
|
|
@@ -333,6 +337,7 @@ exports.mockProps4 = mockProps4;
|
|
|
333
337
|
var mockPropsOnce = {
|
|
334
338
|
emitEvent: _mocker.emitEvent,
|
|
335
339
|
soundActions: _mocker.soundActions,
|
|
340
|
+
keyboardControl: _mocker.keyboardControl,
|
|
336
341
|
disableExit: function disableExit() {},
|
|
337
342
|
setResolveAction: function setResolveAction() {},
|
|
338
343
|
transitionEffects: null,
|
|
@@ -33,7 +33,8 @@ var ImageComponent = function ImageComponent(_ref) {
|
|
|
33
33
|
visible = _ref.visible,
|
|
34
34
|
viewed = _ref.viewed,
|
|
35
35
|
imgId = _ref.imgId_labelId,
|
|
36
|
-
soundActions = _ref.soundActions
|
|
36
|
+
soundActions = _ref.soundActions,
|
|
37
|
+
keyboardControl = _ref.keyboardControl;
|
|
37
38
|
|
|
38
39
|
var _useState = (0, _react.useState)(false),
|
|
39
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -59,6 +60,7 @@ var ImageComponent = function ImageComponent(_ref) {
|
|
|
59
60
|
payload: item
|
|
60
61
|
});
|
|
61
62
|
}, [playSound, imgId, imgName, documentType, emitEvent]);
|
|
63
|
+
keyboardControl(null, !viewed ? close : null, !viewed ? close : null);
|
|
62
64
|
(0, _react.useEffect)(function () {
|
|
63
65
|
if (!visible && !saved) {
|
|
64
66
|
save(true);
|
|
@@ -9,6 +9,7 @@ var _mocker = require("helpers/mocker");
|
|
|
9
9
|
|
|
10
10
|
var mockProps = {
|
|
11
11
|
soundActions: _mocker.soundActions,
|
|
12
|
+
keyboardControl: _mocker.keyboardControl,
|
|
12
13
|
emitEvent: _mocker.emitEvent,
|
|
13
14
|
img: {
|
|
14
15
|
imgId: 'alfalfa',
|
|
@@ -23,6 +24,7 @@ var mockProps = {
|
|
|
23
24
|
exports.mockProps = mockProps;
|
|
24
25
|
var mockWithNotVisible = {
|
|
25
26
|
soundActions: _mocker.soundActions,
|
|
27
|
+
keyboardControl: _mocker.keyboardControl,
|
|
26
28
|
emitEvent: _mocker.emitEvent,
|
|
27
29
|
img: {
|
|
28
30
|
imgId: 'alfalfa2',
|
|
@@ -37,6 +39,7 @@ var mockWithNotVisible = {
|
|
|
37
39
|
exports.mockWithNotVisible = mockWithNotVisible;
|
|
38
40
|
var mockWithImageNotViewed = {
|
|
39
41
|
soundActions: _mocker.soundActions,
|
|
42
|
+
keyboardControl: _mocker.keyboardControl,
|
|
40
43
|
emitEvent: _mocker.emitEvent,
|
|
41
44
|
img: {
|
|
42
45
|
imgId: 'alfalfa2',
|
|
@@ -50,7 +50,8 @@ var KeyboardPuzzleComponent = function KeyboardPuzzleComponent(_ref) {
|
|
|
50
50
|
disableExit = _ref.disableExit,
|
|
51
51
|
soundActions = _ref.soundActions,
|
|
52
52
|
setResolveAction = _ref.setResolveAction,
|
|
53
|
-
nodeId = _ref.nodeId
|
|
53
|
+
nodeId = _ref.nodeId,
|
|
54
|
+
keyboardControl = _ref.keyboardControl;
|
|
54
55
|
|
|
55
56
|
var _useState = (0, _react.useState)(false),
|
|
56
57
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -271,7 +272,8 @@ var KeyboardPuzzleComponent = function KeyboardPuzzleComponent(_ref) {
|
|
|
271
272
|
translate: translate,
|
|
272
273
|
text: feedBackText,
|
|
273
274
|
success: feedbackResult,
|
|
274
|
-
functionOnClose: handleFeedbackFuncionOnClose
|
|
275
|
+
functionOnClose: handleFeedbackFuncionOnClose,
|
|
276
|
+
keyboardControl: keyboardControl
|
|
275
277
|
}));
|
|
276
278
|
};
|
|
277
279
|
|
|
@@ -12,6 +12,7 @@ var mockProps = {
|
|
|
12
12
|
disableExit: function disableExit() {},
|
|
13
13
|
setResolveAction: function setResolveAction() {},
|
|
14
14
|
soundActions: _mocker.soundActions,
|
|
15
|
+
keyboardControl: _mocker.keyboardControl,
|
|
15
16
|
password: '1234',
|
|
16
17
|
keyboard: [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9'], ['*', '0', '#']],
|
|
17
18
|
image: {
|
|
@@ -44,7 +44,8 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
44
44
|
documentType = _ref.documentType,
|
|
45
45
|
viewed = _ref.viewed,
|
|
46
46
|
soundActions = _ref.soundActions,
|
|
47
|
-
backgroundImage = _ref.backgroundImage
|
|
47
|
+
backgroundImage = _ref.backgroundImage,
|
|
48
|
+
keyboardControl = _ref.keyboardControl;
|
|
48
49
|
|
|
49
50
|
var _useState = (0, _react.useState)(),
|
|
50
51
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -76,9 +77,8 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
76
77
|
};
|
|
77
78
|
|
|
78
79
|
var close = (0, _react.useCallback)(function () {
|
|
79
|
-
playSound('click-ui');
|
|
80
|
-
|
|
81
80
|
if (goToLecture) {
|
|
81
|
+
playSound('click-ui');
|
|
82
82
|
emitEvent({
|
|
83
83
|
type: 'finishMedia',
|
|
84
84
|
payload: {
|
|
@@ -90,6 +90,7 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
}, [documentType, emitEvent, goToLecture, nameLabel, textLabel, playSound]);
|
|
93
|
+
keyboardControl(null, !viewed ? close : null, !viewed ? close : null);
|
|
93
94
|
(0, _react.useEffect)(function () {
|
|
94
95
|
if (!visible && !saved) {
|
|
95
96
|
close();
|
|
@@ -16,6 +16,7 @@ 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
|
+
keyboardControl: _mocker.keyboardControl,
|
|
19
20
|
name: 'lecture',
|
|
20
21
|
required: true,
|
|
21
22
|
text: '<p>hola</p><div>soy un hermoso trozo de hmtl</div><div>y yo otro</div>',
|
|
@@ -26,7 +26,8 @@ var PatternComponent = function PatternComponent(_ref) {
|
|
|
26
26
|
name = _ref.name,
|
|
27
27
|
viewed = _ref.viewed,
|
|
28
28
|
emitEvent = _ref.emitEvent,
|
|
29
|
-
soundActions = _ref.soundActions
|
|
29
|
+
soundActions = _ref.soundActions,
|
|
30
|
+
keyboardControl = _ref.keyboardControl;
|
|
30
31
|
|
|
31
32
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
32
33
|
play = _soundActions[0];
|
|
@@ -58,6 +59,7 @@ var PatternComponent = function PatternComponent(_ref) {
|
|
|
58
59
|
});
|
|
59
60
|
};
|
|
60
61
|
|
|
62
|
+
keyboardControl(null, !viewed ? close : null, !viewed ? close : null);
|
|
61
63
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
62
64
|
className: viewed ? 'notes--results' : 'readings--container pattern-wrap--overlay'
|
|
63
65
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -10,6 +10,7 @@ var _mocker = require("helpers/mocker");
|
|
|
10
10
|
var mockProps = {
|
|
11
11
|
emitEvent: _mocker.emitEvent,
|
|
12
12
|
soundActions: _mocker.soundActions,
|
|
13
|
+
keyboardControl: _mocker.keyboardControl,
|
|
13
14
|
img: {
|
|
14
15
|
imgId: 'alfalfa',
|
|
15
16
|
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/58dccfba26561500117caf53/image/603fb8b1901f3e001238e297/gif.gif',
|
|
@@ -23,6 +24,7 @@ exports.mockProps = mockProps;
|
|
|
23
24
|
var mockProps2 = {
|
|
24
25
|
emitEvent: _mocker.emitEvent,
|
|
25
26
|
soundActions: _mocker.soundActions,
|
|
27
|
+
keyboardControl: _mocker.keyboardControl,
|
|
26
28
|
img: {
|
|
27
29
|
imgId: 'space',
|
|
28
30
|
url: 'https://min.gamelearn.io/css-resources/gamelearn/resources/cosmos-bg.jpg',
|
|
@@ -11,7 +11,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _PdfVisor = _interopRequireDefault(require("./PdfVisor"));
|
|
13
13
|
|
|
14
|
-
var _excluded = ["emitEvent", "soundActions", "documentType", "name", "required", "viewed", "visible", "documentId", "documentId_labelId"];
|
|
14
|
+
var _excluded = ["emitEvent", "soundActions", "keyboardControl", "documentType", "name", "required", "viewed", "visible", "documentId", "documentId_labelId"];
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
@@ -38,6 +38,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
38
38
|
var PdfComponent = function PdfComponent(_ref) {
|
|
39
39
|
var emitEvent = _ref.emitEvent,
|
|
40
40
|
soundActions = _ref.soundActions,
|
|
41
|
+
keyboardControl = _ref.keyboardControl,
|
|
41
42
|
documentType = _ref.documentType,
|
|
42
43
|
name = _ref.name,
|
|
43
44
|
required = _ref.required,
|
|
@@ -87,6 +88,11 @@ var PdfComponent = function PdfComponent(_ref) {
|
|
|
87
88
|
onlyOnePage = _useState4[0],
|
|
88
89
|
setOnlyOnePage = _useState4[1];
|
|
89
90
|
|
|
91
|
+
var _useState5 = (0, _react.useState)(false),
|
|
92
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
93
|
+
isLastPage = _useState6[0],
|
|
94
|
+
setIsLastPage = _useState6[1];
|
|
95
|
+
|
|
90
96
|
(0, _react.useEffect)(function () {
|
|
91
97
|
if (!visible) {
|
|
92
98
|
emitFinish();
|
|
@@ -105,12 +111,19 @@ var PdfComponent = function PdfComponent(_ref) {
|
|
|
105
111
|
setcloseVisible(true);
|
|
106
112
|
};
|
|
107
113
|
|
|
108
|
-
var readNumberOfPages = function readNumberOfPages(
|
|
109
|
-
if (
|
|
114
|
+
var readNumberOfPages = function readNumberOfPages(event) {
|
|
115
|
+
if (event.numPages === event.currentPage) {
|
|
116
|
+
setIsLastPage(true);
|
|
117
|
+
} else {
|
|
118
|
+
setIsLastPage(false);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (event.numPages === 1) {
|
|
110
122
|
setOnlyOnePage(true);
|
|
111
123
|
}
|
|
112
124
|
};
|
|
113
125
|
|
|
126
|
+
keyboardControl(null, onlyOnePage || !viewed && isLastPage || isLastPage && !required ? emitFinish : null, onlyOnePage || !viewed && isLastPage || !required ? emitFinish : null);
|
|
114
127
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
115
128
|
className: "".concat(viewed ? 'notes--results' : '')
|
|
116
129
|
}, (onlyOnePage || !viewed && closeVisible) && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -131,7 +144,8 @@ var PdfComponent = function PdfComponent(_ref) {
|
|
|
131
144
|
},
|
|
132
145
|
url: url,
|
|
133
146
|
endPdf: endPdf,
|
|
134
|
-
translate: translate
|
|
147
|
+
translate: translate,
|
|
148
|
+
keyboardControl: keyboardControl
|
|
135
149
|
}));
|
|
136
150
|
};
|
|
137
151
|
|
|
@@ -77,7 +77,8 @@ var PdfVisor = function PdfVisor(_ref) {
|
|
|
77
77
|
endPdf = _ref.endPdf,
|
|
78
78
|
emitNumberOfPages = _ref.emitNumberOfPages,
|
|
79
79
|
translate = _ref.translate,
|
|
80
|
-
soundActions = _ref.soundActions
|
|
80
|
+
soundActions = _ref.soundActions,
|
|
81
|
+
keyboardControl = _ref.keyboardControl;
|
|
81
82
|
var scrollElement = (0, _react.useRef)();
|
|
82
83
|
|
|
83
84
|
var _useState = (0, _react.useState)(1),
|
|
@@ -116,13 +117,15 @@ var PdfVisor = function PdfVisor(_ref) {
|
|
|
116
117
|
var validScale = maxScaleByArea < maxScaleBySide ? maxScaleByArea : maxScaleBySide;
|
|
117
118
|
setScale(validScale > SCALE_LIMIT ? SCALE_LIMIT : validScale);
|
|
118
119
|
});
|
|
120
|
+
setPages(pdf.numPages);
|
|
119
121
|
|
|
120
122
|
if (pdf.numPages) {
|
|
121
|
-
emitNumberOfPages(
|
|
123
|
+
emitNumberOfPages({
|
|
124
|
+
numPages: pdf.numPages,
|
|
125
|
+
currentPage: currentPage
|
|
126
|
+
});
|
|
122
127
|
}
|
|
123
128
|
|
|
124
|
-
setPages(pdf.numPages);
|
|
125
|
-
|
|
126
129
|
var timeOut = function timeOut() {
|
|
127
130
|
setTimeout(function () {
|
|
128
131
|
if (scrollElement.current && scrollElement.current.scrollHeight <= scrollElement.current.offsetHeight) {
|
|
@@ -135,7 +138,7 @@ var PdfVisor = function PdfVisor(_ref) {
|
|
|
135
138
|
};
|
|
136
139
|
|
|
137
140
|
timeOut();
|
|
138
|
-
}, [emitNumberOfPages]);
|
|
141
|
+
}, [currentPage, emitNumberOfPages]);
|
|
139
142
|
(0, _react.useEffect)(function () {
|
|
140
143
|
setCurrentPage(1);
|
|
141
144
|
}, []);
|
|
@@ -150,16 +153,27 @@ var PdfVisor = function PdfVisor(_ref) {
|
|
|
150
153
|
};
|
|
151
154
|
|
|
152
155
|
var turnPage = function turnPage(value) {
|
|
156
|
+
console.info('trunpage', value);
|
|
153
157
|
play('click-ui');
|
|
154
158
|
scrollElement.current.scrollTo(0, 0);
|
|
155
159
|
setOverlay(false);
|
|
156
160
|
setCurrentPage(currentPage + value);
|
|
161
|
+
emitNumberOfPages({
|
|
162
|
+
numPages: pages,
|
|
163
|
+
currentPage: currentPage + value
|
|
164
|
+
});
|
|
157
165
|
|
|
158
166
|
if (currentPage === pages - 1) {
|
|
159
167
|
endPdf();
|
|
160
168
|
}
|
|
161
169
|
};
|
|
162
170
|
|
|
171
|
+
keyboardControl(pages > 1 && currentPage !== 1 ? function () {
|
|
172
|
+
return turnPage(-1);
|
|
173
|
+
} : null, pages > 1 && currentPage !== pages ? function () {
|
|
174
|
+
return turnPage(1);
|
|
175
|
+
} : null);
|
|
176
|
+
|
|
163
177
|
var removeOverlay = function removeOverlay() {
|
|
164
178
|
setOverlay(false);
|
|
165
179
|
};
|
|
@@ -68,7 +68,8 @@ var TerminalPuzzleComponent = function TerminalPuzzleComponent(_ref) {
|
|
|
68
68
|
disableExit = _ref.disableExit,
|
|
69
69
|
soundActions = _ref.soundActions,
|
|
70
70
|
setResolveAction = _ref.setResolveAction,
|
|
71
|
-
nodeId = _ref.nodeId
|
|
71
|
+
nodeId = _ref.nodeId,
|
|
72
|
+
keyboardControl = _ref.keyboardControl;
|
|
72
73
|
|
|
73
74
|
// todo: PREPROCESS BACKGROUND IMAGE IN ARCADE
|
|
74
75
|
var _useState = (0, _react.useState)({}),
|
|
@@ -245,7 +246,8 @@ var TerminalPuzzleComponent = function TerminalPuzzleComponent(_ref) {
|
|
|
245
246
|
showContinue: !resolved,
|
|
246
247
|
solution: solution,
|
|
247
248
|
file: file,
|
|
248
|
-
translate: translate
|
|
249
|
+
translate: translate,
|
|
250
|
+
keyboardControl: keyboardControl
|
|
249
251
|
}));
|
|
250
252
|
};
|
|
251
253
|
|
|
@@ -56,7 +56,8 @@ var Visor = function Visor(_ref) {
|
|
|
56
56
|
resolvePuzzle = _ref.resolvePuzzle,
|
|
57
57
|
backFile = _ref.backFile,
|
|
58
58
|
translate = _ref.translate,
|
|
59
|
-
soundActions = _ref.soundActions
|
|
59
|
+
soundActions = _ref.soundActions,
|
|
60
|
+
keyboardControl = _ref.keyboardControl;
|
|
60
61
|
var fileId = file.fileId;
|
|
61
62
|
var url = ((_file$document = file.document) === null || _file$document === void 0 ? void 0 : _file$document.url) || '';
|
|
62
63
|
|
|
@@ -128,7 +129,8 @@ var Visor = function Visor(_ref) {
|
|
|
128
129
|
additionalStyle: ICONS[file.type],
|
|
129
130
|
secondText: title,
|
|
130
131
|
translate: translate,
|
|
131
|
-
puzzleHeaderClass: "puzzle--terminal__visor--message"
|
|
132
|
+
puzzleHeaderClass: "puzzle--terminal__visor--message",
|
|
133
|
+
keyboardControl: keyboardControl
|
|
132
134
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
133
135
|
className: "puzzle--terminal__visor--body"
|
|
134
136
|
}, /*#__PURE__*/_react.default.createElement(View, viewProps)), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -223,6 +223,11 @@ var TestComponent = function TestComponent(_ref) {
|
|
|
223
223
|
var rewards = resultAnswers.reduce(function (acc, current) {
|
|
224
224
|
return [].concat(_toConsumableArray(acc), _toConsumableArray(current.rewards));
|
|
225
225
|
}, []);
|
|
226
|
+
|
|
227
|
+
if (timeOver && countdown.rewards) {
|
|
228
|
+
rewards = [].concat(_toConsumableArray(rewards), _toConsumableArray(countdown.rewards));
|
|
229
|
+
}
|
|
230
|
+
|
|
226
231
|
emitEvent({
|
|
227
232
|
type: 'addPoints',
|
|
228
233
|
payload: rewards,
|
|
@@ -102,7 +102,13 @@ var mockProps = {
|
|
|
102
102
|
var mockProps2 = _objectSpread(_objectSpread({}, mockProps), {}, {
|
|
103
103
|
countdown: {
|
|
104
104
|
time: 5,
|
|
105
|
-
text: 'se te acabao el tiempo'
|
|
105
|
+
text: 'se te acabao el tiempo',
|
|
106
|
+
rewards: [{
|
|
107
|
+
id: 'id010001',
|
|
108
|
+
name: 'love',
|
|
109
|
+
points: -25,
|
|
110
|
+
type: 'score'
|
|
111
|
+
}]
|
|
106
112
|
}
|
|
107
113
|
});
|
|
108
114
|
|
|
@@ -57,7 +57,8 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
57
57
|
soundActions = _ref.soundActions,
|
|
58
58
|
description = _ref.description,
|
|
59
59
|
setInfo = _ref.setInfo,
|
|
60
|
-
setResolveAction = _ref.setResolveAction
|
|
60
|
+
setResolveAction = _ref.setResolveAction,
|
|
61
|
+
keyboardControl = _ref.keyboardControl;
|
|
61
62
|
|
|
62
63
|
var _useState = (0, _react.useState)({
|
|
63
64
|
result: null,
|
|
@@ -406,7 +407,8 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
406
407
|
text: feedbackData.text,
|
|
407
408
|
translate: translate,
|
|
408
409
|
functionOnClose: handleFeedbackFuncionOnClose,
|
|
409
|
-
hasTimeout: feedbackData.timeout
|
|
410
|
+
hasTimeout: feedbackData.timeout,
|
|
411
|
+
keyboardControl: keyboardControl
|
|
410
412
|
}));
|
|
411
413
|
};
|
|
412
414
|
|
|
@@ -19,6 +19,7 @@ var mockProps = {
|
|
|
19
19
|
setResolveAction: function setResolveAction() {},
|
|
20
20
|
showFrames: true,
|
|
21
21
|
soundActions: _mocker.soundActions,
|
|
22
|
+
keyboardControl: _mocker.keyboardControl,
|
|
22
23
|
styles: 'chalkboard',
|
|
23
24
|
list: [{
|
|
24
25
|
allWrong: true,
|
|
@@ -253,6 +254,7 @@ var mockPropsOnce = {
|
|
|
253
254
|
setResolveAction: function setResolveAction() {},
|
|
254
255
|
showFrames: true,
|
|
255
256
|
soundActions: _mocker.soundActions,
|
|
257
|
+
keyboardControl: _mocker.keyboardControl,
|
|
256
258
|
styles: 'chalkboard',
|
|
257
259
|
list: [{
|
|
258
260
|
allWrong: true,
|
|
@@ -28,7 +28,8 @@ var VideoComponent = function VideoComponent(_ref) {
|
|
|
28
28
|
viewed = _ref.viewed,
|
|
29
29
|
visible = _ref.visible,
|
|
30
30
|
img = _ref.img,
|
|
31
|
-
imgIdLabel = _ref.imgId_labelId
|
|
31
|
+
imgIdLabel = _ref.imgId_labelId,
|
|
32
|
+
keyboardControl = _ref.keyboardControl;
|
|
32
33
|
var url = document.url;
|
|
33
34
|
var item = (0, _react.useMemo)(function () {
|
|
34
35
|
return {
|
|
@@ -59,6 +60,7 @@ var VideoComponent = function VideoComponent(_ref) {
|
|
|
59
60
|
return null;
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
keyboardControl(null, !viewed ? _endVideo : null, !viewed ? _endVideo : null);
|
|
62
64
|
return /*#__PURE__*/_react.default.createElement(_videoVisor.default, {
|
|
63
65
|
backgroundImage: img === null || img === void 0 ? void 0 : img.url,
|
|
64
66
|
url: url,
|
|
@@ -10,6 +10,7 @@ var _mocker = require("helpers/mocker");
|
|
|
10
10
|
var mockProps = [{
|
|
11
11
|
emitEvent: _mocker.emitEvent,
|
|
12
12
|
soundActions: _mocker.soundActions,
|
|
13
|
+
keyboardControl: _mocker.keyboardControl,
|
|
13
14
|
name: 'video',
|
|
14
15
|
required: true,
|
|
15
16
|
isLesson: true,
|
|
@@ -23,6 +24,7 @@ var mockProps = [{
|
|
|
23
24
|
}, {
|
|
24
25
|
emitEvent: _mocker.emitEvent,
|
|
25
26
|
soundActions: _mocker.soundActions,
|
|
27
|
+
keyboardControl: _mocker.keyboardControl,
|
|
26
28
|
name: 'video2',
|
|
27
29
|
required: true,
|
|
28
30
|
isLesson: true,
|
|
@@ -35,6 +37,7 @@ var mockProps = [{
|
|
|
35
37
|
}, {
|
|
36
38
|
emitEvent: _mocker.emitEvent,
|
|
37
39
|
soundActions: _mocker.soundActions,
|
|
40
|
+
keyboardControl: _mocker.keyboardControl,
|
|
38
41
|
name: 'video3',
|
|
39
42
|
required: true,
|
|
40
43
|
isLesson: true,
|
|
@@ -47,6 +50,7 @@ var mockProps = [{
|
|
|
47
50
|
}, {
|
|
48
51
|
emitEvent: _mocker.emitEvent,
|
|
49
52
|
soundActions: _mocker.soundActions,
|
|
53
|
+
keyboardControl: _mocker.keyboardControl,
|
|
50
54
|
name: 'video4',
|
|
51
55
|
required: true,
|
|
52
56
|
isLesson: true,
|
|
@@ -59,6 +63,7 @@ var mockProps = [{
|
|
|
59
63
|
}, {
|
|
60
64
|
emitEvent: _mocker.emitEvent,
|
|
61
65
|
soundActions: _mocker.soundActions,
|
|
66
|
+
keyboardControl: _mocker.keyboardControl,
|
|
62
67
|
name: 'video5',
|
|
63
68
|
required: true,
|
|
64
69
|
isLesson: true,
|
|
@@ -71,6 +76,7 @@ var mockProps = [{
|
|
|
71
76
|
}, {
|
|
72
77
|
emitEvent: _mocker.emitEvent,
|
|
73
78
|
soundActions: _mocker.soundActions,
|
|
79
|
+
keyboardControl: _mocker.keyboardControl,
|
|
74
80
|
name: 'video6',
|
|
75
81
|
required: true,
|
|
76
82
|
isLesson: true,
|
package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js
CHANGED
|
@@ -77,7 +77,8 @@ var WebBuilderPuzzleComponent = function WebBuilderPuzzleComponent(_ref) {
|
|
|
77
77
|
emitEvent = _ref.emitEvent,
|
|
78
78
|
setResolveAction = _ref.setResolveAction,
|
|
79
79
|
soundActions = _ref.soundActions,
|
|
80
|
-
disableExit = _ref.disableExit
|
|
80
|
+
disableExit = _ref.disableExit,
|
|
81
|
+
keyboardControl = _ref.keyboardControl;
|
|
81
82
|
|
|
82
83
|
var _useState = (0, _react.useState)(false),
|
|
83
84
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -186,6 +187,8 @@ var WebBuilderPuzzleComponent = function WebBuilderPuzzleComponent(_ref) {
|
|
|
186
187
|
}
|
|
187
188
|
};
|
|
188
189
|
|
|
190
|
+
keyboardControl(null, currentFeed === 'success' ? handleFinish : null, currentFeed === 'success' ? handleFinish : null);
|
|
191
|
+
|
|
189
192
|
var checkObjs = function checkObjs(obj1, obj2) {
|
|
190
193
|
var usingOBject = Object.keys(obj1);
|
|
191
194
|
var result = {
|