@gamelearn/arcade-components 1.35.8-hotfix → 2.0.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/auto-evaluation-component/components/AutoEvaluation.js +4 -2
- package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +16 -27
- package/dist/components/conversational-pro-component/components/scene/Panel.js +17 -44
- package/dist/components/dialog-component/components/DialogComponent.js +20 -34
- package/dist/components/survey-component/components/SurveyComponent.js +4 -2
- package/dist/components/test-component/components/TestComponent.js +4 -2
- package/dist/helpers/index.js +1 -1
- package/package.json +2 -2
|
@@ -106,7 +106,9 @@ var AutoEvaluation = function AutoEvaluation(_ref) {
|
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
109
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
110
|
+
className: "test--container__overlay"
|
|
111
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
110
112
|
className: "test--container",
|
|
111
113
|
dir: "auto"
|
|
112
114
|
}, phase === 'start' && /*#__PURE__*/_react.default.createElement(_StartScreen.default, {
|
|
@@ -157,7 +159,7 @@ var AutoEvaluation = function AutoEvaluation(_ref) {
|
|
|
157
159
|
})))), phase === 'end' && /*#__PURE__*/_react.default.createElement(_EndScreen.default, {
|
|
158
160
|
onFinish: close,
|
|
159
161
|
translate: translate
|
|
160
|
-
}));
|
|
162
|
+
})));
|
|
161
163
|
};
|
|
162
164
|
|
|
163
165
|
var _default = AutoEvaluation;
|
package/dist/components/conversational-pro-component/components/ConversationalProComponent.js
CHANGED
|
@@ -59,7 +59,7 @@ var characterMs = 75;
|
|
|
59
59
|
var minMs = 1400;
|
|
60
60
|
|
|
61
61
|
var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
62
|
-
var _background$img, _currentLineData$
|
|
62
|
+
var _background$img, _currentLineData$slot;
|
|
63
63
|
|
|
64
64
|
var emitEvent = _ref.emitEvent,
|
|
65
65
|
lines = _ref.lines,
|
|
@@ -110,12 +110,12 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
110
110
|
|
|
111
111
|
var backgroundImage = (background === null || background === void 0 ? void 0 : (_background$img = background.img) === null || _background$img === void 0 ? void 0 : _background$img.url) || null;
|
|
112
112
|
var currentLineData = lines[currentLine];
|
|
113
|
-
var voiceOver = currentLineData.voiceOver,
|
|
114
|
-
decision = currentLineData.decision;
|
|
115
113
|
var voiceOverSlots = [];
|
|
116
114
|
var isBranched = !!edges;
|
|
117
115
|
var isVoiceOver = voiceOver || currentLineData.type === 'conversationalNarration';
|
|
118
116
|
var isDecision = decision || currentLineData.type === 'conversationalDecision';
|
|
117
|
+
var voiceOver = currentLineData.voiceOver,
|
|
118
|
+
decision = currentLineData.decision;
|
|
119
119
|
var isFlex = currentLineData.flex;
|
|
120
120
|
|
|
121
121
|
var _useState13 = (0, _react.useState)([]),
|
|
@@ -154,13 +154,11 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
154
154
|
});
|
|
155
155
|
}, [emitEvent]);
|
|
156
156
|
var getCurrentMessage = (0, _react.useCallback)(function () {
|
|
157
|
-
var _currentLineData$slot, _currentLineData$slot2;
|
|
158
|
-
|
|
159
157
|
if (isVoiceOver) {
|
|
160
158
|
return currentLineData;
|
|
161
159
|
}
|
|
162
160
|
|
|
163
|
-
var currentMessage = currentLineData
|
|
161
|
+
var currentMessage = currentLineData.slots.find(function (slot) {
|
|
164
162
|
return slot.uid && slot.talking;
|
|
165
163
|
});
|
|
166
164
|
|
|
@@ -169,7 +167,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
169
167
|
} // Old conversational schema
|
|
170
168
|
|
|
171
169
|
|
|
172
|
-
return currentLineData
|
|
170
|
+
return currentLineData.slots.find(function (slot) {
|
|
173
171
|
return slot.uid && slot.text;
|
|
174
172
|
});
|
|
175
173
|
}, [currentLineData, isVoiceOver]);
|
|
@@ -188,10 +186,9 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
188
186
|
var leftWithSlots = lines.slice(0, currentLine + 1).reverse().find(function (line) {
|
|
189
187
|
return line.slots;
|
|
190
188
|
});
|
|
191
|
-
var hasCharacters = !isDecision && ((_currentLineData$
|
|
189
|
+
var hasCharacters = !isDecision && ((_currentLineData$slot = currentLineData.slots) === null || _currentLineData$slot === void 0 ? void 0 : _currentLineData$slot.filter(function (slot) {
|
|
192
190
|
return slot.uid;
|
|
193
191
|
}).length);
|
|
194
|
-
var autoPlayTime = characterMs * ((currentMessage === null || currentMessage === void 0 ? void 0 : (_currentMessage$text = currentMessage.text) === null || _currentMessage$text === void 0 ? void 0 : _currentMessage$text.length) || 0);
|
|
195
192
|
var currentSlots = [];
|
|
196
193
|
|
|
197
194
|
if (currentLineData.slots) {
|
|
@@ -348,7 +345,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
348
345
|
|
|
349
346
|
if (isBranched) {
|
|
350
347
|
handleBranchDirection(false);
|
|
351
|
-
} else if (
|
|
348
|
+
} else if (currentLine > 0) {
|
|
352
349
|
setCurrentLine(currentLine - 1);
|
|
353
350
|
}
|
|
354
351
|
|
|
@@ -383,9 +380,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
383
380
|
};
|
|
384
381
|
|
|
385
382
|
var autoplayCond = automatic && !isDecision;
|
|
386
|
-
var disableBackButton =
|
|
387
|
-
return currentLine === 0 || previousLineWasDecision();
|
|
388
|
-
}, [currentLine, previousLineWasDecision]);
|
|
383
|
+
var disableBackButton = currentLine === 0 || previousLineWasDecision();
|
|
389
384
|
(0, _useEkho.default)({
|
|
390
385
|
audioType: currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType,
|
|
391
386
|
volume: currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioVolume,
|
|
@@ -415,32 +410,26 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
415
410
|
(0, _react.useEffect)(function () {
|
|
416
411
|
var _currentMessage$emoti2;
|
|
417
412
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
if (((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType) === 'none' || audioFailed) && !(currentMessage !== null && currentMessage !== void 0 && (_currentMessage$emoti2 = currentMessage.emotion) !== null && _currentMessage$emoti2 !== void 0 && _currentMessage$emoti2.includes('think'))) {
|
|
413
|
+
if ((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType) === 'none' && !(currentMessage !== null && currentMessage !== void 0 && (_currentMessage$emoti2 = currentMessage.emotion) !== null && _currentMessage$emoti2 !== void 0 && _currentMessage$emoti2.includes('think'))) {
|
|
421
414
|
setTTsStart(true);
|
|
422
|
-
timeout = setTimeout(function () {
|
|
423
|
-
setTTsStart(false);
|
|
424
|
-
}, autoPlayTime < minMs ? minMs : autoPlayTime);
|
|
425
415
|
}
|
|
426
|
-
|
|
427
|
-
return function () {
|
|
428
|
-
if (timeout) clearTimeout(timeout);
|
|
429
|
-
};
|
|
430
|
-
}, [audioFailed, currentLineData, currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.emotion, autoPlayTime]); // Autoplay logic
|
|
416
|
+
}, [currentLineData, currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.emotion]); // Autoplay logic
|
|
431
417
|
|
|
432
418
|
(0, _react.useEffect)(function () {
|
|
433
419
|
if (autoplayCond && ((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType) === 'none' || audioFailed)) {
|
|
434
|
-
|
|
420
|
+
var _currentMessage$text;
|
|
421
|
+
|
|
422
|
+
var time = characterMs * ((currentMessage === null || currentMessage === void 0 ? void 0 : (_currentMessage$text = currentMessage.text) === null || _currentMessage$text === void 0 ? void 0 : _currentMessage$text.length) || 0); // if it's not last node
|
|
423
|
+
|
|
435
424
|
if (!isEndNode()) {
|
|
436
|
-
start(handleClickNext,
|
|
425
|
+
start(handleClickNext, time < minMs ? minMs : time);
|
|
437
426
|
}
|
|
438
427
|
}
|
|
439
428
|
|
|
440
429
|
return function () {
|
|
441
430
|
stop();
|
|
442
431
|
};
|
|
443
|
-
}, [currentMessage, start, stop, handleClickNext, currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType, autoplayCond, audioFailed, lines, isEndNode
|
|
432
|
+
}, [currentMessage, start, stop, handleClickNext, currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType, autoplayCond, audioFailed, lines, isEndNode]); // Calculate start node
|
|
444
433
|
|
|
445
434
|
(0, _react.useEffect)(function () {
|
|
446
435
|
if (isBranched && !mounted) {
|
|
@@ -29,18 +29,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
29
|
|
|
30
30
|
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
31
|
|
|
32
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
|
-
|
|
34
|
-
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
|
-
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 _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; }
|
|
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
|
-
|
|
42
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
|
-
|
|
44
32
|
var isMobile = (0, _deviceDetection.DeviceDetection)();
|
|
45
33
|
var defaultCamPos = [0, 14.63, 16];
|
|
46
34
|
|
|
@@ -53,12 +41,6 @@ function Panel(_ref) {
|
|
|
53
41
|
var cameraRef = (0, _react.useRef)(null);
|
|
54
42
|
var sceneRef = (0, _react.useRef)(null);
|
|
55
43
|
var isCharacter = character.type === 'character';
|
|
56
|
-
|
|
57
|
-
var _useState = (0, _react.useState)(false),
|
|
58
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
-
talking = _useState2[0],
|
|
60
|
-
setTalking = _useState2[1];
|
|
61
|
-
|
|
62
44
|
var model = (0, _react.useRef)();
|
|
63
45
|
var defaultClip = (0, _react.useRef)();
|
|
64
46
|
var emotion = (0, _react.useMemo)(function () {
|
|
@@ -76,36 +58,27 @@ function Panel(_ref) {
|
|
|
76
58
|
|
|
77
59
|
return {};
|
|
78
60
|
}, [character.emotion, character === null || character === void 0 ? void 0 : (_character$resource4 = character.resource) === null || _character$resource4 === void 0 ? void 0 : _character$resource4.animations, isCharacter]);
|
|
79
|
-
var resetAnimation = (0, _react.useCallback)(function () {
|
|
80
|
-
var _model$current$userDa = model.current.userData,
|
|
81
|
-
mixer = _model$current$userDa.mixer,
|
|
82
|
-
defaultAnim = _model$current$userDa.defaultAnim,
|
|
83
|
-
emotionClip = _model$current$userDa.emotionClip;
|
|
84
|
-
|
|
85
|
-
if (defaultAnim && emotionClip) {
|
|
86
|
-
var emotionAction = mixer.clipAction(emotionClip, model.current);
|
|
87
|
-
var defaultAction = mixer.clipAction(defaultAnim, model.current);
|
|
88
|
-
mixer.stopAllAction();
|
|
89
|
-
(0, _helpers.executeCrossFade)(emotionAction, defaultAction);
|
|
90
|
-
setTalking(false);
|
|
91
|
-
}
|
|
92
|
-
}, []);
|
|
93
61
|
(0, _react.useEffect)(function () {
|
|
94
|
-
if (model.current) {
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
62
|
+
if (model.current && active) {
|
|
63
|
+
if (ttsStarted) {
|
|
64
|
+
var _character$resource5, _character$resource5$, _character$resource5$2;
|
|
65
|
+
|
|
66
|
+
(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);
|
|
67
|
+
} else {
|
|
68
|
+
var _model$current$userDa = model.current.userData,
|
|
69
|
+
mixer = _model$current$userDa.mixer,
|
|
70
|
+
defaultAnim = _model$current$userDa.defaultAnim,
|
|
71
|
+
emotionClip = _model$current$userDa.emotionClip;
|
|
72
|
+
|
|
73
|
+
if (defaultAnim && emotionClip) {
|
|
74
|
+
var emotionAction = mixer.clipAction(emotionClip, model.current);
|
|
75
|
+
var defaultAction = mixer.clipAction(defaultAnim, model.current);
|
|
76
|
+
mixer.stopAllAction();
|
|
77
|
+
(0, _helpers.executeCrossFade)(emotionAction, defaultAction);
|
|
103
78
|
}
|
|
104
|
-
} else if (talking) {
|
|
105
|
-
resetAnimation();
|
|
106
79
|
}
|
|
107
80
|
}
|
|
108
|
-
}, [character === null || character === void 0 ? void 0 : (_character$resource6 = character.resource) === null || _character$resource6 === void 0 ? void 0 : (_character$resource6$ = _character$resource6.animations) === null || _character$resource6$ === void 0 ? void 0 : (_character$resource6$2 = _character$resource6$.talking) === null || _character$resource6$2 === void 0 ? void 0 : _character$resource6$2.url, ttsStarted, active
|
|
81
|
+
}, [character === null || character === void 0 ? void 0 : (_character$resource6 = character.resource) === null || _character$resource6 === void 0 ? void 0 : (_character$resource6$ = _character$resource6.animations) === null || _character$resource6$ === void 0 ? void 0 : (_character$resource6$2 = _character$resource6$.talking) === null || _character$resource6$2 === void 0 ? void 0 : _character$resource6$2.url, ttsStarted, active]);
|
|
109
82
|
var onLoadElement = (0, _react.useCallback)(function (object) {
|
|
110
83
|
if (cameraRef.current) {
|
|
111
84
|
var boundingBox = new _three.Box3();
|
|
@@ -212,22 +212,23 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
212
212
|
var lastEdge = edges.find(function (edge) {
|
|
213
213
|
return edge.fromId === lastNodeId;
|
|
214
214
|
});
|
|
215
|
-
var
|
|
216
|
-
return
|
|
215
|
+
var lastLine = lines.find(function (line) {
|
|
216
|
+
return line.id === lastEdge.fromId;
|
|
217
217
|
});
|
|
218
|
-
return
|
|
218
|
+
return lastLine;
|
|
219
219
|
}, [edges, lines, lastNodeId]);
|
|
220
220
|
var previousLineWasDecision = (0, _react.useCallback)(function () {
|
|
221
221
|
if (isBranched) {
|
|
222
222
|
// if we have edges, we need to check if the previous line was a decision
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
return _lastL === null || _lastL === void 0 ? void 0 : _lastL.decision;
|
|
226
|
-
} // if there is no branching, the previous line is the previous one
|
|
223
|
+
var _lastLine = findLastLineBranched();
|
|
227
224
|
|
|
225
|
+
return _lastLine === null || _lastLine === void 0 ? void 0 : _lastLine.decision;
|
|
226
|
+
} else {
|
|
227
|
+
// if there is no branching, the previous line is the previous one
|
|
228
|
+
var _lastLine2 = lines[currentLineData - 1] ? lines[currentLineData - 1] : {};
|
|
228
229
|
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
return currentLineData > 0 && (_lastLine2 === null || _lastLine2 === void 0 ? void 0 : _lastLine2.decision);
|
|
231
|
+
}
|
|
231
232
|
}, [currentLineData, isBranched, lines, lastNodeId, edges]);
|
|
232
233
|
var getCurrentVisible = (0, _react.useCallback)(function (uid) {
|
|
233
234
|
if (!uid) return null;
|
|
@@ -303,12 +304,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
303
304
|
|
|
304
305
|
var restTalkingAnimation = function restTalkingAnimation() {
|
|
305
306
|
var element = getCurrentVisible(talkingCharacter === null || talkingCharacter === void 0 ? void 0 : talkingCharacter.uid);
|
|
306
|
-
|
|
307
|
-
if (!element) {
|
|
308
|
-
startTalking(false);
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
|
|
307
|
+
if (!element) return;
|
|
312
308
|
var _element$userData = element.userData,
|
|
313
309
|
mixer = _element$userData.mixer,
|
|
314
310
|
defaultAnim = _element$userData.defaultAnim,
|
|
@@ -413,7 +409,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
413
409
|
|
|
414
410
|
if (isBranched) {
|
|
415
411
|
handleBranchDirection(false);
|
|
416
|
-
} else if (
|
|
412
|
+
} else if (previousLineWasDecision()) {
|
|
417
413
|
setCurrentMessage({
|
|
418
414
|
show: false
|
|
419
415
|
});
|
|
@@ -579,6 +575,10 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
579
575
|
element.userData.defaultAnim = action.getClip();
|
|
580
576
|
}
|
|
581
577
|
|
|
578
|
+
if ((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType) === 'none' && talkingCharacter.emotion !== 'thinkful') {
|
|
579
|
+
startTalking(true);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
582
|
if (talkingCharacter.uid === element.uid) {
|
|
583
583
|
var showArrowTop = talkingCharacter.text.length > maxCharacterToSwitch;
|
|
584
584
|
moveBubble(element, showArrowTop);
|
|
@@ -661,24 +661,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
661
661
|
return function () {
|
|
662
662
|
stopEkho();
|
|
663
663
|
};
|
|
664
|
-
}, [line, stopEkho]);
|
|
665
|
-
(0, _react.useEffect)(function () {
|
|
666
|
-
if (((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType) === 'none' || audioFailed) && currentMessage !== null && currentMessage !== void 0 && currentMessage.show && (talkingCharacter === null || talkingCharacter === void 0 ? void 0 : talkingCharacter.emotion) !== 'thinkful') {
|
|
667
|
-
var _currentMessage$text;
|
|
668
|
-
|
|
669
|
-
startTalking(true);
|
|
670
|
-
var time = characterMs * ((currentMessage === null || currentMessage === void 0 ? void 0 : (_currentMessage$text = currentMessage.text) === null || _currentMessage$text === void 0 ? void 0 : _currentMessage$text.length) || 0);
|
|
671
|
-
setTimeout(function () {
|
|
672
|
-
startTalking(false);
|
|
673
|
-
}, time < minMs ? minMs : time);
|
|
674
|
-
}
|
|
675
|
-
}, [audioFailed, currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType, talkingCharacter === null || talkingCharacter === void 0 ? void 0 : talkingCharacter.emotion, currentMessage]); // Autoplay logic
|
|
664
|
+
}, [line, stopEkho]); // Autoplay logic
|
|
676
665
|
|
|
677
666
|
(0, _react.useEffect)(function () {
|
|
678
667
|
if (autoPlayCond && currentMessage.show && ((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType) === 'none' || audioFailed)) {
|
|
679
|
-
var _currentMessage$
|
|
668
|
+
var _currentMessage$text;
|
|
680
669
|
|
|
681
|
-
var time = characterMs * ((currentMessage === null || currentMessage === void 0 ? void 0 : (_currentMessage$
|
|
670
|
+
var time = characterMs * ((currentMessage === null || currentMessage === void 0 ? void 0 : (_currentMessage$text = currentMessage.text) === null || _currentMessage$text === void 0 ? void 0 : _currentMessage$text.length) || 0); // if it's not last node
|
|
682
671
|
|
|
683
672
|
if (!isEndNode()) {
|
|
684
673
|
start(nextLine, time < minMs ? minMs : time);
|
|
@@ -805,10 +794,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
805
794
|
height: '100vh',
|
|
806
795
|
position: 'static'
|
|
807
796
|
};
|
|
808
|
-
var disableBackButton =
|
|
809
|
-
var disabled = line === 0 || previousLineWasDecision();
|
|
810
|
-
return disabled;
|
|
811
|
-
}, [line, previousLineWasDecision]);
|
|
797
|
+
var disableBackButton = line === 0 || previousLineWasDecision();
|
|
812
798
|
|
|
813
799
|
if (isDecision) {
|
|
814
800
|
var decisionPayload = _objectSpread(_objectSpread({}, currentLineData.payload), {}, {
|
|
@@ -107,7 +107,9 @@ var SurveyComponent = function SurveyComponent(_ref) {
|
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
var View = PAGES[page].component;
|
|
110
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
111
|
+
className: "survey--container__overlay"
|
|
112
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
111
113
|
className: "survey--container",
|
|
112
114
|
dir: "auto"
|
|
113
115
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -153,7 +155,7 @@ var SurveyComponent = function SurveyComponent(_ref) {
|
|
|
153
155
|
});
|
|
154
156
|
},
|
|
155
157
|
className: "gat--btn gat--btn__primary ".concat(disabled ? 'disabled' : '', " not-transition")
|
|
156
|
-
}, translate('survey.finish')))));
|
|
158
|
+
}, translate('survey.finish'))))));
|
|
157
159
|
};
|
|
158
160
|
|
|
159
161
|
var _default = SurveyComponent;
|
|
@@ -242,7 +242,9 @@ var TestComponent = function TestComponent(_ref) {
|
|
|
242
242
|
});
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
245
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
246
|
+
className: "test--container__overlay"
|
|
247
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
246
248
|
className: "test--container",
|
|
247
249
|
dir: "auto"
|
|
248
250
|
}, view !== 'results' ? /*#__PURE__*/_react.default.createElement(_Container.default, {
|
|
@@ -280,7 +282,7 @@ var TestComponent = function TestComponent(_ref) {
|
|
|
280
282
|
timeOverText: countdown.text,
|
|
281
283
|
emitEvent: emitEvent,
|
|
282
284
|
soundActions: soundActions
|
|
283
|
-
}));
|
|
285
|
+
})));
|
|
284
286
|
};
|
|
285
287
|
|
|
286
288
|
var _default = TestComponent;
|
package/dist/helpers/index.js
CHANGED
|
@@ -30,7 +30,7 @@ exports.yAxis = yAxis;
|
|
|
30
30
|
var zAxis = new _three.Vector3(0, 0, 1);
|
|
31
31
|
exports.zAxis = zAxis;
|
|
32
32
|
var crossFadeDuration = 0.2;
|
|
33
|
-
var bones = ['Jaw_M', 'Head_M', 'L_lip_jnt', '
|
|
33
|
+
var bones = ['Jaw_M', 'Head_M', 'L_lip_jnt', 'R_lip_jnt', 'joint4', 'transform1', 'lowerTeeths', 'upperTeeths'];
|
|
34
34
|
var loader = new _GLTFLoader.GLTFLoader();
|
|
35
35
|
|
|
36
36
|
var formatMessage = function formatMessage(text) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@gamelearn/arcade-components",
|
|
3
3
|
"author": "Gamelearn",
|
|
4
4
|
"license": "unlicense",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "2.0.2",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime": "^7.18.6",
|
|
17
|
-
"@gamelearn/arcade-styles": "0.
|
|
17
|
+
"@gamelearn/arcade-styles": "2.0.3",
|
|
18
18
|
"@gamelearn/arcade-three-core": "1.17.1",
|
|
19
19
|
"@react-three/drei": "9.4.3",
|
|
20
20
|
"@react-three/fiber": "8.0.17",
|