@gamelearn/arcade-components 2.31.4 → 2.31.6

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.
@@ -305,18 +305,19 @@ var ConversationalProComponent = function ConversationalProComponent(_ref) {
305
305
  });
306
306
  }
307
307
  }
308
- } else {
308
+ } else if (currentLine < lines.length - 1) {
309
309
  var line = currentLine;
310
- var maxLine = lines.length - 1;
311
- if (line + 1 <= maxLine) {
312
- var next = line + 1;
313
- emitEvent({
314
- type: 'notifyProgress',
315
- payload: {
316
- line: next
317
- }
318
- });
319
- }
310
+ var next = line + 1;
311
+ emitEvent({
312
+ type: 'notifyProgress',
313
+ payload: {
314
+ line: next
315
+ }
316
+ });
317
+ } else {
318
+ emitEvent({
319
+ type: 'saveNode'
320
+ });
320
321
  }
321
322
  }, [edges, lines, emitEvent, currentLine, currentLineData.id, isBranched]);
322
323
  var handleClickNext = (0, _react.useCallback)(function (choice, reset) {
@@ -331,23 +332,20 @@ var ConversationalProComponent = function ConversationalProComponent(_ref) {
331
332
  } else {
332
333
  handleBranchDirection();
333
334
  }
334
- } else {
335
+ } else if (currentLine < lines.length - 1) {
335
336
  var line = currentLine;
336
- var maxLine = lines.length - 1;
337
- if (line + 1 <= maxLine) {
338
- var next = line + 1;
339
- setCurrentLine(next);
340
- emitEvent({
341
- type: 'notifyProgress',
342
- payload: {
343
- line: next
344
- }
345
- });
346
- } else if (currentLineData.decision) {
347
- finishConversation();
348
- } else {
349
- isLast = true;
350
- }
337
+ var next = line + 1;
338
+ setCurrentLine(next);
339
+ emitEvent({
340
+ type: 'notifyProgress',
341
+ payload: {
342
+ line: next
343
+ }
344
+ });
345
+ } else if (currentLineData.decision) {
346
+ finishConversation();
347
+ } else {
348
+ isLast = true;
351
349
  }
352
350
  if (!isLast) {
353
351
  setStarted(true);
@@ -434,6 +434,10 @@ var DialogComponent = function DialogComponent(_ref) {
434
434
  line: next
435
435
  }
436
436
  });
437
+ } else {
438
+ emitEvent({
439
+ type: 'saveNode'
440
+ });
437
441
  }
438
442
  }, [edges, line, lines, emitEvent, currentLineData.id, isBranched]);
439
443
  var nextLine = (0, _react.useCallback)(function (choice, reset) {
@@ -57,6 +57,7 @@ function useStateMachine(lines) {
57
57
  var slot = _step2.value;
58
58
  if (!slot.uid) continue;
59
59
  var animations = (_slot$character = slot.character) === null || _slot$character === void 0 ? void 0 : _slot$character.resource.animations;
60
+ if (!animations) continue;
60
61
  if (!urls[slot.uid]) {
61
62
  urls[slot.uid] = _defineProperty({}, slot.emotion, animations[slot.emotion].url);
62
63
  } else {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "2.31.4",
5
+ "version": "2.31.6",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",