@gamelearn/arcade-components 1.35.1 → 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.
@@ -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 (currentLine === lines.length - 1) {
329
+ if (isEndNode()) {
320
330
  finishConversation();
321
331
  } else {
322
332
  setAutomatic(false);
@@ -357,7 +367,9 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
357
367
  }
358
368
  });
359
369
  (0, _react.useEffect)(function () {
360
- if ((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType) === 'none' && !currentMessage.emotion.includes('think')) {
370
+ var _currentMessage$emoti;
371
+
372
+ if ((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType) === 'none' && !((_currentMessage$emoti = currentMessage.emotion) !== null && _currentMessage$emoti !== void 0 && _currentMessage$emoti.includes('think'))) {
361
373
  setTTsStart(true);
362
374
  }
363
375
  }, [currentLineData, currentMessage.emotion]); // Autoplay logic
@@ -438,7 +450,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
438
450
  }, /*#__PURE__*/_react.default.createElement("span", {
439
451
  className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
440
452
  })), /*#__PURE__*/_react.default.createElement("button", {
441
- className: "gat--btn__round ".concat(automatic && currentLine === lines.length - 1 ? 'glowing-animation' : ''),
453
+ className: "gat--btn__round ".concat(automatic && isEndNode() ? 'glowing-animation' : ''),
442
454
  type: "button",
443
455
  onClick: manualClickNext
444
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 (line === lines.length - 1) {
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 && line === lines.length - 1 ? 'glowing-animation' : '')
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
  })))));
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "1.35.1",
5
+ "version": "1.35.3",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",