@gamelearn/arcade-components 2.11.2 → 2.12.0

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.
@@ -751,7 +751,7 @@ var DialogComponent = function DialogComponent(_ref) {
751
751
  var disabled = line === 0 || previousLineWasDecision();
752
752
  return disabled;
753
753
  }, [line, previousLineWasDecision]);
754
- keyboardControl(disableBackButton || animationRunning ? null : manualBackLine, animationRunning ? null : manualNextLine);
754
+ keyboardControl(isDecision || disableBackButton || animationRunning ? null : manualBackLine, isDecision || animationRunning ? null : manualNextLine);
755
755
 
756
756
  if (isDecision) {
757
757
  var decisionPayload = _objectSpread(_objectSpread({}, currentLineData.payload), {}, {
@@ -42,7 +42,8 @@ var InventoryItem = function InventoryItem(_ref) {
42
42
  description = _ref.description,
43
43
  element = _ref.element,
44
44
  onFinish = _ref.onFinish,
45
- soundActions = _ref.soundActions;
45
+ soundActions = _ref.soundActions,
46
+ keyboardControl = _ref.keyboardControl;
46
47
  var orbit = (0, _react.useRef)();
47
48
 
48
49
  var _soundActions = _slicedToArray(soundActions, 1),
@@ -69,6 +70,15 @@ var InventoryItem = function InventoryItem(_ref) {
69
70
  }
70
71
  };
71
72
 
73
+ var close = function close() {
74
+ playSound('click-ui');
75
+ onFinish();
76
+ };
77
+
78
+ if (keyboardControl) {
79
+ keyboardControl(null, close, close);
80
+ }
81
+
72
82
  return /*#__PURE__*/_react.default.createElement("div", {
73
83
  className: "inventory--layer__info",
74
84
  dir: "auto"
@@ -77,8 +87,7 @@ var InventoryItem = function InventoryItem(_ref) {
77
87
  }, /*#__PURE__*/_react.default.createElement("div", {
78
88
  className: "inventory-popup__close",
79
89
  onClick: function onClick() {
80
- playSound('click-ui');
81
- onFinish();
90
+ close();
82
91
  }
83
92
  }, /*#__PURE__*/_react.default.createElement("span", {
84
93
  className: "icon-close"
@@ -26,7 +26,8 @@ var NoticeComponent = function NoticeComponent(_ref) {
26
26
  text = _ref.text,
27
27
  buttonText = _ref.buttonText,
28
28
  emitEvent = _ref.emitEvent,
29
- soundActions = _ref.soundActions;
29
+ soundActions = _ref.soundActions,
30
+ keyboardControl = _ref.keyboardControl;
30
31
 
31
32
  var _soundActions = _slicedToArray(soundActions, 1),
32
33
  playSound = _soundActions[0];
@@ -38,6 +39,7 @@ var NoticeComponent = function NoticeComponent(_ref) {
38
39
  });
39
40
  };
40
41
 
42
+ keyboardControl(null, onFinish, onFinish);
41
43
  return /*#__PURE__*/_react.default.createElement("div", {
42
44
  className: "popup--layer"
43
45
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -9,6 +9,7 @@ var _mocker = require("helpers/mocker");
9
9
 
10
10
  var mockProps = {
11
11
  soundActions: _mocker.soundActions,
12
+ keyboardControl: _mocker.keyboardControl,
12
13
  title: 'title',
13
14
  text: 'text',
14
15
  buttonText: 'click',
@@ -35,7 +35,8 @@ var UrlComponent = function UrlComponent(_ref) {
35
35
  textLabel = _ref.text_labelId,
36
36
  viewed = _ref.viewed,
37
37
  documentType = _ref.documentType,
38
- soundActions = _ref.soundActions;
38
+ soundActions = _ref.soundActions,
39
+ keyboardControl = _ref.keyboardControl;
39
40
  var item = {
40
41
  documentType: documentType,
41
42
  name: nameLabel,
@@ -60,6 +61,7 @@ var UrlComponent = function UrlComponent(_ref) {
60
61
  clicked = _useState2[0],
61
62
  setClicked = _useState2[1];
62
63
 
64
+ keyboardControl(null, !viewed && clicked ? close : null, !viewed && clicked ? close : null);
63
65
  var linkUrl = link.indexOf('http') !== 0 ? "http://".concat(link) : link;
64
66
  return /*#__PURE__*/_react.default.createElement("div", {
65
67
  className: "popup--layer"
@@ -10,6 +10,7 @@ var _mocker = require("helpers/mocker");
10
10
  var mockProps = {
11
11
  emitEvent: _mocker.emitEvent,
12
12
  soundActions: _mocker.soundActions,
13
+ keyboardControl: _mocker.keyboardControl,
13
14
  name: 'un link',
14
15
  link: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
15
16
  text: 'yea',
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.11.2",
5
+ "version": "2.12.0",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",