@gamelearn/arcade-components 1.35.2 → 1.35.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
|
@@ -313,10 +313,20 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
313
313
|
setStarted(true);
|
|
314
314
|
};
|
|
315
315
|
|
|
316
|
+
var isEndNode = function isEndNode() {
|
|
317
|
+
if (isBranched) {
|
|
318
|
+
return currentLineData && currentLineData.type !== 'conversationalDecision' && !edges.find(function (edge) {
|
|
319
|
+
return edge.fromId === currentLineData.id;
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return currentLine === lines.length - 1;
|
|
324
|
+
};
|
|
325
|
+
|
|
316
326
|
var manualClickNext = function manualClickNext() {
|
|
317
327
|
playSound('click-ui');
|
|
318
328
|
|
|
319
|
-
if (
|
|
329
|
+
if (isEndNode()) {
|
|
320
330
|
finishConversation();
|
|
321
331
|
} else {
|
|
322
332
|
setAutomatic(false);
|
|
@@ -440,7 +450,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
440
450
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
441
451
|
className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
|
|
442
452
|
})), /*#__PURE__*/_react.default.createElement("button", {
|
|
443
|
-
className: "gat--btn__round ".concat(automatic &&
|
|
453
|
+
className: "gat--btn__round ".concat(automatic && isEndNode() ? 'glowing-animation' : ''),
|
|
444
454
|
type: "button",
|
|
445
455
|
onClick: manualClickNext
|
|
446
456
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -409,8 +409,18 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
409
409
|
backLine();
|
|
410
410
|
};
|
|
411
411
|
|
|
412
|
+
var isEndNode = function isEndNode() {
|
|
413
|
+
if (isBranched) {
|
|
414
|
+
return currentLine && currentLine.type !== 'conversationalDecision' && !edges.find(function (edge) {
|
|
415
|
+
return edge.fromId === currentLine.id;
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
return line === lines.length - 1;
|
|
420
|
+
};
|
|
421
|
+
|
|
412
422
|
var manualNextLine = function manualNextLine() {
|
|
413
|
-
if (
|
|
423
|
+
if (isEndNode()) {
|
|
414
424
|
finishConversation();
|
|
415
425
|
} else {
|
|
416
426
|
setAutomatic(false);
|
|
@@ -806,7 +816,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
806
816
|
type: "button",
|
|
807
817
|
onClick: manualNextLine,
|
|
808
818
|
disabled: animationRunning,
|
|
809
|
-
className: "gat--btn__round \n ".concat(animationRunning ? 'disabled' : '', "\n ").concat(automatic &&
|
|
819
|
+
className: "gat--btn__round \n ".concat(animationRunning ? 'disabled' : '', "\n ").concat(automatic && isEndNode() ? 'glowing-animation' : '')
|
|
810
820
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
811
821
|
className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
|
|
812
822
|
})))));
|