@gamelearn/arcade-components 1.3.5-hotfix-login-GAT-4291 → 1.3.5-hotfix-compile
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 +6 -21
- package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +7 -16
- 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 -8
- package/dist/components/chained-image-click-puzzle-component/mocks/mockForStory.js +2 -0
- package/dist/components/comic-component/mocks/mockForStory.js +1 -0
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +7 -16
- package/dist/components/conversational-pro-component/components/scene/Panel.js +1 -4
- package/dist/components/conversational-pro-component/mocks/mockForStory.js +6 -0
- package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +4 -13
- package/dist/components/cracker-puzzle-component/mocks/mockForStory.js +5 -0
- package/dist/components/decision-component/components/DecisionBody.js +4 -4
- package/dist/components/decision-component/components/DecisionComponent.js +34 -20
- package/dist/components/decision-component/components/Feedback.js +15 -3
- package/dist/components/decision-component/components/Options.js +4 -2
- package/dist/components/decision-component/mocks/mockForStory.js +2 -0
- package/dist/components/dialog-component/components/DialogComponent.js +35 -34
- package/dist/components/dialog-component/mocks/mockForStory.js +1 -0
- package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +8 -47
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +0 -2
- package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +3 -0
- package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +10 -17
- package/dist/components/hacker-puzzle-component/mocks/mockForStory.js +3 -0
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +4 -13
- package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +1 -1
- package/dist/components/image-click-puzzle-component/components/ImageClickPuzzleComponent.js +0 -2
- package/dist/components/image-click-puzzle-component/mocks/mockForStory.js +4 -0
- package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +3 -0
- package/dist/components/index.js +0 -8
- package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +4 -8
- package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +1 -1
- package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +6 -15
- package/dist/components/login-puzzle-component/mocks/mockForStory.js +1 -1
- package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +4 -13
- package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +2 -0
- package/dist/components/test-component/components/Results.js +27 -2
- package/dist/components/test-component/components/TestComponent.js +40 -40
- package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +5 -14
- package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +2 -0
- package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +5 -14
- package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/writer-puzzle-component/components/FeedbackComponent.js +27 -9
- package/dist/components/writer-puzzle-component/components/FeedbackElement.js +4 -8
- package/dist/components/writer-puzzle-component/components/Rewards.js +189 -0
- package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +55 -52
- package/dist/components/writer-puzzle-component/mocks/mockForStory.js +8 -0
- package/package.json +1 -1
- package/dist/components/referral-component/components/EmailPill.js +0 -30
- package/dist/components/referral-component/components/ReferralComponent.js +0 -144
- package/dist/components/referral-component/components/StepOne.js +0 -186
- package/dist/components/referral-component/components/StepTwo.js +0 -71
- package/dist/components/referral-component/index.js +0 -13
- package/dist/components/referral-component/mocks/mockForStory.js +0 -42
package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js
CHANGED
|
@@ -46,7 +46,7 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
46
46
|
disableExit = _ref.disableExit,
|
|
47
47
|
setResolveAction = _ref.setResolveAction,
|
|
48
48
|
soundActions = _ref.soundActions,
|
|
49
|
-
|
|
49
|
+
setShowPoints = _ref.setShowPoints;
|
|
50
50
|
|
|
51
51
|
var _useState = (0, _react.useState)(false),
|
|
52
52
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -100,13 +100,8 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
100
100
|
type: 'hidePuzzleButtons',
|
|
101
101
|
payload: false
|
|
102
102
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
complex: true,
|
|
106
|
-
finish: true,
|
|
107
|
-
payload: rewardsData
|
|
108
|
-
});
|
|
109
|
-
}, [emitEvent]);
|
|
103
|
+
setShowPoints(rewardsData);
|
|
104
|
+
}, [emitEvent, setShowPoints]);
|
|
110
105
|
|
|
111
106
|
var _endPuzzle = function endPuzzle() {
|
|
112
107
|
emitEvent({
|
|
@@ -147,8 +142,6 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
147
142
|
payload: false
|
|
148
143
|
});
|
|
149
144
|
}
|
|
150
|
-
|
|
151
|
-
setFeedBackText('');
|
|
152
145
|
};
|
|
153
146
|
|
|
154
147
|
var _handleError = function handleError() {
|
|
@@ -194,14 +187,9 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
194
187
|
closeFeedbackAndShowPoints(rewardsData);
|
|
195
188
|
}, 2000);
|
|
196
189
|
});
|
|
197
|
-
}, [setResolveAction, disableExit, accRewards, info.resolve.rewards, emitEvent, closeFeedbackAndShowPoints]);
|
|
190
|
+
}, [setResolveAction, disableExit, accRewards, info.resolve.rewards, emitEvent, setShowPoints, closeFeedbackAndShowPoints]);
|
|
198
191
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
199
|
-
className: "cards-selector"
|
|
200
|
-
style: backgroundImage !== null && backgroundImage !== void 0 && backgroundImage.url ? {
|
|
201
|
-
backgroundImage: "url(".concat(backgroundImage.url, ")"),
|
|
202
|
-
backgroundRepeat: 'no-repeat',
|
|
203
|
-
backgroundSize: 'cover'
|
|
204
|
-
} : {}
|
|
192
|
+
className: "cards-selector"
|
|
205
193
|
}, /*#__PURE__*/_react.default.createElement(_Board.default, {
|
|
206
194
|
setCurrentOrder: setCurrentOrder,
|
|
207
195
|
currentOrder: currentOrder,
|
|
@@ -226,10 +214,7 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
226
214
|
|
|
227
215
|
CardsSelectorPuzzleComponent.defaultProps = {
|
|
228
216
|
cards: [],
|
|
229
|
-
info: {}
|
|
230
|
-
backgroundImage: {
|
|
231
|
-
url: ''
|
|
232
|
-
}
|
|
217
|
+
info: {}
|
|
233
218
|
};
|
|
234
219
|
var _default = CardsSelectorPuzzleComponent;
|
|
235
220
|
exports.default = _default;
|
|
@@ -3,19 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.mockProps4 = exports.mockProps3 = exports.mockProps2 = exports.mockProps = void 0;
|
|
7
7
|
|
|
8
8
|
var _mocker = require("helpers/mocker");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
13
|
-
|
|
14
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
|
|
10
|
+
/* eslint-disable max-len */
|
|
16
11
|
var mockProps = {
|
|
17
12
|
emitEvent: _mocker.emitEvent,
|
|
18
13
|
soundActions: _mocker.soundActions,
|
|
14
|
+
setShowPoints: _mocker.setShowPoints,
|
|
19
15
|
disableExit: function disableExit() {},
|
|
20
16
|
setResolveAction: function setResolveAction() {},
|
|
21
17
|
cards: [{
|
|
@@ -92,6 +88,7 @@ exports.mockProps = mockProps;
|
|
|
92
88
|
var mockProps2 = {
|
|
93
89
|
emitEvent: _mocker.emitEvent,
|
|
94
90
|
soundActions: _mocker.soundActions,
|
|
91
|
+
setShowPoints: _mocker.setShowPoints,
|
|
95
92
|
disableExit: function disableExit() {},
|
|
96
93
|
setResolveAction: function setResolveAction() {},
|
|
97
94
|
cards: [{
|
|
@@ -168,6 +165,7 @@ exports.mockProps2 = mockProps2;
|
|
|
168
165
|
var mockProps3 = {
|
|
169
166
|
emitEvent: _mocker.emitEvent,
|
|
170
167
|
soundActions: _mocker.soundActions,
|
|
168
|
+
setShowPoints: _mocker.setShowPoints,
|
|
171
169
|
disableExit: function disableExit() {},
|
|
172
170
|
setResolveAction: function setResolveAction() {},
|
|
173
171
|
cards: [{
|
|
@@ -272,6 +270,7 @@ exports.mockProps3 = mockProps3;
|
|
|
272
270
|
var mockProps4 = {
|
|
273
271
|
emitEvent: _mocker.emitEvent,
|
|
274
272
|
soundActions: _mocker.soundActions,
|
|
273
|
+
setShowPoints: _mocker.setShowPoints,
|
|
275
274
|
disableExit: function disableExit() {},
|
|
276
275
|
setResolveAction: function setResolveAction() {},
|
|
277
276
|
cards: [{
|
|
@@ -344,12 +343,4 @@ var mockProps4 = {
|
|
|
344
343
|
}
|
|
345
344
|
}
|
|
346
345
|
};
|
|
347
|
-
exports.mockProps4 = mockProps4;
|
|
348
|
-
|
|
349
|
-
var mockProps5 = _objectSpread(_objectSpread({}, mockProps), {}, {
|
|
350
|
-
backgroundImage: {
|
|
351
|
-
url: 'https://i.imgur.com/DTFfovW.jpeg'
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
exports.mockProps5 = mockProps5;
|
|
346
|
+
exports.mockProps4 = mockProps4;
|
|
@@ -38,7 +38,8 @@ var ChainedImageClickPuzzleComponent = function ChainedImageClickPuzzleComponent
|
|
|
38
38
|
soundActions = props.soundActions,
|
|
39
39
|
showFrames = props.showFrames,
|
|
40
40
|
disableExit = props.disableExit,
|
|
41
|
-
setResolveAction = props.setResolveAction
|
|
41
|
+
setResolveAction = props.setResolveAction,
|
|
42
|
+
setShowPoints = props.setShowPoints;
|
|
42
43
|
|
|
43
44
|
var _useState = (0, _react.useState)(0),
|
|
44
45
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -55,7 +56,8 @@ var ChainedImageClickPuzzleComponent = function ChainedImageClickPuzzleComponent
|
|
|
55
56
|
soundActions: soundActions,
|
|
56
57
|
setInfo: setInfo,
|
|
57
58
|
setSelected: setSelected,
|
|
58
|
-
selected: selected
|
|
59
|
+
selected: selected,
|
|
60
|
+
setShowPoints: setShowPoints
|
|
59
61
|
};
|
|
60
62
|
var totalCorrects = list.reduce(function (acc, current) {
|
|
61
63
|
return acc + current.areas.length;
|
package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js
CHANGED
|
@@ -55,7 +55,8 @@ var CurrentImageClickPuzzle = function CurrentImageClickPuzzle(_ref) {
|
|
|
55
55
|
setResolveAction = _ref.setResolveAction,
|
|
56
56
|
soundActions = _ref.soundActions,
|
|
57
57
|
setSelected = _ref.setSelected,
|
|
58
|
-
selected = _ref.selected
|
|
58
|
+
selected = _ref.selected,
|
|
59
|
+
setShowPoints = _ref.setShowPoints;
|
|
59
60
|
var accRewards = (0, _react.useRef)([]);
|
|
60
61
|
var correctClicked = (0, _react.useRef)(0);
|
|
61
62
|
|
|
@@ -86,13 +87,8 @@ var CurrentImageClickPuzzle = function CurrentImageClickPuzzle(_ref) {
|
|
|
86
87
|
type: 'hidePuzzleButtons',
|
|
87
88
|
payload: false
|
|
88
89
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
complex: true,
|
|
92
|
-
finish: true,
|
|
93
|
-
payload: [].concat(_toConsumableArray(accRewards.current), _toConsumableArray(rewards))
|
|
94
|
-
});
|
|
95
|
-
}, [playSound, emitEvent]);
|
|
90
|
+
setShowPoints([].concat(_toConsumableArray(accRewards.current), _toConsumableArray(rewards)));
|
|
91
|
+
}, [playSound, emitEvent, setShowPoints]);
|
|
96
92
|
var currentImageProps = list[index];
|
|
97
93
|
var info = currentImageProps.info,
|
|
98
94
|
specificFeedbacks = currentImageProps.specificFeedbacks;
|
|
@@ -13,6 +13,7 @@ var mockProps = {
|
|
|
13
13
|
description: 'Dale al arma',
|
|
14
14
|
showFrames: true,
|
|
15
15
|
setInfo: function setInfo() {},
|
|
16
|
+
setShowPoints: _mocker.setShowPoints,
|
|
16
17
|
emitEvent: _mocker.emitEvent,
|
|
17
18
|
soundActions: _mocker.soundActions,
|
|
18
19
|
disableExit: function disableExit() {},
|
|
@@ -169,6 +170,7 @@ var mockProps2 = {
|
|
|
169
170
|
soundActions: _mocker.soundActions,
|
|
170
171
|
disableExit: function disableExit() {},
|
|
171
172
|
setResolveAction: function setResolveAction() {},
|
|
173
|
+
setShowPoints: _mocker.setShowPoints,
|
|
172
174
|
list: [{
|
|
173
175
|
info: {
|
|
174
176
|
hint: {
|
package/dist/components/conversational-pro-component/components/ConversationalProComponent.js
CHANGED
|
@@ -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;
|
|
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 =
|
|
130
|
+
_context.next = 5;
|
|
131
131
|
break;
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -137,27 +137,23 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
if (!(payload.voiceId && payload.text)) {
|
|
140
|
-
_context.next =
|
|
140
|
+
_context.next = 5;
|
|
141
141
|
break;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
_context.next = 5;
|
|
145
145
|
return emitEvent({
|
|
146
|
-
type: '
|
|
146
|
+
type: 'playSpeech',
|
|
147
147
|
payload: payload
|
|
148
148
|
});
|
|
149
149
|
|
|
150
150
|
case 5:
|
|
151
|
-
url = _context.sent;
|
|
152
|
-
playSound(url, 'tts');
|
|
153
|
-
|
|
154
|
-
case 7:
|
|
155
151
|
case "end":
|
|
156
152
|
return _context.stop();
|
|
157
153
|
}
|
|
158
154
|
}
|
|
159
155
|
}, _callee);
|
|
160
|
-
})), [currentLineData.voice, currentMessage, emitEvent, getVoice
|
|
156
|
+
})), [currentLineData.voice, currentMessage, emitEvent, getVoice]); // Recupera la antigua linea de la conversacion para conservar los personajes en voice-over
|
|
161
157
|
|
|
162
158
|
var leftWithSlots = lines.slice(0, currentLine + 1).reverse().find(function (line) {
|
|
163
159
|
return line.slots;
|
|
@@ -265,18 +261,13 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
265
261
|
} else if (currentLineData !== null && currentLineData !== void 0 && (_currentLineData$audi = currentLineData.audio) !== null && _currentLineData$audi !== void 0 && _currentLineData$audi.url) {
|
|
266
262
|
var _currentLineData$audi2;
|
|
267
263
|
|
|
268
|
-
playSound(currentLineData === null || currentLineData === void 0 ? void 0 : (_currentLineData$audi2 = currentLineData.audio) === null || _currentLineData$audi2 === void 0 ? void 0 : _currentLineData$audi2.url
|
|
264
|
+
playSound(currentLineData === null || currentLineData === void 0 ? void 0 : (_currentLineData$audi2 = currentLineData.audio) === null || _currentLineData$audi2 === void 0 ? void 0 : _currentLineData$audi2.url);
|
|
269
265
|
}
|
|
270
266
|
|
|
271
267
|
return function () {
|
|
272
|
-
stop(
|
|
268
|
+
stop();
|
|
273
269
|
};
|
|
274
270
|
}, [currentLineData, currentMessage, finished, lines, playSound, playSpeech, stop]);
|
|
275
|
-
(0, _react.useEffect)(function () {
|
|
276
|
-
return function () {
|
|
277
|
-
stop('tts');
|
|
278
|
-
};
|
|
279
|
-
}, [stop]);
|
|
280
271
|
|
|
281
272
|
var decisionPayload = _objectSpread(_objectSpread({}, currentLineData.payload), {}, {
|
|
282
273
|
onFinish: handleClickNext,
|
|
@@ -21,15 +21,12 @@ var _helpers = require("../../../../helpers");
|
|
|
21
21
|
|
|
22
22
|
var _LightSet = _interopRequireDefault(require("../../../../helpers/LightSet"));
|
|
23
23
|
|
|
24
|
-
var _deviceDetection = require("../../../../helpers/deviceDetection");
|
|
25
|
-
|
|
26
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
25
|
|
|
28
26
|
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); }
|
|
29
27
|
|
|
30
28
|
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; }
|
|
31
29
|
|
|
32
|
-
var isMobile = (0, _deviceDetection.DeviceDetection)();
|
|
33
30
|
var defaultCamPos = [0, 14.63, 16];
|
|
34
31
|
|
|
35
32
|
function Panel(_ref) {
|
|
@@ -94,7 +91,7 @@ function Panel(_ref) {
|
|
|
94
91
|
left: child.left - parent.left,
|
|
95
92
|
bottom: child.bottom - parent.bottom
|
|
96
93
|
};
|
|
97
|
-
var paddingBottom =
|
|
94
|
+
var paddingBottom = 40;
|
|
98
95
|
relativePos.bottom += active ? -paddingBottom : paddingBottom;
|
|
99
96
|
gl.setViewport(relativePos.left, relativePos.bottom, width, height);
|
|
100
97
|
gl.setScissor(relativePos.left, relativePos.bottom, width, height);
|
|
@@ -22,6 +22,7 @@ var animations = {
|
|
|
22
22
|
var converOld = {
|
|
23
23
|
emitEvent: _mocker.emitEvent,
|
|
24
24
|
soundActions: _mocker.soundActions,
|
|
25
|
+
setShowPoints: _mocker.setShowPoints,
|
|
25
26
|
messages: [{
|
|
26
27
|
character: 'Puerta',
|
|
27
28
|
emotion: 'neutral',
|
|
@@ -76,6 +77,7 @@ exports.converOld = converOld;
|
|
|
76
77
|
var conversationProps = {
|
|
77
78
|
emitEvent: _mocker.emitEvent,
|
|
78
79
|
soundActions: _mocker.soundActions,
|
|
80
|
+
setShowPoints: _mocker.setShowPoints,
|
|
79
81
|
lines: [{
|
|
80
82
|
flex: true,
|
|
81
83
|
slots: [{
|
|
@@ -342,6 +344,7 @@ exports.conversationProps = conversationProps;
|
|
|
342
344
|
var voiceOverProps = {
|
|
343
345
|
emitEvent: _mocker.emitEvent,
|
|
344
346
|
soundActions: _mocker.soundActions,
|
|
347
|
+
setShowPoints: _mocker.setShowPoints,
|
|
345
348
|
lines: [{
|
|
346
349
|
flex: false,
|
|
347
350
|
slots: [{
|
|
@@ -475,6 +478,7 @@ exports.voiceOverProps = voiceOverProps;
|
|
|
475
478
|
var withoutBackground = {
|
|
476
479
|
emitEvent: _mocker.emitEvent,
|
|
477
480
|
soundActions: _mocker.soundActions,
|
|
481
|
+
setShowPoints: _mocker.setShowPoints,
|
|
478
482
|
lines: [{
|
|
479
483
|
flex: false,
|
|
480
484
|
slots: [{
|
|
@@ -604,6 +608,7 @@ exports.withoutBackground = withoutBackground;
|
|
|
604
608
|
var conversationPropsNoFeedbackNoRewards = {
|
|
605
609
|
emitEvent: _mocker.emitEvent,
|
|
606
610
|
soundActions: _mocker.soundActions,
|
|
611
|
+
setShowPoints: _mocker.setShowPoints,
|
|
607
612
|
lines: [{
|
|
608
613
|
flex: true,
|
|
609
614
|
slots: [{
|
|
@@ -864,6 +869,7 @@ exports.conversationPropsNoFeedbackNoRewards = conversationPropsNoFeedbackNoRewa
|
|
|
864
869
|
var conversationPropsLodSettings = {
|
|
865
870
|
emitEvent: _mocker.emitEvent,
|
|
866
871
|
soundActions: _mocker.soundActions,
|
|
872
|
+
setShowPoints: _mocker.setShowPoints,
|
|
867
873
|
lodSettings: {
|
|
868
874
|
currentLOD: 'original',
|
|
869
875
|
rgbSimulation: true,
|
|
@@ -74,7 +74,8 @@ var CrackerPuzzleComponent = function CrackerPuzzleComponent(_ref) {
|
|
|
74
74
|
password = _ref.password,
|
|
75
75
|
disableExit = _ref.disableExit,
|
|
76
76
|
difficulty = _ref.difficulty,
|
|
77
|
-
setResolveAction = _ref.setResolveAction
|
|
77
|
+
setResolveAction = _ref.setResolveAction,
|
|
78
|
+
setShowPoints = _ref.setShowPoints;
|
|
78
79
|
|
|
79
80
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
80
81
|
playSound = _soundActions[0];
|
|
@@ -146,12 +147,7 @@ var CrackerPuzzleComponent = function CrackerPuzzleComponent(_ref) {
|
|
|
146
147
|
type: 'hidePuzzleButtons',
|
|
147
148
|
payload: false
|
|
148
149
|
});
|
|
149
|
-
|
|
150
|
-
type: 'addPoints',
|
|
151
|
-
complex: true,
|
|
152
|
-
finish: true,
|
|
153
|
-
payload: info.resolve.rewards
|
|
154
|
-
});
|
|
150
|
+
setShowPoints(info.resolve.rewards);
|
|
155
151
|
}, 0);
|
|
156
152
|
});
|
|
157
153
|
}, [setResolveAction, playSound]);
|
|
@@ -159,12 +155,7 @@ var CrackerPuzzleComponent = function CrackerPuzzleComponent(_ref) {
|
|
|
159
155
|
var handleFinish = function handleFinish() {
|
|
160
156
|
playSound('click-ui');
|
|
161
157
|
var rewards = solution.right.rewards;
|
|
162
|
-
|
|
163
|
-
type: 'addPoints',
|
|
164
|
-
complex: true,
|
|
165
|
-
finish: true,
|
|
166
|
-
payload: rewards
|
|
167
|
-
});
|
|
158
|
+
setShowPoints(rewards);
|
|
168
159
|
};
|
|
169
160
|
|
|
170
161
|
var generatePasswordPositions = function generatePasswordPositions() {
|
|
@@ -10,6 +10,7 @@ var _mocker = require("helpers/mocker");
|
|
|
10
10
|
var mockProps = {
|
|
11
11
|
emitEvent: _mocker.emitEvent,
|
|
12
12
|
soundActions: _mocker.soundActions,
|
|
13
|
+
setShowPoints: _mocker.setShowPoints,
|
|
13
14
|
disableExit: function disableExit() {},
|
|
14
15
|
setResolveAction: function setResolveAction() {},
|
|
15
16
|
velocity: 'slow',
|
|
@@ -63,6 +64,7 @@ exports.mockProps = mockProps;
|
|
|
63
64
|
var mockProps2 = {
|
|
64
65
|
emitEvent: _mocker.emitEvent,
|
|
65
66
|
soundActions: _mocker.soundActions,
|
|
67
|
+
setShowPoints: _mocker.setShowPoints,
|
|
66
68
|
disableExit: function disableExit() {},
|
|
67
69
|
setResolveAction: function setResolveAction() {},
|
|
68
70
|
velocity: 'fast',
|
|
@@ -116,6 +118,7 @@ exports.mockProps2 = mockProps2;
|
|
|
116
118
|
var mockProps3 = {
|
|
117
119
|
emitEvent: _mocker.emitEvent,
|
|
118
120
|
soundActions: _mocker.soundActions,
|
|
121
|
+
setShowPoints: _mocker.setShowPoints,
|
|
119
122
|
disableExit: function disableExit() {},
|
|
120
123
|
setResolveAction: function setResolveAction() {},
|
|
121
124
|
velocity: 'fastest',
|
|
@@ -169,6 +172,7 @@ exports.mockProps3 = mockProps3;
|
|
|
169
172
|
var mockProps4 = {
|
|
170
173
|
emitEvent: _mocker.emitEvent,
|
|
171
174
|
soundActions: _mocker.soundActions,
|
|
175
|
+
setShowPoints: _mocker.setShowPoints,
|
|
172
176
|
disableExit: function disableExit() {},
|
|
173
177
|
setResolveAction: function setResolveAction() {},
|
|
174
178
|
velocity: 'fastest',
|
|
@@ -222,6 +226,7 @@ exports.mockProps4 = mockProps4;
|
|
|
222
226
|
var mockProps5 = {
|
|
223
227
|
emitEvent: _mocker.emitEvent,
|
|
224
228
|
soundActions: _mocker.soundActions,
|
|
229
|
+
setShowPoints: _mocker.setShowPoints,
|
|
225
230
|
disableExit: function disableExit() {},
|
|
226
231
|
setResolveAction: function setResolveAction() {},
|
|
227
232
|
velocity: 'slow',
|
|
@@ -65,7 +65,9 @@ var DecisionBody = function DecisionBody(_ref) {
|
|
|
65
65
|
selectedChoice: selectedChoice,
|
|
66
66
|
selectChoice: !showingResults || inherited && failed ? choose : noop,
|
|
67
67
|
options: options,
|
|
68
|
-
showingResults: showingResults
|
|
68
|
+
showingResults: showingResults,
|
|
69
|
+
hasFeedbackDefinedInEditor: currentSelectedChoice.feedback,
|
|
70
|
+
hasRewards: hasRewards
|
|
69
71
|
};
|
|
70
72
|
|
|
71
73
|
var BasicDecision = function BasicDecision(_ref2) {
|
|
@@ -76,9 +78,7 @@ var DecisionBody = function DecisionBody(_ref) {
|
|
|
76
78
|
className: "popup--info"
|
|
77
79
|
}, showingResults ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, defaultChildren, !currentSelectedChoice.feedback && hasRewards.length === 0 && /*#__PURE__*/_react.default.createElement("span", {
|
|
78
80
|
className: "popup--info__title"
|
|
79
|
-
}, question !== '' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, question))
|
|
80
|
-
className: "popup--info__title"
|
|
81
|
-
}, question)) : /*#__PURE__*/_react.default.createElement("span", {
|
|
81
|
+
}, question !== '' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, question))) : /*#__PURE__*/_react.default.createElement("span", {
|
|
82
82
|
className: "popup--info__title"
|
|
83
83
|
}, question)), /*#__PURE__*/_react.default.createElement("div", {
|
|
84
84
|
className: "popup__questions"
|
|
@@ -23,6 +23,14 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
23
23
|
|
|
24
24
|
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; }
|
|
25
25
|
|
|
26
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
27
|
+
|
|
28
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
|
|
30
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
31
|
+
|
|
32
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
33
|
+
|
|
26
34
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
27
35
|
|
|
28
36
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
@@ -63,10 +71,15 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
63
71
|
selectedView = _useState2[0],
|
|
64
72
|
selectView = _useState2[1];
|
|
65
73
|
|
|
66
|
-
var _useState3 = (0, _react.useState)(
|
|
74
|
+
var _useState3 = (0, _react.useState)([]),
|
|
67
75
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
rewards = _useState4[0],
|
|
77
|
+
addReward = _useState4[1];
|
|
78
|
+
|
|
79
|
+
var _useState5 = (0, _react.useState)({}),
|
|
80
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
81
|
+
resultChoice = _useState6[0],
|
|
82
|
+
setResultChoice = _useState6[1];
|
|
70
83
|
|
|
71
84
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
72
85
|
playSound = _soundActions[0];
|
|
@@ -127,37 +140,38 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
127
140
|
playSound('click-ui');
|
|
128
141
|
|
|
129
142
|
if (!failed && selectedView === 'results') {
|
|
130
|
-
setResultChoice({});
|
|
131
|
-
selectView('options');
|
|
132
143
|
emitEvent({
|
|
133
144
|
type: 'addPoints',
|
|
134
|
-
payload:
|
|
135
|
-
finish:
|
|
136
|
-
complex: true,
|
|
137
|
-
onFinish: onFinish
|
|
145
|
+
payload: rewards,
|
|
146
|
+
finish: !onFinish
|
|
138
147
|
});
|
|
148
|
+
setResultChoice({});
|
|
149
|
+
selectView('options');
|
|
150
|
+
|
|
151
|
+
if (onFinish) {
|
|
152
|
+
onFinish();
|
|
153
|
+
}
|
|
139
154
|
} else if (Object.keys(choice).length > 0) {
|
|
155
|
+
var currentRewards = [].concat(_toConsumableArray(rewards), _toConsumableArray(choice.rewards));
|
|
156
|
+
|
|
140
157
|
if (choice.right) {
|
|
141
158
|
playSound('score');
|
|
142
159
|
} else {
|
|
143
160
|
playSound('fail');
|
|
144
|
-
emitEvent({
|
|
145
|
-
type: 'addPoints',
|
|
146
|
-
payload: choice.rewards,
|
|
147
|
-
finish: false,
|
|
148
|
-
complex: true
|
|
149
|
-
});
|
|
150
161
|
}
|
|
151
162
|
|
|
152
163
|
setResultChoice(choice);
|
|
164
|
+
addReward(currentRewards);
|
|
153
165
|
playCurrentAudio(choice);
|
|
154
166
|
selectView('results');
|
|
155
167
|
}
|
|
156
168
|
},
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
169
|
+
onExit: function onExit() {
|
|
170
|
+
playSound('click-ui');
|
|
171
|
+
emitEvent({
|
|
172
|
+
type: 'success'
|
|
173
|
+
});
|
|
174
|
+
},
|
|
161
175
|
translate: function translate(id) {
|
|
162
176
|
return emitEvent({
|
|
163
177
|
type: 'translate',
|
|
@@ -200,7 +214,7 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
200
214
|
};
|
|
201
215
|
|
|
202
216
|
var Body = function Body() {
|
|
203
|
-
return inherited ? /*#__PURE__*/_react.default.createElement(CharactersWrapper, null, selectedView === 'results'
|
|
217
|
+
return inherited ? /*#__PURE__*/_react.default.createElement(CharactersWrapper, null, selectedView === 'results' ? /*#__PURE__*/_react.default.createElement(_Feedback.default, {
|
|
204
218
|
question: question,
|
|
205
219
|
soundActions: soundActions,
|
|
206
220
|
inherited: inherited,
|
|
@@ -7,11 +7,16 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _RewardsComponent = _interopRequireDefault(require("../../rewards-component/components/RewardsComponent"));
|
|
11
|
+
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
13
|
|
|
12
14
|
var FeedBack = function FeedBack(_ref) {
|
|
13
15
|
var choice = _ref.choice,
|
|
14
|
-
inherited = _ref.inherited
|
|
16
|
+
inherited = _ref.inherited,
|
|
17
|
+
rewards = _ref.rewards,
|
|
18
|
+
emitEvent = _ref.emitEvent,
|
|
19
|
+
soundActions = _ref.soundActions;
|
|
15
20
|
|
|
16
21
|
var Wrapper = function Wrapper(_ref2) {
|
|
17
22
|
var children = _ref2.children;
|
|
@@ -31,7 +36,10 @@ var FeedBack = function FeedBack(_ref) {
|
|
|
31
36
|
return children;
|
|
32
37
|
};
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
var noRewards = rewards.filter(function (reward) {
|
|
40
|
+
return reward.type !== 'grade';
|
|
41
|
+
}).length === 0;
|
|
42
|
+
if (!choice.feedback && noRewards) return null;
|
|
35
43
|
return /*#__PURE__*/_react.default.createElement(Wrapper, null, choice.feedback ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
36
44
|
className: "conversation--feedback__title"
|
|
37
45
|
}, "Feedback"), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -40,7 +48,11 @@ var FeedBack = function FeedBack(_ref) {
|
|
|
40
48
|
className: "icon-check-circle-black color--success"
|
|
41
49
|
}) : /*#__PURE__*/_react.default.createElement("span", {
|
|
42
50
|
className: "icon-error-circle-black color--error"
|
|
43
|
-
}), /*#__PURE__*/_react.default.createElement("p", null, choice.feedback))) : null
|
|
51
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, choice.feedback))) : null, !noRewards ? /*#__PURE__*/_react.default.createElement(_RewardsComponent.default, {
|
|
52
|
+
soundActions: soundActions,
|
|
53
|
+
rewards: choice.right ? rewards : choice.rewards,
|
|
54
|
+
emitEvent: emitEvent
|
|
55
|
+
}) : null);
|
|
44
56
|
};
|
|
45
57
|
|
|
46
58
|
var _default = FeedBack;
|
|
@@ -14,7 +14,9 @@ var Options = function Options(_ref) {
|
|
|
14
14
|
options = _ref.options,
|
|
15
15
|
selectedChoice = _ref.selectedChoice,
|
|
16
16
|
selectChoice = _ref.selectChoice,
|
|
17
|
-
showingResults = _ref.showingResults
|
|
17
|
+
showingResults = _ref.showingResults,
|
|
18
|
+
hasFeedbackDefinedInEditor = _ref.hasFeedbackDefinedInEditor,
|
|
19
|
+
hasRewards = _ref.hasRewards;
|
|
18
20
|
return options.filter(function (option) {
|
|
19
21
|
return option.text;
|
|
20
22
|
}).map(function (option) {
|
|
@@ -26,7 +28,7 @@ var Options = function Options(_ref) {
|
|
|
26
28
|
name: option.id,
|
|
27
29
|
defaultChecked: selectedChoice.id === option.id
|
|
28
30
|
}), showingResults ? /*#__PURE__*/_react.default.createElement("label", {
|
|
29
|
-
className: "".concat(option.right ?
|
|
31
|
+
className: "".concat(option.right ? "radio-text-success ".concat(!hasFeedbackDefinedInEditor && hasRewards.length === 0 ? 'radio-icon-success' : '') : "radio-text-fail ".concat(!hasFeedbackDefinedInEditor && hasRewards.length === 0 ? 'radio-icon-fail' : '')),
|
|
30
32
|
htmlFor: option.id,
|
|
31
33
|
onClick: function onClick() {
|
|
32
34
|
selectChoice(option);
|
|
@@ -10,6 +10,7 @@ var _mocker = require("helpers/mocker");
|
|
|
10
10
|
var decisionProps = {
|
|
11
11
|
emitEvent: _mocker.emitEvent,
|
|
12
12
|
soundActions: _mocker.soundActions,
|
|
13
|
+
setShowPoints: _mocker.setShowPoints,
|
|
13
14
|
onFinish: function onFinish() {
|
|
14
15
|
return (0, _mocker.onFinish)('decision-component');
|
|
15
16
|
},
|
|
@@ -128,6 +129,7 @@ exports.decisionProps = decisionProps;
|
|
|
128
129
|
var decisionPropsWithRadios = {
|
|
129
130
|
emitEvent: _mocker.emitEvent,
|
|
130
131
|
soundActions: _mocker.soundActions,
|
|
132
|
+
setShowPoints: _mocker.setShowPoints,
|
|
131
133
|
options: [{
|
|
132
134
|
id: 0,
|
|
133
135
|
right: false,
|