@gamelearn/arcade-components 1.21.0 → 1.21.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/conversational-pro-component/components/ConversationalProComponent.js
CHANGED
|
@@ -300,6 +300,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
300
300
|
};
|
|
301
301
|
|
|
302
302
|
var autoplayCond = automatic && !isDecision;
|
|
303
|
+
var disableBackButton = currentLine === 0 || currentLine > 0 && (lastLine === null || lastLine === void 0 ? void 0 : lastLine.decision);
|
|
303
304
|
var stopEkho = (0, _useEkho.default)({
|
|
304
305
|
audioType: currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType,
|
|
305
306
|
voice: currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.voice,
|
|
@@ -332,7 +333,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
332
333
|
return function () {
|
|
333
334
|
stop();
|
|
334
335
|
};
|
|
335
|
-
}, [currentMessage, start, stop, handleClickNext, currentLineData.audioType, autoplayCond, audioFailed]);
|
|
336
|
+
}, [currentMessage, start, stop, handleClickNext, currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType, autoplayCond, audioFailed]);
|
|
336
337
|
|
|
337
338
|
var decisionPayload = _objectSpread(_objectSpread({}, currentLineData.payload), {}, {
|
|
338
339
|
required: !isBranched,
|
|
@@ -368,8 +369,8 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
368
369
|
}) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
369
370
|
className: "conversation--controls"
|
|
370
371
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
371
|
-
className: "gat--btn__round ".concat(
|
|
372
|
-
disabled:
|
|
372
|
+
className: "gat--btn__round ".concat(disableBackButton ? 'disabled' : ''),
|
|
373
|
+
disabled: disableBackButton ? true : '',
|
|
373
374
|
type: "button",
|
|
374
375
|
onClick: manualClickBack
|
|
375
376
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -590,6 +590,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
590
590
|
height: '100vh',
|
|
591
591
|
position: 'static'
|
|
592
592
|
};
|
|
593
|
+
var disableBackButton = line === 0 || line > 0 && (lastLine === null || lastLine === void 0 ? void 0 : lastLine.decision);
|
|
593
594
|
|
|
594
595
|
if (isDecision) {
|
|
595
596
|
var decisionPayload = _objectSpread(_objectSpread({}, currentLine.payload), {}, {
|
|
@@ -643,10 +644,10 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
643
644
|
dir: (0, _LangIsRtl.default)() ? 'rtl' : 'ltr',
|
|
644
645
|
className: "dialog-component-controls"
|
|
645
646
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
646
|
-
disabled:
|
|
647
|
+
disabled: disableBackButton,
|
|
647
648
|
type: "button",
|
|
648
649
|
onClick: manualBackLine,
|
|
649
|
-
className: "gat--btn__round ".concat(
|
|
650
|
+
className: "gat--btn__round ".concat(disableBackButton ? 'disabled' : '')
|
|
650
651
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
651
652
|
className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
|
|
652
653
|
})), /*#__PURE__*/_react.default.createElement("button", {
|