@gamelearn/arcade-components 2.31.0 → 2.31.1

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.
@@ -476,22 +476,27 @@ var ConversationalProComponent = function ConversationalProComponent(_ref) {
476
476
  }
477
477
  }, [edges, isBranched, lines, mounted, progress === null || progress === void 0 ? void 0 : progress.line]);
478
478
  keyboardControl(isDecision || disableBackButton ? null : manualClickBack, isDecision ? null : manualClickNext);
479
- var decisionPayload = _objectSpread(_objectSpread({}, currentLineData.payload), {}, {
480
- required: !isBranched,
481
- branched: isBranched,
482
- onAddPoints: decisionNotifyProgress,
483
- onFinish: handleClickNext,
484
- keyboardControl: keyboardControl,
485
- emitEvent: emitEvent,
486
- soundActions: soundActions,
487
- inheritProps: {
488
- characters: currentCharacters,
489
- background: background,
490
- flex: leftWithSlots ? leftWithSlots.flex : true,
491
- slots: !leftWithSlots ? [] : leftWithSlots.slots
492
- }
493
- });
494
479
  if (isDecision) {
480
+ var decisionPayload = _objectSpread(_objectSpread({}, currentLineData.payload), {}, {
481
+ decisionNumber: lines.filter(function (l) {
482
+ return l.decision;
483
+ }).findIndex(function (l) {
484
+ return l.id === lines[currentLine].id;
485
+ }) + 1,
486
+ required: !isBranched,
487
+ branched: isBranched,
488
+ onAddPoints: decisionNotifyProgress,
489
+ onFinish: handleClickNext,
490
+ keyboardControl: keyboardControl,
491
+ emitEvent: emitEvent,
492
+ soundActions: soundActions,
493
+ inheritProps: {
494
+ characters: currentCharacters,
495
+ background: background,
496
+ flex: leftWithSlots ? leftWithSlots.flex : true,
497
+ slots: !leftWithSlots ? [] : leftWithSlots.slots
498
+ }
499
+ });
495
500
  return /*#__PURE__*/_react.default.createElement(_decisionComponent.default, decisionPayload);
496
501
  }
497
502
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -34,6 +34,7 @@ var DecisionComponent = function DecisionComponent(_ref) {
34
34
  props = _objectWithoutProperties(_ref, _excluded);
35
35
  var _props$inheritProps = props.inheritProps,
36
36
  inheritProps = _props$inheritProps === void 0 ? {} : _props$inheritProps,
37
+ decisionNumber = props.decisionNumber,
37
38
  required = props.required,
38
39
  question = props.question,
39
40
  onAddPoints = props.onAddPoints,
@@ -78,7 +79,10 @@ var DecisionComponent = function DecisionComponent(_ref) {
78
79
  var emitGameData = function emitGameData(choice) {
79
80
  emitEvent({
80
81
  type: 'decisionJournal',
81
- payload: choice
82
+ payload: {
83
+ choice: choice,
84
+ decisionNumber: decisionNumber
85
+ }
82
86
  });
83
87
  };
84
88
  var onNext = function onNext(choice) {
@@ -670,6 +670,11 @@ var DialogComponent = function DialogComponent(_ref) {
670
670
  var container = document.querySelector('.screens--container');
671
671
  if (isDecision) {
672
672
  var decisionPayload = _objectSpread(_objectSpread({}, currentLineData.payload), {}, {
673
+ decisionNumber: lines.filter(function (l) {
674
+ return l.decision;
675
+ }).findIndex(function (l) {
676
+ return l.id === currentLineData.id;
677
+ }) + 1,
673
678
  inheritProps: {
674
679
  slots: [],
675
680
  disableBackground: true
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.0",
5
+ "version": "2.31.1",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",