@gamelearn/arcade-components 2.41.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/dist/arcade-components.cjs +91984 -0
- package/dist/arcade-components.js +91968 -0
- package/package.json +74 -73
- package/dist/components/animation-component/components/AnimationComponent.js +0 -98
- package/dist/components/animation-component/index.js +0 -10
- package/dist/components/animation-component/mocks/mockForStory.js +0 -26
- package/dist/components/auto-evaluation-component/components/AutoEvaluation.js +0 -215
- package/dist/components/auto-evaluation-component/components/EndScreen.js +0 -43
- package/dist/components/auto-evaluation-component/components/StartScreen.js +0 -32
- package/dist/components/auto-evaluation-component/index.js +0 -10
- package/dist/components/auto-evaluation-component/mocks/mockForStory.js +0 -38
- package/dist/components/cards-selector-puzzle-component/components/Board/index.js +0 -159
- package/dist/components/cards-selector-puzzle-component/components/Card/index.js +0 -115
- package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +0 -289
- package/dist/components/cards-selector-puzzle-component/index.js +0 -10
- package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +0 -446
- package/dist/components/cartel-component/components/CartelComponent.js +0 -124
- package/dist/components/cartel-component/index.js +0 -10
- package/dist/components/chained-image-click-puzzle-component/components/ChainedImageClickPuzzleComponent.js +0 -80
- package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +0 -182
- package/dist/components/chained-image-click-puzzle-component/index.js +0 -10
- package/dist/components/chained-image-click-puzzle-component/mocks/mockForStory.js +0 -413
- package/dist/components/comic-component/components/ComicComponent.js +0 -201
- package/dist/components/comic-component/components/Slide.js +0 -31
- package/dist/components/comic-component/components/Vignette.js +0 -70
- package/dist/components/comic-component/index.js +0 -10
- package/dist/components/comic-component/mocks/mockForStory.js +0 -314
- package/dist/components/conversational-component/components/ConversationalComponent.js +0 -101
- package/dist/components/conversational-component/index.js +0 -10
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +0 -543
- package/dist/components/conversational-pro-component/components/Message.js +0 -37
- package/dist/components/conversational-pro-component/components/Slot.js +0 -92
- package/dist/components/conversational-pro-component/components/SlotList.js +0 -162
- package/dist/components/conversational-pro-component/components/scene/Panel.js +0 -179
- package/dist/components/conversational-pro-component/components/scene/Panels.js +0 -46
- package/dist/components/conversational-pro-component/components/scene/index.js +0 -77
- package/dist/components/conversational-pro-component/index.js +0 -10
- package/dist/components/conversational-pro-component/mocks/mockForStory.js +0 -1529
- package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +0 -261
- package/dist/components/cracker-puzzle-component/components/DrawGrid/index.js +0 -33
- package/dist/components/cracker-puzzle-component/components/DrawItem/index.js +0 -48
- package/dist/components/cracker-puzzle-component/components/DrawRow/index.js +0 -43
- package/dist/components/cracker-puzzle-component/components/colors.js +0 -12
- package/dist/components/cracker-puzzle-component/components/helpers.js +0 -133
- package/dist/components/cracker-puzzle-component/index.js +0 -10
- package/dist/components/cracker-puzzle-component/mocks/mockForStory.js +0 -277
- package/dist/components/decision-component/components/DecisionBody.js +0 -116
- package/dist/components/decision-component/components/DecisionComponent.js +0 -248
- package/dist/components/decision-component/components/Feedback.js +0 -40
- package/dist/components/decision-component/components/Options.js +0 -74
- package/dist/components/decision-component/index.js +0 -10
- package/dist/components/decision-component/mocks/mockForStory.js +0 -166
- package/dist/components/dialog-component/components/BubbleWrapper.js +0 -39
- package/dist/components/dialog-component/components/DialogComponent.js +0 -779
- package/dist/components/dialog-component/components/DialogDecision.js +0 -44
- package/dist/components/dialog-component/components/SpeechBubbleComponent.js +0 -66
- package/dist/components/dialog-component/index.js +0 -10
- package/dist/components/dialog-component/mocks/mockForStory.js +0 -550
- package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +0 -359
- package/dist/components/drag-item-puzzle-component/index.js +0 -10
- package/dist/components/drag-item-puzzle-component/mocks/mockForStory.js +0 -74
- package/dist/components/feedback-component/components/FeedbackComponent.js +0 -126
- package/dist/components/feedback-component/index.js +0 -10
- package/dist/components/feedback-component/mocks/mockForStory.js +0 -52
- package/dist/components/frame-click-puzzle-component/components/Counter/index.js +0 -24
- package/dist/components/frame-click-puzzle-component/components/CurrentFramePuzzle.js +0 -196
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +0 -178
- package/dist/components/frame-click-puzzle-component/components/Tooltip/index.js +0 -23
- package/dist/components/frame-click-puzzle-component/index.js +0 -10
- package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +0 -717
- package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +0 -255
- package/dist/components/hacker-puzzle-component/components/languages.js +0 -13
- package/dist/components/hacker-puzzle-component/index.js +0 -10
- package/dist/components/hacker-puzzle-component/mocks/mockForStory.js +0 -103
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +0 -488
- package/dist/components/hanged-puzzle-component/index.js +0 -10
- package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +0 -61
- package/dist/components/hanged-puzzle-component/utils.js +0 -64
- package/dist/components/image-click-puzzle-component/components/ImageClickPuzzleComponent.js +0 -40
- package/dist/components/image-click-puzzle-component/index.js +0 -10
- package/dist/components/image-click-puzzle-component/mocks/mockForStory.js +0 -427
- package/dist/components/image-click-wrapper-component/components/CountDown/index.js +0 -18
- package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +0 -472
- package/dist/components/image-click-wrapper-component/components/TimerDialog/index.js +0 -26
- package/dist/components/image-click-wrapper-component/index.js +0 -10
- package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +0 -432
- package/dist/components/image-component/components/ImageComponent.js +0 -83
- package/dist/components/image-component/index.js +0 -10
- package/dist/components/image-component/mocks/mockForStory.js +0 -52
- package/dist/components/index.js +0 -260
- package/dist/components/inventory-item/components/InventoryItem.js +0 -120
- package/dist/components/inventory-item/index.js +0 -10
- package/dist/components/inventory-item/mocks/mockForStory.js +0 -29
- package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +0 -275
- package/dist/components/keyboard-puzzle-component/index.js +0 -10
- package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +0 -40
- package/dist/components/konva-components/Area/index.js +0 -170
- package/dist/components/konva-components/KonvaMapper.js +0 -185
- package/dist/components/lectures-component/components/LectureButtons.js +0 -40
- package/dist/components/lectures-component/components/LecturesComponent.js +0 -157
- package/dist/components/lectures-component/index.js +0 -10
- package/dist/components/lectures-component/mocks/mockForStory.js +0 -39
- package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +0 -243
- package/dist/components/login-puzzle-component/index.js +0 -10
- package/dist/components/login-puzzle-component/mocks/mockForStory.js +0 -38
- package/dist/components/notice-component/components/NoticeComponent.js +0 -96
- package/dist/components/notice-component/index.js +0 -10
- package/dist/components/notice-component/mocks/mockForStory.js +0 -20
- package/dist/components/pattern-component/components/PatternComponent.js +0 -78
- package/dist/components/pattern-component/index.js +0 -10
- package/dist/components/pattern-component/mocks/mockForStory.js +0 -35
- package/dist/components/pdf-component/components/PdfComponent.js +0 -122
- package/dist/components/pdf-component/components/PdfVisor.js +0 -187
- package/dist/components/pdf-component/index.js +0 -20
- package/dist/components/pdf-component/mocks/mockForProps.js +0 -38
- package/dist/components/referral-component/components/EmailPill.js +0 -26
- package/dist/components/referral-component/components/ReferralComponent.js +0 -115
- package/dist/components/referral-component/components/StepOne.js +0 -170
- package/dist/components/referral-component/components/StepTwo.js +0 -57
- package/dist/components/referral-component/index.js +0 -10
- package/dist/components/referral-component/mocks/mockForStory.js +0 -40
- package/dist/components/survey-component/components/ApplicableBox.js +0 -49
- package/dist/components/survey-component/components/OpinionBox.js +0 -45
- package/dist/components/survey-component/components/SurveyComponent.js +0 -150
- package/dist/components/survey-component/components/TextBox.js +0 -40
- package/dist/components/survey-component/index.js +0 -10
- package/dist/components/survey-component/mocks/mockForStory.js +0 -14
- package/dist/components/terminal-puzzle-component/components/FilesGroup/Item.js +0 -28
- package/dist/components/terminal-puzzle-component/components/FilesGroup/index.js +0 -76
- package/dist/components/terminal-puzzle-component/components/Image/index.js +0 -22
- package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +0 -216
- package/dist/components/terminal-puzzle-component/components/Visor/index.js +0 -129
- package/dist/components/terminal-puzzle-component/components/utils/index.js +0 -26
- package/dist/components/terminal-puzzle-component/index.js +0 -10
- package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +0 -188
- package/dist/components/test-component/components/Container.js +0 -211
- package/dist/components/test-component/components/Feedbacks.js +0 -48
- package/dist/components/test-component/components/Questions.js +0 -145
- package/dist/components/test-component/components/Results.js +0 -208
- package/dist/components/test-component/components/TestComponent.js +0 -302
- package/dist/components/test-component/index.js +0 -10
- package/dist/components/test-component/mocks/mockForStory.js +0 -113
- package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +0 -387
- package/dist/components/text-click-puzzle-component/index.js +0 -10
- package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +0 -485
- package/dist/components/text-click-puzzle-component/utils/index.js +0 -76
- package/dist/components/url-component/components/UrlComponent.js +0 -88
- package/dist/components/url-component/index.js +0 -10
- package/dist/components/url-component/mocks/mockForProps.js +0 -20
- package/dist/components/video-component/components/VideoComponent.js +0 -73
- package/dist/components/video-component/index.js +0 -10
- package/dist/components/video-component/mocks/mockForStory.js +0 -94
- package/dist/components/video-visor/components/VideoControllers/BufferBar.js +0 -108
- package/dist/components/video-visor/components/VideoControllers/ControlButtons.js +0 -31
- package/dist/components/video-visor/components/VideoControllers/FinishedVideoButtons.js +0 -32
- package/dist/components/video-visor/components/VideoControllers/PlayInitButton.js +0 -37
- package/dist/components/video-visor/components/VideoControllers/SkipButton.js +0 -37
- package/dist/components/video-visor/components/VideoControllers/Timer.js +0 -37
- package/dist/components/video-visor/components/VideoControllers/VolumeBar.js +0 -92
- package/dist/components/video-visor/components/VideoControllers/index.js +0 -122
- package/dist/components/video-visor/components/VideoVisor.js +0 -271
- package/dist/components/video-visor/index.js +0 -10
- package/dist/components/video-visor/mocks/mockForStory.js +0 -42
- package/dist/components/web-builder-puzzle-component/Popups/PopupColorComponent/index.js +0 -87
- package/dist/components/web-builder-puzzle-component/Popups/PopupImageComponent/index.js +0 -94
- package/dist/components/web-builder-puzzle-component/Popups/PopupTextComponent/index.js +0 -114
- package/dist/components/web-builder-puzzle-component/Popups/index.js +0 -27
- package/dist/components/web-builder-puzzle-component/Templates/Bank.js +0 -98
- package/dist/components/web-builder-puzzle-component/Templates/Facebook.js +0 -37
- package/dist/components/web-builder-puzzle-component/Templates/resourcePath.js +0 -9
- package/dist/components/web-builder-puzzle-component/components/EditButton/index.js +0 -28
- package/dist/components/web-builder-puzzle-component/components/Feedback/index.js +0 -41
- package/dist/components/web-builder-puzzle-component/components/PublishButton/index.js +0 -29
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/BankBody.js +0 -118
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/FacebookBody.js +0 -149
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/index.js +0 -25
- package/dist/components/web-builder-puzzle-component/components/WebBuilderFront/index.js +0 -89
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/BankHeader.js +0 -84
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/FacebookHeader.js +0 -38
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/index.js +0 -40
- package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +0 -302
- package/dist/components/web-builder-puzzle-component/components/WebBuilderTopBar/index.js +0 -30
- package/dist/components/web-builder-puzzle-component/index.js +0 -10
- package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +0 -27
- package/dist/components/writer-puzzle-component/components/ElectionComponent.js +0 -69
- package/dist/components/writer-puzzle-component/components/FeedbackComponent.js +0 -97
- package/dist/components/writer-puzzle-component/components/FeedbackElement.js +0 -32
- package/dist/components/writer-puzzle-component/components/FinishedTextComponent.js +0 -25
- package/dist/components/writer-puzzle-component/components/FixedComponent.js +0 -120
- package/dist/components/writer-puzzle-component/components/SingleElection.js +0 -85
- package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +0 -450
- package/dist/components/writer-puzzle-component/index.js +0 -10
- package/dist/components/writer-puzzle-component/mocks/mockForStory.js +0 -1194
- package/dist/components/zoom-test/components/ZoomTest.js +0 -73
- package/dist/components/zoom-test/index.js +0 -10
- package/dist/components/zoom-test/mocks/mockForStory.js +0 -21
- package/dist/helpers/LangIsRtl.js +0 -16
- package/dist/helpers/LightSet.js +0 -35
- package/dist/helpers/LodController.js +0 -28
- package/dist/helpers/deviceDetection.js +0 -21
- package/dist/helpers/drawLOD.js +0 -310
- package/dist/helpers/index.js +0 -268
- package/dist/helpers/lodStats.js +0 -55
- package/dist/helpers/mocker.js +0 -116
- package/dist/helpers/useEkho.js +0 -172
- package/dist/helpers/useGLB.js +0 -57
- package/dist/helpers/useStateMachine.js +0 -277
- package/dist/helpers/useTimeout.js +0 -32
- package/dist/helpers/useWindowSize.js +0 -44
- package/dist/index.js +0 -16
- package/dist/test/testSceneWrapper.js +0 -31
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
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
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _LangIsRtl = _interopRequireDefault(require("../../../helpers/LangIsRtl"));
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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); }
|
|
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; }
|
|
13
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
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."); }
|
|
15
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
16
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
17
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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."); }
|
|
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); }
|
|
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; } }
|
|
22
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
-
var imagenPorDefecto = 'https://min.gamelearn.io/css-resources/gamelearn/resources/puzzle-login-low.png';
|
|
24
|
-
var LoginPuzzleComponent = function LoginPuzzleComponent(_ref) {
|
|
25
|
-
var _image$img;
|
|
26
|
-
var emitEvent = _ref.emitEvent,
|
|
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;
|
|
35
|
-
var translate = function translate(id) {
|
|
36
|
-
return emitEvent({
|
|
37
|
-
type: 'translate',
|
|
38
|
-
payload: id
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
var puzzleId = "login-puzzle_".concat(nodeId);
|
|
42
|
-
var isRtl = (0, _LangIsRtl.default)();
|
|
43
|
-
var _useState = (0, _react.useState)(''),
|
|
44
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
-
inputUser = _useState2[0],
|
|
46
|
-
setUser = _useState2[1];
|
|
47
|
-
var _useState3 = (0, _react.useState)(''),
|
|
48
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
-
inputPassword = _useState4[0],
|
|
50
|
-
setPassword = _useState4[1];
|
|
51
|
-
var _useState5 = (0, _react.useState)(false),
|
|
52
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
53
|
-
inputPasswordFocus = _useState6[0],
|
|
54
|
-
setInputPasswordFocus = _useState6[1];
|
|
55
|
-
var _useState7 = (0, _react.useState)(''),
|
|
56
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
57
|
-
fakeHashes = _useState8[0],
|
|
58
|
-
setFakeHashes = _useState8[1];
|
|
59
|
-
var _useState9 = (0, _react.useState)(''),
|
|
60
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
61
|
-
successClass = _useState10[0],
|
|
62
|
-
setSuccessClass = _useState10[1];
|
|
63
|
-
var _useState11 = (0, _react.useState)(false),
|
|
64
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
65
|
-
finished = _useState12[0],
|
|
66
|
-
setFinished = _useState12[1];
|
|
67
|
-
var _useState13 = (0, _react.useState)(false),
|
|
68
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
69
|
-
errorMessage = _useState14[0],
|
|
70
|
-
setErrorMessage = _useState14[1];
|
|
71
|
-
var _useState15 = (0, _react.useState)(false),
|
|
72
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
73
|
-
showCorrectSolution = _useState16[0],
|
|
74
|
-
setCorrectSolution = _useState16[1];
|
|
75
|
-
var _soundActions = _slicedToArray(soundActions, 1),
|
|
76
|
-
playSound = _soundActions[0];
|
|
77
|
-
var _useState17 = (0, _react.useState)([]),
|
|
78
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
79
|
-
accRewards = _useState18[0],
|
|
80
|
-
setRewards = _useState18[1];
|
|
81
|
-
var imgURL = ((_image$img = image.img) === null || _image$img === void 0 ? void 0 : _image$img.url) || imagenPorDefecto;
|
|
82
|
-
var handleFinish = function handleFinish() {
|
|
83
|
-
var rewards = info.solution.right.rewards;
|
|
84
|
-
var rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(rewards));
|
|
85
|
-
emitEvent({
|
|
86
|
-
type: 'addPoints',
|
|
87
|
-
complex: true,
|
|
88
|
-
finish: true,
|
|
89
|
-
payload: rewardsData
|
|
90
|
-
});
|
|
91
|
-
emitEvent({
|
|
92
|
-
type: 'passPuzzle'
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
var checkInput = function checkInput() {
|
|
96
|
-
playSound('click-ui');
|
|
97
|
-
var guessed = {
|
|
98
|
-
login: true,
|
|
99
|
-
password: false
|
|
100
|
-
};
|
|
101
|
-
if (login) {
|
|
102
|
-
guessed.login = user === inputUser;
|
|
103
|
-
}
|
|
104
|
-
guessed.password = password === inputPassword;
|
|
105
|
-
var correctGuess = guessed.login && guessed.password;
|
|
106
|
-
if (correctGuess) {
|
|
107
|
-
setSuccessClass('success');
|
|
108
|
-
setFinished(true);
|
|
109
|
-
setErrorMessage(false);
|
|
110
|
-
playSound('score');
|
|
111
|
-
setTimeout(function () {
|
|
112
|
-
handleFinish();
|
|
113
|
-
}, 2000);
|
|
114
|
-
} else {
|
|
115
|
-
setRewards([].concat(_toConsumableArray(accRewards), _toConsumableArray(info.solution.wrong.rewards)));
|
|
116
|
-
playSound('fail');
|
|
117
|
-
setSuccessClass('failed');
|
|
118
|
-
setErrorMessage(true);
|
|
119
|
-
emitEvent({
|
|
120
|
-
type: 'failPuzzle'
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
var changeCharactersByHashes = function changeCharactersByHashes(e) {
|
|
125
|
-
var fakePassword = '';
|
|
126
|
-
if (e.length >= 0) {
|
|
127
|
-
for (var i = 0; i < e.length; i += 1) {
|
|
128
|
-
fakePassword += '•';
|
|
129
|
-
}
|
|
130
|
-
setFakeHashes(fakePassword);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
(0, _react.useEffect)(function () {
|
|
134
|
-
setResolveAction(function () {
|
|
135
|
-
var rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(info.resolve.rewards));
|
|
136
|
-
setCorrectSolution(true);
|
|
137
|
-
setTimeout(function () {
|
|
138
|
-
emitEvent({
|
|
139
|
-
type: 'hidePuzzleButtons',
|
|
140
|
-
payload: false
|
|
141
|
-
});
|
|
142
|
-
emitEvent({
|
|
143
|
-
type: 'puzzleAction',
|
|
144
|
-
action: 'resolve',
|
|
145
|
-
payload: {
|
|
146
|
-
element: puzzleId,
|
|
147
|
-
rewards: rewardsData,
|
|
148
|
-
finish: true
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
}, 2000);
|
|
152
|
-
});
|
|
153
|
-
}, [accRewards, info.resolve.rewards, emitEvent, setResolveAction, puzzleId]);
|
|
154
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
155
|
-
className: "puzzle--layer",
|
|
156
|
-
style: {
|
|
157
|
-
backgroundImage: "url(\"".concat(imgURL, "\")")
|
|
158
|
-
}
|
|
159
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
160
|
-
className: "puzzle--login ".concat(user ? 'puzzle--login--withuser' : '')
|
|
161
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
162
|
-
className: "icon-login-puzzle"
|
|
163
|
-
}, " "), /*#__PURE__*/_react.default.createElement("span", {
|
|
164
|
-
className: "puzzle--login__title"
|
|
165
|
-
}, translate('puzzle.initSession')), /*#__PURE__*/_react.default.createElement("div", null, login && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
-
dir: "auto",
|
|
167
|
-
className: "puzzle--login__label"
|
|
168
|
-
}, translate('puzzle.user')), /*#__PURE__*/_react.default.createElement("div", {
|
|
169
|
-
dir: "auto",
|
|
170
|
-
className: "puzzle--login__group"
|
|
171
|
-
}, showCorrectSolution ? /*#__PURE__*/_react.default.createElement("input", {
|
|
172
|
-
dir: isRtl ? 'rtl' : 'auto',
|
|
173
|
-
disabled: finished,
|
|
174
|
-
"data-testid": "username",
|
|
175
|
-
className: "puzzle--login__input success",
|
|
176
|
-
type: "text",
|
|
177
|
-
placeholder: user,
|
|
178
|
-
value: user
|
|
179
|
-
}) : /*#__PURE__*/_react.default.createElement("input", {
|
|
180
|
-
dir: isRtl ? 'rtl' : 'auto',
|
|
181
|
-
disabled: finished,
|
|
182
|
-
"data-testid": "username",
|
|
183
|
-
className: "puzzle--login__input ".concat(successClass),
|
|
184
|
-
type: "text",
|
|
185
|
-
placeholder: translate('puzzle.user'),
|
|
186
|
-
onChange: function onChange(e) {
|
|
187
|
-
setUser(e.target.value);
|
|
188
|
-
setSuccessClass('');
|
|
189
|
-
setErrorMessage(false);
|
|
190
|
-
}
|
|
191
|
-
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
192
|
-
className: "icon-circle-check"
|
|
193
|
-
}, " "))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
194
|
-
dir: "auto",
|
|
195
|
-
className: "puzzle--login__label"
|
|
196
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, translate('puzzle.password'))), /*#__PURE__*/_react.default.createElement("div", {
|
|
197
|
-
dir: "auto",
|
|
198
|
-
className: "puzzle--login__group"
|
|
199
|
-
}, showCorrectSolution ? /*#__PURE__*/_react.default.createElement("input", {
|
|
200
|
-
dir: isRtl ? 'rtl' : 'auto',
|
|
201
|
-
disabled: true,
|
|
202
|
-
"data-testid": "password",
|
|
203
|
-
className: "puzzle--login__input puzzle--login__input--fakepassword success",
|
|
204
|
-
type: "text",
|
|
205
|
-
placeholder: password,
|
|
206
|
-
value: password,
|
|
207
|
-
style: {
|
|
208
|
-
opacity: 1
|
|
209
|
-
}
|
|
210
|
-
}) : /*#__PURE__*/_react.default.createElement("input", {
|
|
211
|
-
dir: isRtl ? 'rtl' : 'auto',
|
|
212
|
-
disabled: finished,
|
|
213
|
-
"data-testid": "password",
|
|
214
|
-
className: "puzzle--login__input puzzle--login__input--fakepassword ".concat(successClass),
|
|
215
|
-
type: "text",
|
|
216
|
-
placeholder: translate('puzzle.password'),
|
|
217
|
-
onFocus: function onFocus() {
|
|
218
|
-
setInputPasswordFocus(true);
|
|
219
|
-
},
|
|
220
|
-
onBlur: function onBlur() {
|
|
221
|
-
setInputPasswordFocus(false);
|
|
222
|
-
},
|
|
223
|
-
onChange: function onChange(e) {
|
|
224
|
-
setPassword(e.target.value);
|
|
225
|
-
changeCharactersByHashes(e.target.value);
|
|
226
|
-
setSuccessClass('');
|
|
227
|
-
setErrorMessage(false);
|
|
228
|
-
}
|
|
229
|
-
}), !showCorrectSolution ? /*#__PURE__*/_react.default.createElement("div", {
|
|
230
|
-
dir: isRtl ? 'rtl' : 'auto',
|
|
231
|
-
className: "login-fakepassword".concat(inputPasswordFocus ? ' login-fakepassword--focus' : '').concat(fakeHashes.length ? ' login-fakepassword--fill' : '', " ").concat(successClass || '')
|
|
232
|
-
}, inputPassword ? fakeHashes : translate('puzzle.password')) : null, /*#__PURE__*/_react.default.createElement("span", {
|
|
233
|
-
className: "icon-circle-check"
|
|
234
|
-
}, " ")))), /*#__PURE__*/_react.default.createElement("button", {
|
|
235
|
-
type: "button",
|
|
236
|
-
className: "gat--btn gat--btn__primary ".concat(inputPassword.length !== 0 && !finished ? '' : 'disabled'),
|
|
237
|
-
onClick: checkInput
|
|
238
|
-
}, translate('puzzle.loginIn')), !showCorrectSolution && errorMessage && info.solution.wrong.desc !== '' && /*#__PURE__*/_react.default.createElement("div", {
|
|
239
|
-
className: "puzzle--login__label--error"
|
|
240
|
-
}, info.solution.wrong.desc)));
|
|
241
|
-
};
|
|
242
|
-
var _default = LoginPuzzleComponent;
|
|
243
|
-
exports.default = _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _LoginPuzzleComponent = _interopRequireDefault(require("./components/LoginPuzzleComponent"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _LoginPuzzleComponent.default;
|
|
10
|
-
exports.default = _default;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.mockProps = exports.default = void 0;
|
|
7
|
-
var _mocker = require("helpers/mocker");
|
|
8
|
-
var mockProps = {
|
|
9
|
-
emitEvent: _mocker.emitEvent,
|
|
10
|
-
setResolveAction: function setResolveAction() {},
|
|
11
|
-
soundActions: _mocker.soundActions,
|
|
12
|
-
keyboardControl: _mocker.keyboardControl,
|
|
13
|
-
user: 'pepe',
|
|
14
|
-
password: '1234',
|
|
15
|
-
login: true,
|
|
16
|
-
info: {
|
|
17
|
-
resolve: {
|
|
18
|
-
rewards: []
|
|
19
|
-
},
|
|
20
|
-
solution: {
|
|
21
|
-
right: {
|
|
22
|
-
rewards: []
|
|
23
|
-
},
|
|
24
|
-
wrong: {
|
|
25
|
-
rewards: []
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
image: {
|
|
30
|
-
img: {
|
|
31
|
-
// eslint-disable-next-line max-len
|
|
32
|
-
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/58dccfba26561500117caf53/image/60508f84901f3e00123a0796/holamundo.jpg'
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
exports.mockProps = mockProps;
|
|
37
|
-
var _default = mockProps;
|
|
38
|
-
exports.default = _default;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
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
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _useTimeout2 = _interopRequireDefault(require("../../../helpers/useTimeout"));
|
|
10
|
-
var _LangIsRtl = _interopRequireDefault(require("../../../helpers/LangIsRtl"));
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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); }
|
|
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; }
|
|
14
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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."); }
|
|
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
|
-
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; }
|
|
20
|
-
var NoticeComponent = function NoticeComponent(_ref) {
|
|
21
|
-
var title = _ref.title,
|
|
22
|
-
text = _ref.text,
|
|
23
|
-
buttonText = _ref.buttonText,
|
|
24
|
-
emitEvent = _ref.emitEvent,
|
|
25
|
-
soundActions = _ref.soundActions,
|
|
26
|
-
keyboardControl = _ref.keyboardControl,
|
|
27
|
-
styles = _ref.styles,
|
|
28
|
-
autoEnd = _ref.autoEnd;
|
|
29
|
-
var _soundActions = _slicedToArray(soundActions, 1),
|
|
30
|
-
playSound = _soundActions[0];
|
|
31
|
-
var _useTimeout = (0, _useTimeout2.default)(),
|
|
32
|
-
start = _useTimeout.start,
|
|
33
|
-
stop = _useTimeout.stop;
|
|
34
|
-
var characterMs = 75;
|
|
35
|
-
var onFinish = (0, _react.useCallback)(function () {
|
|
36
|
-
playSound('click-ui');
|
|
37
|
-
emitEvent({
|
|
38
|
-
type: 'success'
|
|
39
|
-
});
|
|
40
|
-
}, [emitEvent, playSound]);
|
|
41
|
-
(0, _react.useEffect)(function () {
|
|
42
|
-
if (autoEnd) {
|
|
43
|
-
var time = characterMs * (text.length || 0);
|
|
44
|
-
start(onFinish, time < 2000 ? 2000 : time);
|
|
45
|
-
}
|
|
46
|
-
return function () {
|
|
47
|
-
stop();
|
|
48
|
-
};
|
|
49
|
-
}, [autoEnd, onFinish, start, stop, text]);
|
|
50
|
-
keyboardControl(null, onFinish, onFinish);
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
-
className: "notice--layer notice--layer--".concat(styles)
|
|
53
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
-
className: "notice notice--".concat(styles)
|
|
55
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
-
className: "notice--head__title--wrapper"
|
|
57
|
-
}, ['classic', 'futuristic'].includes(styles) && /*#__PURE__*/_react.default.createElement("span", {
|
|
58
|
-
className: "notice--head__title"
|
|
59
|
-
}, title), ['futuristic'].includes(styles) && /*#__PURE__*/_react.default.createElement("span", {
|
|
60
|
-
className: "notice--head__title-part2"
|
|
61
|
-
}), ['futuristic'].includes(styles) && /*#__PURE__*/_react.default.createElement("span", {
|
|
62
|
-
className: "notice--head__title-part3"
|
|
63
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
-
className: "notice--info"
|
|
65
|
-
}, ['notification-light', 'notification-dark', 'minimalist'].includes(styles) && /*#__PURE__*/_react.default.createElement("span", {
|
|
66
|
-
className: "notice--info__title"
|
|
67
|
-
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
68
|
-
className: "notice--info__item"
|
|
69
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
70
|
-
className: "notice--info__text",
|
|
71
|
-
style: {
|
|
72
|
-
whiteSpace: 'pre-line'
|
|
73
|
-
}
|
|
74
|
-
}, text), ['classic'].includes(styles) ? /*#__PURE__*/_react.default.createElement("button", {
|
|
75
|
-
className: "gat--btn gat--btn__primary",
|
|
76
|
-
onClick: onFinish,
|
|
77
|
-
type: "button"
|
|
78
|
-
}, buttonText) : /*#__PURE__*/_react.default.createElement("button", {
|
|
79
|
-
type: "button",
|
|
80
|
-
className: "gat--btn__navigation",
|
|
81
|
-
onClick: onFinish
|
|
82
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
83
|
-
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
84
|
-
}))))));
|
|
85
|
-
};
|
|
86
|
-
NoticeComponent.defaultProps = {
|
|
87
|
-
title: '',
|
|
88
|
-
buttonText: 'X',
|
|
89
|
-
color: '#CCC',
|
|
90
|
-
text: '',
|
|
91
|
-
context: {},
|
|
92
|
-
styles: 'classic',
|
|
93
|
-
autoEnd: false
|
|
94
|
-
};
|
|
95
|
-
var _default = NoticeComponent;
|
|
96
|
-
exports.default = _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _NoticeComponent = _interopRequireDefault(require("./components/NoticeComponent"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _NoticeComponent.default;
|
|
10
|
-
exports.default = _default;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.mockProps = exports.default = void 0;
|
|
7
|
-
var _mocker = require("helpers/mocker");
|
|
8
|
-
var mockProps = {
|
|
9
|
-
soundActions: _mocker.soundActions,
|
|
10
|
-
keyboardControl: _mocker.keyboardControl,
|
|
11
|
-
title: 'title',
|
|
12
|
-
text: 'text',
|
|
13
|
-
buttonText: 'click',
|
|
14
|
-
buttonColor: '#00ff75',
|
|
15
|
-
nodeId: 'dasdaa',
|
|
16
|
-
emitEvent: _mocker.emitEvent
|
|
17
|
-
};
|
|
18
|
-
exports.mockProps = mockProps;
|
|
19
|
-
var _default = mockProps;
|
|
20
|
-
exports.default = _default;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
-
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."); }
|
|
11
|
-
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); }
|
|
12
|
-
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; }
|
|
13
|
-
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; } }
|
|
14
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
-
var PatternComponent = function PatternComponent(_ref) {
|
|
16
|
-
var img = _ref.img,
|
|
17
|
-
name = _ref.name,
|
|
18
|
-
viewed = _ref.viewed,
|
|
19
|
-
emitEvent = _ref.emitEvent,
|
|
20
|
-
soundActions = _ref.soundActions,
|
|
21
|
-
keyboardControl = _ref.keyboardControl;
|
|
22
|
-
var _soundActions = _slicedToArray(soundActions, 1),
|
|
23
|
-
play = _soundActions[0];
|
|
24
|
-
var translate = function translate(id) {
|
|
25
|
-
return emitEvent({
|
|
26
|
-
type: 'translate',
|
|
27
|
-
payload: id
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
if (!img) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
var imgUrl = img.url;
|
|
34
|
-
var close = function close() {
|
|
35
|
-
play('click-ui');
|
|
36
|
-
emitEvent({
|
|
37
|
-
type: 'emitSavePattern',
|
|
38
|
-
payload: {
|
|
39
|
-
imgId: img.resourceId,
|
|
40
|
-
name: name,
|
|
41
|
-
viewed: true,
|
|
42
|
-
url: imgUrl,
|
|
43
|
-
type: 'pattern'
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
keyboardControl(null, !viewed ? close : null, !viewed ? close : null);
|
|
48
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
-
className: viewed ? 'notes--results' : 'readings--container pattern-wrap--overlay'
|
|
50
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
-
className: viewed ? 'notes--results__text' : 'pattern-wrap'
|
|
52
|
-
}, !viewed ? /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
-
className: "pattern"
|
|
54
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
55
|
-
className: "pattern__header"
|
|
56
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
-
className: "pattern__title"
|
|
58
|
-
}, translate('phone.pattern')), /*#__PURE__*/_react.default.createElement("button", {
|
|
59
|
-
type: "button",
|
|
60
|
-
"aria-label": translate('storylines.misc.closePiece'),
|
|
61
|
-
className: "pattern__close gat--btn__round gat--btn__close",
|
|
62
|
-
onClick: function onClick() {
|
|
63
|
-
return close();
|
|
64
|
-
}
|
|
65
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
66
|
-
className: "icon-close"
|
|
67
|
-
}))), /*#__PURE__*/_react.default.createElement("figure", {
|
|
68
|
-
className: "pattern__figure"
|
|
69
|
-
}, imgUrl && /*#__PURE__*/_react.default.createElement("img", {
|
|
70
|
-
src: imgUrl,
|
|
71
|
-
alt: "pattern"
|
|
72
|
-
}))) : /*#__PURE__*/_react.default.createElement("div", null, imgUrl && /*#__PURE__*/_react.default.createElement("img", {
|
|
73
|
-
src: imgUrl,
|
|
74
|
-
alt: "pattern"
|
|
75
|
-
}))));
|
|
76
|
-
};
|
|
77
|
-
var _default = PatternComponent;
|
|
78
|
-
exports.default = _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _PatternComponent = _interopRequireDefault(require("./components/PatternComponent"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _PatternComponent.default;
|
|
10
|
-
exports.default = _default;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.mockProps2 = exports.mockProps = void 0;
|
|
7
|
-
var _mocker = require("helpers/mocker");
|
|
8
|
-
var mockProps = {
|
|
9
|
-
emitEvent: _mocker.emitEvent,
|
|
10
|
-
soundActions: _mocker.soundActions,
|
|
11
|
-
keyboardControl: _mocker.keyboardControl,
|
|
12
|
-
img: {
|
|
13
|
-
imgId: 'alfalfa',
|
|
14
|
-
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/58dccfba26561500117caf53/image/603fb8b1901f3e001238e297/gif.gif',
|
|
15
|
-
resourceId: '5e79e0c8f5b3a6000fd81472'
|
|
16
|
-
},
|
|
17
|
-
imgName: 'Hand gif',
|
|
18
|
-
name: 'pika pika pikachu',
|
|
19
|
-
nodeId: 'node'
|
|
20
|
-
};
|
|
21
|
-
exports.mockProps = mockProps;
|
|
22
|
-
var mockProps2 = {
|
|
23
|
-
emitEvent: _mocker.emitEvent,
|
|
24
|
-
soundActions: _mocker.soundActions,
|
|
25
|
-
keyboardControl: _mocker.keyboardControl,
|
|
26
|
-
img: {
|
|
27
|
-
imgId: 'space',
|
|
28
|
-
url: 'https://min.gamelearn.io/css-resources/gamelearn/resources/cosmos-bg.jpg',
|
|
29
|
-
resourceId: '5e79e0c8f5b3a6000fd81472'
|
|
30
|
-
},
|
|
31
|
-
imgName: 'Hand gif',
|
|
32
|
-
name: 'el espacio la ultima frontera',
|
|
33
|
-
nodeId: 'node2'
|
|
34
|
-
};
|
|
35
|
-
exports.mockProps2 = mockProps2;
|