@gamelearn/arcade-components 2.27.0 → 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 +28 -52
- 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,107 +1,77 @@
|
|
|
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 _feedbackComponent = _interopRequireDefault(require("../../feedback-component"));
|
|
15
|
-
|
|
16
11
|
var _utils = require("../utils");
|
|
17
|
-
|
|
18
12
|
var _LangIsRtl = _interopRequireDefault(require("../../../helpers/LangIsRtl"));
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
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); }
|
|
23
|
-
|
|
24
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
16
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
27
|
-
|
|
28
17
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
-
|
|
30
18
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
31
|
-
|
|
32
19
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
33
|
-
|
|
34
20
|
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; }
|
|
35
|
-
|
|
36
21
|
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; }
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
22
|
+
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; }
|
|
23
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
24
|
+
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); }
|
|
40
25
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
41
|
-
|
|
42
26
|
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."); }
|
|
43
|
-
|
|
44
27
|
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); }
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
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; }
|
|
49
|
-
|
|
28
|
+
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; }
|
|
29
|
+
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; } }
|
|
50
30
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
|
-
|
|
52
31
|
var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
53
32
|
var emitEvent = _ref.emitEvent,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
33
|
+
showFrames = _ref.showFrames,
|
|
34
|
+
styles = _ref.styles,
|
|
35
|
+
list = _ref.list,
|
|
36
|
+
soundActions = _ref.soundActions,
|
|
37
|
+
description = _ref.description,
|
|
38
|
+
setInfo = _ref.setInfo,
|
|
39
|
+
setResolveAction = _ref.setResolveAction,
|
|
40
|
+
keyboardControl = _ref.keyboardControl,
|
|
41
|
+
backgroundImage = _ref.backgroundImage;
|
|
64
42
|
var _useState = (0, _react.useState)({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
43
|
+
result: null,
|
|
44
|
+
show: false,
|
|
45
|
+
text: '',
|
|
46
|
+
timeout: false
|
|
47
|
+
}),
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
feedbackData = _useState2[0],
|
|
50
|
+
setFeedbackData = _useState2[1];
|
|
74
51
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
75
|
-
|
|
76
|
-
|
|
52
|
+
playSound = _soundActions[0];
|
|
77
53
|
var _useState3 = (0, _react.useState)(0),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
54
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
+
currentSlide = _useState4[0],
|
|
56
|
+
setCurrentSlide = _useState4[1];
|
|
82
57
|
var _useState5 = (0, _react.useState)(0),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
58
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
59
|
+
numberAllCorrectFragments = _useState6[0],
|
|
60
|
+
setNumberAllCorrectFragments = _useState6[1];
|
|
87
61
|
var _useState7 = (0, _react.useState)(0),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
62
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
63
|
+
correctTextFragmentsAccumulated = _useState8[0],
|
|
64
|
+
setCorrectTextFragmentsAccumulated = _useState8[1];
|
|
92
65
|
var correctTextFragmentsPartial = (0, _react.useRef)(0);
|
|
93
66
|
var accRewards = (0, _react.useRef)([]);
|
|
94
|
-
|
|
95
67
|
var _useState9 = (0, _react.useState)(0),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
68
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
69
|
+
orderCounter = _useState10[0],
|
|
70
|
+
setOrderCounter = _useState10[1];
|
|
100
71
|
var _useState11 = (0, _react.useState)(),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
72
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
73
|
+
transitionToNextSlide = _useState12[0],
|
|
74
|
+
setTransitionToNextSlide = _useState12[1];
|
|
105
75
|
var translate = (0, _react.useCallback)(function (id) {
|
|
106
76
|
return emitEvent({
|
|
107
77
|
type: 'translate',
|
|
@@ -131,19 +101,16 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
131
101
|
});
|
|
132
102
|
});
|
|
133
103
|
correctTextFragmentsPartial.current = 0;
|
|
134
|
-
|
|
135
104
|
if (correctTextFragmentsAccumulated === numberAllCorrectFragments) {
|
|
136
105
|
var totalRewards = accRewards.current.reduce(function (acc, current) {
|
|
137
106
|
var existing = acc.findIndex(function (r) {
|
|
138
107
|
return r.id === current.id;
|
|
139
108
|
});
|
|
140
|
-
|
|
141
109
|
if (existing >= 0) {
|
|
142
110
|
acc[existing].points += current.points;
|
|
143
111
|
} else {
|
|
144
112
|
acc.push(_objectSpread({}, current));
|
|
145
113
|
}
|
|
146
|
-
|
|
147
114
|
return acc;
|
|
148
115
|
}, []);
|
|
149
116
|
emitEvent({
|
|
@@ -178,21 +145,19 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
178
145
|
text: ''
|
|
179
146
|
});
|
|
180
147
|
});
|
|
181
|
-
|
|
182
148
|
if (document.querySelector('.text-click__failed')) {
|
|
183
149
|
document.querySelector('.text-click__failed').classList.remove('text-click__failed');
|
|
184
150
|
}
|
|
185
151
|
}, [emitEvent, goForward]);
|
|
186
152
|
var handleCorrectClick = (0, _react.useCallback)(function (allDataTextIds, specificFeedback) {
|
|
187
153
|
var _list$currentSlide$in;
|
|
188
|
-
|
|
189
154
|
allDataTextIds.forEach(function (el) {
|
|
190
155
|
return el.classList.add('text-click__success');
|
|
191
156
|
});
|
|
192
157
|
setCorrectTextFragmentsAccumulated(correctTextFragmentsAccumulated + 1);
|
|
193
158
|
correctTextFragmentsPartial.current += 1;
|
|
194
|
-
playSound('score');
|
|
195
|
-
|
|
159
|
+
playSound('score');
|
|
160
|
+
// si tiene feedback general definido
|
|
196
161
|
if ((_list$currentSlide$in = list[currentSlide].info.solution.right) !== null && _list$currentSlide$in !== void 0 && _list$currentSlide$in.desc) {
|
|
197
162
|
// solo muestra la caja verde y suma puntos cuando resuelves todos los fragmentos correctos
|
|
198
163
|
if (isCompleted()) {
|
|
@@ -203,29 +168,30 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
203
168
|
timeout: false
|
|
204
169
|
});
|
|
205
170
|
}
|
|
206
|
-
}
|
|
171
|
+
}
|
|
172
|
+
// si no tiene feedback general y tiene specificFeedbacks definido
|
|
207
173
|
else if (list[currentSlide].info.solution.right.desc === '' && specificFeedback !== null && specificFeedback !== void 0 && specificFeedback.desc) {
|
|
208
174
|
var _specificFeedback$rew;
|
|
209
|
-
|
|
210
175
|
accRewards.current = specificFeedback !== null && specificFeedback !== void 0 && (_specificFeedback$rew = specificFeedback.rewards) !== null && _specificFeedback$rew !== void 0 && _specificFeedback$rew.length ? [].concat(_toConsumableArray(accRewards.current), _toConsumableArray(specificFeedback === null || specificFeedback === void 0 ? void 0 : specificFeedback.rewards)) : _toConsumableArray(accRewards.current);
|
|
211
176
|
modifyFeedbackData(true, {
|
|
212
177
|
result: true,
|
|
213
178
|
text: specificFeedback.desc,
|
|
214
179
|
timeout: false
|
|
215
180
|
});
|
|
216
|
-
}
|
|
181
|
+
}
|
|
182
|
+
// si no tiene feedback general ni specificFeedbacks,
|
|
217
183
|
// solo muestra la caja verde y suma puntos cuando resuelves todos los fragmentos correctos
|
|
218
184
|
else if (list[currentSlide].specificFeedbacks.specificCorrectFeedbacks) {
|
|
219
185
|
// si tiene puntos definidos por feedbacks correctos
|
|
220
186
|
accRewards.current = [].concat(_toConsumableArray(accRewards.current), _toConsumableArray(specificFeedback === null || specificFeedback === void 0 ? void 0 : specificFeedback.rewards));
|
|
221
|
-
|
|
222
187
|
if (isCompleted()) {
|
|
223
188
|
modifyFeedbackData(true, {
|
|
224
189
|
result: true,
|
|
225
190
|
timeout: true
|
|
226
191
|
});
|
|
227
192
|
}
|
|
228
|
-
}
|
|
193
|
+
}
|
|
194
|
+
// si tiene puntos generales
|
|
229
195
|
else if (isCompleted()) {
|
|
230
196
|
accRewards.current = [].concat(_toConsumableArray(accRewards.current), _toConsumableArray(list[currentSlide].info.solution.right.rewards));
|
|
231
197
|
modifyFeedbackData(true, {
|
|
@@ -241,8 +207,8 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
241
207
|
playSound('fail');
|
|
242
208
|
emitEvent({
|
|
243
209
|
type: 'failPuzzle'
|
|
244
|
-
});
|
|
245
|
-
|
|
210
|
+
});
|
|
211
|
+
// si tiene feedback general definido
|
|
246
212
|
if (list[currentSlide].info.solution.wrong.desc !== '') {
|
|
247
213
|
accRewards.current = [].concat(_toConsumableArray(accRewards.current), _toConsumableArray(list[currentSlide].info.solution.wrong.rewards));
|
|
248
214
|
modifyFeedbackData(true, {
|
|
@@ -250,17 +216,18 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
250
216
|
text: list[currentSlide].info.solution.wrong.desc,
|
|
251
217
|
timeout: false
|
|
252
218
|
});
|
|
253
|
-
}
|
|
219
|
+
}
|
|
220
|
+
// si no tiene feedback general pero tiene specificFeedbacks definido
|
|
254
221
|
else if (list[currentSlide].info.solution.wrong.desc === '' && specificFeedback !== null && specificFeedback !== void 0 && specificFeedback.desc) {
|
|
255
222
|
var _specificFeedback$rew2;
|
|
256
|
-
|
|
257
223
|
accRewards.current = specificFeedback !== null && specificFeedback !== void 0 && (_specificFeedback$rew2 = specificFeedback.rewards) !== null && _specificFeedback$rew2 !== void 0 && _specificFeedback$rew2.length ? [].concat(_toConsumableArray(accRewards.current), _toConsumableArray(specificFeedback === null || specificFeedback === void 0 ? void 0 : specificFeedback.rewards)) : _toConsumableArray(accRewards.current);
|
|
258
224
|
modifyFeedbackData(true, {
|
|
259
225
|
result: false,
|
|
260
226
|
text: specificFeedback.desc,
|
|
261
227
|
timeout: false
|
|
262
228
|
});
|
|
263
|
-
}
|
|
229
|
+
}
|
|
230
|
+
// si no tiene feedback general ni specificFeedbacks definido
|
|
264
231
|
else if (list[currentSlide].specificFeedbacks.specificWrongFeedbacks) {
|
|
265
232
|
// si tiene puntos definidos por feedbacks negativos
|
|
266
233
|
accRewards.current = [].concat(_toConsumableArray(accRewards.current), _toConsumableArray(specificFeedback === null || specificFeedback === void 0 ? void 0 : specificFeedback.rewards));
|
|
@@ -268,7 +235,8 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
268
235
|
result: false,
|
|
269
236
|
timeout: true
|
|
270
237
|
});
|
|
271
|
-
}
|
|
238
|
+
}
|
|
239
|
+
// si tiene puntos generales definidos por feedbacks negativo
|
|
272
240
|
else {
|
|
273
241
|
accRewards.current = [].concat(_toConsumableArray(accRewards.current), _toConsumableArray(list[currentSlide].info.solution.wrong.rewards));
|
|
274
242
|
modifyFeedbackData(true, {
|
|
@@ -279,7 +247,6 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
279
247
|
}, [playSound, emitEvent, list, currentSlide, modifyFeedbackData]);
|
|
280
248
|
var onClickMark = (0, _react.useCallback)(function (e, id) {
|
|
281
249
|
var _list$currentSlide, _list$currentSlide$sp, _list$currentSlide2, _list$currentSlide2$s;
|
|
282
|
-
|
|
283
250
|
e.stopPropagation();
|
|
284
251
|
var currentTextDom = document.querySelectorAll("[data-text-id=\"".concat(id, "\"]"));
|
|
285
252
|
var allDataTextIds = document.querySelectorAll("[data-text-id]");
|
|
@@ -295,13 +262,13 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
295
262
|
var specificWrongFeedback = (_list$currentSlide2 = list[currentSlide]) === null || _list$currentSlide2 === void 0 ? void 0 : (_list$currentSlide2$s = _list$currentSlide2.specificFeedbacks) === null || _list$currentSlide2$s === void 0 ? void 0 : _list$currentSlide2$s.wrongFeedbacks.find(function (fb) {
|
|
296
263
|
return fb.id === id;
|
|
297
264
|
});
|
|
298
|
-
playSound('click-ui');
|
|
299
|
-
|
|
265
|
+
playSound('click-ui');
|
|
266
|
+
// si va en orden
|
|
300
267
|
if (list[currentSlide].hasClickOrder) {
|
|
301
268
|
// y lo has hecho bien
|
|
302
269
|
if (list[currentSlide].correctTexts[orderCounter].id === id) {
|
|
303
|
-
setOrderCounter(orderCounter + 1);
|
|
304
|
-
|
|
270
|
+
setOrderCounter(orderCounter + 1);
|
|
271
|
+
// hacer verde 🎉
|
|
305
272
|
handleCorrectClick(currentTextDom, specificCorrectFeedback);
|
|
306
273
|
} else if (list[currentSlide].correctTexts.find(function (c) {
|
|
307
274
|
return c.id === id;
|
|
@@ -337,7 +304,6 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
337
304
|
}, [currentSlide, list, onClickMark]);
|
|
338
305
|
var getnumberAllCorrectFragments = (0, _react.useCallback)(function () {
|
|
339
306
|
var counter = 0;
|
|
340
|
-
|
|
341
307
|
for (var i = 0; i < list.length; i += 1) {
|
|
342
308
|
if (list[i].hasClickOnce) {
|
|
343
309
|
counter += 1;
|
|
@@ -352,13 +318,11 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
352
318
|
}, [list]);
|
|
353
319
|
(0, _react.useEffect)(function () {
|
|
354
320
|
var _list$currentSlide3;
|
|
355
|
-
|
|
356
321
|
if (list !== null && list !== void 0 && list[currentSlide]) {
|
|
357
322
|
setInfo(_objectSpread(_objectSpread({}, list[currentSlide].info), {}, {
|
|
358
323
|
description: description
|
|
359
324
|
}));
|
|
360
325
|
}
|
|
361
|
-
|
|
362
326
|
if ((_list$currentSlide3 = list[currentSlide]) !== null && _list$currentSlide3 !== void 0 && _list$currentSlide3.text) {
|
|
363
327
|
var jsx = (0, _htmlReactParser.default)(list[currentSlide].text);
|
|
364
328
|
parsedText.current = recursiveStuff(jsx);
|
|
@@ -416,6 +380,5 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
416
380
|
keyboardControl: keyboardControl
|
|
417
381
|
}));
|
|
418
382
|
};
|
|
419
|
-
|
|
420
383
|
var _default = TextClickPuzzleComponent;
|
|
421
384
|
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 _TextClickPuzzleComponent = _interopRequireDefault(require("./components/TextClickPuzzleComponent"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _TextClickPuzzleComponent.default;
|
|
13
10
|
exports.default = _default;
|
|
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.mockPropsOnce = exports.mockProps = exports.messages = void 0;
|
|
7
|
-
|
|
8
7
|
var _mocker = require("helpers/mocker");
|
|
9
|
-
|
|
10
8
|
/* eslint-disable max-len */
|
|
9
|
+
|
|
11
10
|
var messages = {
|
|
12
11
|
fullText1: '<div><p><span></span><strong>Texto de prueba:</strong></p><p>Con <span data-text-id="text-click-0">un texto correcto normal</span></p><p>Con <span data-text-id="text-click-2">un texto incorrecto normal</span></p><p>Con un texto <span data-text-id="text-click-1">corr</span></p><p><span data-text-id="text-click-1">ecto partido</span></p></div>',
|
|
13
12
|
fullText2: '<div><mark data-text-id="text-click-4">FRAGMENTO <strong>CORRECTO</strong> id4</mark> que <mark data-text-id="text-click-7">FRAGMENTO <strong>CORRECTO id7</strong> 4</mark> en <mark data-text-id="text-click-6">FRAGMENTO <strong>inCORRECTO id6</strong> 4</mark> asdf asdf asf <mark data-text-id="text-click-5">FRAGMENTO <strong>INCORRECTO id5</strong></mark></div>',
|
|
@@ -4,57 +4,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getRecursiveJSX = exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _excluded = ["children"];
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
-
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
11
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
17
|
-
|
|
18
12
|
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."); }
|
|
19
|
-
|
|
20
13
|
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); }
|
|
21
|
-
|
|
22
14
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
23
|
-
|
|
24
15
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
16
|
+
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; }
|
|
28
17
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
-
|
|
30
18
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
-
|
|
32
19
|
var getRecursiveJSX = function getRecursiveJSX(jsx) {
|
|
33
20
|
var _jsx$props, _jsx$props3;
|
|
34
|
-
|
|
35
21
|
var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
36
22
|
var slide = arguments.length > 2 ? arguments[2] : undefined;
|
|
37
23
|
var onClick = arguments.length > 3 ? arguments[3] : undefined;
|
|
38
24
|
var onHover = arguments.length > 4 ? arguments[4] : undefined;
|
|
39
|
-
|
|
40
25
|
if ((_jsx$props = jsx.props) !== null && _jsx$props !== void 0 && _jsx$props.children) {
|
|
41
26
|
var Type = jsx.type; // Tipo de marcado
|
|
42
|
-
|
|
43
27
|
var _jsx$props2 = jsx.props,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
children = _jsx$props2.children,
|
|
29
|
+
props = _objectWithoutProperties(_jsx$props2, _excluded); // Obtenemos el hijo y los props por separado
|
|
48
30
|
if (jsx.props['data-text-id']) {
|
|
49
31
|
props.dir = 'auto';
|
|
50
|
-
|
|
51
32
|
props.onClick = function (e) {
|
|
52
33
|
return onClick(e, props['data-text-id'] || -1);
|
|
53
34
|
};
|
|
54
|
-
|
|
55
35
|
if (slide !== null && slide !== void 0 && slide.hasHighlights) {
|
|
56
36
|
var clickabledIds = [].concat(_toConsumableArray(slide.correctTexts), _toConsumableArray(slide.wrongTexts));
|
|
57
|
-
|
|
58
37
|
for (var j = 0; j < clickabledIds.length; j += 1) {
|
|
59
38
|
if (props['data-text-id'] === clickabledIds[j].id) {
|
|
60
39
|
props.className = 'text-click__hover-correct';
|
|
@@ -65,9 +44,9 @@ var getRecursiveJSX = function getRecursiveJSX(jsx) {
|
|
|
65
44
|
props.onClick = function (e) {
|
|
66
45
|
return onClick(e, 'allWrong');
|
|
67
46
|
};
|
|
68
|
-
}
|
|
69
|
-
|
|
47
|
+
}
|
|
70
48
|
|
|
49
|
+
// Si hay varios hijos los recorremos y llamamos a la función recursiva
|
|
71
50
|
if (Array.isArray(children)) {
|
|
72
51
|
// Mantenemos el marcado y los props
|
|
73
52
|
return /*#__PURE__*/_react.default.createElement(Type, _extends({
|
|
@@ -76,12 +55,10 @@ var getRecursiveJSX = function getRecursiveJSX(jsx) {
|
|
|
76
55
|
return getRecursiveJSX(child, ind, slide, onClick, onHover);
|
|
77
56
|
}));
|
|
78
57
|
}
|
|
79
|
-
|
|
80
58
|
return /*#__PURE__*/_react.default.createElement(Type, _extends({
|
|
81
59
|
key: "".concat(jsx.type, "_").concat(i)
|
|
82
60
|
}, props), getRecursiveJSX(children, i, slide, onClick, onHover));
|
|
83
61
|
}
|
|
84
|
-
|
|
85
62
|
if (((_jsx$props3 = jsx.props) === null || _jsx$props3 === void 0 ? void 0 : _jsx$props3.children) !== null) {
|
|
86
63
|
return jsx.split(' ').filter(function (word) {
|
|
87
64
|
return word !== '';
|
|
@@ -92,10 +69,8 @@ var getRecursiveJSX = function getRecursiveJSX(jsx) {
|
|
|
92
69
|
}, word);
|
|
93
70
|
});
|
|
94
71
|
}
|
|
95
|
-
|
|
96
72
|
return null;
|
|
97
73
|
};
|
|
98
|
-
|
|
99
74
|
exports.getRecursiveJSX = getRecursiveJSX;
|
|
100
75
|
var _default = getRecursiveJSX;
|
|
101
76
|
exports.default = _default;
|
|
@@ -1,50 +1,37 @@
|
|
|
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
|
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
|
-
|
|
14
10
|
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; }
|
|
15
|
-
|
|
16
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
|
-
|
|
18
12
|
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
|
-
|
|
20
13
|
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); }
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
14
|
+
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; }
|
|
15
|
+
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; } }
|
|
26
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
-
|
|
28
17
|
var UrlComponent = function UrlComponent(_ref) {
|
|
29
18
|
var emitEvent = _ref.emitEvent,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
19
|
+
name = _ref.name,
|
|
20
|
+
nameLabel = _ref.name_labelId,
|
|
21
|
+
link = _ref.link,
|
|
22
|
+
linkLabel = _ref.link_labelId,
|
|
23
|
+
text = _ref.text,
|
|
24
|
+
textLabel = _ref.text_labelId,
|
|
25
|
+
viewed = _ref.viewed,
|
|
26
|
+
documentType = _ref.documentType,
|
|
27
|
+
soundActions = _ref.soundActions,
|
|
28
|
+
keyboardControl = _ref.keyboardControl;
|
|
41
29
|
var translate = function translate(id) {
|
|
42
30
|
return emitEvent({
|
|
43
31
|
type: 'translate',
|
|
44
32
|
payload: id
|
|
45
33
|
});
|
|
46
34
|
};
|
|
47
|
-
|
|
48
35
|
var item = {
|
|
49
36
|
documentType: documentType,
|
|
50
37
|
name: nameLabel,
|
|
@@ -52,10 +39,8 @@ var UrlComponent = function UrlComponent(_ref) {
|
|
|
52
39
|
link: linkLabel,
|
|
53
40
|
type: 'url'
|
|
54
41
|
};
|
|
55
|
-
|
|
56
42
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
play = _soundActions[0];
|
|
59
44
|
var close = function close() {
|
|
60
45
|
play('click-ui');
|
|
61
46
|
emitEvent({
|
|
@@ -63,12 +48,10 @@ var UrlComponent = function UrlComponent(_ref) {
|
|
|
63
48
|
payload: item
|
|
64
49
|
});
|
|
65
50
|
};
|
|
66
|
-
|
|
67
51
|
var _useState = (0, _react.useState)(false),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
53
|
+
clicked = _useState2[0],
|
|
54
|
+
setClicked = _useState2[1];
|
|
72
55
|
keyboardControl(null, !viewed && clicked ? close : null, !viewed && clicked ? close : null);
|
|
73
56
|
var linkUrl = link.indexOf('http') !== 0 ? "http://".concat(link) : link;
|
|
74
57
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -100,6 +83,5 @@ var UrlComponent = function UrlComponent(_ref) {
|
|
|
100
83
|
}
|
|
101
84
|
}, link)));
|
|
102
85
|
};
|
|
103
|
-
|
|
104
86
|
var _default = UrlComponent;
|
|
105
87
|
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 _UrlComponent = _interopRequireDefault(require("./components/UrlComponent"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _UrlComponent.default;
|
|
13
10
|
exports.default = _default;
|