@gamelearn/arcade-components 1.3.3 → 1.3.5-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/dist/components/animation-component/components/AnimationComponent.js +9 -3
- package/dist/components/animation-component/mocks/mockForStory.js +16 -9
- package/dist/components/arcade-render/background/scene-elements/index.js +2 -4
- package/dist/components/arcade-render/element/AnimateElement.js +5 -7
- package/dist/components/arcade-render/element/BoundingBox.js +3 -5
- package/dist/components/arcade-render/element/Projection.js +3 -3
- package/dist/components/arcade-render/element/index.js +7 -9
- package/dist/components/arcade-render/elements-list/ClickableArea.js +4 -6
- package/dist/components/arcade-render/elements-list/Poster.js +4 -6
- package/dist/components/arcade-render/elements-list/index.js +5 -8
- package/dist/components/arcade-render/light/index.js +1 -3
- package/dist/components/arcade-render/light/useLight.js +7 -17
- package/dist/components/arcade-render/loading/Loading.js +2 -2
- package/dist/components/arcade-render/loading/LoadingLogic.js +5 -7
- package/dist/components/arcade-render/mocks/index.js +1 -3
- package/dist/components/arcade-render/scene/ConfigController.js +7 -7
- package/dist/components/arcade-render/scene/index.js +3 -3
- package/dist/components/arcade-render/scene/useCameraPan.js +2 -1
- package/dist/components/auto-evaluation-component/components/AutoEvaluation.js +4 -4
- package/dist/components/auto-evaluation-component/components/EndScreen.js +2 -2
- package/dist/components/auto-evaluation-component/mocks/mockForStory.js +3 -5
- package/dist/components/cards-selector-puzzle-component/components/Board/index.js +9 -5
- package/dist/components/cards-selector-puzzle-component/components/Card/index.js +2 -0
- package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +12 -12
- package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +0 -1
- package/dist/components/cartel-component/components/CartelComponent.js +3 -3
- package/dist/components/chained-image-click-puzzle-component/components/ChainedImageClickPuzzleComponent.js +3 -3
- package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +4 -4
- package/dist/components/chained-image-click-puzzle-component/mocks/mockForStory.js +0 -1
- package/dist/components/comic-component/components/ComicComponent.js +3 -3
- package/dist/components/comic-component/components/Slide.js +4 -4
- package/dist/components/comic-component/mocks/mockForStory.js +2 -5
- package/dist/components/conversational-component/components/ConversationalComponent.js +4 -4
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +15 -18
- package/dist/components/conversational-pro-component/components/Slot.js +2 -0
- package/dist/components/conversational-pro-component/components/SlotList.js +7 -14
- package/dist/components/conversational-pro-component/components/scene/Panel.js +19 -14
- package/dist/components/conversational-pro-component/components/scene/Panels.js +2 -8
- package/dist/components/conversational-pro-component/components/scene/index.js +20 -19
- package/dist/components/conversational-pro-component/mocks/mockForStory.js +91 -92
- package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +4 -4
- package/dist/components/cracker-puzzle-component/components/helpers.js +1 -1
- package/dist/components/decision-component/components/DecisionBody.js +4 -3
- package/dist/components/decision-component/components/DecisionComponent.js +6 -8
- package/dist/components/decision-component/components/Feedback.js +6 -15
- package/dist/components/decision-component/mocks/mockForStory.js +1 -1
- package/dist/components/dialog-component/components/DialogComponent.js +50 -95
- package/dist/components/dialog-component/components/SpeechBubbleComponent.js +3 -5
- package/dist/components/dialog-component/mocks/mockForStory.js +2 -3
- package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +6 -6
- package/dist/components/drag-item-puzzle-component/components/Messages.js +2 -4
- package/dist/components/drag-item-puzzle-component/mocks/mockForStory.js +2 -5
- package/dist/components/feedback-component/components/FeedbackComponent.js +5 -5
- package/dist/components/feedback-component/mocks/mockForStory.js +0 -1
- package/dist/components/frame-click-puzzle-component/components/CurrentFramePuzzle.js +4 -4
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +3 -3
- package/dist/components/frame-click-puzzle-component/components/PlayButton/index.js +3 -3
- package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +1 -2
- package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +5 -5
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +20 -38
- package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +2 -4
- package/dist/components/hanged-puzzle-component/utils.js +2 -10
- package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +5 -9
- package/dist/components/image-component/components/ImageComponent.js +6 -6
- package/dist/components/image-component/mocks/mockForStory.js +1 -1
- package/dist/components/index.js +86 -86
- package/dist/components/inventory-item/components/InventoryItem.js +14 -12
- package/dist/components/inventory-item/mocks/mockForStory.js +5 -7
- package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +7 -8
- package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +2 -4
- package/dist/components/konva-components/Area/index.js +4 -4
- package/dist/components/konva-components/KonvaMapper.js +3 -3
- package/dist/components/lectures-component/components/LecturesComponent.js +10 -10
- package/dist/components/lectures-component/mocks/mockForStory.js +4 -6
- package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +29 -80
- package/dist/components/login-puzzle-component/mocks/mockForStory.js +2 -4
- package/dist/components/media-visor/components/MediaVisor.js +13 -13
- package/dist/components/media-visor/mocks/mockForStory.js +2 -6
- package/dist/components/notice-component/components/NoticeComponent.js +2 -3
- package/dist/components/notice-component/mocks/mockForStory.js +2 -4
- package/dist/components/pattern-component/components/PatternComponent.js +1 -1
- package/dist/components/pdf-component/components/PdfComponent.js +7 -9
- package/dist/components/pdf-component/components/PdfVisor.js +10 -11
- package/dist/components/pdf-component/index.js +4 -4
- package/dist/components/pdf-component/mocks/mockForProps.js +0 -1
- package/dist/components/rewards-component/components/RewardItem.js +4 -4
- package/dist/components/rewards-component/components/RewardsComponent.js +5 -5
- package/dist/components/survey-component/components/ApplicableBox.js +4 -4
- package/dist/components/survey-component/components/OpinionBox.js +4 -4
- package/dist/components/survey-component/components/SurveyComponent.js +3 -3
- package/dist/components/survey-component/components/TextBox.js +1 -1
- package/dist/components/survey-component/mocks/mockForStory.js +2 -4
- package/dist/components/terminal-puzzle-component/components/FilesGroup/index.js +3 -3
- package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +3 -3
- package/dist/components/terminal-puzzle-component/components/Visor/index.js +2 -2
- package/dist/components/terminal-puzzle-component/components/utils/index.js +1 -1
- package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +2 -3
- package/dist/components/test-component/components/Container.js +3 -3
- package/dist/components/test-component/components/Results.js +3 -3
- package/dist/components/test-component/components/TestComponent.js +8 -8
- package/dist/components/test-component/mocks/mockForStory.js +2 -5
- package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +110 -84
- package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +0 -1
- package/dist/components/text-click-puzzle-component/utils/index.js +9 -15
- package/dist/components/url-component/components/UrlComponent.js +10 -9
- package/dist/components/url-component/mocks/mockForProps.js +6 -8
- package/dist/components/video-component/components/VideoComponent.js +7 -7
- package/dist/components/video-component/mocks/mockForStory.js +2 -4
- package/dist/components/video-visor/components/VideoControllers/BufferBar.js +3 -3
- package/dist/components/video-visor/components/VideoVisor.js +4 -3
- package/dist/components/video-visor/mocks/mockForStory.js +2 -5
- package/dist/components/web-builder-puzzle-component/Popups/PopupColorComponent/index.js +3 -3
- package/dist/components/web-builder-puzzle-component/Popups/PopupImageComponent/index.js +3 -3
- package/dist/components/web-builder-puzzle-component/Popups/PopupTextComponent/index.js +8 -8
- package/dist/components/web-builder-puzzle-component/Templates/Bank.js +1 -1
- package/dist/components/web-builder-puzzle-component/Templates/Facebook.js +1 -1
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/BankBody.js +5 -5
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/FacebookBody.js +8 -8
- package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +7 -6
- package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +2 -7
- package/dist/components/writer-puzzle-component/components/ElectionComponent.js +3 -3
- package/dist/components/writer-puzzle-component/components/FeedbackComponent.js +1 -1
- package/dist/components/writer-puzzle-component/components/FixedComponent.js +3 -3
- package/dist/components/writer-puzzle-component/components/Rewards.js +7 -7
- package/dist/components/writer-puzzle-component/components/SingleElection.js +3 -3
- package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +7 -9
- package/dist/components/zoom-test/components/ZoomTest.js +5 -5
- package/dist/components/zoom-test/mocks/mockForStory.js +4 -6
- package/dist/helpers/HtmlPro.js +34 -0
- package/dist/helpers/deviceDetection.js +1 -1
- package/dist/helpers/drawLOD.js +77 -60
- package/dist/helpers/index.js +8 -9
- package/dist/helpers/lodStats.js +25 -37
- package/dist/helpers/mocker.js +2 -6
- package/dist/helpers/useWindowSize.js +3 -5
- package/dist/test/testSceneWrapper.js +17 -12
- package/package.json +1 -1
|
@@ -15,13 +15,11 @@ var _DecisionBody = _interopRequireDefault(require("./DecisionBody"));
|
|
|
15
15
|
|
|
16
16
|
var _Feedback = _interopRequireDefault(require("./Feedback"));
|
|
17
17
|
|
|
18
|
-
var _excluded = ["emitEvent", "soundActions", "inScene"];
|
|
19
|
-
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
19
|
|
|
22
|
-
function _getRequireWildcardCache(
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
23
21
|
|
|
24
|
-
function _interopRequireWildcard(obj
|
|
22
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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
23
|
|
|
26
24
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
27
25
|
|
|
@@ -31,7 +29,7 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
31
29
|
|
|
32
30
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
33
31
|
|
|
34
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly)
|
|
32
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
35
33
|
|
|
36
34
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
37
35
|
|
|
@@ -45,7 +43,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
45
43
|
|
|
46
44
|
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; }
|
|
47
45
|
|
|
48
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
46
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
49
47
|
|
|
50
48
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
49
|
|
|
@@ -57,7 +55,7 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
57
55
|
var emitEvent = _ref.emitEvent,
|
|
58
56
|
soundActions = _ref.soundActions,
|
|
59
57
|
inScene = _ref.inScene,
|
|
60
|
-
props = _objectWithoutProperties(_ref,
|
|
58
|
+
props = _objectWithoutProperties(_ref, ["emitEvent", "soundActions", "inScene"]);
|
|
61
59
|
|
|
62
60
|
var _props$inheritProps = props.inheritProps,
|
|
63
61
|
inheritProps = _props$inheritProps === void 0 ? {} : _props$inheritProps,
|
|
@@ -97,7 +95,7 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
97
95
|
var listProps = _objectSpread(_objectSpread({}, inheritProps), {}, {
|
|
98
96
|
slots: inheritProps.slots ? inheritProps.slots : inheritProps.characters,
|
|
99
97
|
currentMessage: {
|
|
100
|
-
position:
|
|
98
|
+
position: -1,
|
|
101
99
|
emotion: ''
|
|
102
100
|
}
|
|
103
101
|
});
|
|
@@ -20,27 +20,18 @@ var FeedBack = function FeedBack(_ref) {
|
|
|
20
20
|
|
|
21
21
|
var Wrapper = function Wrapper(_ref2) {
|
|
22
22
|
var children = _ref2.children;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (!choice.feedback) {
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
-
className: "popup__basicDecision__only--rewards only--rewards"
|
|
33
|
-
}, children);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return children;
|
|
23
|
+
return inherited ? /*#__PURE__*/_react.default.createElement("div", {
|
|
24
|
+
className: "conversation--feedback ".concat(!choice.feedback ? 'only--rewards' : '')
|
|
25
|
+
}, children) : !choice.feedback ? /*#__PURE__*/_react.default.createElement("div", {
|
|
26
|
+
className: "popup__basicDecision__only--rewards only--rewards"
|
|
27
|
+
}, children) : children;
|
|
37
28
|
};
|
|
38
29
|
|
|
39
30
|
var noRewards = rewards.filter(function (reward) {
|
|
40
31
|
return reward.type !== 'grade';
|
|
41
32
|
}).length === 0;
|
|
42
33
|
if (!choice.feedback && noRewards) return null;
|
|
43
|
-
return /*#__PURE__*/_react.default.createElement(Wrapper, null, choice.feedback ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(Wrapper, null, !!choice.feedback ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
44
35
|
className: "conversation--feedback__title"
|
|
45
36
|
}, "Feedback"), /*#__PURE__*/_react.default.createElement("div", {
|
|
46
37
|
className: "conversation--feedback__text"
|
|
@@ -12,7 +12,7 @@ var decisionProps = {
|
|
|
12
12
|
soundActions: _mocker.soundActions,
|
|
13
13
|
setShowPoints: _mocker.setShowPoints,
|
|
14
14
|
onFinish: function onFinish() {
|
|
15
|
-
return (0, _mocker.onFinish)(
|
|
15
|
+
return (0, _mocker.onFinish)("decision-component");
|
|
16
16
|
},
|
|
17
17
|
options: [{
|
|
18
18
|
id: 0,
|
|
@@ -15,25 +15,25 @@ var _three = require("three");
|
|
|
15
15
|
|
|
16
16
|
var _GLTFLoader = require("three/examples/jsm/loaders/GLTFLoader");
|
|
17
17
|
|
|
18
|
-
var _arcadeThreeCore = require("@gamelearn/arcade-three-core");
|
|
19
|
-
|
|
20
18
|
var _SpeechBubbleComponent = _interopRequireDefault(require("./SpeechBubbleComponent"));
|
|
21
19
|
|
|
22
20
|
var _decisionComponent = _interopRequireDefault(require("../../decision-component"));
|
|
23
21
|
|
|
24
22
|
var _helpers = require("../../../helpers");
|
|
25
23
|
|
|
24
|
+
var _HtmlPro = _interopRequireDefault(require("../../../helpers/HtmlPro"));
|
|
25
|
+
|
|
26
26
|
var _deviceDetection = require("../../../helpers/deviceDetection");
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
30
|
-
function _getRequireWildcardCache(
|
|
30
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
31
31
|
|
|
32
|
-
function _interopRequireWildcard(obj
|
|
32
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
33
33
|
|
|
34
34
|
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); }
|
|
35
35
|
|
|
36
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly)
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
37
37
|
|
|
38
38
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
39
39
|
|
|
@@ -51,16 +51,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
51
51
|
|
|
52
52
|
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; }
|
|
53
53
|
|
|
54
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
54
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
55
55
|
|
|
56
56
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
57
57
|
|
|
58
58
|
var isMobile = (0, _deviceDetection.DeviceDetection)();
|
|
59
59
|
var crossFadeDuration = 0.5; // Mobile always zoom in?
|
|
60
60
|
|
|
61
|
-
var raycast = new _three.Raycaster();
|
|
62
|
-
raycast.firstHitOnly = true;
|
|
63
|
-
|
|
64
61
|
var DialogComponent = function DialogComponent(_ref) {
|
|
65
62
|
var _currentLine$audio3, _currentLine$audio4;
|
|
66
63
|
|
|
@@ -88,13 +85,14 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
88
85
|
inScene: false,
|
|
89
86
|
thinkful: false,
|
|
90
87
|
voiceOver: false,
|
|
91
|
-
avatar: ''
|
|
92
|
-
show: false
|
|
88
|
+
avatar: ''
|
|
93
89
|
}),
|
|
94
90
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
95
91
|
currentMessage = _useState6[0],
|
|
96
92
|
setCurrentMessage = _useState6[1];
|
|
97
93
|
|
|
94
|
+
var emitRef = (0, _react.useRef)(emitEvent);
|
|
95
|
+
|
|
98
96
|
var _useThree = (0, _fiber.useThree)(function (state) {
|
|
99
97
|
return [state.camera, state.scene];
|
|
100
98
|
}),
|
|
@@ -102,7 +100,6 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
102
100
|
camera = _useThree2[0],
|
|
103
101
|
scene = _useThree2[1];
|
|
104
102
|
|
|
105
|
-
var changedMats = (0, _react.useRef)([]);
|
|
106
103
|
var loader = (0, _react.useMemo)(function () {
|
|
107
104
|
return new _GLTFLoader.GLTFLoader();
|
|
108
105
|
}, []);
|
|
@@ -123,7 +120,6 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
123
120
|
var currentLine = lines[line];
|
|
124
121
|
var lastLine = lines[line - 1];
|
|
125
122
|
var lastSet = (0, _react.useRef)(false);
|
|
126
|
-
var emitRef = (0, _react.useRef)(emitEvent);
|
|
127
123
|
var translate = (0, _react.useCallback)(function (id) {
|
|
128
124
|
return emitRef.current({
|
|
129
125
|
type: 'translate',
|
|
@@ -139,9 +135,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
139
135
|
|
|
140
136
|
if (type === 'base') {
|
|
141
137
|
return usedVoices === null || usedVoices === void 0 ? void 0 : usedVoices[id];
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (type === 'character') {
|
|
138
|
+
} else if (type === 'character') {
|
|
145
139
|
var _gameChars$id;
|
|
146
140
|
|
|
147
141
|
return gameChars === null || gameChars === void 0 ? void 0 : (_gameChars$id = gameChars[id]) === null || _gameChars$id === void 0 ? void 0 : _gameChars$id.voiceId;
|
|
@@ -150,7 +144,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
150
144
|
return null;
|
|
151
145
|
}, [translate]);
|
|
152
146
|
var playSpeech = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
153
|
-
var payload,
|
|
147
|
+
var payload, speechUrl;
|
|
154
148
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
155
149
|
while (1) {
|
|
156
150
|
switch (_context.prev = _context.next) {
|
|
@@ -177,8 +171,8 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
177
171
|
});
|
|
178
172
|
|
|
179
173
|
case 5:
|
|
180
|
-
|
|
181
|
-
playSound(
|
|
174
|
+
speechUrl = _context.sent;
|
|
175
|
+
playSound(speechUrl);
|
|
182
176
|
|
|
183
177
|
case 7:
|
|
184
178
|
case "end":
|
|
@@ -186,7 +180,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
186
180
|
}
|
|
187
181
|
}
|
|
188
182
|
}, _callee);
|
|
189
|
-
})), [currentLine
|
|
183
|
+
})), [currentLine.voice, getVoice, currentMessage.text, playSound]);
|
|
190
184
|
var getCurrentVisible = (0, _react.useCallback)(function (uid) {
|
|
191
185
|
var object;
|
|
192
186
|
scene.traverseVisible(function (node) {
|
|
@@ -213,10 +207,10 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
213
207
|
|
|
214
208
|
var onLoadAnim = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
|
|
215
209
|
var animation = (_slot$character2 = slot.character) === null || _slot$character2 === void 0 ? void 0 : _slot$character2.resource.animations[slot.emotion];
|
|
216
|
-
var mixer = element.userData.mixer;
|
|
217
210
|
|
|
218
|
-
if (animation
|
|
219
|
-
|
|
211
|
+
if (animation) {
|
|
212
|
+
var mixer = element.userData.mixer;
|
|
213
|
+
loader.load(animation === null || animation === void 0 ? void 0 : animation.url, function (anim) {
|
|
220
214
|
var emotionClip = anim.animations[0];
|
|
221
215
|
var defaultClip = element.userData.defaultAnim;
|
|
222
216
|
var emotionAction = mixer.clipAction(emotionClip, element);
|
|
@@ -229,8 +223,6 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
229
223
|
element.userData.currentEmotion = emotionAction;
|
|
230
224
|
onLoadAnim(mixer, emotionAction, defaultAction);
|
|
231
225
|
});
|
|
232
|
-
} else {
|
|
233
|
-
onLoadAnim();
|
|
234
226
|
}
|
|
235
227
|
}, [loader]); // Reset currentEmotion to defaultAnim
|
|
236
228
|
|
|
@@ -294,17 +286,18 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
294
286
|
setCurrentMessage({});
|
|
295
287
|
resetCameraView();
|
|
296
288
|
setTimeout(function () {
|
|
297
|
-
|
|
289
|
+
emitEvent({
|
|
298
290
|
type: 'success'
|
|
299
291
|
});
|
|
300
292
|
camera.copy(defaultCamera.current);
|
|
301
293
|
}, currentLine.decision ? 0 : 1200);
|
|
302
294
|
}
|
|
303
|
-
}, [camera, currentLine
|
|
295
|
+
}, [camera, currentLine.decision, emitEvent, line, lines.length, resetAnims, resetCameraView]); // Position bubble over talking character/and switch emotions
|
|
304
296
|
|
|
305
297
|
(0, _react.useEffect)(function () {
|
|
306
298
|
if (currentLine.decision) {
|
|
307
299
|
resetCameraView();
|
|
300
|
+
return;
|
|
308
301
|
} else if (currentLine.voiceOver) {
|
|
309
302
|
resetCameraView();
|
|
310
303
|
setCurrentMessage({
|
|
@@ -314,8 +307,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
314
307
|
inScene: false,
|
|
315
308
|
voiceOver: true,
|
|
316
309
|
thinkful: false,
|
|
317
|
-
avatar: ''
|
|
318
|
-
show: true
|
|
310
|
+
avatar: ''
|
|
319
311
|
});
|
|
320
312
|
} else if (!lastSet.current) {
|
|
321
313
|
var talkingCharacter = currentLine.slots.find(function (slot) {
|
|
@@ -333,7 +325,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
333
325
|
loadEmotion(slot, element, function (mixer, action, defaultAction) {
|
|
334
326
|
var startAction = element.userData.lastEmotion ? element.userData.lastEmotion : defaultAction;
|
|
335
327
|
|
|
336
|
-
if (startAction
|
|
328
|
+
if (startAction !== action) {
|
|
337
329
|
mixer.stopAllAction();
|
|
338
330
|
(0, _helpers.executeCrossFade)(startAction, action, crossFadeDuration);
|
|
339
331
|
}
|
|
@@ -351,7 +343,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
351
343
|
loadEmotion(talkingCharacter, element, function (mixer, action, defaultAction) {
|
|
352
344
|
var startAction = element.userData.lastEmotion ? element.userData.lastEmotion : defaultAction;
|
|
353
345
|
|
|
354
|
-
if (startAction
|
|
346
|
+
if (startAction !== action) {
|
|
355
347
|
mixer.stopAllAction();
|
|
356
348
|
(0, _helpers.executeCrossFade)(startAction, action, crossFadeDuration);
|
|
357
349
|
} // Ugly timeout to wait an animation transition
|
|
@@ -364,7 +356,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
364
356
|
head.getWorldPosition(target.position);
|
|
365
357
|
target.applyQuaternion(camera.quaternion);
|
|
366
358
|
target.translateX(1.25);
|
|
367
|
-
target.translateY(
|
|
359
|
+
target.translateY(3);
|
|
368
360
|
messagePosition.current = {
|
|
369
361
|
pos: target.position.toArray(),
|
|
370
362
|
child: head,
|
|
@@ -385,8 +377,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
385
377
|
left: true,
|
|
386
378
|
inScene: true,
|
|
387
379
|
thinkful: talkingCharacter.emotion === 'thinkful',
|
|
388
|
-
avatar: ''
|
|
389
|
-
show: true
|
|
380
|
+
avatar: ''
|
|
390
381
|
});
|
|
391
382
|
}, zoomInActor ? 1200 : 0);
|
|
392
383
|
}
|
|
@@ -402,15 +393,9 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
402
393
|
left: false,
|
|
403
394
|
inScene: false,
|
|
404
395
|
thinkful: talkingCharacter.emotion === 'thinkful',
|
|
405
|
-
avatar: getAvatarURL(talkingCharacter)
|
|
406
|
-
show: true
|
|
396
|
+
avatar: getAvatarURL(talkingCharacter)
|
|
407
397
|
});
|
|
408
398
|
}
|
|
409
|
-
} else {
|
|
410
|
-
resetCameraView();
|
|
411
|
-
setCurrentMessage({
|
|
412
|
-
show: true
|
|
413
|
-
});
|
|
414
399
|
}
|
|
415
400
|
}
|
|
416
401
|
}, [actors, camera, currentLine, zoomInActor, getCurrentVisible, translate, getAvatarURL, loadEmotion, resetAnims, resetCameraView]); // Sound logic
|
|
@@ -437,13 +422,8 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
437
422
|
if (autoPlay) {
|
|
438
423
|
if (line >= lines.length - 1 && automatic) {
|
|
439
424
|
setAutomatic(false);
|
|
440
|
-
} else if (automatic && currentMessage.
|
|
441
|
-
var time = 0;
|
|
442
|
-
|
|
443
|
-
if (currentMessage.text) {
|
|
444
|
-
time = 75 * (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.text.length);
|
|
445
|
-
}
|
|
446
|
-
|
|
425
|
+
} else if (automatic && currentMessage.text && !currentLine.decision) {
|
|
426
|
+
var time = 70 * (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.text.length);
|
|
447
427
|
timeout = setTimeout(function () {
|
|
448
428
|
nextLine();
|
|
449
429
|
}, time < 1400 ? 1400 : time);
|
|
@@ -453,7 +433,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
453
433
|
return function () {
|
|
454
434
|
if (timeout) clearTimeout(timeout);
|
|
455
435
|
};
|
|
456
|
-
}, [currentMessage, nextLine, autoPlay, lines.length, automatic, line, currentLine
|
|
436
|
+
}, [currentMessage, nextLine, autoPlay, lines.length, automatic, line, currentLine.decision, currentLine === null || currentLine === void 0 ? void 0 : currentLine.audioType, currentLine === null || currentLine === void 0 ? void 0 : (_currentLine$audio4 = currentLine.audio) === null || _currentLine$audio4 === void 0 ? void 0 : _currentLine$audio4.url]); //Positioning logic
|
|
457
437
|
|
|
458
438
|
var checkBubblePosition = (0, _react.useCallback)(function () {
|
|
459
439
|
if (bubbleRef.current && currentLine.slots) {
|
|
@@ -489,8 +469,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
489
469
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
490
470
|
left: false,
|
|
491
471
|
inScene: !completeOutside,
|
|
492
|
-
avatar: getAvatarURL(talkingCharacter)
|
|
493
|
-
show: true
|
|
472
|
+
avatar: getAvatarURL(talkingCharacter)
|
|
494
473
|
});
|
|
495
474
|
});
|
|
496
475
|
}
|
|
@@ -498,57 +477,38 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
498
477
|
bubbleRef.current.parentNode.style.transform = '';
|
|
499
478
|
}
|
|
500
479
|
}
|
|
501
|
-
}, [camera.quaternion, currentLine
|
|
480
|
+
}, [camera.quaternion, currentLine.slots, currentMessage.inScene, getAvatarURL]);
|
|
502
481
|
(0, _react.useEffect)(function () {
|
|
503
482
|
checkBubblePosition();
|
|
504
483
|
}, [checkBubblePosition]); // Animate Camera
|
|
505
484
|
|
|
506
485
|
(0, _fiber.useFrame)(function (_ref4, delta) {
|
|
507
|
-
var
|
|
486
|
+
var camera = _ref4.camera;
|
|
508
487
|
|
|
509
488
|
if (animationStart.current) {
|
|
510
489
|
var targetPosition = messagePosition.current.child ? messagePosition.current.pos : defaultCamera.current.position.toArray();
|
|
511
490
|
animationTarget.current.position.fromArray(targetPosition);
|
|
512
491
|
|
|
513
492
|
if (messagePosition.current.parent) {
|
|
514
|
-
if (!animationTarget.current.quaternion.equals(
|
|
515
|
-
animationTarget.current.applyQuaternion(
|
|
493
|
+
if (!animationTarget.current.quaternion.equals(camera.quaternion)) {
|
|
494
|
+
animationTarget.current.applyQuaternion(camera.quaternion);
|
|
516
495
|
}
|
|
517
496
|
|
|
518
|
-
animationTarget.current.translateX(
|
|
497
|
+
animationTarget.current.translateX(13);
|
|
519
498
|
animationTarget.current.translateY(-5);
|
|
520
499
|
animationTarget.current.translateZ(30);
|
|
521
500
|
}
|
|
522
501
|
|
|
523
|
-
if (animationTarget.current.position.distanceTo(
|
|
502
|
+
if (animationTarget.current.position.distanceTo(camera.position) < 1) {
|
|
524
503
|
animationStart.current = false;
|
|
525
|
-
raycast.set(cam.getWorldPosition(new _three.Vector3(0, 0, 0)), cam.getWorldDirection(new _three.Vector3()));
|
|
526
|
-
var objects = raycast.intersectObjects(scene.children, true);
|
|
527
|
-
changedMats.current = objects.filter(function (o) {
|
|
528
|
-
return o.distance < 10;
|
|
529
|
-
});
|
|
530
|
-
|
|
531
|
-
if (changedMats.current.length) {
|
|
532
|
-
changedMats.current.forEach(function (o) {
|
|
533
|
-
var object = o.object;
|
|
534
|
-
object.material.visible = false;
|
|
535
|
-
});
|
|
536
|
-
}
|
|
537
504
|
|
|
538
505
|
if (lastSet.current || !messagePosition.current.child) {
|
|
539
|
-
|
|
506
|
+
camera.copy(defaultCamera.current);
|
|
540
507
|
}
|
|
541
508
|
|
|
542
509
|
checkBubblePosition();
|
|
543
510
|
} else {
|
|
544
|
-
|
|
545
|
-
changedMats.current.forEach(function (o) {
|
|
546
|
-
var object = o.object;
|
|
547
|
-
object.material.visible = true;
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
cam.position.lerp(animationTarget.current.position, delta * 2.5);
|
|
511
|
+
camera.position.lerp(animationTarget.current.position, delta * 2.5);
|
|
552
512
|
}
|
|
553
513
|
}
|
|
554
514
|
});
|
|
@@ -568,23 +528,18 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
568
528
|
height: '100vh',
|
|
569
529
|
position: 'static'
|
|
570
530
|
};
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
inScene: true
|
|
581
|
-
}, decisionPayload)));
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, currentMessage.text ? /*#__PURE__*/_react.default.createElement("group", {
|
|
531
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, currentLine.decision ? /*#__PURE__*/_react.default.createElement(_HtmlPro.default, {
|
|
532
|
+
zIndexRange: [3, 3],
|
|
533
|
+
style: cleanStyle,
|
|
534
|
+
calculatePosition: function calculatePosition() {
|
|
535
|
+
return [0, 0];
|
|
536
|
+
}
|
|
537
|
+
}, /*#__PURE__*/_react.default.createElement(_decisionComponent.default, _extends({
|
|
538
|
+
inScene: true
|
|
539
|
+
}, decisionPayload))) : null, currentMessage.text ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("group", {
|
|
585
540
|
ref: groupRef,
|
|
586
541
|
position: messagePosition.current.pos
|
|
587
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
542
|
+
}, /*#__PURE__*/_react.default.createElement(_HtmlPro.default, {
|
|
588
543
|
zIndexRange: [2, 2],
|
|
589
544
|
calculatePosition: currentMessage.inScene ? undefined : function () {
|
|
590
545
|
return [0, 0];
|
|
@@ -595,7 +550,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
595
550
|
}, /*#__PURE__*/_react.default.createElement(_SpeechBubbleComponent.default, {
|
|
596
551
|
ref: bubbleRef,
|
|
597
552
|
message: currentMessage
|
|
598
|
-
})))
|
|
553
|
+
}))), /*#__PURE__*/_react.default.createElement(_HtmlPro.default, {
|
|
599
554
|
style: {
|
|
600
555
|
width: '100vw',
|
|
601
556
|
height: '100vh'
|
|
@@ -620,7 +575,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
620
575
|
onClick: nextLine
|
|
621
576
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
622
577
|
className: "icon-next"
|
|
623
|
-
})))) : null);
|
|
578
|
+
}))))) : null);
|
|
624
579
|
};
|
|
625
580
|
|
|
626
581
|
var _default = DialogComponent;
|
|
@@ -18,13 +18,11 @@ var SpeechBubbleComponent = /*#__PURE__*/_react.default.forwardRef(function (_re
|
|
|
18
18
|
|
|
19
19
|
if (avatarUrl.includes('object')) {
|
|
20
20
|
return avatarUrl.slice(0, idx).concat('/mini-thumbnail.png');
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (avatarUrl.includes('character')) {
|
|
21
|
+
} else if (avatarUrl.includes('character')) {
|
|
24
22
|
return avatarUrl.slice(0, idx).concat('/mini-face.png');
|
|
23
|
+
} else {
|
|
24
|
+
return avatarUrl;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
return avatarUrl;
|
|
28
26
|
};
|
|
29
27
|
|
|
30
28
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -5,15 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.mockScene = exports.mockProps = void 0;
|
|
7
7
|
|
|
8
|
-
var _bg001_street = _interopRequireDefault(require("
|
|
8
|
+
var _bg001_street = _interopRequireDefault(require("components/arcade-render/mocks/scenes/bg001_street.json"));
|
|
9
9
|
|
|
10
|
-
var _characters = require("
|
|
10
|
+
var _characters = require("components/arcade-render/mocks/scenes/characters.json");
|
|
11
11
|
|
|
12
12
|
var _mocker = require("helpers/mocker");
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
/* eslint-disable max-len */
|
|
17
16
|
var animations = {
|
|
18
17
|
neutral: {
|
|
19
18
|
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/5981fca94d82290bcbe957fe/animation/5f06e116f9efdd00112fcc6f/male_missunderstand_1.glb'
|
|
@@ -19,9 +19,9 @@ var _feedbackComponent = _interopRequireDefault(require("../../feedback-componen
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
-
function _getRequireWildcardCache(
|
|
22
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
23
23
|
|
|
24
|
-
function _interopRequireWildcard(obj
|
|
24
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
25
|
|
|
26
26
|
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); }
|
|
27
27
|
|
|
@@ -33,7 +33,7 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
33
33
|
|
|
34
34
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
35
35
|
|
|
36
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly)
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
37
37
|
|
|
38
38
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
39
39
|
|
|
@@ -47,7 +47,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
47
47
|
|
|
48
48
|
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; }
|
|
49
49
|
|
|
50
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
50
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
51
51
|
|
|
52
52
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
53
|
|
|
@@ -101,7 +101,7 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
|
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
(0, _react.useEffect)(function () {
|
|
104
|
-
disableExit(resolvedClass !==
|
|
104
|
+
disableExit(resolvedClass !== "");
|
|
105
105
|
}, [resolvedClass, disableExit]);
|
|
106
106
|
|
|
107
107
|
var intersectRect = function intersectRect(a, b) {
|
|
@@ -363,7 +363,7 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
|
|
|
363
363
|
opacity: 0
|
|
364
364
|
}))) : null)), showTooltip && /*#__PURE__*/_react.default.createElement(_Messages.TooltipHint, {
|
|
365
365
|
translate: translate
|
|
366
|
-
}), resolvedClass !==
|
|
366
|
+
}), resolvedClass !== "" ? /*#__PURE__*/_react.default.createElement(_feedbackComponent.default, {
|
|
367
367
|
text: info.solution[resolvedClass === 'success' ? 'right' : 'wrong'].desc,
|
|
368
368
|
success: resolvedClass === 'success',
|
|
369
369
|
translate: translate,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.TooltipHint = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -18,6 +18,4 @@ var TooltipHint = function TooltipHint(_ref) {
|
|
|
18
18
|
}), /*#__PURE__*/_react.default.createElement("span", null, translate('tooltip.bag')));
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
exports.TooltipHint = TooltipHint;
|
|
22
|
-
var _default = TooltipHint;
|
|
23
|
-
exports.default = _default;
|
|
21
|
+
exports.TooltipHint = TooltipHint;
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.mockProps =
|
|
6
|
+
exports.mockProps = void 0;
|
|
7
7
|
|
|
8
8
|
var _mocker = require("helpers/mocker");
|
|
9
9
|
|
|
10
|
-
/* eslint-disable max-len */
|
|
11
10
|
var mockProps = {
|
|
12
11
|
emitEvent: _mocker.emitEvent,
|
|
13
12
|
soundActions: _mocker.soundActions,
|
|
@@ -69,6 +68,4 @@ var mockProps = {
|
|
|
69
68
|
description: 'description'
|
|
70
69
|
}
|
|
71
70
|
};
|
|
72
|
-
exports.mockProps = mockProps;
|
|
73
|
-
var _default = mockProps;
|
|
74
|
-
exports.default = _default;
|
|
71
|
+
exports.mockProps = mockProps;
|