@gamelearn/arcade-components 1.3.5-1 → 1.3.5-hotfix-compile
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 +3 -9
- package/dist/components/animation-component/mocks/mockForStory.js +9 -16
- package/dist/components/arcade-render/background/scene-elements/index.js +4 -2
- package/dist/components/arcade-render/element/AnimateElement.js +7 -5
- package/dist/components/arcade-render/element/BoundingBox.js +5 -3
- package/dist/components/arcade-render/element/Projection.js +3 -3
- package/dist/components/arcade-render/element/index.js +9 -7
- package/dist/components/arcade-render/elements-list/ClickableArea.js +6 -4
- package/dist/components/arcade-render/elements-list/Poster.js +6 -4
- package/dist/components/arcade-render/elements-list/index.js +8 -5
- package/dist/components/arcade-render/light/index.js +3 -1
- package/dist/components/arcade-render/light/useLight.js +17 -7
- package/dist/components/arcade-render/loading/Loading.js +2 -2
- package/dist/components/arcade-render/loading/LoadingLogic.js +7 -5
- package/dist/components/arcade-render/mocks/index.js +3 -1
- 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 +1 -2
- 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 +5 -3
- package/dist/components/cards-selector-puzzle-component/components/Board/index.js +5 -9
- package/dist/components/cards-selector-puzzle-component/components/Card/index.js +0 -2
- package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +12 -12
- package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +1 -0
- 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 +1 -0
- 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 +5 -2
- package/dist/components/conversational-component/components/ConversationalComponent.js +4 -4
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +16 -19
- package/dist/components/conversational-pro-component/components/Slot.js +0 -2
- package/dist/components/conversational-pro-component/components/SlotList.js +14 -7
- package/dist/components/conversational-pro-component/components/scene/Panel.js +14 -19
- package/dist/components/conversational-pro-component/components/scene/Panels.js +8 -2
- package/dist/components/conversational-pro-component/components/scene/index.js +19 -20
- package/dist/components/conversational-pro-component/mocks/mockForStory.js +92 -91
- 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 +3 -4
- package/dist/components/decision-component/components/DecisionComponent.js +8 -6
- package/dist/components/decision-component/components/Feedback.js +15 -6
- package/dist/components/decision-component/mocks/mockForStory.js +1 -1
- package/dist/components/dialog-component/components/DialogComponent.js +97 -57
- package/dist/components/dialog-component/components/SpeechBubbleComponent.js +5 -3
- package/dist/components/dialog-component/mocks/mockForStory.js +3 -2
- package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +6 -6
- package/dist/components/drag-item-puzzle-component/components/Messages.js +4 -2
- package/dist/components/drag-item-puzzle-component/mocks/mockForStory.js +5 -2
- package/dist/components/feedback-component/components/FeedbackComponent.js +5 -5
- package/dist/components/feedback-component/mocks/mockForStory.js +1 -0
- 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 +2 -1
- package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +5 -5
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +38 -20
- package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +4 -2
- package/dist/components/hanged-puzzle-component/utils.js +10 -2
- package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +9 -5
- 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 +12 -14
- package/dist/components/inventory-item/mocks/mockForStory.js +7 -5
- package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +8 -7
- package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +4 -2
- 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 +6 -4
- package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +79 -28
- package/dist/components/login-puzzle-component/mocks/mockForStory.js +4 -2
- package/dist/components/media-visor/components/MediaVisor.js +13 -13
- package/dist/components/media-visor/mocks/mockForStory.js +6 -2
- package/dist/components/notice-component/components/NoticeComponent.js +3 -2
- package/dist/components/notice-component/mocks/mockForStory.js +4 -2
- package/dist/components/pattern-component/components/PatternComponent.js +1 -1
- package/dist/components/pdf-component/components/PdfComponent.js +9 -7
- package/dist/components/pdf-component/components/PdfVisor.js +11 -10
- package/dist/components/pdf-component/index.js +4 -4
- package/dist/components/pdf-component/mocks/mockForProps.js +1 -0
- 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 +4 -2
- 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 +3 -2
- 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 +5 -2
- package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +84 -110
- package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +1 -0
- package/dist/components/text-click-puzzle-component/utils/index.js +15 -9
- package/dist/components/url-component/components/UrlComponent.js +9 -10
- package/dist/components/url-component/mocks/mockForProps.js +8 -6
- package/dist/components/video-component/components/VideoComponent.js +7 -7
- package/dist/components/video-component/mocks/mockForStory.js +4 -2
- package/dist/components/video-visor/components/VideoControllers/BufferBar.js +3 -3
- package/dist/components/video-visor/components/VideoVisor.js +3 -4
- package/dist/components/video-visor/mocks/mockForStory.js +5 -2
- 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 +6 -7
- package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +7 -2
- package/dist/components/writer-puzzle-component/components/ElectionComponent.js +3 -3
- package/dist/components/writer-puzzle-component/components/FeedbackComponent.js +2 -7
- 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 +9 -44
- package/dist/components/writer-puzzle-component/mocks/mockForStory.js +5 -5
- package/dist/components/zoom-test/components/ZoomTest.js +5 -5
- package/dist/components/zoom-test/mocks/mockForStory.js +6 -4
- package/dist/helpers/deviceDetection.js +1 -1
- package/dist/helpers/drawLOD.js +60 -77
- package/dist/helpers/index.js +9 -8
- package/dist/helpers/lodStats.js +37 -25
- package/dist/helpers/mocker.js +6 -2
- package/dist/helpers/useWindowSize.js +5 -3
- package/dist/test/testSceneWrapper.js +12 -17
- package/package.json +1 -1
- package/dist/helpers/HtmlPro.js +0 -34
|
@@ -15,11 +15,13 @@ var _DecisionBody = _interopRequireDefault(require("./DecisionBody"));
|
|
|
15
15
|
|
|
16
16
|
var _Feedback = _interopRequireDefault(require("./Feedback"));
|
|
17
17
|
|
|
18
|
+
var _excluded = ["emitEvent", "soundActions", "inScene"];
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
23
|
|
|
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; }
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
25
|
|
|
24
26
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
25
27
|
|
|
@@ -29,7 +31,7 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
29
31
|
|
|
30
32
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
31
33
|
|
|
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; }
|
|
34
|
+
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; }
|
|
33
35
|
|
|
34
36
|
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; }
|
|
35
37
|
|
|
@@ -43,7 +45,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
43
45
|
|
|
44
46
|
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; }
|
|
45
47
|
|
|
46
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
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; }
|
|
47
49
|
|
|
48
50
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
51
|
|
|
@@ -55,7 +57,7 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
55
57
|
var emitEvent = _ref.emitEvent,
|
|
56
58
|
soundActions = _ref.soundActions,
|
|
57
59
|
inScene = _ref.inScene,
|
|
58
|
-
props = _objectWithoutProperties(_ref,
|
|
60
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
59
61
|
|
|
60
62
|
var _props$inheritProps = props.inheritProps,
|
|
61
63
|
inheritProps = _props$inheritProps === void 0 ? {} : _props$inheritProps,
|
|
@@ -95,7 +97,7 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
95
97
|
var listProps = _objectSpread(_objectSpread({}, inheritProps), {}, {
|
|
96
98
|
slots: inheritProps.slots ? inheritProps.slots : inheritProps.characters,
|
|
97
99
|
currentMessage: {
|
|
98
|
-
position:
|
|
100
|
+
position: null,
|
|
99
101
|
emotion: ''
|
|
100
102
|
}
|
|
101
103
|
});
|
|
@@ -20,18 +20,27 @@ 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
|
-
|
|
23
|
+
|
|
24
|
+
if (inherited) {
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
26
|
+
className: "conversation--feedback ".concat(!choice.feedback ? 'only--rewards' : '')
|
|
27
|
+
}, children);
|
|
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;
|
|
28
37
|
};
|
|
29
38
|
|
|
30
39
|
var noRewards = rewards.filter(function (reward) {
|
|
31
40
|
return reward.type !== 'grade';
|
|
32
41
|
}).length === 0;
|
|
33
42
|
if (!choice.feedback && noRewards) return null;
|
|
34
|
-
return /*#__PURE__*/_react.default.createElement(Wrapper, null,
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(Wrapper, null, choice.feedback ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
35
44
|
className: "conversation--feedback__title"
|
|
36
45
|
}, "Feedback"), /*#__PURE__*/_react.default.createElement("div", {
|
|
37
46
|
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
|
+
|
|
18
20
|
var _SpeechBubbleComponent = _interopRequireDefault(require("./SpeechBubbleComponent"));
|
|
19
21
|
|
|
20
22
|
var _decisionComponent = _interopRequireDefault(require("../../decision-component"));
|
|
21
23
|
|
|
22
24
|
var _helpers = require("../../../helpers");
|
|
23
25
|
|
|
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() { if (typeof WeakMap !== "function") return null; var
|
|
30
|
+
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); }
|
|
31
31
|
|
|
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; }
|
|
32
|
+
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; }
|
|
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) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
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,13 +51,16 @@ 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 == 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; }
|
|
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
|
+
|
|
61
64
|
var DialogComponent = function DialogComponent(_ref) {
|
|
62
65
|
var _currentLine$audio3, _currentLine$audio4;
|
|
63
66
|
|
|
@@ -85,14 +88,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
85
88
|
inScene: false,
|
|
86
89
|
thinkful: false,
|
|
87
90
|
voiceOver: false,
|
|
88
|
-
avatar: ''
|
|
91
|
+
avatar: '',
|
|
92
|
+
show: false
|
|
89
93
|
}),
|
|
90
94
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
91
95
|
currentMessage = _useState6[0],
|
|
92
96
|
setCurrentMessage = _useState6[1];
|
|
93
97
|
|
|
94
|
-
var emitRef = (0, _react.useRef)(emitEvent);
|
|
95
|
-
|
|
96
98
|
var _useThree = (0, _fiber.useThree)(function (state) {
|
|
97
99
|
return [state.camera, state.scene];
|
|
98
100
|
}),
|
|
@@ -100,6 +102,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
100
102
|
camera = _useThree2[0],
|
|
101
103
|
scene = _useThree2[1];
|
|
102
104
|
|
|
105
|
+
var changedMats = (0, _react.useRef)([]);
|
|
103
106
|
var loader = (0, _react.useMemo)(function () {
|
|
104
107
|
return new _GLTFLoader.GLTFLoader();
|
|
105
108
|
}, []);
|
|
@@ -121,11 +124,11 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
121
124
|
var lastLine = lines[line - 1];
|
|
122
125
|
var lastSet = (0, _react.useRef)(false);
|
|
123
126
|
var translate = (0, _react.useCallback)(function (id) {
|
|
124
|
-
return
|
|
127
|
+
return emitEvent({
|
|
125
128
|
type: 'translate',
|
|
126
129
|
payload: id
|
|
127
130
|
});
|
|
128
|
-
}, []);
|
|
131
|
+
}, [emitEvent]);
|
|
129
132
|
var getVoice = (0, _react.useCallback)(function (_ref2) {
|
|
130
133
|
var id = _ref2.id,
|
|
131
134
|
_ref2$type = _ref2.type,
|
|
@@ -135,7 +138,9 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
135
138
|
|
|
136
139
|
if (type === 'base') {
|
|
137
140
|
return usedVoices === null || usedVoices === void 0 ? void 0 : usedVoices[id];
|
|
138
|
-
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (type === 'character') {
|
|
139
144
|
var _gameChars$id;
|
|
140
145
|
|
|
141
146
|
return gameChars === null || gameChars === void 0 ? void 0 : (_gameChars$id = gameChars[id]) === null || _gameChars$id === void 0 ? void 0 : _gameChars$id.voiceId;
|
|
@@ -144,13 +149,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
144
149
|
return null;
|
|
145
150
|
}, [translate]);
|
|
146
151
|
var playSpeech = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
147
|
-
var payload
|
|
152
|
+
var payload;
|
|
148
153
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
149
154
|
while (1) {
|
|
150
155
|
switch (_context.prev = _context.next) {
|
|
151
156
|
case 0:
|
|
152
157
|
if (!currentLine.voice.id) {
|
|
153
|
-
_context.next =
|
|
158
|
+
_context.next = 5;
|
|
154
159
|
break;
|
|
155
160
|
}
|
|
156
161
|
|
|
@@ -160,27 +165,23 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
160
165
|
};
|
|
161
166
|
|
|
162
167
|
if (!(payload.voiceId && payload.text)) {
|
|
163
|
-
_context.next =
|
|
168
|
+
_context.next = 5;
|
|
164
169
|
break;
|
|
165
170
|
}
|
|
166
171
|
|
|
167
172
|
_context.next = 5;
|
|
168
|
-
return
|
|
173
|
+
return emitEvent({
|
|
169
174
|
type: 'playSpeech',
|
|
170
175
|
payload: payload
|
|
171
176
|
});
|
|
172
177
|
|
|
173
178
|
case 5:
|
|
174
|
-
speechUrl = _context.sent;
|
|
175
|
-
playSound(speechUrl);
|
|
176
|
-
|
|
177
|
-
case 7:
|
|
178
179
|
case "end":
|
|
179
180
|
return _context.stop();
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
183
|
}, _callee);
|
|
183
|
-
})), [currentLine.voice, getVoice, currentMessage.text,
|
|
184
|
+
})), [currentLine === null || currentLine === void 0 ? void 0 : currentLine.voice, getVoice, currentMessage.text, emitEvent]);
|
|
184
185
|
var getCurrentVisible = (0, _react.useCallback)(function (uid) {
|
|
185
186
|
var object;
|
|
186
187
|
scene.traverseVisible(function (node) {
|
|
@@ -207,10 +208,10 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
207
208
|
|
|
208
209
|
var onLoadAnim = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
|
|
209
210
|
var animation = (_slot$character2 = slot.character) === null || _slot$character2 === void 0 ? void 0 : _slot$character2.resource.animations[slot.emotion];
|
|
211
|
+
var mixer = element.userData.mixer;
|
|
210
212
|
|
|
211
|
-
if (animation) {
|
|
212
|
-
|
|
213
|
-
loader.load(animation === null || animation === void 0 ? void 0 : animation.url, function (anim) {
|
|
213
|
+
if (animation && animation.url) {
|
|
214
|
+
loader.load(animation.url, function (anim) {
|
|
214
215
|
var emotionClip = anim.animations[0];
|
|
215
216
|
var defaultClip = element.userData.defaultAnim;
|
|
216
217
|
var emotionAction = mixer.clipAction(emotionClip, element);
|
|
@@ -223,6 +224,8 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
223
224
|
element.userData.currentEmotion = emotionAction;
|
|
224
225
|
onLoadAnim(mixer, emotionAction, defaultAction);
|
|
225
226
|
});
|
|
227
|
+
} else {
|
|
228
|
+
onLoadAnim();
|
|
226
229
|
}
|
|
227
230
|
}, [loader]); // Reset currentEmotion to defaultAnim
|
|
228
231
|
|
|
@@ -292,12 +295,11 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
292
295
|
camera.copy(defaultCamera.current);
|
|
293
296
|
}, currentLine.decision ? 0 : 1200);
|
|
294
297
|
}
|
|
295
|
-
}, [camera, currentLine.decision, emitEvent, line, lines.length, resetAnims, resetCameraView]); // Position bubble over talking character/and switch emotions
|
|
298
|
+
}, [camera, currentLine === null || currentLine === void 0 ? void 0 : currentLine.decision, emitEvent, line, lines.length, resetAnims, resetCameraView]); // Position bubble over talking character/and switch emotions
|
|
296
299
|
|
|
297
300
|
(0, _react.useEffect)(function () {
|
|
298
301
|
if (currentLine.decision) {
|
|
299
302
|
resetCameraView();
|
|
300
|
-
return;
|
|
301
303
|
} else if (currentLine.voiceOver) {
|
|
302
304
|
resetCameraView();
|
|
303
305
|
setCurrentMessage({
|
|
@@ -307,7 +309,8 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
307
309
|
inScene: false,
|
|
308
310
|
voiceOver: true,
|
|
309
311
|
thinkful: false,
|
|
310
|
-
avatar: ''
|
|
312
|
+
avatar: '',
|
|
313
|
+
show: true
|
|
311
314
|
});
|
|
312
315
|
} else if (!lastSet.current) {
|
|
313
316
|
var talkingCharacter = currentLine.slots.find(function (slot) {
|
|
@@ -325,7 +328,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
325
328
|
loadEmotion(slot, element, function (mixer, action, defaultAction) {
|
|
326
329
|
var startAction = element.userData.lastEmotion ? element.userData.lastEmotion : defaultAction;
|
|
327
330
|
|
|
328
|
-
if (startAction !== action) {
|
|
331
|
+
if (startAction && action && startAction !== action) {
|
|
329
332
|
mixer.stopAllAction();
|
|
330
333
|
(0, _helpers.executeCrossFade)(startAction, action, crossFadeDuration);
|
|
331
334
|
}
|
|
@@ -343,7 +346,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
343
346
|
loadEmotion(talkingCharacter, element, function (mixer, action, defaultAction) {
|
|
344
347
|
var startAction = element.userData.lastEmotion ? element.userData.lastEmotion : defaultAction;
|
|
345
348
|
|
|
346
|
-
if (startAction !== action) {
|
|
349
|
+
if (startAction && action && startAction !== action) {
|
|
347
350
|
mixer.stopAllAction();
|
|
348
351
|
(0, _helpers.executeCrossFade)(startAction, action, crossFadeDuration);
|
|
349
352
|
} // Ugly timeout to wait an animation transition
|
|
@@ -356,7 +359,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
356
359
|
head.getWorldPosition(target.position);
|
|
357
360
|
target.applyQuaternion(camera.quaternion);
|
|
358
361
|
target.translateX(1.25);
|
|
359
|
-
target.translateY(
|
|
362
|
+
target.translateY(2);
|
|
360
363
|
messagePosition.current = {
|
|
361
364
|
pos: target.position.toArray(),
|
|
362
365
|
child: head,
|
|
@@ -377,7 +380,8 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
377
380
|
left: true,
|
|
378
381
|
inScene: true,
|
|
379
382
|
thinkful: talkingCharacter.emotion === 'thinkful',
|
|
380
|
-
avatar: ''
|
|
383
|
+
avatar: '',
|
|
384
|
+
show: true
|
|
381
385
|
});
|
|
382
386
|
}, zoomInActor ? 1200 : 0);
|
|
383
387
|
}
|
|
@@ -393,9 +397,15 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
393
397
|
left: false,
|
|
394
398
|
inScene: false,
|
|
395
399
|
thinkful: talkingCharacter.emotion === 'thinkful',
|
|
396
|
-
avatar: getAvatarURL(talkingCharacter)
|
|
400
|
+
avatar: getAvatarURL(talkingCharacter),
|
|
401
|
+
show: true
|
|
397
402
|
});
|
|
398
403
|
}
|
|
404
|
+
} else {
|
|
405
|
+
resetCameraView();
|
|
406
|
+
setCurrentMessage({
|
|
407
|
+
show: true
|
|
408
|
+
});
|
|
399
409
|
}
|
|
400
410
|
}
|
|
401
411
|
}, [actors, camera, currentLine, zoomInActor, getCurrentVisible, translate, getAvatarURL, loadEmotion, resetAnims, resetCameraView]); // Sound logic
|
|
@@ -422,8 +432,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
422
432
|
if (autoPlay) {
|
|
423
433
|
if (line >= lines.length - 1 && automatic) {
|
|
424
434
|
setAutomatic(false);
|
|
425
|
-
} else if (automatic && currentMessage.
|
|
426
|
-
var time =
|
|
435
|
+
} else if (automatic && currentMessage.show && !currentLine.decision) {
|
|
436
|
+
var time = 0;
|
|
437
|
+
|
|
438
|
+
if (currentMessage.text) {
|
|
439
|
+
time = 75 * (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.text.length);
|
|
440
|
+
}
|
|
441
|
+
|
|
427
442
|
timeout = setTimeout(function () {
|
|
428
443
|
nextLine();
|
|
429
444
|
}, time < 1400 ? 1400 : time);
|
|
@@ -433,7 +448,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
433
448
|
return function () {
|
|
434
449
|
if (timeout) clearTimeout(timeout);
|
|
435
450
|
};
|
|
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
|
|
451
|
+
}, [currentMessage, nextLine, autoPlay, lines.length, automatic, line, currentLine === null || currentLine === void 0 ? void 0 : 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
|
|
437
452
|
|
|
438
453
|
var checkBubblePosition = (0, _react.useCallback)(function () {
|
|
439
454
|
if (bubbleRef.current && currentLine.slots) {
|
|
@@ -469,7 +484,8 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
469
484
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
470
485
|
left: false,
|
|
471
486
|
inScene: !completeOutside,
|
|
472
|
-
avatar: getAvatarURL(talkingCharacter)
|
|
487
|
+
avatar: getAvatarURL(talkingCharacter),
|
|
488
|
+
show: true
|
|
473
489
|
});
|
|
474
490
|
});
|
|
475
491
|
}
|
|
@@ -477,38 +493,57 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
477
493
|
bubbleRef.current.parentNode.style.transform = '';
|
|
478
494
|
}
|
|
479
495
|
}
|
|
480
|
-
}, [camera.quaternion, currentLine.slots, currentMessage.inScene, getAvatarURL]);
|
|
496
|
+
}, [camera.quaternion, currentLine === null || currentLine === void 0 ? void 0 : currentLine.slots, currentMessage.inScene, getAvatarURL]);
|
|
481
497
|
(0, _react.useEffect)(function () {
|
|
482
498
|
checkBubblePosition();
|
|
483
499
|
}, [checkBubblePosition]); // Animate Camera
|
|
484
500
|
|
|
485
501
|
(0, _fiber.useFrame)(function (_ref4, delta) {
|
|
486
|
-
var
|
|
502
|
+
var cam = _ref4.camera;
|
|
487
503
|
|
|
488
504
|
if (animationStart.current) {
|
|
489
505
|
var targetPosition = messagePosition.current.child ? messagePosition.current.pos : defaultCamera.current.position.toArray();
|
|
490
506
|
animationTarget.current.position.fromArray(targetPosition);
|
|
491
507
|
|
|
492
508
|
if (messagePosition.current.parent) {
|
|
493
|
-
if (!animationTarget.current.quaternion.equals(
|
|
494
|
-
animationTarget.current.applyQuaternion(
|
|
509
|
+
if (!animationTarget.current.quaternion.equals(cam.quaternion)) {
|
|
510
|
+
animationTarget.current.applyQuaternion(cam.quaternion);
|
|
495
511
|
}
|
|
496
512
|
|
|
497
|
-
animationTarget.current.translateX(
|
|
513
|
+
animationTarget.current.translateX(10);
|
|
498
514
|
animationTarget.current.translateY(-5);
|
|
499
515
|
animationTarget.current.translateZ(30);
|
|
500
516
|
}
|
|
501
517
|
|
|
502
|
-
if (animationTarget.current.position.distanceTo(
|
|
518
|
+
if (animationTarget.current.position.distanceTo(cam.position) < 1) {
|
|
503
519
|
animationStart.current = false;
|
|
520
|
+
raycast.set(cam.getWorldPosition(new _three.Vector3(0, 0, 0)), cam.getWorldDirection(new _three.Vector3()));
|
|
521
|
+
var objects = raycast.intersectObjects(scene.children, true);
|
|
522
|
+
changedMats.current = objects.filter(function (o) {
|
|
523
|
+
return o.distance < 10;
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
if (changedMats.current.length) {
|
|
527
|
+
changedMats.current.forEach(function (o) {
|
|
528
|
+
var object = o.object;
|
|
529
|
+
object.material.visible = false;
|
|
530
|
+
});
|
|
531
|
+
}
|
|
504
532
|
|
|
505
533
|
if (lastSet.current || !messagePosition.current.child) {
|
|
506
|
-
|
|
534
|
+
cam.copy(defaultCamera.current);
|
|
507
535
|
}
|
|
508
536
|
|
|
509
537
|
checkBubblePosition();
|
|
510
538
|
} else {
|
|
511
|
-
|
|
539
|
+
if (changedMats.current.length) {
|
|
540
|
+
changedMats.current.forEach(function (o) {
|
|
541
|
+
var object = o.object;
|
|
542
|
+
object.material.visible = true;
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
cam.position.lerp(animationTarget.current.position, delta * 2.5);
|
|
512
547
|
}
|
|
513
548
|
}
|
|
514
549
|
});
|
|
@@ -519,7 +554,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
519
554
|
disableBackground: true
|
|
520
555
|
},
|
|
521
556
|
onFinish: nextLine,
|
|
522
|
-
emitEvent:
|
|
557
|
+
emitEvent: emitEvent,
|
|
523
558
|
soundActions: soundActions
|
|
524
559
|
});
|
|
525
560
|
|
|
@@ -528,18 +563,23 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
528
563
|
height: '100vh',
|
|
529
564
|
position: 'static'
|
|
530
565
|
};
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
566
|
+
|
|
567
|
+
if (currentLine.decision) {
|
|
568
|
+
return /*#__PURE__*/_react.default.createElement(_arcadeThreeCore.HtmlPro, {
|
|
569
|
+
zIndexRange: [3, 3],
|
|
570
|
+
style: cleanStyle,
|
|
571
|
+
calculatePosition: function calculatePosition() {
|
|
572
|
+
return [0, 0];
|
|
573
|
+
}
|
|
574
|
+
}, /*#__PURE__*/_react.default.createElement(_decisionComponent.default, _extends({
|
|
575
|
+
inScene: true
|
|
576
|
+
}, decisionPayload)));
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, currentMessage.text ? /*#__PURE__*/_react.default.createElement("group", {
|
|
540
580
|
ref: groupRef,
|
|
541
581
|
position: messagePosition.current.pos
|
|
542
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
582
|
+
}, /*#__PURE__*/_react.default.createElement(_arcadeThreeCore.HtmlPro, {
|
|
543
583
|
zIndexRange: [2, 2],
|
|
544
584
|
calculatePosition: currentMessage.inScene ? undefined : function () {
|
|
545
585
|
return [0, 0];
|
|
@@ -550,7 +590,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
550
590
|
}, /*#__PURE__*/_react.default.createElement(_SpeechBubbleComponent.default, {
|
|
551
591
|
ref: bubbleRef,
|
|
552
592
|
message: currentMessage
|
|
553
|
-
}))), /*#__PURE__*/_react.default.createElement(
|
|
593
|
+
}))) : null, currentMessage.show ? /*#__PURE__*/_react.default.createElement(_arcadeThreeCore.HtmlPro, {
|
|
554
594
|
style: {
|
|
555
595
|
width: '100vw',
|
|
556
596
|
height: '100vh'
|
|
@@ -575,7 +615,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
575
615
|
onClick: nextLine
|
|
576
616
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
577
617
|
className: "icon-next"
|
|
578
|
-
}))))
|
|
618
|
+
})))) : null);
|
|
579
619
|
};
|
|
580
620
|
|
|
581
621
|
var _default = DialogComponent;
|
|
@@ -18,11 +18,13 @@ 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
|
-
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (avatarUrl.includes('character')) {
|
|
22
24
|
return avatarUrl.slice(0, idx).concat('/mini-face.png');
|
|
23
|
-
} else {
|
|
24
|
-
return avatarUrl;
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
return avatarUrl;
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -5,14 +5,15 @@ 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("test/mocks/bg001_street.json"));
|
|
9
9
|
|
|
10
|
-
var _characters = require("
|
|
10
|
+
var _characters = require("test/mocks/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 */
|
|
16
17
|
var animations = {
|
|
17
18
|
neutral: {
|
|
18
19
|
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() { if (typeof WeakMap !== "function") return null; var
|
|
22
|
+
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
23
|
|
|
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; }
|
|
24
|
+
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
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) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
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 == 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; }
|
|
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.TooltipHint = void 0;
|
|
6
|
+
exports.default = exports.TooltipHint = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -18,4 +18,6 @@ var TooltipHint = function TooltipHint(_ref) {
|
|
|
18
18
|
}), /*#__PURE__*/_react.default.createElement("span", null, translate('tooltip.bag')));
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
exports.TooltipHint = TooltipHint;
|
|
21
|
+
exports.TooltipHint = TooltipHint;
|
|
22
|
+
var _default = TooltipHint;
|
|
23
|
+
exports.default = _default;
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.mockProps = void 0;
|
|
6
|
+
exports.mockProps = exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
var _mocker = require("helpers/mocker");
|
|
9
9
|
|
|
10
|
+
/* eslint-disable max-len */
|
|
10
11
|
var mockProps = {
|
|
11
12
|
emitEvent: _mocker.emitEvent,
|
|
12
13
|
soundActions: _mocker.soundActions,
|
|
@@ -68,4 +69,6 @@ var mockProps = {
|
|
|
68
69
|
description: 'description'
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
|
-
exports.mockProps = mockProps;
|
|
72
|
+
exports.mockProps = mockProps;
|
|
73
|
+
var _default = mockProps;
|
|
74
|
+
exports.default = _default;
|