@gamelearn/arcade-components 2.27.0 → 2.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/animation-component/components/AnimationComponent.js +10 -28
- package/dist/components/animation-component/index.js +0 -3
- package/dist/components/animation-component/mocks/mockForStory.js +0 -3
- package/dist/components/auto-evaluation-component/components/AutoEvaluation.js +30 -71
- package/dist/components/auto-evaluation-component/components/EndScreen.js +1 -9
- package/dist/components/auto-evaluation-component/components/StartScreen.js +2 -6
- package/dist/components/auto-evaluation-component/index.js +0 -3
- package/dist/components/auto-evaluation-component/mocks/mockForStory.js +0 -2
- package/dist/components/cards-selector-puzzle-component/components/Board/index.js +23 -55
- package/dist/components/cards-selector-puzzle-component/components/Card/index.js +4 -23
- package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +41 -92
- package/dist/components/cards-selector-puzzle-component/index.js +0 -3
- package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +4 -10
- package/dist/components/cartel-component/components/CartelComponent.js +16 -42
- package/dist/components/cartel-component/index.js +0 -3
- package/dist/components/chained-image-click-puzzle-component/components/ChainedImageClickPuzzleComponent.js +20 -38
- package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +25 -64
- package/dist/components/chained-image-click-puzzle-component/index.js +0 -3
- package/dist/components/chained-image-click-puzzle-component/mocks/mockForStory.js +1 -2
- package/dist/components/comic-component/components/ComicComponent.js +37 -81
- package/dist/components/comic-component/components/Slide.js +2 -7
- package/dist/components/comic-component/components/Vignette.js +7 -23
- package/dist/components/comic-component/index.js +0 -3
- package/dist/components/comic-component/mocks/mockForStory.js +1 -2
- package/dist/components/conversational-component/components/ConversationalComponent.js +15 -39
- package/dist/components/conversational-component/index.js +0 -3
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +54 -137
- package/dist/components/conversational-pro-component/components/Message.js +1 -9
- package/dist/components/conversational-pro-component/components/Slot.js +3 -20
- package/dist/components/conversational-pro-component/components/SlotList.js +16 -40
- package/dist/components/conversational-pro-component/components/scene/Panel.js +12 -54
- package/dist/components/conversational-pro-component/components/scene/Panels.js +10 -17
- package/dist/components/conversational-pro-component/components/scene/index.js +11 -30
- package/dist/components/conversational-pro-component/index.js +0 -3
- package/dist/components/conversational-pro-component/mocks/mockForStory.js +1 -2
- package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +35 -89
- package/dist/components/cracker-puzzle-component/components/DrawGrid/index.js +3 -7
- package/dist/components/cracker-puzzle-component/components/DrawItem/index.js +4 -9
- package/dist/components/cracker-puzzle-component/components/DrawRow/index.js +4 -9
- package/dist/components/cracker-puzzle-component/components/helpers.js +15 -55
- package/dist/components/cracker-puzzle-component/index.js +0 -3
- package/dist/components/cracker-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/decision-component/components/DecisionBody.js +26 -48
- package/dist/components/decision-component/components/DecisionComponent.js +22 -70
- package/dist/components/decision-component/components/Feedback.js +2 -11
- package/dist/components/decision-component/components/Options.js +12 -31
- package/dist/components/decision-component/index.js +0 -3
- package/dist/components/decision-component/mocks/mockForStory.js +0 -2
- package/dist/components/dialog-component/components/BubbleWrapper.js +1 -7
- package/dist/components/dialog-component/components/DialogComponent.js +118 -338
- package/dist/components/dialog-component/components/DialogDecision.js +3 -13
- package/dist/components/dialog-component/components/SpeechBubbleComponent.js +6 -24
- package/dist/components/dialog-component/index.js +0 -3
- package/dist/components/dialog-component/mocks/mockForStory.js +1 -5
- package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +34 -90
- package/dist/components/drag-item-puzzle-component/components/Messages.js +0 -4
- package/dist/components/drag-item-puzzle-component/index.js +0 -3
- package/dist/components/drag-item-puzzle-component/mocks/mockForStory.js +1 -2
- package/dist/components/feedback-component/components/FeedbackComponent.js +34 -52
- package/dist/components/feedback-component/index.js +0 -3
- package/dist/components/feedback-component/mocks/mockForStory.js +1 -2
- package/dist/components/frame-click-puzzle-component/components/Counter/index.js +3 -8
- package/dist/components/frame-click-puzzle-component/components/CurrentFramePuzzle.js +36 -68
- package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +33 -68
- package/dist/components/frame-click-puzzle-component/components/Tooltip/index.js +0 -6
- package/dist/components/frame-click-puzzle-component/index.js +0 -3
- package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +1 -2
- package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +29 -69
- package/dist/components/hacker-puzzle-component/index.js +0 -3
- package/dist/components/hacker-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +48 -123
- package/dist/components/hanged-puzzle-component/index.js +0 -3
- package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +0 -3
- package/dist/components/hanged-puzzle-component/utils.js +0 -20
- package/dist/components/image-click-puzzle-component/components/ImageClickPuzzleComponent.js +1 -8
- package/dist/components/image-click-puzzle-component/index.js +0 -3
- package/dist/components/image-click-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/image-click-wrapper-component/components/CountDown/index.js +0 -4
- package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +67 -134
- package/dist/components/image-click-wrapper-component/components/TimerDialog/index.js +2 -6
- package/dist/components/image-click-wrapper-component/index.js +0 -3
- package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +0 -2
- package/dist/components/image-component/components/ImageComponent.js +14 -33
- package/dist/components/image-component/index.js +0 -3
- package/dist/components/image-component/mocks/mockForStory.js +0 -2
- package/dist/components/index.js +0 -39
- package/dist/components/inventory-item/components/InventoryItem.js +9 -35
- package/dist/components/inventory-item/index.js +0 -3
- package/dist/components/inventory-item/mocks/mockForStory.js +0 -3
- package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +33 -75
- package/dist/components/keyboard-puzzle-component/index.js +0 -3
- package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/konva-components/Area/index.js +15 -44
- package/dist/components/konva-components/KonvaMapper.js +19 -42
- package/dist/components/lectures-component/components/LectureButtons.js +12 -13
- package/dist/components/lectures-component/components/LecturesComponent.js +29 -55
- package/dist/components/lectures-component/index.js +0 -3
- package/dist/components/lectures-component/mocks/mockForStory.js +6 -9
- package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +38 -80
- package/dist/components/login-puzzle-component/index.js +0 -3
- package/dist/components/login-puzzle-component/mocks/mockForStory.js +0 -2
- package/dist/components/notice-component/components/NoticeComponent.js +8 -21
- package/dist/components/notice-component/index.js +0 -3
- package/dist/components/notice-component/mocks/mockForStory.js +0 -2
- package/dist/components/pattern-component/components/PatternComponent.js +8 -24
- package/dist/components/pattern-component/index.js +0 -3
- package/dist/components/pattern-component/mocks/mockForStory.js +0 -2
- package/dist/components/pdf-component/components/PdfComponent.js +23 -55
- package/dist/components/pdf-component/components/PdfVisor.js +22 -58
- package/dist/components/pdf-component/index.js +0 -3
- package/dist/components/pdf-component/mocks/mockForProps.js +1 -2
- package/dist/components/referral-component/components/EmailPill.js +2 -6
- package/dist/components/referral-component/components/ReferralComponent.js +30 -59
- package/dist/components/referral-component/components/StepOne.js +14 -48
- package/dist/components/referral-component/components/StepTwo.js +8 -23
- package/dist/components/referral-component/index.js +0 -3
- package/dist/components/referral-component/mocks/mockForStory.js +0 -2
- package/dist/components/survey-component/components/ApplicableBox.js +8 -15
- package/dist/components/survey-component/components/OpinionBox.js +8 -15
- package/dist/components/survey-component/components/SurveyComponent.js +13 -40
- package/dist/components/survey-component/components/TextBox.js +7 -13
- package/dist/components/survey-component/index.js +0 -3
- package/dist/components/survey-component/mocks/mockForStory.js +0 -2
- package/dist/components/terminal-puzzle-component/components/FilesGroup/Item.js +1 -6
- package/dist/components/terminal-puzzle-component/components/FilesGroup/index.js +4 -10
- package/dist/components/terminal-puzzle-component/components/Image/index.js +2 -6
- package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +26 -65
- package/dist/components/terminal-puzzle-component/components/Visor/index.js +15 -35
- package/dist/components/terminal-puzzle-component/components/utils/index.js +0 -3
- package/dist/components/terminal-puzzle-component/index.js +0 -3
- package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +1 -2
- package/dist/components/test-component/components/Container.js +26 -60
- package/dist/components/test-component/components/Feedbacks.js +3 -13
- package/dist/components/test-component/components/Questions.js +11 -45
- package/dist/components/test-component/components/Results.js +28 -52
- package/dist/components/test-component/components/TestComponent.js +59 -110
- package/dist/components/test-component/index.js +0 -3
- package/dist/components/test-component/mocks/mockForStory.js +4 -8
- package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +58 -95
- package/dist/components/text-click-puzzle-component/index.js +0 -3
- package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +1 -2
- package/dist/components/text-click-puzzle-component/utils/index.js +6 -31
- package/dist/components/url-component/components/UrlComponent.js +16 -34
- package/dist/components/url-component/index.js +0 -3
- package/dist/components/url-component/mocks/mockForProps.js +0 -2
- package/dist/components/video-component/components/VideoComponent.js +11 -25
- package/dist/components/video-component/index.js +0 -3
- package/dist/components/video-component/mocks/mockForStory.js +0 -2
- package/dist/components/video-visor/components/VideoControllers/BufferBar.js +10 -37
- package/dist/components/video-visor/components/VideoControllers/ControlButtons.js +2 -6
- package/dist/components/video-visor/components/VideoControllers/FinishedVideoButtons.js +1 -5
- package/dist/components/video-visor/components/VideoControllers/PlayInitButton.js +2 -8
- package/dist/components/video-visor/components/VideoControllers/SkipButton.js +5 -9
- package/dist/components/video-visor/components/VideoControllers/Timer.js +0 -5
- package/dist/components/video-visor/components/VideoControllers/VolumeBar.js +4 -20
- package/dist/components/video-visor/components/VideoControllers/index.js +17 -29
- package/dist/components/video-visor/components/VideoVisor.js +38 -92
- package/dist/components/video-visor/index.js +0 -3
- package/dist/components/video-visor/mocks/mockForStory.js +1 -2
- package/dist/components/web-builder-puzzle-component/Popups/PopupColorComponent/index.js +11 -28
- package/dist/components/web-builder-puzzle-component/Popups/PopupImageComponent/index.js +10 -27
- package/dist/components/web-builder-puzzle-component/Popups/PopupTextComponent/index.js +13 -36
- package/dist/components/web-builder-puzzle-component/Popups/index.js +0 -4
- package/dist/components/web-builder-puzzle-component/Templates/Facebook.js +0 -2
- package/dist/components/web-builder-puzzle-component/components/EditButton/index.js +1 -5
- package/dist/components/web-builder-puzzle-component/components/Feedback/index.js +3 -7
- package/dist/components/web-builder-puzzle-component/components/PublishButton/index.js +1 -5
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/BankBody.js +5 -12
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/FacebookBody.js +5 -11
- package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/index.js +0 -7
- package/dist/components/web-builder-puzzle-component/components/WebBuilderFront/index.js +5 -14
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/BankHeader.js +5 -13
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/FacebookHeader.js +3 -8
- package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/index.js +3 -10
- package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +47 -112
- package/dist/components/web-builder-puzzle-component/components/WebBuilderTopBar/index.js +3 -9
- package/dist/components/web-builder-puzzle-component/index.js +0 -3
- package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +0 -3
- package/dist/components/writer-puzzle-component/components/ElectionComponent.js +13 -30
- package/dist/components/writer-puzzle-component/components/FeedbackComponent.js +14 -30
- package/dist/components/writer-puzzle-component/components/FeedbackElement.js +2 -6
- package/dist/components/writer-puzzle-component/components/FinishedTextComponent.js +1 -6
- package/dist/components/writer-puzzle-component/components/FixedComponent.js +17 -52
- package/dist/components/writer-puzzle-component/components/SingleElection.js +13 -41
- package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +63 -145
- package/dist/components/writer-puzzle-component/index.js +0 -3
- package/dist/components/writer-puzzle-component/mocks/mockForStory.js +10 -7
- package/dist/components/zoom-test/components/ZoomTest.js +7 -25
- package/dist/components/zoom-test/index.js +0 -3
- package/dist/components/zoom-test/mocks/mockForStory.js +0 -4
- package/dist/helpers/LangIsRtl.js +0 -4
- package/dist/helpers/LightSet.js +0 -4
- package/dist/helpers/LodController.js +1 -10
- package/dist/helpers/deviceDetection.js +2 -5
- package/dist/helpers/drawLOD.js +11 -53
- package/dist/helpers/index.js +73 -102
- package/dist/helpers/lodStats.js +2 -10
- package/dist/helpers/mocker.js +1 -20
- package/dist/helpers/useEkho.js +64 -91
- package/dist/helpers/useGLB.js +5 -13
- package/dist/helpers/useStateMachine.js +257 -0
- package/dist/helpers/useTimeout.js +0 -6
- package/dist/helpers/useWindowSize.js +8 -22
- package/dist/index.js +0 -2
- package/dist/test/testSceneWrapper.js +0 -8
- package/package.json +3 -2
|
@@ -4,24 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var Message = function Message(_ref) {
|
|
13
10
|
var _current$emotion, _current$emotion2;
|
|
14
|
-
|
|
15
11
|
var current = _ref.current,
|
|
16
|
-
|
|
12
|
+
translate = _ref.translate;
|
|
17
13
|
var currentText = current.text;
|
|
18
|
-
|
|
19
14
|
var VoiceOver = function VoiceOver() {
|
|
20
15
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
21
16
|
className: "conversation--voice__over"
|
|
22
17
|
}, /*#__PURE__*/_react.default.createElement("span", null, current.name ? current.name : 'Voice-Over'));
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
var ThinkFul = function ThinkFul() {
|
|
26
20
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
21
|
className: "conversation--voice__over"
|
|
@@ -29,14 +23,12 @@ var Message = function Message(_ref) {
|
|
|
29
23
|
className: "icon-bubble-thinkful-black"
|
|
30
24
|
}), /*#__PURE__*/_react.default.createElement("span", null, "[", translate('emotion.thinking'), "]"));
|
|
31
25
|
};
|
|
32
|
-
|
|
33
26
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
27
|
className: "conversation--message ".concat(current.voiceOver || current !== null && current !== void 0 && (_current$emotion = current.emotion) !== null && _current$emotion !== void 0 && _current$emotion.includes('think') ? 'voice--over' : '')
|
|
35
28
|
}, current.voiceOver ? /*#__PURE__*/_react.default.createElement(VoiceOver, null) : null, current !== null && current !== void 0 && (_current$emotion2 = current.emotion) !== null && _current$emotion2 !== void 0 && _current$emotion2.includes('think') ? /*#__PURE__*/_react.default.createElement(ThinkFul, null) : null, /*#__PURE__*/_react.default.createElement("span", {
|
|
36
29
|
className: "conversation--main__text"
|
|
37
30
|
}, currentText));
|
|
38
31
|
};
|
|
39
|
-
|
|
40
32
|
Message.defaultProps = {
|
|
41
33
|
current: {},
|
|
42
34
|
voiceOver: false
|
|
@@ -4,65 +4,49 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
var Slot = function Slot(_ref) {
|
|
15
11
|
var _character$resource;
|
|
16
|
-
|
|
17
12
|
var character = _ref.character,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
active = _ref.active,
|
|
14
|
+
slot = _ref.slot,
|
|
15
|
+
lowQuality = _ref.lowQuality;
|
|
21
16
|
var isImage = character.type === 'image';
|
|
22
17
|
var isCharacter = character.type === 'character';
|
|
23
18
|
var isObject = character.type === 'object';
|
|
24
19
|
var imgUrl = character === null || character === void 0 ? void 0 : (_character$resource = character.resource) === null || _character$resource === void 0 ? void 0 : _character$resource.url;
|
|
25
|
-
|
|
26
20
|
var backgroundImage = function backgroundImage() {
|
|
27
21
|
if (isImage) {
|
|
28
22
|
return "url(".concat(imgUrl, ")");
|
|
29
23
|
}
|
|
30
|
-
|
|
31
24
|
if (isCharacter && lowQuality) {
|
|
32
25
|
return "url(".concat(imgUrl.replace('character.glb', 'face.png'), ")");
|
|
33
26
|
}
|
|
34
|
-
|
|
35
27
|
if (isObject && lowQuality) {
|
|
36
28
|
return "url(".concat(imgUrl.replace('object.glb', 'thumbnail.png'), ")");
|
|
37
29
|
}
|
|
38
|
-
|
|
39
30
|
return '';
|
|
40
31
|
};
|
|
41
|
-
|
|
42
32
|
var backgroundSize = function backgroundSize() {
|
|
43
33
|
if (isImage) {
|
|
44
34
|
return 'contain';
|
|
45
35
|
}
|
|
46
|
-
|
|
47
36
|
if (isCharacter || isObject) {
|
|
48
37
|
return 'auto 95%';
|
|
49
38
|
}
|
|
50
|
-
|
|
51
39
|
return '';
|
|
52
40
|
};
|
|
53
|
-
|
|
54
41
|
var backgroundPosition = function backgroundPosition() {
|
|
55
42
|
if (isImage) {
|
|
56
43
|
return 'center';
|
|
57
44
|
}
|
|
58
|
-
|
|
59
45
|
if (isCharacter || isObject) {
|
|
60
46
|
return 'center bottom';
|
|
61
47
|
}
|
|
62
|
-
|
|
63
48
|
return '';
|
|
64
49
|
};
|
|
65
|
-
|
|
66
50
|
var thumbnailsImage = isImage || lowQuality ? {
|
|
67
51
|
backgroundImage: backgroundImage(),
|
|
68
52
|
backgroundRepeat: 'no-repeat',
|
|
@@ -77,7 +61,6 @@ var Slot = function Slot(_ref) {
|
|
|
77
61
|
className: "conversation--character__name"
|
|
78
62
|
}, character.name) : null);
|
|
79
63
|
};
|
|
80
|
-
|
|
81
64
|
Slot.propTypes = {
|
|
82
65
|
character: _propTypes.default.shape({
|
|
83
66
|
name: _propTypes.default.string,
|
|
@@ -1,48 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
8
|
var _Slot = _interopRequireDefault(require("./Slot"));
|
|
13
|
-
|
|
14
9
|
var _scene = _interopRequireDefault(require("./scene"));
|
|
15
|
-
|
|
16
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
|
-
function _extends() { _extends = Object.assign
|
|
23
|
-
|
|
13
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
24
15
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
-
|
|
26
16
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
30
20
|
var SlotList = function SlotList(_ref) {
|
|
31
21
|
var characters = _ref.characters,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
22
|
+
actors = _ref.actors,
|
|
23
|
+
lodSettings = _ref.lodSettings,
|
|
24
|
+
ttsStarted = _ref.ttsStarted,
|
|
25
|
+
currentMessage = _ref.currentMessage,
|
|
26
|
+
flex = _ref.flex,
|
|
27
|
+
slots = _ref.slots,
|
|
28
|
+
children = _ref.children,
|
|
29
|
+
pause = _ref.pause,
|
|
30
|
+
emitEvent = _ref.emitEvent;
|
|
42
31
|
var characterProps = function characterProps(_ref2) {
|
|
43
32
|
var character = _ref2.character,
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
active = _ref2.active,
|
|
34
|
+
slot = _ref2.slot;
|
|
46
35
|
return {
|
|
47
36
|
character: character,
|
|
48
37
|
active: active,
|
|
@@ -50,7 +39,6 @@ var SlotList = function SlotList(_ref) {
|
|
|
50
39
|
slot: slot
|
|
51
40
|
};
|
|
52
41
|
};
|
|
53
|
-
|
|
54
42
|
var currentLOD = (0, _react.useMemo)(function () {
|
|
55
43
|
return emitEvent({
|
|
56
44
|
type: 'currentLod'
|
|
@@ -61,9 +49,7 @@ var SlotList = function SlotList(_ref) {
|
|
|
61
49
|
var actor = actors === null || actors === void 0 ? void 0 : actors.find(function (a) {
|
|
62
50
|
return a.uid === current.uid;
|
|
63
51
|
});
|
|
64
|
-
|
|
65
52
|
var char = _objectSpread({}, current);
|
|
66
|
-
|
|
67
53
|
if (current.character) {
|
|
68
54
|
char.name = current.alias || current.character.name;
|
|
69
55
|
char.resource = char.character.resource;
|
|
@@ -80,7 +66,6 @@ var SlotList = function SlotList(_ref) {
|
|
|
80
66
|
acc.push(char);
|
|
81
67
|
} else if (current.type) {
|
|
82
68
|
var _current$character, _char$character;
|
|
83
|
-
|
|
84
69
|
char.name = current.alias || ((_current$character = current.character) === null || _current$character === void 0 ? void 0 : _current$character.name) || current.name;
|
|
85
70
|
char.resource = ((_char$character = char.character) === null || _char$character === void 0 ? void 0 : _char$character.resource) || current.resource;
|
|
86
71
|
char.position = char.position >= 0 ? char.position : -1;
|
|
@@ -90,7 +75,6 @@ var SlotList = function SlotList(_ref) {
|
|
|
90
75
|
} else if (!flex) {
|
|
91
76
|
acc.push(null);
|
|
92
77
|
}
|
|
93
|
-
|
|
94
78
|
return acc;
|
|
95
79
|
}, []);
|
|
96
80
|
var hasGameChars = gameChars.length && gameChars.some(function (c) {
|
|
@@ -101,7 +85,6 @@ var SlotList = function SlotList(_ref) {
|
|
|
101
85
|
return c.uid === s.uid;
|
|
102
86
|
});
|
|
103
87
|
});
|
|
104
|
-
|
|
105
88
|
var Slots = function Slots() {
|
|
106
89
|
if (hasGameChars) {
|
|
107
90
|
return gameChars.map(function (character, index) {
|
|
@@ -111,7 +94,6 @@ var SlotList = function SlotList(_ref) {
|
|
|
111
94
|
className: "conversation--character__item void ".concat(index)
|
|
112
95
|
});
|
|
113
96
|
}
|
|
114
|
-
|
|
115
97
|
return /*#__PURE__*/_react.default.createElement(_Slot.default, _extends({
|
|
116
98
|
emitEvent: emitEvent,
|
|
117
99
|
key: "".concat(character.uid + index),
|
|
@@ -123,7 +105,6 @@ var SlotList = function SlotList(_ref) {
|
|
|
123
105
|
})));
|
|
124
106
|
});
|
|
125
107
|
}
|
|
126
|
-
|
|
127
108
|
if (flex) {
|
|
128
109
|
return currentChars.map(function (character, index) {
|
|
129
110
|
var active = currentMessage.position === index;
|
|
@@ -136,12 +117,10 @@ var SlotList = function SlotList(_ref) {
|
|
|
136
117
|
})));
|
|
137
118
|
});
|
|
138
119
|
}
|
|
139
|
-
|
|
140
120
|
return slots.length > 0 ? slots.map(function (el, index) {
|
|
141
121
|
var character = characters.find(function (char) {
|
|
142
122
|
return char.uid === el.uid;
|
|
143
123
|
});
|
|
144
|
-
|
|
145
124
|
if (character) {
|
|
146
125
|
var active = currentMessage.position === index;
|
|
147
126
|
character.name = el.alias || character.name;
|
|
@@ -153,14 +132,12 @@ var SlotList = function SlotList(_ref) {
|
|
|
153
132
|
slot: index
|
|
154
133
|
})));
|
|
155
134
|
}
|
|
156
|
-
|
|
157
135
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
158
136
|
key: "".concat(0 + index),
|
|
159
137
|
className: "conversation--character__item void ".concat(index)
|
|
160
138
|
});
|
|
161
139
|
}) : null;
|
|
162
140
|
};
|
|
163
|
-
|
|
164
141
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
165
142
|
className: "conversation--characters"
|
|
166
143
|
}, /*#__PURE__*/_react.default.createElement(_scene.default, {
|
|
@@ -175,7 +152,6 @@ var SlotList = function SlotList(_ref) {
|
|
|
175
152
|
lowQuality: lowQuality
|
|
176
153
|
}), children || /*#__PURE__*/_react.default.createElement(Slots, null));
|
|
177
154
|
};
|
|
178
|
-
|
|
179
155
|
SlotList.defaultProps = {
|
|
180
156
|
characters: [],
|
|
181
157
|
currentMessage: {},
|
|
@@ -1,67 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _fiber = require("@react-three/fiber");
|
|
13
|
-
|
|
14
10
|
var _drei = require("@react-three/drei");
|
|
15
|
-
|
|
16
11
|
var _arcadeThreeCore = require("@gamelearn/arcade-three-core");
|
|
17
|
-
|
|
18
12
|
var _three = require("three");
|
|
19
|
-
|
|
20
13
|
var _helpers = require("../../../../helpers");
|
|
21
|
-
|
|
22
14
|
var _LightSet = _interopRequireDefault(require("../../../../helpers/LightSet"));
|
|
23
|
-
|
|
24
15
|
var _deviceDetection = require("../../../../helpers/deviceDetection");
|
|
25
|
-
|
|
26
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
-
|
|
28
17
|
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); }
|
|
29
|
-
|
|
30
18
|
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; }
|
|
31
|
-
|
|
32
19
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
|
-
|
|
34
20
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
35
|
-
|
|
36
21
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
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; }
|
|
41
|
-
|
|
22
|
+
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; }
|
|
23
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
42
24
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
|
-
|
|
44
25
|
var isMobile = (0, _deviceDetection.DeviceDetection)();
|
|
45
26
|
var defaultCamPos = [0, 14.63, 16];
|
|
46
27
|
var boneWhiteList = ['l_eye_jnt', 'l_eye', 'eye_l', 'head_m'];
|
|
47
|
-
|
|
48
28
|
function Panel(_ref) {
|
|
49
29
|
var _character$resource4, _character$resource6, _character$resource6$, _character$resource6$2, _character$resource7;
|
|
50
|
-
|
|
51
30
|
var character = _ref.character,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
31
|
+
ttsStarted = _ref.ttsStarted,
|
|
32
|
+
active = _ref.active,
|
|
33
|
+
emitEvent = _ref.emitEvent;
|
|
55
34
|
var cameraRef = (0, _react.useRef)(null);
|
|
56
35
|
var sceneRef = (0, _react.useRef)(null);
|
|
57
36
|
var isCharacter = character.type === 'character';
|
|
58
37
|
var ref = (0, _react.useRef)();
|
|
59
|
-
|
|
60
38
|
var _useState = (0, _react.useState)(false),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
talking = _useState2[0],
|
|
41
|
+
setTalking = _useState2[1];
|
|
65
42
|
var currentLOD = (0, _react.useMemo)(function () {
|
|
66
43
|
return emitEvent({
|
|
67
44
|
type: 'currentLod'
|
|
@@ -71,28 +48,22 @@ function Panel(_ref) {
|
|
|
71
48
|
var emotion = (0, _react.useMemo)(function () {
|
|
72
49
|
if (isCharacter) {
|
|
73
50
|
var _character$animation, _character$resource, _character$resource$a, _character$resource$a2, _character$resource3, _character$resource3$;
|
|
74
|
-
|
|
75
51
|
if (character.animationId && (_character$animation = character.animation) !== null && _character$animation !== void 0 && _character$animation.url) {
|
|
76
52
|
return character.animation;
|
|
77
53
|
}
|
|
78
|
-
|
|
79
54
|
if (character !== null && character !== void 0 && (_character$resource = character.resource) !== null && _character$resource !== void 0 && (_character$resource$a = _character$resource.animations) !== null && _character$resource$a !== void 0 && (_character$resource$a2 = _character$resource$a[character.emotion]) !== null && _character$resource$a2 !== void 0 && _character$resource$a2.url) {
|
|
80
55
|
var _character$resource2, _character$resource2$;
|
|
81
|
-
|
|
82
56
|
return character === null || character === void 0 ? void 0 : (_character$resource2 = character.resource) === null || _character$resource2 === void 0 ? void 0 : (_character$resource2$ = _character$resource2.animations) === null || _character$resource2$ === void 0 ? void 0 : _character$resource2$[character.emotion];
|
|
83
57
|
}
|
|
84
|
-
|
|
85
58
|
return character === null || character === void 0 ? void 0 : (_character$resource3 = character.resource) === null || _character$resource3 === void 0 ? void 0 : (_character$resource3$ = _character$resource3.animations) === null || _character$resource3$ === void 0 ? void 0 : _character$resource3$.neutral;
|
|
86
59
|
}
|
|
87
|
-
|
|
88
60
|
return {};
|
|
89
61
|
}, [character.emotion, character === null || character === void 0 ? void 0 : character.animationId, character === null || character === void 0 ? void 0 : character.animation, character === null || character === void 0 ? void 0 : (_character$resource4 = character.resource) === null || _character$resource4 === void 0 ? void 0 : _character$resource4.animations, isCharacter]);
|
|
90
62
|
var resetAnimation = (0, _react.useCallback)(function () {
|
|
91
63
|
var _model$current$userDa = model.current.userData,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
64
|
+
mixer = _model$current$userDa.mixer,
|
|
65
|
+
defaultAnim = _model$current$userDa.defaultAnim,
|
|
66
|
+
emotionClip = _model$current$userDa.emotionClip;
|
|
96
67
|
if (defaultAnim && emotionClip) {
|
|
97
68
|
var emotionAction = mixer.clipAction(emotionClip, model.current);
|
|
98
69
|
var defaultAction = mixer.clipAction(defaultAnim, model.current);
|
|
@@ -106,7 +77,6 @@ function Panel(_ref) {
|
|
|
106
77
|
if (active) {
|
|
107
78
|
if (ttsStarted) {
|
|
108
79
|
var _character$resource5, _character$resource5$, _character$resource5$2;
|
|
109
|
-
|
|
110
80
|
(0, _helpers.executeTalkingAnimation)(model.current, character === null || character === void 0 ? void 0 : (_character$resource5 = character.resource) === null || _character$resource5 === void 0 ? void 0 : (_character$resource5$ = _character$resource5.animations) === null || _character$resource5$ === void 0 ? void 0 : (_character$resource5$2 = _character$resource5$.talking) === null || _character$resource5$2 === void 0 ? void 0 : _character$resource5$2.url);
|
|
111
81
|
setTalking(true);
|
|
112
82
|
} else {
|
|
@@ -127,27 +97,21 @@ function Panel(_ref) {
|
|
|
127
97
|
cameraRef.current.updateProjectionMatrix();
|
|
128
98
|
cameraRef.current.layers.enableAll();
|
|
129
99
|
var defaultAnim = object.userData.defaultAnim;
|
|
130
|
-
|
|
131
100
|
if (character.type === 'character' && defaultAnim) {
|
|
132
101
|
var _character$emotion;
|
|
133
|
-
|
|
134
102
|
model.current = object;
|
|
135
103
|
var head;
|
|
136
104
|
var isSeated = (_character$emotion = character.emotion) === null || _character$emotion === void 0 ? void 0 : _character$emotion.includes('seated');
|
|
137
105
|
cameraRef.current.position.setY(size.y - 1.5 * 1.3); // Retro compatible with resources without eye bone
|
|
138
|
-
|
|
139
106
|
object.traverse(function (node) {
|
|
140
107
|
var boneName = node.name.toLowerCase();
|
|
141
|
-
|
|
142
108
|
if (node.isBone && boneWhiteList.includes(boneName)) {
|
|
143
109
|
var distance = isSeated ? 1 : 0;
|
|
144
110
|
var leftEyeVector = new _three.Vector3().setFromMatrixPosition(node.matrixWorld);
|
|
145
|
-
|
|
146
111
|
if (boneName === 'head_m') {
|
|
147
112
|
head = leftEyeVector;
|
|
148
113
|
return;
|
|
149
114
|
}
|
|
150
|
-
|
|
151
115
|
cameraRef.current.position.setY(leftEyeVector.y - distance);
|
|
152
116
|
cameraRef.current.position.setX(leftEyeVector.x - 0.5);
|
|
153
117
|
}
|
|
@@ -158,21 +122,18 @@ function Panel(_ref) {
|
|
|
158
122
|
(0, _helpers.cameraFitAnyObject)(object, cameraRef.current);
|
|
159
123
|
cameraRef.current.zoom = 1;
|
|
160
124
|
}
|
|
161
|
-
|
|
162
125
|
cameraRef.current.updateProjectionMatrix();
|
|
163
126
|
}
|
|
164
127
|
}, [character.type, character.emotion]);
|
|
165
128
|
(0, _fiber.useFrame)(function (_ref2) {
|
|
166
129
|
var gl = _ref2.gl;
|
|
167
|
-
|
|
168
130
|
if (cameraRef.current && sceneRef.current) {
|
|
169
131
|
var doc = document.getElementsByClassName('conversation--character__item')[character.slot];
|
|
170
|
-
|
|
171
132
|
if (doc) {
|
|
172
133
|
var child = doc.getBoundingClientRect();
|
|
173
134
|
var parent = doc.parentNode.getBoundingClientRect();
|
|
174
135
|
var width = child.right - child.left,
|
|
175
|
-
|
|
136
|
+
height = child.bottom - child.top;
|
|
176
137
|
cameraRef.current.aspect = width / height;
|
|
177
138
|
cameraRef.current.updateProjectionMatrix();
|
|
178
139
|
var relativePos = {
|
|
@@ -181,11 +142,9 @@ function Panel(_ref) {
|
|
|
181
142
|
left: child.left - parent.left,
|
|
182
143
|
bottom: child.bottom - parent.bottom
|
|
183
144
|
};
|
|
184
|
-
|
|
185
145
|
if (ref.current) {
|
|
186
146
|
onLoadElement(ref.current);
|
|
187
147
|
}
|
|
188
|
-
|
|
189
148
|
var paddingBottom = isMobile ? 24 : 40;
|
|
190
149
|
relativePos.bottom += active ? -paddingBottom : paddingBottom;
|
|
191
150
|
gl.setViewport(relativePos.left, relativePos.bottom, width, height);
|
|
@@ -216,6 +175,5 @@ function Panel(_ref) {
|
|
|
216
175
|
defaultCamera: true
|
|
217
176
|
}), /*#__PURE__*/_react.default.createElement(_LightSet.default, null));
|
|
218
177
|
}
|
|
219
|
-
|
|
220
178
|
var _default = Panel;
|
|
221
179
|
exports.default = _default;
|
|
@@ -4,33 +4,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _Panel = _interopRequireDefault(require("./Panel"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
10
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
14
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
16
|
var Panels = function Panels(_ref) {
|
|
21
17
|
var characters = _ref.characters,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
slots = _ref.slots,
|
|
19
|
+
ttsStarted = _ref.ttsStarted,
|
|
20
|
+
activeIndex = _ref.activeIndex,
|
|
21
|
+
flex = _ref.flex,
|
|
22
|
+
lodSettings = _ref.lodSettings,
|
|
23
|
+
emitEvent = _ref.emitEvent;
|
|
28
24
|
return slots.map(function (slot, slotPosition) {
|
|
29
25
|
var currentCharacter = null;
|
|
30
26
|
var characterPos = characters.findIndex(function (c) {
|
|
31
27
|
return c && c.uid === slot.uid;
|
|
32
28
|
});
|
|
33
|
-
|
|
34
29
|
if (characterPos >= 0) {
|
|
35
30
|
var currentPosition = !flex ? slotPosition : characterPos;
|
|
36
31
|
currentCharacter = _objectSpread({}, characters[characterPos]);
|
|
@@ -44,10 +39,8 @@ var Panels = function Panels(_ref) {
|
|
|
44
39
|
emitEvent: emitEvent
|
|
45
40
|
});
|
|
46
41
|
}
|
|
47
|
-
|
|
48
42
|
return null;
|
|
49
43
|
});
|
|
50
44
|
};
|
|
51
|
-
|
|
52
45
|
var _default = Panels;
|
|
53
46
|
exports.default = _default;
|
|
@@ -1,52 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _fiber = require("@react-three/fiber");
|
|
13
|
-
|
|
14
10
|
var _arcadeThreeCore = require("@gamelearn/arcade-three-core");
|
|
15
|
-
|
|
16
11
|
var _Panels = _interopRequireDefault(require("./Panels"));
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
|
-
|
|
26
16
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
27
|
-
|
|
28
17
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
33
|
-
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
19
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
34
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
|
-
|
|
36
21
|
var PanelsWrapper = function PanelsWrapper(_ref) {
|
|
37
22
|
var characters = _ref.characters,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
23
|
+
slots = _ref.slots,
|
|
24
|
+
ttsStarted = _ref.ttsStarted,
|
|
25
|
+
slotRefs = _ref.slotRefs,
|
|
26
|
+
flex = _ref.flex,
|
|
27
|
+
currentMessage = _ref.currentMessage,
|
|
28
|
+
emitEvent = _ref.emitEvent;
|
|
45
29
|
var _useState = (0, _react.useState)(false),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
built = _useState2[0],
|
|
32
|
+
finishBuild = _useState2[1];
|
|
50
33
|
(0, _fiber.useFrame)(function (_ref2) {
|
|
51
34
|
var gl = _ref2.gl;
|
|
52
35
|
gl.setScissorTest(false);
|
|
@@ -67,7 +50,6 @@ var PanelsWrapper = function PanelsWrapper(_ref) {
|
|
|
67
50
|
emitEvent: emitEvent
|
|
68
51
|
}) : null;
|
|
69
52
|
};
|
|
70
|
-
|
|
71
53
|
var Scene = function Scene(props) {
|
|
72
54
|
return !props.lowQuality ? /*#__PURE__*/_react.default.createElement(_arcadeThreeCore.Renderer, {
|
|
73
55
|
fullscreen: false,
|
|
@@ -91,6 +73,5 @@ var Scene = function Scene(props) {
|
|
|
91
73
|
fallback: null
|
|
92
74
|
}, /*#__PURE__*/_react.default.createElement(PanelsWrapper, props))) : null;
|
|
93
75
|
};
|
|
94
|
-
|
|
95
76
|
var _default = Scene;
|
|
96
77
|
exports.default = _default;
|
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _ConversationalProComponent = _interopRequireDefault(require("./components/ConversationalProComponent"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _ConversationalProComponent.default;
|
|
13
10
|
exports.default = _default;
|
|
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.withoutBackground = exports.voiceOverProps = exports.textToSpeechProps = exports.conversationPropsNoFeedbackNoRewards = exports.conversationPropsLodSettings = exports.conversationProps = exports.converOld = exports.branchedConver = void 0;
|
|
7
|
-
|
|
8
7
|
var _mocker = require("helpers/mocker");
|
|
9
|
-
|
|
10
8
|
/* eslint-disable max-len */
|
|
9
|
+
|
|
11
10
|
var animations = {
|
|
12
11
|
neutral: {
|
|
13
12
|
url: 'https://min.int.gamelearn.io/cooked.gl-lms-storage/clients/5981fca94d82290bcbe957fe/animation/5f06e116f9efdd00112fcc6f/male_missunderstand_1.glb'
|