@gamelearn/arcade-components 0.20.5 → 0.20.6
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/auto-evaluation-component/components/AutoEvaluation.js +10 -2
- package/dist/components/cards-selector-puzzle-component/components/Board/index.js +7 -1
- package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +3 -2
- package/dist/components/cartel-component/components/CartelComponent.js +1 -0
- package/dist/components/comic-component/components/ComicComponent.js +6 -0
- package/dist/components/conversational-component/components/ConversationalComponent.js +6 -0
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +3 -0
- package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +1 -1
- package/dist/components/decision-component/components/DecisionBody.js +2 -2
- package/dist/components/decision-component/components/DecisionComponent.js +14 -0
- package/dist/components/feedback-component/components/FeedbackComponent.js +1 -2
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +9 -1
- package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +2 -1
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +4 -1
- package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +7 -2
- package/dist/components/image-component/components/ImageComponent.js +19 -1
- package/dist/components/inventory-item/components/InventoryItem.js +21 -2
- package/dist/components/lectures-component/components/LectureButtons.js +0 -9
- package/dist/components/lectures-component/components/LecturesComponent.js +9 -14
- package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +1 -0
- package/dist/components/notice-component/components/NoticeComponent.js +18 -11
- package/dist/components/pattern-component/components/PatternComponent.js +18 -1
- package/dist/components/pdf-component/components/PdfComponent.js +10 -2
- package/dist/components/pdf-component/components/PdfVisor.js +7 -1
- package/dist/components/rewards-component/components/RewardsComponent.js +8 -1
- package/dist/components/survey-component/components/SurveyComponent.js +8 -1
- package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +4 -1
- package/dist/components/terminal-puzzle-component/components/Visor/index.js +10 -4
- package/dist/components/test-component/components/Container.js +14 -3
- package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +3 -2
- package/dist/components/url-component/components/UrlComponent.js +7 -1
- package/dist/components/video-component/components/VideoComponent.js +2 -0
- package/dist/components/video-visor/components/VideoControllers/ControlButtons.js +0 -6
- package/dist/components/video-visor/components/VideoControllers/FinishedVideoButtons.js +0 -6
- package/dist/components/video-visor/components/VideoControllers/PlayInitButton.js +0 -7
- package/dist/components/video-visor/components/VideoControllers/SkipButton.js +0 -8
- package/dist/components/video-visor/components/VideoVisor.js +23 -12
- package/dist/components/web-builder-puzzle-component/Popups/PopupColorComponent/index.js +6 -1
- package/dist/components/web-builder-puzzle-component/Popups/PopupImageComponent/index.js +6 -11
- package/dist/components/web-builder-puzzle-component/Popups/PopupTextComponent/index.js +6 -1
- package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +3 -0
- package/dist/components/writer-puzzle-component/components/ElectionComponent.js +6 -12
- package/dist/components/writer-puzzle-component/components/FeedbackComponent.js +19 -22
- package/dist/components/writer-puzzle-component/components/FeedbackElement.js +0 -10
- package/dist/components/writer-puzzle-component/components/FinishedTextComponent.js +0 -6
- package/dist/components/writer-puzzle-component/components/FixedComponent.js +0 -11
- package/dist/components/writer-puzzle-component/components/Rewards.js +0 -14
- package/dist/components/writer-puzzle-component/components/SingleElection.js +6 -14
- package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +1 -0
- package/package.json +1 -1
|
@@ -9,11 +9,27 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
+
|
|
14
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
+
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
+
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
19
|
+
|
|
20
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
21
|
+
|
|
22
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
+
|
|
12
24
|
var PatternComponent = function PatternComponent(_ref) {
|
|
13
25
|
var img = _ref.img,
|
|
14
26
|
name = _ref.name,
|
|
15
27
|
viewed = _ref.viewed,
|
|
16
|
-
emitEvent = _ref.emitEvent
|
|
28
|
+
emitEvent = _ref.emitEvent,
|
|
29
|
+
soundActions = _ref.soundActions;
|
|
30
|
+
|
|
31
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
32
|
+
play = _soundActions[0];
|
|
17
33
|
|
|
18
34
|
if (!img) {
|
|
19
35
|
return null;
|
|
@@ -22,6 +38,7 @@ var PatternComponent = function PatternComponent(_ref) {
|
|
|
22
38
|
var imgUrl = img.url;
|
|
23
39
|
|
|
24
40
|
var close = function close() {
|
|
41
|
+
play('click-ui');
|
|
25
42
|
emitEvent({
|
|
26
43
|
type: 'emitSavePattern',
|
|
27
44
|
payload: {
|
|
@@ -35,6 +35,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
35
35
|
|
|
36
36
|
var PdfComponent = function PdfComponent(_ref) {
|
|
37
37
|
var emitEvent = _ref.emitEvent,
|
|
38
|
+
soundActions = _ref.soundActions,
|
|
38
39
|
documentType = _ref.documentType,
|
|
39
40
|
name = _ref.name,
|
|
40
41
|
required = _ref.required,
|
|
@@ -42,7 +43,7 @@ var PdfComponent = function PdfComponent(_ref) {
|
|
|
42
43
|
visible = _ref.visible,
|
|
43
44
|
documentId = _ref.documentId,
|
|
44
45
|
documentId_labelId = _ref.documentId_labelId,
|
|
45
|
-
props = _objectWithoutProperties(_ref, ["emitEvent", "documentType", "name", "required", "viewed", "visible", "documentId", "documentId_labelId"]);
|
|
46
|
+
props = _objectWithoutProperties(_ref, ["emitEvent", "soundActions", "documentType", "name", "required", "viewed", "visible", "documentId", "documentId_labelId"]);
|
|
46
47
|
|
|
47
48
|
var translate = function translate(id) {
|
|
48
49
|
return emitEvent({
|
|
@@ -51,6 +52,9 @@ var PdfComponent = function PdfComponent(_ref) {
|
|
|
51
52
|
});
|
|
52
53
|
};
|
|
53
54
|
|
|
55
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
56
|
+
play = _soundActions[0];
|
|
57
|
+
|
|
54
58
|
var documentFile = props.document;
|
|
55
59
|
|
|
56
60
|
var _ref2 = documentFile || '',
|
|
@@ -112,10 +116,14 @@ var PdfComponent = function PdfComponent(_ref) {
|
|
|
112
116
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
113
117
|
type: "button",
|
|
114
118
|
className: "gat--btn__round",
|
|
115
|
-
onClick:
|
|
119
|
+
onClick: function onClick() {
|
|
120
|
+
emitFinish();
|
|
121
|
+
play('click-ui');
|
|
122
|
+
}
|
|
116
123
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
117
124
|
className: "icon-close"
|
|
118
125
|
}))), url && /*#__PURE__*/_react.default.createElement(_PdfVisor.default, {
|
|
126
|
+
soundActions: soundActions,
|
|
119
127
|
emitNumberOfPages: function emitNumberOfPages(e) {
|
|
120
128
|
return readNumberOfPages(e);
|
|
121
129
|
},
|
|
@@ -35,7 +35,8 @@ var PdfVisor = function PdfVisor(_ref) {
|
|
|
35
35
|
var url = _ref.url,
|
|
36
36
|
endPdf = _ref.endPdf,
|
|
37
37
|
emitNumberOfPages = _ref.emitNumberOfPages,
|
|
38
|
-
translate = _ref.translate
|
|
38
|
+
translate = _ref.translate,
|
|
39
|
+
soundActions = _ref.soundActions;
|
|
39
40
|
var scrollElement = (0, _react.useRef)();
|
|
40
41
|
|
|
41
42
|
var _useState = (0, _react.useState)(1),
|
|
@@ -54,6 +55,10 @@ var PdfVisor = function PdfVisor(_ref) {
|
|
|
54
55
|
setCurrentPage = _useState6[1];
|
|
55
56
|
|
|
56
57
|
var scale = (0, _deviceDetection.DeviceDetection)() ? 1 : 2;
|
|
58
|
+
|
|
59
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
60
|
+
play = _soundActions[0];
|
|
61
|
+
|
|
57
62
|
var handleLoadSucess = (0, _react.useCallback)(function (pdf) {
|
|
58
63
|
if (pdf.numPages) {
|
|
59
64
|
emitNumberOfPages(pdf.numPages);
|
|
@@ -87,6 +92,7 @@ var PdfVisor = function PdfVisor(_ref) {
|
|
|
87
92
|
};
|
|
88
93
|
|
|
89
94
|
var turnPage = function turnPage(value) {
|
|
95
|
+
play('click-ui');
|
|
90
96
|
scrollElement.current.scrollTo(0, 0);
|
|
91
97
|
setOverlay(false);
|
|
92
98
|
setCurrentPage(currentPage + value);
|
|
@@ -37,7 +37,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
37
37
|
|
|
38
38
|
var RewardsComponent = function RewardsComponent(_ref) {
|
|
39
39
|
var rewards = _ref.rewards,
|
|
40
|
-
emitEvent = _ref.emitEvent
|
|
40
|
+
emitEvent = _ref.emitEvent,
|
|
41
|
+
soundActions = _ref.soundActions;
|
|
41
42
|
var carouselRef = (0, _react.useRef)();
|
|
42
43
|
var indicators = emitEvent({
|
|
43
44
|
type: 'loadIndicators'
|
|
@@ -69,6 +70,10 @@ var RewardsComponent = function RewardsComponent(_ref) {
|
|
|
69
70
|
return reward.type !== 'grade';
|
|
70
71
|
});
|
|
71
72
|
var rewardsUnified = [];
|
|
73
|
+
|
|
74
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
75
|
+
play = _soundActions[0];
|
|
76
|
+
|
|
72
77
|
var displayingItems = 4;
|
|
73
78
|
|
|
74
79
|
var getIndicator = function getIndicator(element) {
|
|
@@ -110,6 +115,7 @@ var RewardsComponent = function RewardsComponent(_ref) {
|
|
|
110
115
|
|
|
111
116
|
var onClickPrev = function onClickPrev() {
|
|
112
117
|
if (offset - 1 < 0) return;
|
|
118
|
+
play('click-ui');
|
|
113
119
|
setOffset(offset - 1);
|
|
114
120
|
var nextSize = Object.values(rewardsSize.current)[offset - 1];
|
|
115
121
|
setRightAmount(null);
|
|
@@ -118,6 +124,7 @@ var RewardsComponent = function RewardsComponent(_ref) {
|
|
|
118
124
|
|
|
119
125
|
var onClickNext = function onClickNext() {
|
|
120
126
|
if (offset + displayingItems >= totalItems) return;
|
|
127
|
+
play('click-ui');
|
|
121
128
|
setRightAmount(offset + displayingItems === totalItems - 1 ? 0 : null);
|
|
122
129
|
setOffset(offset + 1);
|
|
123
130
|
var nextSize = Object.values(rewardsSize.current)[offset];
|
|
@@ -58,7 +58,8 @@ var PAGES = [{
|
|
|
58
58
|
}];
|
|
59
59
|
|
|
60
60
|
var SurveyComponent = function SurveyComponent(_ref) {
|
|
61
|
-
var emitEvent = _ref.emitEvent
|
|
61
|
+
var emitEvent = _ref.emitEvent,
|
|
62
|
+
soundActions = _ref.soundActions;
|
|
62
63
|
|
|
63
64
|
var _useState = (0, _react.useState)(INIT_SURVEY),
|
|
64
65
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -80,6 +81,9 @@ var SurveyComponent = function SurveyComponent(_ref) {
|
|
|
80
81
|
finished = _useState8[0],
|
|
81
82
|
finish = _useState8[1];
|
|
82
83
|
|
|
84
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
85
|
+
play = _soundActions[0];
|
|
86
|
+
|
|
83
87
|
var translate = function translate(id, values) {
|
|
84
88
|
return emitEvent({
|
|
85
89
|
type: 'translate',
|
|
@@ -89,6 +93,8 @@ var SurveyComponent = function SurveyComponent(_ref) {
|
|
|
89
93
|
};
|
|
90
94
|
|
|
91
95
|
var changePage = function changePage() {
|
|
96
|
+
play('click-ui');
|
|
97
|
+
|
|
92
98
|
if (page + 1 >= PAGES.length) {
|
|
93
99
|
finish(true);
|
|
94
100
|
} else {
|
|
@@ -137,6 +143,7 @@ var SurveyComponent = function SurveyComponent(_ref) {
|
|
|
137
143
|
type: "button",
|
|
138
144
|
disabled: disabled,
|
|
139
145
|
onClick: function onClick() {
|
|
146
|
+
play('click-ui');
|
|
140
147
|
emitEvent({
|
|
141
148
|
type: 'saveSurvey',
|
|
142
149
|
payload: survey
|
|
@@ -101,6 +101,7 @@ var TerminalPuzzleComponent = function TerminalPuzzleComponent(_ref) {
|
|
|
101
101
|
};
|
|
102
102
|
}, [items]);
|
|
103
103
|
var selectItem = (0, _react.useCallback)(function (item) {
|
|
104
|
+
playSound('click-ui');
|
|
104
105
|
selectFile(item);
|
|
105
106
|
setBreadcrumb([].concat(_toConsumableArray(breadcrumb), [item]));
|
|
106
107
|
|
|
@@ -111,7 +112,7 @@ var TerminalPuzzleComponent = function TerminalPuzzleComponent(_ref) {
|
|
|
111
112
|
});
|
|
112
113
|
disableExit(true);
|
|
113
114
|
}
|
|
114
|
-
}, [breadcrumb, disableExit, emitEvent]);
|
|
115
|
+
}, [breadcrumb, disableExit, emitEvent, playSound]);
|
|
115
116
|
(0, _react.useEffect)(function () {
|
|
116
117
|
selectFile(initFile);
|
|
117
118
|
setBreadcrumb([initFile]);
|
|
@@ -132,6 +133,7 @@ var TerminalPuzzleComponent = function TerminalPuzzleComponent(_ref) {
|
|
|
132
133
|
};
|
|
133
134
|
|
|
134
135
|
var closeFolder = function closeFolder() {
|
|
136
|
+
playSound('click-ui');
|
|
135
137
|
var initItem = breadcrumb[0];
|
|
136
138
|
selectFile(initItem);
|
|
137
139
|
setBreadcrumb([initItem]);
|
|
@@ -162,6 +164,7 @@ var TerminalPuzzleComponent = function TerminalPuzzleComponent(_ref) {
|
|
|
162
164
|
file: file,
|
|
163
165
|
translate: translate
|
|
164
166
|
})) : /*#__PURE__*/_react.default.createElement(_Visor.default, {
|
|
167
|
+
soundActions: soundActions,
|
|
165
168
|
backFile: backFile,
|
|
166
169
|
resolvePuzzle: resolvePuzzle,
|
|
167
170
|
info: info,
|
|
@@ -43,27 +43,31 @@ var Visor = function Visor(_ref) {
|
|
|
43
43
|
info = _ref.info,
|
|
44
44
|
resolvePuzzle = _ref.resolvePuzzle,
|
|
45
45
|
backFile = _ref.backFile,
|
|
46
|
-
translate = _ref.translate
|
|
46
|
+
translate = _ref.translate,
|
|
47
|
+
soundActions = _ref.soundActions;
|
|
47
48
|
var fileId = file.fileId;
|
|
48
49
|
var url = ((_file$document = file.document) === null || _file$document === void 0 ? void 0 : _file$document.url) || '';
|
|
49
50
|
var COMPONENTS = {
|
|
50
51
|
image: {
|
|
51
52
|
component: _Image.default,
|
|
52
53
|
props: _objectSpread(_objectSpread({}, file), {}, {
|
|
53
|
-
url: url
|
|
54
|
+
url: url,
|
|
55
|
+
soundActions: soundActions
|
|
54
56
|
})
|
|
55
57
|
},
|
|
56
58
|
video: {
|
|
57
59
|
component: _videoVisor.default,
|
|
58
60
|
props: _objectSpread(_objectSpread({}, file), {}, {
|
|
59
61
|
url: url,
|
|
60
|
-
endVideo: resolvePuzzle
|
|
62
|
+
endVideo: resolvePuzzle,
|
|
63
|
+
soundActions: soundActions
|
|
61
64
|
})
|
|
62
65
|
},
|
|
63
66
|
embedded_video: {
|
|
64
67
|
component: _videoVisor.default,
|
|
65
68
|
props: _objectSpread(_objectSpread({}, file), {}, {
|
|
66
|
-
url: url
|
|
69
|
+
url: url,
|
|
70
|
+
soundActions: soundActions
|
|
67
71
|
})
|
|
68
72
|
},
|
|
69
73
|
pdf: {
|
|
@@ -71,6 +75,7 @@ var Visor = function Visor(_ref) {
|
|
|
71
75
|
props: _objectSpread(_objectSpread({}, file), {}, {
|
|
72
76
|
url: url,
|
|
73
77
|
translate: translate,
|
|
78
|
+
soundActions: soundActions,
|
|
74
79
|
emitNumberOfPages: function emitNumberOfPages() {},
|
|
75
80
|
endPdf: function endPdf() {}
|
|
76
81
|
})
|
|
@@ -80,6 +85,7 @@ var Visor = function Visor(_ref) {
|
|
|
80
85
|
props: _objectSpread(_objectSpread({}, file), {}, {
|
|
81
86
|
url: url,
|
|
82
87
|
translate: translate,
|
|
88
|
+
soundActions: soundActions,
|
|
83
89
|
emitNumberOfPages: function emitNumberOfPages() {},
|
|
84
90
|
endPdf: function endPdf() {}
|
|
85
91
|
})
|
|
@@ -44,7 +44,8 @@ var Container = function Container(_ref) {
|
|
|
44
44
|
answerPage = _ref.answerPage,
|
|
45
45
|
updateForm = _ref.updateForm,
|
|
46
46
|
disabled = _ref.disabled,
|
|
47
|
-
translate = _ref.translate
|
|
47
|
+
translate = _ref.translate,
|
|
48
|
+
soundActions = _ref.soundActions;
|
|
48
49
|
|
|
49
50
|
var _useState = (0, _react.useState)(0),
|
|
50
51
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -57,6 +58,10 @@ var Container = function Container(_ref) {
|
|
|
57
58
|
setFeedback = _useState4[1];
|
|
58
59
|
|
|
59
60
|
var qid = questions[currentQuestionId].id;
|
|
61
|
+
|
|
62
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
63
|
+
play = _soundActions[0];
|
|
64
|
+
|
|
60
65
|
(0, _react.useEffect)(function () {
|
|
61
66
|
if (time >= 0 && !disabled) {
|
|
62
67
|
var timeout = setInterval(function () {
|
|
@@ -76,6 +81,8 @@ var Container = function Container(_ref) {
|
|
|
76
81
|
}, [disabled, feedback, saveInterval, setTime, time]);
|
|
77
82
|
|
|
78
83
|
var nextPage = function nextPage() {
|
|
84
|
+
play('click-ui');
|
|
85
|
+
|
|
79
86
|
if (answered) {
|
|
80
87
|
if (result[qid].feedback && !disabled) {
|
|
81
88
|
setFeedback(true);
|
|
@@ -127,7 +134,7 @@ var Container = function Container(_ref) {
|
|
|
127
134
|
className: "test--timer ".concat(time < 10 ? 'test--timer--finalseconds' : '')
|
|
128
135
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
129
136
|
id: "test-time"
|
|
130
|
-
}, minutes < 10 ? "0".concat(minutes) : minutes, " :",
|
|
137
|
+
}, minutes < 10 ? "0".concat(minutes) : minutes, " : ", seconds < 10 ? "0".concat(seconds) : seconds)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null)), /*#__PURE__*/_react.default.createElement(_Questions.default, {
|
|
131
138
|
key: questions[currentQuestionId].id,
|
|
132
139
|
result: result,
|
|
133
140
|
disabled: disabled,
|
|
@@ -149,7 +156,11 @@ var Container = function Container(_ref) {
|
|
|
149
156
|
})) : /*#__PURE__*/_react.default.createElement("button", {
|
|
150
157
|
id: "finish-button",
|
|
151
158
|
onClick: function onClick() {
|
|
152
|
-
|
|
159
|
+
play('click-ui');
|
|
160
|
+
|
|
161
|
+
if (answered) {
|
|
162
|
+
finishTest();
|
|
163
|
+
}
|
|
153
164
|
},
|
|
154
165
|
type: "button",
|
|
155
166
|
className: "gat--btn__navigation ".concat(!answered ? 'disabled' : '')
|
|
@@ -261,7 +261,8 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
261
261
|
});
|
|
262
262
|
var specificWrongFeedback = (_list$currentSlide2 = list[currentSlide]) === null || _list$currentSlide2 === void 0 ? void 0 : (_list$currentSlide2$s = _list$currentSlide2.specificFeedbacks) === null || _list$currentSlide2$s === void 0 ? void 0 : _list$currentSlide2$s.wrongFeedbacks.find(function (fb) {
|
|
263
263
|
return fb.id === id;
|
|
264
|
-
});
|
|
264
|
+
});
|
|
265
|
+
playSound('click-ui'); // si va en orden
|
|
265
266
|
|
|
266
267
|
if (list[currentSlide].hasClickOrder) {
|
|
267
268
|
// y lo has hecho bien
|
|
@@ -315,7 +316,7 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
315
316
|
|
|
316
317
|
}
|
|
317
318
|
}
|
|
318
|
-
}, [list, currentSlide, orderCounter, handleCorrectClick, emitEvent, translate, handleIncorrectClick]);
|
|
319
|
+
}, [list, currentSlide, orderCounter, handleCorrectClick, emitEvent, translate, handleIncorrectClick, playSound]);
|
|
319
320
|
var recursiveStuff = (0, _react.useCallback)(function (jsx) {
|
|
320
321
|
return (0, _utils.getRecursiveJSX)(jsx, 0, list[currentSlide], onClickMark);
|
|
321
322
|
}, [currentSlide, list, onClickMark]);
|
|
@@ -34,7 +34,8 @@ var UrlComponent = function UrlComponent(_ref) {
|
|
|
34
34
|
text = _ref.text,
|
|
35
35
|
text_labelId = _ref.text_labelId,
|
|
36
36
|
viewed = _ref.viewed,
|
|
37
|
-
documentType = _ref.documentType
|
|
37
|
+
documentType = _ref.documentType,
|
|
38
|
+
soundActions = _ref.soundActions;
|
|
38
39
|
var item = {
|
|
39
40
|
documentType: documentType,
|
|
40
41
|
name: name_labelId,
|
|
@@ -43,7 +44,11 @@ var UrlComponent = function UrlComponent(_ref) {
|
|
|
43
44
|
type: 'url'
|
|
44
45
|
};
|
|
45
46
|
|
|
47
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
48
|
+
play = _soundActions[0];
|
|
49
|
+
|
|
46
50
|
var close = function close() {
|
|
51
|
+
play('click-ui');
|
|
47
52
|
emitEvent({
|
|
48
53
|
type: 'finishMedia',
|
|
49
54
|
payload: item
|
|
@@ -86,6 +91,7 @@ var UrlComponent = function UrlComponent(_ref) {
|
|
|
86
91
|
target: "_blank",
|
|
87
92
|
rel: "noopener noreferrer",
|
|
88
93
|
onClick: function onClick() {
|
|
94
|
+
play('click-ui');
|
|
89
95
|
setClicked(true);
|
|
90
96
|
}
|
|
91
97
|
}, link)))));
|
|
@@ -23,6 +23,7 @@ var VideoComponent = function VideoComponent(_ref) {
|
|
|
23
23
|
documentType = _ref.documentType,
|
|
24
24
|
document = _ref.document,
|
|
25
25
|
documentId_labelId = _ref.documentId_labelId,
|
|
26
|
+
soundActions = _ref.soundActions,
|
|
26
27
|
required = _ref.required,
|
|
27
28
|
viewed = _ref.viewed,
|
|
28
29
|
visible = _ref.visible,
|
|
@@ -61,6 +62,7 @@ var VideoComponent = function VideoComponent(_ref) {
|
|
|
61
62
|
return /*#__PURE__*/_react.default.createElement(_videoVisor.default, {
|
|
62
63
|
backgroundImage: img === null || img === void 0 ? void 0 : img.url,
|
|
63
64
|
url: url,
|
|
65
|
+
soundActions: soundActions,
|
|
64
66
|
documentType: documentType,
|
|
65
67
|
required: required,
|
|
66
68
|
viewed: viewed,
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
11
|
|
|
14
12
|
var ControlButtons = function ControlButtons(_ref) {
|
|
@@ -28,9 +26,5 @@ ControlButtons.defaultProps = {
|
|
|
28
26
|
paused: false,
|
|
29
27
|
pauseVideo: function pauseVideo() {}
|
|
30
28
|
};
|
|
31
|
-
ControlButtons.propTypes = {
|
|
32
|
-
paused: _propTypes.default.bool,
|
|
33
|
-
pauseVideo: _propTypes.default.func
|
|
34
|
-
};
|
|
35
29
|
var _default = ControlButtons;
|
|
36
30
|
exports.default = _default;
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
11
|
|
|
14
12
|
var FinishedVideoButtons = function FinishedVideoButtons(_ref) {
|
|
@@ -37,9 +35,5 @@ FinishedVideoButtons.defaultProps = {
|
|
|
37
35
|
restart: function restart() {},
|
|
38
36
|
finished: false
|
|
39
37
|
};
|
|
40
|
-
FinishedVideoButtons.propTypes = {
|
|
41
|
-
restart: _propTypes.default.func,
|
|
42
|
-
finished: _propTypes.default.bool
|
|
43
|
-
};
|
|
44
38
|
var _default = FinishedVideoButtons;
|
|
45
39
|
exports.default = _default;
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
11
|
|
|
14
12
|
var PlayInitButton = function PlayInitButton(_ref) {
|
|
@@ -37,10 +35,5 @@ PlayInitButton.defaultProps = {
|
|
|
37
35
|
finished: false,
|
|
38
36
|
paused: false
|
|
39
37
|
};
|
|
40
|
-
PlayInitButton.propTypes = {
|
|
41
|
-
play: _propTypes.default.func,
|
|
42
|
-
finished: _propTypes.default.bool,
|
|
43
|
-
paused: _propTypes.default.bool
|
|
44
|
-
};
|
|
45
38
|
var _default = PlayInitButton;
|
|
46
39
|
exports.default = _default;
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
11
|
|
|
14
12
|
var skipButton = function skipButton(_ref) {
|
|
@@ -34,11 +32,5 @@ skipButton.defaultProps = {
|
|
|
34
32
|
finished: false,
|
|
35
33
|
skip: function skip() {}
|
|
36
34
|
};
|
|
37
|
-
skipButton.propTypes = {
|
|
38
|
-
mandatory: _propTypes.default.bool,
|
|
39
|
-
viewed: _propTypes.default.bool,
|
|
40
|
-
finished: _propTypes.default.bool,
|
|
41
|
-
skip: _propTypes.default.func
|
|
42
|
-
};
|
|
43
35
|
var _default = skipButton;
|
|
44
36
|
exports.default = _default;
|
|
@@ -33,7 +33,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "und
|
|
|
33
33
|
|
|
34
34
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
35
|
|
|
36
|
-
var defaultBgImageForAudio =
|
|
36
|
+
var defaultBgImageForAudio = 'https://min.gamelearn.io/css-resources/gamelearn/resources/bgAudioPiece.jpg';
|
|
37
37
|
|
|
38
38
|
var VideoVisor = function VideoVisor(_ref) {
|
|
39
39
|
var documentType = _ref.documentType,
|
|
@@ -41,8 +41,12 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
41
41
|
required = _ref.required,
|
|
42
42
|
viewed = _ref.viewed,
|
|
43
43
|
backgroundImage = _ref.backgroundImage,
|
|
44
|
+
soundActions = _ref.soundActions,
|
|
44
45
|
endVideo = _ref.endVideo;
|
|
45
46
|
|
|
47
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
48
|
+
playSound = _soundActions[0];
|
|
49
|
+
|
|
46
50
|
var _useState = (0, _react.useState)(0),
|
|
47
51
|
_useState2 = _slicedToArray(_useState, 2),
|
|
48
52
|
duration = _useState2[0],
|
|
@@ -93,8 +97,8 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
93
97
|
},
|
|
94
98
|
src: url,
|
|
95
99
|
style: {
|
|
96
|
-
height:
|
|
97
|
-
width:
|
|
100
|
+
height: '100%',
|
|
101
|
+
width: '100%'
|
|
98
102
|
}
|
|
99
103
|
};
|
|
100
104
|
|
|
@@ -105,7 +109,7 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
105
109
|
setIsFinish(true);
|
|
106
110
|
hideControls(false);
|
|
107
111
|
|
|
108
|
-
if (documentType !==
|
|
112
|
+
if (documentType !== 'document' && documentType !== 'lesson') {
|
|
109
113
|
endVideo();
|
|
110
114
|
}
|
|
111
115
|
};
|
|
@@ -161,6 +165,8 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
161
165
|
};
|
|
162
166
|
|
|
163
167
|
var pause = function pause() {
|
|
168
|
+
playSound('click-ui');
|
|
169
|
+
|
|
164
170
|
if (paused) {
|
|
165
171
|
videoPlayer.play();
|
|
166
172
|
setIsFinish(false);
|
|
@@ -183,6 +189,7 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
183
189
|
};
|
|
184
190
|
|
|
185
191
|
var mute = function mute() {
|
|
192
|
+
playSound('click-ui');
|
|
186
193
|
videoPlayer.muted = !videoPlayer.muted;
|
|
187
194
|
};
|
|
188
195
|
|
|
@@ -215,12 +222,12 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
215
222
|
};
|
|
216
223
|
|
|
217
224
|
var audioBackgroundImage = backgroundImage || defaultBgImageForAudio;
|
|
218
|
-
var CoverOrContain = audioBackgroundImage === defaultBgImageForAudio ?
|
|
225
|
+
var CoverOrContain = audioBackgroundImage === defaultBgImageForAudio ? 'cover' : 'contain';
|
|
219
226
|
var configForAudio = {
|
|
220
227
|
backgroundImage: "url(\"".concat(audioBackgroundImage, "\")"),
|
|
221
228
|
backgroundSize: CoverOrContain,
|
|
222
|
-
backgroundRepeat:
|
|
223
|
-
backgroundPosition:
|
|
229
|
+
backgroundRepeat: 'no-repeat',
|
|
230
|
+
backgroundPosition: 'center center'
|
|
224
231
|
};
|
|
225
232
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
226
233
|
className: "video",
|
|
@@ -250,7 +257,8 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
250
257
|
return handleHideControls();
|
|
251
258
|
},
|
|
252
259
|
onClick: function onClick() {
|
|
253
|
-
|
|
260
|
+
handleHideControls();
|
|
261
|
+
playSound('click-ui');
|
|
254
262
|
},
|
|
255
263
|
onCanPlayThrough: onCanPlay,
|
|
256
264
|
onWaiting: onWaiting,
|
|
@@ -275,7 +283,10 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
275
283
|
className: "position--absolute right top z-index1"
|
|
276
284
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
277
285
|
className: "gat--btn__round",
|
|
278
|
-
onClick:
|
|
286
|
+
onClick: function onClick() {
|
|
287
|
+
playSound('click-ui');
|
|
288
|
+
endVideo();
|
|
289
|
+
}
|
|
279
290
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
280
291
|
className: "icon-close"
|
|
281
292
|
}))), /*#__PURE__*/_react.default.createElement("iframe", _extends({
|
|
@@ -285,10 +296,10 @@ var VideoVisor = function VideoVisor(_ref) {
|
|
|
285
296
|
};
|
|
286
297
|
|
|
287
298
|
VideoVisor.defaultProps = {
|
|
288
|
-
url:
|
|
289
|
-
name:
|
|
299
|
+
url: '',
|
|
300
|
+
name: '',
|
|
290
301
|
backgroundImage: null,
|
|
291
|
-
documentType:
|
|
302
|
+
documentType: '',
|
|
292
303
|
required: false,
|
|
293
304
|
viewed: false,
|
|
294
305
|
endVideo: function endVideo() {}
|
|
@@ -33,7 +33,11 @@ var PopupColorComponent = function PopupColorComponent(_ref) {
|
|
|
33
33
|
var colors = _ref.colors,
|
|
34
34
|
onSave = _ref.onSave,
|
|
35
35
|
closingAction = _ref.closingAction,
|
|
36
|
-
translate = _ref.translate
|
|
36
|
+
translate = _ref.translate,
|
|
37
|
+
soundActions = _ref.soundActions;
|
|
38
|
+
|
|
39
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
40
|
+
playSound = _soundActions[0];
|
|
37
41
|
|
|
38
42
|
var _useState = (0, _react.useState)(),
|
|
39
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -80,6 +84,7 @@ var PopupColorComponent = function PopupColorComponent(_ref) {
|
|
|
80
84
|
type: "button",
|
|
81
85
|
className: "gat--btn gat--btn__primary ".concat(disabled ? 'disabled' : ''),
|
|
82
86
|
onClick: !disabled ? function () {
|
|
87
|
+
playSound('click-ui');
|
|
83
88
|
onSave(selected);
|
|
84
89
|
} : null
|
|
85
90
|
}, translate('webbuilder.save')))));
|
|
@@ -9,8 +9,6 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
12
|
var _resourcePath = _interopRequireDefault(require("../../Templates/resourcePath"));
|
|
15
13
|
|
|
16
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -35,7 +33,11 @@ var PopupImageComponent = function PopupImageComponent(_ref) {
|
|
|
35
33
|
var images = _ref.images,
|
|
36
34
|
onSave = _ref.onSave,
|
|
37
35
|
closingAction = _ref.closingAction,
|
|
38
|
-
translate = _ref.translate
|
|
36
|
+
translate = _ref.translate,
|
|
37
|
+
soundActions = _ref.soundActions;
|
|
38
|
+
|
|
39
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
40
|
+
playSound = _soundActions[0];
|
|
39
41
|
|
|
40
42
|
var _useState = (0, _react.useState)(),
|
|
41
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -91,6 +93,7 @@ var PopupImageComponent = function PopupImageComponent(_ref) {
|
|
|
91
93
|
type: "button",
|
|
92
94
|
className: "gat--btn gat--btn__primary ".concat(disabled ? 'disabled' : ''),
|
|
93
95
|
onClick: !disabled ? function () {
|
|
96
|
+
playSound('click-ui');
|
|
94
97
|
onSave(selected.src);
|
|
95
98
|
} : null
|
|
96
99
|
}, translate('webbuilder.open'))))));
|
|
@@ -101,13 +104,5 @@ PopupImageComponent.defaultProps = {
|
|
|
101
104
|
onSave: function onSave() {},
|
|
102
105
|
images: []
|
|
103
106
|
};
|
|
104
|
-
PopupImageComponent.propTypes = {
|
|
105
|
-
closingAction: _propTypes.default.func,
|
|
106
|
-
onSave: _propTypes.default.func,
|
|
107
|
-
images: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
108
|
-
name: _propTypes.default.string,
|
|
109
|
-
src: _propTypes.default.string
|
|
110
|
-
}))
|
|
111
|
-
};
|
|
112
107
|
var _default = PopupImageComponent;
|
|
113
108
|
exports.default = _default;
|
|
@@ -29,7 +29,11 @@ var PopupTextComponent = function PopupTextComponent(_ref) {
|
|
|
29
29
|
var closingAction = _ref.closingAction,
|
|
30
30
|
onSave = _ref.onSave,
|
|
31
31
|
options = _ref.options,
|
|
32
|
-
translate = _ref.translate
|
|
32
|
+
translate = _ref.translate,
|
|
33
|
+
soundActions = _ref.soundActions;
|
|
34
|
+
|
|
35
|
+
var _soundActions = _slicedToArray(soundActions, 1),
|
|
36
|
+
playSound = _soundActions[0];
|
|
33
37
|
|
|
34
38
|
var _useState = (0, _react.useState)(''),
|
|
35
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -113,6 +117,7 @@ var PopupTextComponent = function PopupTextComponent(_ref) {
|
|
|
113
117
|
className: "gat--btn gat--btn__primary ".concat(disabled ? 'disabled' : ''),
|
|
114
118
|
disabled: disabled,
|
|
115
119
|
onClick: function onClick() {
|
|
120
|
+
playSound('click-ui');
|
|
116
121
|
onSave(selected);
|
|
117
122
|
}
|
|
118
123
|
}, translate('webbuilder.save')))));
|