@gamelearn/arcade-components 2.23.2 → 2.23.3
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/conversational-pro-component/components/ConversationalProComponent.js
CHANGED
|
@@ -166,29 +166,28 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
166
166
|
payload: id
|
|
167
167
|
});
|
|
168
168
|
}, [emitEvent]);
|
|
169
|
-
var
|
|
169
|
+
var currentMessage = (0, _react.useMemo)(function () {
|
|
170
170
|
var _currentLineData$slot, _currentLineData$slot2;
|
|
171
171
|
|
|
172
|
+
if (isDecision) return {};
|
|
173
|
+
|
|
172
174
|
if (isVoiceOver) {
|
|
173
175
|
return currentLineData;
|
|
174
176
|
}
|
|
175
177
|
|
|
176
|
-
var
|
|
178
|
+
var message = currentLineData === null || currentLineData === void 0 ? void 0 : (_currentLineData$slot = currentLineData.slots) === null || _currentLineData$slot === void 0 ? void 0 : _currentLineData$slot.find(function (slot) {
|
|
177
179
|
return slot.uid && slot.talking;
|
|
178
180
|
});
|
|
179
181
|
|
|
180
|
-
if (
|
|
181
|
-
return
|
|
182
|
+
if (message) {
|
|
183
|
+
return message;
|
|
182
184
|
} // Old conversational schema
|
|
183
185
|
|
|
184
186
|
|
|
185
187
|
return currentLineData === null || currentLineData === void 0 ? void 0 : (_currentLineData$slot2 = currentLineData.slots) === null || _currentLineData$slot2 === void 0 ? void 0 : _currentLineData$slot2.find(function (slot) {
|
|
186
188
|
return slot.uid && slot.text;
|
|
187
189
|
});
|
|
188
|
-
}, [currentLineData, isVoiceOver]);
|
|
189
|
-
var currentMessage = (0, _react.useMemo)(function () {
|
|
190
|
-
return !isDecision ? getCurrentMessage() : {};
|
|
191
|
-
}, [getCurrentMessage, isDecision]);
|
|
190
|
+
}, [currentLineData, isVoiceOver, isDecision]);
|
|
192
191
|
var listProps = {
|
|
193
192
|
characters: currentCharacters,
|
|
194
193
|
lodSettings: lodSettings,
|
|
@@ -29,8 +29,8 @@ var Message = function Message(_ref) {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
-
className: "conversation--message ".concat(current.voiceOver || current.emotion
|
|
33
|
-
}, current.voiceOver ? /*#__PURE__*/_react.default.createElement(VoiceOver, null) : null, current.emotion
|
|
32
|
+
className: "conversation--message ".concat(current.voiceOver || current.emotion.includes('think') ? 'voice--over' : '')
|
|
33
|
+
}, current.voiceOver ? /*#__PURE__*/_react.default.createElement(VoiceOver, null) : null, current.emotion.includes('think') ? /*#__PURE__*/_react.default.createElement(ThinkFul, null) : null, /*#__PURE__*/_react.default.createElement("span", {
|
|
34
34
|
className: "conversation--main__text"
|
|
35
35
|
}, currentText));
|
|
36
36
|
};
|
|
@@ -727,7 +727,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
727
727
|
text: talkingCharacter.text,
|
|
728
728
|
name: talkingCharacter.alias || ((_talkingCharacter$cha5 = talkingCharacter.character) === null || _talkingCharacter$cha5 === void 0 ? void 0 : _talkingCharacter$cha5.name),
|
|
729
729
|
inScene: true,
|
|
730
|
-
thinkful: talkingCharacter.emotion
|
|
730
|
+
thinkful: talkingCharacter.emotion.includes('think'),
|
|
731
731
|
avatar: getAvatarURL(talkingCharacter),
|
|
732
732
|
show: true
|
|
733
733
|
});
|
|
@@ -752,7 +752,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
752
752
|
left: false,
|
|
753
753
|
top: talkingCharacter.text.length > maxCharacterToSwitch,
|
|
754
754
|
inScene: false,
|
|
755
|
-
thinkful: talkingCharacter.emotion
|
|
755
|
+
thinkful: talkingCharacter.emotion.includes('think'),
|
|
756
756
|
avatar: getAvatarURL(talkingCharacter),
|
|
757
757
|
show: true
|
|
758
758
|
});
|
|
@@ -801,7 +801,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
801
801
|
};
|
|
802
802
|
}, [line, stopEkho]);
|
|
803
803
|
(0, _react.useEffect)(function () {
|
|
804
|
-
if (((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType) === 'none' || audioFailed) && currentMessage !== null && currentMessage !== void 0 && currentMessage.show &&
|
|
804
|
+
if (((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType) === 'none' || audioFailed) && currentMessage !== null && currentMessage !== void 0 && currentMessage.show && !talkingCharacter.emotion.includes('think')) {
|
|
805
805
|
var _currentMessage$text;
|
|
806
806
|
|
|
807
807
|
startTalking(true);
|