@gamelearn/arcade-components 2.26.1 → 2.28.0
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/animation-component/components/AnimationComponent.js +10 -28
- package/dist/components/animation-component/index.js +0 -3
- package/dist/components/animation-component/mocks/mockForStory.js +0 -3
- package/dist/components/auto-evaluation-component/components/AutoEvaluation.js +30 -71
- package/dist/components/auto-evaluation-component/components/EndScreen.js +1 -9
- package/dist/components/auto-evaluation-component/components/StartScreen.js +2 -6
- package/dist/components/auto-evaluation-component/index.js +0 -3
- package/dist/components/auto-evaluation-component/mocks/mockForStory.js +0 -2
- package/dist/components/cards-selector-puzzle-component/components/Board/index.js +23 -55
- package/dist/components/cards-selector-puzzle-component/components/Card/index.js +4 -23
- package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +41 -92
- package/dist/components/cards-selector-puzzle-component/index.js +0 -3
- package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +4 -10
- package/dist/components/cartel-component/components/CartelComponent.js +12 -39
- package/dist/components/cartel-component/index.js +0 -3
- package/dist/components/chained-image-click-puzzle-component/components/ChainedImageClickPuzzleComponent.js +20 -38
- package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +25 -64
- package/dist/components/chained-image-click-puzzle-component/index.js +0 -3
- package/dist/components/chained-image-click-puzzle-component/mocks/mockForStory.js +1 -2
- package/dist/components/comic-component/components/ComicComponent.js +27 -62
- package/dist/components/comic-component/components/Slide.js +2 -7
- package/dist/components/comic-component/components/Vignette.js +7 -23
- package/dist/components/comic-component/index.js +0 -3
- package/dist/components/comic-component/mocks/mockForStory.js +1 -2
- package/dist/components/conversational-component/components/ConversationalComponent.js +15 -39
- package/dist/components/conversational-component/index.js +0 -3
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +54 -137
- package/dist/components/conversational-pro-component/components/Message.js +1 -9
- package/dist/components/conversational-pro-component/components/Slot.js +3 -20
- package/dist/components/conversational-pro-component/components/SlotList.js +16 -40
- package/dist/components/conversational-pro-component/components/scene/Panel.js +12 -54
- package/dist/components/conversational-pro-component/components/scene/Panels.js +10 -17
- package/dist/components/conversational-pro-component/components/scene/index.js +11 -30
- package/dist/components/conversational-pro-component/index.js +0 -3
- package/dist/components/conversational-pro-component/mocks/mockForStory.js +1 -2
- package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +35 -89
- package/dist/components/cracker-puzzle-component/components/DrawGrid/index.js +3 -7
- package/dist/components/cracker-puzzle-component/components/DrawItem/index.js +4 -9
- package/dist/components/cracker-puzzle-component/components/DrawRow/index.js +4 -9
- package/dist/components/cracker-puzzle-component/components/helpers.js +15 -55
- package/dist/components/cracker-puzzle-component/index.js +0 -3
- package/dist/components/cracker-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/decision-component/components/DecisionBody.js +19 -44
- package/dist/components/decision-component/components/DecisionComponent.js +22 -70
- package/dist/components/decision-component/components/Feedback.js +2 -11
- package/dist/components/decision-component/components/Options.js +12 -31
- package/dist/components/decision-component/index.js +0 -3
- package/dist/components/decision-component/mocks/mockForStory.js +0 -2
- package/dist/components/dialog-component/components/BubbleWrapper.js +1 -7
- package/dist/components/dialog-component/components/DialogComponent.js +118 -338
- package/dist/components/dialog-component/components/DialogDecision.js +3 -13
- package/dist/components/dialog-component/components/SpeechBubbleComponent.js +6 -24
- package/dist/components/dialog-component/index.js +0 -3
- package/dist/components/dialog-component/mocks/mockForStory.js +1 -5
- package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +34 -90
- package/dist/components/drag-item-puzzle-component/components/Messages.js +0 -4
- package/dist/components/drag-item-puzzle-component/index.js +0 -3
- package/dist/components/drag-item-puzzle-component/mocks/mockForStory.js +1 -2
- package/dist/components/feedback-component/components/FeedbackComponent.js +16 -41
- package/dist/components/feedback-component/index.js +0 -3
- package/dist/components/feedback-component/mocks/mockForStory.js +1 -2
- package/dist/components/frame-click-puzzle-component/components/Counter/index.js +3 -8
- package/dist/components/frame-click-puzzle-component/components/CurrentFramePuzzle.js +36 -68
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +33 -68
- package/dist/components/frame-click-puzzle-component/components/Tooltip/index.js +0 -6
- package/dist/components/frame-click-puzzle-component/index.js +0 -3
- package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +1 -2
- package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +29 -69
- package/dist/components/hacker-puzzle-component/index.js +0 -3
- package/dist/components/hacker-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +48 -123
- package/dist/components/hanged-puzzle-component/index.js +0 -3
- package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +0 -3
- package/dist/components/hanged-puzzle-component/utils.js +0 -20
- package/dist/components/image-click-puzzle-component/components/ImageClickPuzzleComponent.js +1 -8
- package/dist/components/image-click-puzzle-component/index.js +0 -3
- package/dist/components/image-click-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/image-click-wrapper-component/components/CountDown/index.js +0 -4
- package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +67 -134
- package/dist/components/image-click-wrapper-component/components/TimerDialog/index.js +2 -6
- package/dist/components/image-click-wrapper-component/index.js +0 -3
- package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +0 -2
- package/dist/components/image-component/components/ImageComponent.js +14 -33
- package/dist/components/image-component/index.js +0 -3
- package/dist/components/image-component/mocks/mockForStory.js +0 -2
- package/dist/components/index.js +0 -39
- package/dist/components/inventory-item/components/InventoryItem.js +9 -35
- package/dist/components/inventory-item/index.js +0 -3
- package/dist/components/inventory-item/mocks/mockForStory.js +0 -3
- package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +33 -75
- package/dist/components/keyboard-puzzle-component/index.js +0 -3
- package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/konva-components/Area/index.js +15 -44
- package/dist/components/konva-components/KonvaMapper.js +19 -42
- package/dist/components/lectures-component/components/LectureButtons.js +4 -8
- package/dist/components/lectures-component/components/LecturesComponent.js +29 -55
- package/dist/components/lectures-component/index.js +0 -3
- package/dist/components/lectures-component/mocks/mockForStory.js +6 -9
- package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +38 -80
- package/dist/components/login-puzzle-component/index.js +0 -3
- package/dist/components/login-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/notice-component/components/NoticeComponent.js +8 -21
- package/dist/components/notice-component/index.js +0 -3
- package/dist/components/notice-component/mocks/mockForStory.js +0 -2
- package/dist/components/pattern-component/components/PatternComponent.js +8 -24
- package/dist/components/pattern-component/index.js +0 -3
- package/dist/components/pattern-component/mocks/mockForStory.js +0 -2
- package/dist/components/pdf-component/components/PdfComponent.js +23 -55
- package/dist/components/pdf-component/components/PdfVisor.js +22 -58
- package/dist/components/pdf-component/index.js +0 -3
- package/dist/components/pdf-component/mocks/mockForProps.js +1 -2
- package/dist/components/referral-component/components/EmailPill.js +2 -6
- package/dist/components/referral-component/components/ReferralComponent.js +30 -59
- package/dist/components/referral-component/components/StepOne.js +14 -48
- package/dist/components/referral-component/components/StepTwo.js +8 -23
- package/dist/components/referral-component/index.js +0 -3
- package/dist/components/referral-component/mocks/mockForStory.js +0 -2
- package/dist/components/survey-component/components/ApplicableBox.js +8 -15
- package/dist/components/survey-component/components/OpinionBox.js +8 -15
- package/dist/components/survey-component/components/SurveyComponent.js +13 -40
- package/dist/components/survey-component/components/TextBox.js +7 -13
- package/dist/components/survey-component/index.js +0 -3
- package/dist/components/survey-component/mocks/mockForStory.js +0 -2
- package/dist/components/terminal-puzzle-component/components/FilesGroup/Item.js +1 -6
- package/dist/components/terminal-puzzle-component/components/FilesGroup/index.js +4 -10
- package/dist/components/terminal-puzzle-component/components/Image/index.js +2 -6
- package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +26 -65
- package/dist/components/terminal-puzzle-component/components/Visor/index.js +15 -35
- package/dist/components/terminal-puzzle-component/components/utils/index.js +0 -3
- package/dist/components/terminal-puzzle-component/index.js +0 -3
- package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +1 -2
- package/dist/components/test-component/components/Container.js +26 -60
- package/dist/components/test-component/components/Feedbacks.js +3 -13
- package/dist/components/test-component/components/Questions.js +11 -45
- package/dist/components/test-component/components/Results.js +31 -53
- package/dist/components/test-component/components/TestComponent.js +59 -110
- package/dist/components/test-component/index.js +0 -3
- package/dist/components/test-component/mocks/mockForStory.js +4 -8
- package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +58 -95
- package/dist/components/text-click-puzzle-component/index.js +0 -3
- package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +1 -2
- package/dist/components/text-click-puzzle-component/utils/index.js +6 -31
- package/dist/components/url-component/components/UrlComponent.js +16 -34
- package/dist/components/url-component/index.js +0 -3
- package/dist/components/url-component/mocks/mockForProps.js +0 -2
- package/dist/components/video-component/components/VideoComponent.js +11 -25
- package/dist/components/video-component/index.js +0 -3
- package/dist/components/video-component/mocks/mockForStory.js +0 -2
- package/dist/components/video-visor/components/VideoControllers/BufferBar.js +10 -37
- package/dist/components/video-visor/components/VideoControllers/ControlButtons.js +2 -6
- package/dist/components/video-visor/components/VideoControllers/FinishedVideoButtons.js +1 -5
- package/dist/components/video-visor/components/VideoControllers/PlayInitButton.js +2 -8
- package/dist/components/video-visor/components/VideoControllers/SkipButton.js +5 -9
- package/dist/components/video-visor/components/VideoControllers/Timer.js +0 -5
- package/dist/components/video-visor/components/VideoControllers/VolumeBar.js +4 -20
- package/dist/components/video-visor/components/VideoControllers/index.js +17 -29
- package/dist/components/video-visor/components/VideoVisor.js +38 -92
- package/dist/components/video-visor/index.js +0 -3
- package/dist/components/video-visor/mocks/mockForStory.js +1 -2
- package/dist/components/web-builder-puzzle-component/Popups/PopupColorComponent/index.js +11 -28
- package/dist/components/web-builder-puzzle-component/Popups/PopupImageComponent/index.js +10 -27
- package/dist/components/web-builder-puzzle-component/Popups/PopupTextComponent/index.js +13 -36
- package/dist/components/web-builder-puzzle-component/Popups/index.js +0 -4
- package/dist/components/web-builder-puzzle-component/Templates/Facebook.js +0 -2
- package/dist/components/web-builder-puzzle-component/components/EditButton/index.js +1 -5
- package/dist/components/web-builder-puzzle-component/components/Feedback/index.js +3 -7
- package/dist/components/web-builder-puzzle-component/components/PublishButton/index.js +1 -5
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/BankBody.js +5 -12
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/FacebookBody.js +5 -11
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/index.js +0 -7
- package/dist/components/web-builder-puzzle-component/components/WebBuilderFront/index.js +5 -14
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/BankHeader.js +5 -13
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/FacebookHeader.js +3 -8
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/index.js +3 -10
- package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +47 -112
- package/dist/components/web-builder-puzzle-component/components/WebBuilderTopBar/index.js +3 -9
- package/dist/components/web-builder-puzzle-component/index.js +0 -3
- package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +0 -3
- package/dist/components/writer-puzzle-component/components/ElectionComponent.js +13 -30
- package/dist/components/writer-puzzle-component/components/FeedbackComponent.js +14 -30
- package/dist/components/writer-puzzle-component/components/FeedbackElement.js +2 -6
- package/dist/components/writer-puzzle-component/components/FinishedTextComponent.js +1 -6
- package/dist/components/writer-puzzle-component/components/FixedComponent.js +17 -52
- package/dist/components/writer-puzzle-component/components/SingleElection.js +13 -41
- package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +63 -145
- package/dist/components/writer-puzzle-component/index.js +0 -3
- package/dist/components/writer-puzzle-component/mocks/mockForStory.js +10 -7
- package/dist/components/zoom-test/components/ZoomTest.js +7 -25
- package/dist/components/zoom-test/index.js +0 -3
- package/dist/components/zoom-test/mocks/mockForStory.js +0 -4
- package/dist/helpers/LangIsRtl.js +0 -4
- package/dist/helpers/LightSet.js +0 -4
- package/dist/helpers/LodController.js +1 -10
- package/dist/helpers/deviceDetection.js +2 -5
- package/dist/helpers/drawLOD.js +11 -53
- package/dist/helpers/index.js +73 -102
- package/dist/helpers/lodStats.js +2 -10
- package/dist/helpers/mocker.js +1 -20
- package/dist/helpers/useEkho.js +64 -91
- package/dist/helpers/useGLB.js +5 -13
- package/dist/helpers/useStateMachine.js +254 -0
- package/dist/helpers/useTimeout.js +0 -6
- package/dist/helpers/useWindowSize.js +8 -22
- package/dist/index.js +0 -2
- package/dist/test/testSceneWrapper.js +0 -8
- package/package.json +3 -2
|
@@ -1,47 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _reactKonva = require("react-konva");
|
|
13
|
-
|
|
14
10
|
var _Area = _interopRequireDefault(require("./Area"));
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
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); }
|
|
19
|
-
|
|
20
13
|
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; }
|
|
21
|
-
|
|
22
14
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
-
|
|
24
15
|
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."); }
|
|
25
|
-
|
|
26
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); }
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : 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; }
|
|
31
|
-
|
|
32
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
-
|
|
17
|
+
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; }
|
|
18
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* eslint-disable no-nested-ternary */ /* eslint-disable react/no-array-index-key */ /* eslint-disable jsx-a11y/no-noninteractive-tabindex */ /* eslint-disable prefer-template */ /* eslint-disable jsx-a11y/click-events-have-key-events */ /* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
34
20
|
var useWindowSize = function useWindowSize() {
|
|
35
21
|
var _useState = (0, _react.useState)([0, 0]),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
size = _useState2[0],
|
|
24
|
+
setSize = _useState2[1];
|
|
40
25
|
(0, _react.useLayoutEffect)(function () {
|
|
41
26
|
function updateSize() {
|
|
42
27
|
setSize([window.innerWidth, window.innerHeight]);
|
|
43
28
|
}
|
|
44
|
-
|
|
45
29
|
window.addEventListener('resize', updateSize);
|
|
46
30
|
updateSize();
|
|
47
31
|
return function () {
|
|
@@ -50,16 +34,15 @@ var useWindowSize = function useWindowSize() {
|
|
|
50
34
|
}, []);
|
|
51
35
|
return size;
|
|
52
36
|
};
|
|
53
|
-
|
|
54
37
|
var KonvaMapper = function KonvaMapper(_ref) {
|
|
55
38
|
var areas = _ref.areas,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
39
|
+
badAreas = _ref.badAreas,
|
|
40
|
+
imageUrl = _ref.imageUrl,
|
|
41
|
+
completed = _ref.completed,
|
|
42
|
+
onClick = _ref.onClick,
|
|
43
|
+
onClickOutside = _ref.onClickOutside,
|
|
44
|
+
hasHighlights = _ref.hasHighlights,
|
|
45
|
+
clickedZones = _ref.clickedZones;
|
|
63
46
|
var stageRef = (0, _react.useRef)();
|
|
64
47
|
var areasStroke = (0, _react.useRef)();
|
|
65
48
|
var badAreasStroke = (0, _react.useRef)();
|
|
@@ -67,17 +50,14 @@ var KonvaMapper = function KonvaMapper(_ref) {
|
|
|
67
50
|
var badAreasGroup = (0, _react.useRef)();
|
|
68
51
|
var imageRef = (0, _react.useRef)();
|
|
69
52
|
var overlay = (0, _react.useRef)();
|
|
70
|
-
|
|
71
53
|
var _useState3 = (0, _react.useState)(new window.Image()),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
+
currentImage = _useState4[0],
|
|
56
|
+
setImage = _useState4[1];
|
|
76
57
|
var _useWindowSize = useWindowSize(),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
58
|
+
_useWindowSize2 = _slicedToArray(_useWindowSize, 2),
|
|
59
|
+
width = _useWindowSize2[0],
|
|
60
|
+
height = _useWindowSize2[1];
|
|
81
61
|
var incorrectArea = badAreas.find(function (area) {
|
|
82
62
|
return area.id === 'AllArea';
|
|
83
63
|
}) || false;
|
|
@@ -93,13 +73,11 @@ var KonvaMapper = function KonvaMapper(_ref) {
|
|
|
93
73
|
areasStroke.current.setAttr('visible', true);
|
|
94
74
|
}
|
|
95
75
|
}, [completed]);
|
|
96
|
-
|
|
97
76
|
var handleStageClick = function handleStageClick(a) {
|
|
98
77
|
if (incorrectArea && !a.target.attrs.shape) {
|
|
99
78
|
onClickOutside(incorrectArea);
|
|
100
79
|
}
|
|
101
80
|
};
|
|
102
|
-
|
|
103
81
|
(0, _react.useEffect)(function () {
|
|
104
82
|
currentImage.src = imageUrl;
|
|
105
83
|
currentImage.addEventListener('load', function () {
|
|
@@ -197,7 +175,6 @@ var KonvaMapper = function KonvaMapper(_ref) {
|
|
|
197
175
|
});
|
|
198
176
|
}))));
|
|
199
177
|
};
|
|
200
|
-
|
|
201
178
|
KonvaMapper.defaultProps = {
|
|
202
179
|
hasHighlights: false,
|
|
203
180
|
onClick: function onClick() {},
|
|
@@ -4,17 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var LectureButtons = function LectureButtons(_ref) {
|
|
13
10
|
var goToLecture = _ref.goToLecture,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
close = _ref.close,
|
|
12
|
+
minutes = _ref.minutes,
|
|
13
|
+
seconds = _ref.seconds,
|
|
14
|
+
btnText = _ref.btnText;
|
|
18
15
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
16
|
className: "readings--buttons"
|
|
20
17
|
}, goToLecture ? /*#__PURE__*/_react.default.createElement("button", {
|
|
@@ -29,7 +26,6 @@ var LectureButtons = function LectureButtons(_ref) {
|
|
|
29
26
|
"data-testid": "countdown"
|
|
30
27
|
}, /*#__PURE__*/_react.default.createElement("span", null, minutes < 10 ? "0".concat(minutes) : minutes, ":", seconds < 10 ? "0".concat(seconds) : seconds)));
|
|
31
28
|
};
|
|
32
|
-
|
|
33
29
|
LectureButtons.defaultProps = {
|
|
34
30
|
goToLecture: false,
|
|
35
31
|
close: function close() {},
|
|
@@ -1,82 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
|
|
13
|
-
|
|
14
10
|
var _LectureButtons = _interopRequireDefault(require("./LectureButtons"));
|
|
15
|
-
|
|
16
11
|
var _useEkho = _interopRequireDefault(require("../../../helpers/useEkho"));
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
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); }
|
|
21
|
-
|
|
22
14
|
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; }
|
|
23
|
-
|
|
24
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
|
-
|
|
26
16
|
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."); }
|
|
27
|
-
|
|
28
17
|
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); }
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : 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; }
|
|
33
|
-
|
|
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
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
34
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
|
-
|
|
36
21
|
var READING_TIME = 0.2;
|
|
37
|
-
|
|
38
22
|
var LecturesComponent = function LecturesComponent(_ref) {
|
|
39
23
|
var emitEvent = _ref.emitEvent,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
24
|
+
name = _ref.name,
|
|
25
|
+
nameLabel = _ref.name_labelId,
|
|
26
|
+
required = _ref.required,
|
|
27
|
+
text = _ref.text,
|
|
28
|
+
textLabel = _ref.text_labelId,
|
|
29
|
+
visible = _ref.visible,
|
|
30
|
+
documentType = _ref.documentType,
|
|
31
|
+
viewed = _ref.viewed,
|
|
32
|
+
soundActions = _ref.soundActions,
|
|
33
|
+
backgroundImage = _ref.backgroundImage,
|
|
34
|
+
keyboardControl = _ref.keyboardControl,
|
|
35
|
+
audio = _ref.audio,
|
|
36
|
+
audioType = _ref.audioType,
|
|
37
|
+
audioVolume = _ref.audioVolume,
|
|
38
|
+
voice = _ref.voice,
|
|
39
|
+
pause = _ref.pause;
|
|
57
40
|
var _useState = (0, _react.useState)(),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
+
interval = _useState2[0],
|
|
43
|
+
saveInterval = _useState2[1];
|
|
62
44
|
var _useState3 = (0, _react.useState)(false),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
45
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
46
|
+
saved = _useState4[0],
|
|
47
|
+
save = _useState4[1];
|
|
67
48
|
var _useState5 = (0, _react.useState)(0),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
49
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
50
|
+
time = _useState6[0],
|
|
51
|
+
setTime = _useState6[1];
|
|
72
52
|
var currentLecture = text;
|
|
73
53
|
var limit = Math.trunc(currentLecture.split(' ').length * READING_TIME);
|
|
74
54
|
var goToLecture = !required || required && time >= limit || required && !visible;
|
|
75
|
-
|
|
76
55
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
77
|
-
|
|
78
|
-
|
|
56
|
+
playSound = _soundActions[0];
|
|
79
57
|
|
|
58
|
+
// Formateo de la prop 'text' para que Azure haga pausas después de cada tag que se requiera y para evitar que Azure lea los tags htmls
|
|
80
59
|
var regexForClosingTags = /<\/p>|<\/h1>|<\/h2>|<\/h3>|<\/h4>|<\/h5>|<\/h6>|<\/li>/gi;
|
|
81
60
|
var stringsToDelete = /"|'/gi;
|
|
82
61
|
var textWithDotsBeforeClosingTags = text.replace(regexForClosingTags, '. </p>');
|
|
@@ -93,14 +72,12 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
93
72
|
volume: audioVolume,
|
|
94
73
|
pauseTTS: pause
|
|
95
74
|
});
|
|
96
|
-
|
|
97
75
|
var translate = function translate(id) {
|
|
98
76
|
return emitEvent({
|
|
99
77
|
type: 'translate',
|
|
100
78
|
payload: id
|
|
101
79
|
});
|
|
102
80
|
};
|
|
103
|
-
|
|
104
81
|
var close = (0, _react.useCallback)(function () {
|
|
105
82
|
if (goToLecture) {
|
|
106
83
|
playSound('click-ui');
|
|
@@ -121,7 +98,6 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
121
98
|
close();
|
|
122
99
|
save(true);
|
|
123
100
|
}
|
|
124
|
-
|
|
125
101
|
if (required && visible) {
|
|
126
102
|
var timeout = setInterval(function () {
|
|
127
103
|
setTime(function (t) {
|
|
@@ -133,7 +109,6 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
133
109
|
clearInterval(timeout);
|
|
134
110
|
};
|
|
135
111
|
}
|
|
136
|
-
|
|
137
112
|
return undefined;
|
|
138
113
|
}, [close, required, saved, visible]);
|
|
139
114
|
(0, _react.useEffect)(function () {
|
|
@@ -164,7 +139,6 @@ var LecturesComponent = function LecturesComponent(_ref) {
|
|
|
164
139
|
btnText: translate('screens.continue')
|
|
165
140
|
}) : null))) : null;
|
|
166
141
|
};
|
|
167
|
-
|
|
168
142
|
LecturesComponent.defaultProps = {
|
|
169
143
|
emitEvent: function emitEvent() {},
|
|
170
144
|
name: '',
|
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _LecturesComponent = _interopRequireDefault(require("./components/LecturesComponent"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _LecturesComponent.default;
|
|
13
10
|
exports.default = _default;
|
|
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.mockProps2 = exports.mockProps = exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _mocker = require("helpers/mocker");
|
|
9
|
-
|
|
8
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
10
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
|
|
12
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
14
|
var mockProps = {
|
|
17
15
|
emitEvent: _mocker.emitEvent,
|
|
18
16
|
soundActions: _mocker.soundActions,
|
|
@@ -28,15 +26,14 @@ var mockProps = {
|
|
|
28
26
|
}
|
|
29
27
|
};
|
|
30
28
|
exports.mockProps = mockProps;
|
|
31
|
-
|
|
32
29
|
var mockProps2 = _objectSpread(_objectSpread({}, mockProps), {}, {
|
|
33
30
|
backgroundImage: {
|
|
34
31
|
url: 'https://i.imgur.com/DTFfovW.jpeg'
|
|
35
32
|
},
|
|
36
|
-
text:
|
|
33
|
+
text:
|
|
34
|
+
// eslint-disable-next-line max-len
|
|
37
35
|
'<p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p><p>A while back I needed to count the amount of letters that a piece of text in an email template had (to avoid passing any character limits). Unfortunately, I could not think of a quick way to do so on my macbook and I therefore turned to the Internet.</p>'
|
|
38
36
|
});
|
|
39
|
-
|
|
40
37
|
exports.mockProps2 = mockProps2;
|
|
41
38
|
var _default = mockProps;
|
|
42
39
|
exports.default = _default;
|
|
@@ -1,117 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _LangIsRtl = _interopRequireDefault(require("../../../helpers/LangIsRtl"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
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); }
|
|
17
|
-
|
|
18
12
|
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; }
|
|
19
|
-
|
|
20
13
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
21
|
-
|
|
22
14
|
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."); }
|
|
23
|
-
|
|
24
15
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
25
|
-
|
|
26
16
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
27
|
-
|
|
28
17
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
29
|
-
|
|
30
18
|
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."); }
|
|
31
|
-
|
|
32
19
|
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); }
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : 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; }
|
|
37
|
-
|
|
20
|
+
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; }
|
|
21
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
38
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
|
-
|
|
40
23
|
var imagenPorDefecto = 'https://min.gamelearn.io/css-resources/gamelearn/resources/puzzle-login-low.png';
|
|
41
|
-
|
|
42
24
|
var LoginPuzzleComponent = function LoginPuzzleComponent(_ref) {
|
|
43
25
|
var _image$img;
|
|
44
|
-
|
|
45
26
|
var emitEvent = _ref.emitEvent,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
27
|
+
soundActions = _ref.soundActions,
|
|
28
|
+
info = _ref.info,
|
|
29
|
+
user = _ref.user,
|
|
30
|
+
login = _ref.login,
|
|
31
|
+
password = _ref.password,
|
|
32
|
+
image = _ref.image,
|
|
33
|
+
setResolveAction = _ref.setResolveAction,
|
|
34
|
+
nodeId = _ref.nodeId;
|
|
55
35
|
var translate = function translate(id) {
|
|
56
36
|
return emitEvent({
|
|
57
37
|
type: 'translate',
|
|
58
38
|
payload: id
|
|
59
39
|
});
|
|
60
40
|
};
|
|
61
|
-
|
|
62
41
|
var puzzleId = "login-puzzle_".concat(nodeId);
|
|
63
42
|
var isRtl = (0, _LangIsRtl.default)();
|
|
64
|
-
|
|
65
43
|
var _useState = (0, _react.useState)(''),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
inputUser = _useState2[0],
|
|
46
|
+
setUser = _useState2[1];
|
|
70
47
|
var _useState3 = (0, _react.useState)(''),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
48
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
+
inputPassword = _useState4[0],
|
|
50
|
+
setPassword = _useState4[1];
|
|
75
51
|
var _useState5 = (0, _react.useState)(false),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
52
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
53
|
+
inputPasswordFocus = _useState6[0],
|
|
54
|
+
setInputPasswordFocus = _useState6[1];
|
|
80
55
|
var _useState7 = (0, _react.useState)(''),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
56
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
57
|
+
fakeHashes = _useState8[0],
|
|
58
|
+
setFakeHashes = _useState8[1];
|
|
85
59
|
var _useState9 = (0, _react.useState)(''),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
60
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
61
|
+
successClass = _useState10[0],
|
|
62
|
+
setSuccessClass = _useState10[1];
|
|
90
63
|
var _useState11 = (0, _react.useState)(false),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
64
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
65
|
+
finished = _useState12[0],
|
|
66
|
+
setFinished = _useState12[1];
|
|
95
67
|
var _useState13 = (0, _react.useState)(false),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
68
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
69
|
+
errorMessage = _useState14[0],
|
|
70
|
+
setErrorMessage = _useState14[1];
|
|
100
71
|
var _useState15 = (0, _react.useState)(false),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
72
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
73
|
+
showCorrectSolution = _useState16[0],
|
|
74
|
+
setCorrectSolution = _useState16[1];
|
|
105
75
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
106
|
-
|
|
107
|
-
|
|
76
|
+
playSound = _soundActions[0];
|
|
108
77
|
var _useState17 = (0, _react.useState)([]),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
78
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
79
|
+
accRewards = _useState18[0],
|
|
80
|
+
setRewards = _useState18[1];
|
|
113
81
|
var imgURL = ((_image$img = image.img) === null || _image$img === void 0 ? void 0 : _image$img.url) || imagenPorDefecto;
|
|
114
|
-
|
|
115
82
|
var handleFinish = function handleFinish() {
|
|
116
83
|
var rewards = info.solution.right.rewards;
|
|
117
84
|
var rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(rewards));
|
|
@@ -125,21 +92,17 @@ var LoginPuzzleComponent = function LoginPuzzleComponent(_ref) {
|
|
|
125
92
|
type: 'passPuzzle'
|
|
126
93
|
});
|
|
127
94
|
};
|
|
128
|
-
|
|
129
95
|
var checkInput = function checkInput() {
|
|
130
96
|
playSound('click-ui');
|
|
131
97
|
var guessed = {
|
|
132
98
|
login: true,
|
|
133
99
|
password: false
|
|
134
100
|
};
|
|
135
|
-
|
|
136
101
|
if (login) {
|
|
137
102
|
guessed.login = user === inputUser;
|
|
138
103
|
}
|
|
139
|
-
|
|
140
104
|
guessed.password = password === inputPassword;
|
|
141
105
|
var correctGuess = guessed.login && guessed.password;
|
|
142
|
-
|
|
143
106
|
if (correctGuess) {
|
|
144
107
|
setSuccessClass('success');
|
|
145
108
|
setFinished(true);
|
|
@@ -158,19 +121,15 @@ var LoginPuzzleComponent = function LoginPuzzleComponent(_ref) {
|
|
|
158
121
|
});
|
|
159
122
|
}
|
|
160
123
|
};
|
|
161
|
-
|
|
162
124
|
var changeCharactersByHashes = function changeCharactersByHashes(e) {
|
|
163
125
|
var fakePassword = '';
|
|
164
|
-
|
|
165
126
|
if (e.length >= 0) {
|
|
166
127
|
for (var i = 0; i < e.length; i += 1) {
|
|
167
128
|
fakePassword += '•';
|
|
168
129
|
}
|
|
169
|
-
|
|
170
130
|
setFakeHashes(fakePassword);
|
|
171
131
|
}
|
|
172
132
|
};
|
|
173
|
-
|
|
174
133
|
(0, _react.useEffect)(function () {
|
|
175
134
|
setResolveAction(function () {
|
|
176
135
|
var rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(info.resolve.rewards));
|
|
@@ -280,6 +239,5 @@ var LoginPuzzleComponent = function LoginPuzzleComponent(_ref) {
|
|
|
280
239
|
className: "puzzle--login__label--error"
|
|
281
240
|
}, info.solution.wrong.desc)));
|
|
282
241
|
};
|
|
283
|
-
|
|
284
242
|
var _default = LoginPuzzleComponent;
|
|
285
243
|
exports.default = _default;
|
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _LoginPuzzleComponent = _interopRequireDefault(require("./components/LoginPuzzleComponent"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _LoginPuzzleComponent.default;
|
|
13
10
|
exports.default = _default;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.mockProps = exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _mocker = require("helpers/mocker");
|
|
9
|
-
|
|
10
8
|
var mockProps = {
|
|
11
9
|
emitEvent: _mocker.emitEvent,
|
|
12
10
|
setResolveAction: function setResolveAction() {},
|