@gamelearn/arcade-components 2.11.3 → 2.12.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.
- package/dist/components/decision-component/components/DecisionComponent.js +1 -1
- package/dist/components/inventory-item/components/InventoryItem.js +12 -3
- package/dist/components/notice-component/components/NoticeComponent.js +3 -1
- package/dist/components/notice-component/mocks/mockForStory.js +1 -0
- package/dist/components/url-component/components/UrlComponent.js +3 -1
- package/dist/components/url-component/mocks/mockForProps.js +1 -0
- package/package.json +2 -2
|
@@ -210,7 +210,7 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
|
|
213
|
-
keyboardControl(null, selectedView === 'results' ? function () {
|
|
213
|
+
keyboardControl(null, selectedView === 'results' && !failed ? function () {
|
|
214
214
|
onNext(resultChoice);
|
|
215
215
|
} : null);
|
|
216
216
|
|
|
@@ -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
|
-
|
|
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", {
|
|
@@ -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.
|
|
5
|
+
"version": "2.12.1",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime": "^7.18.6",
|
|
17
|
-
"@gamelearn/arcade-styles": "2.9.
|
|
17
|
+
"@gamelearn/arcade-styles": "2.9.2",
|
|
18
18
|
"@gamelearn/arcade-three-core": "1.17.2",
|
|
19
19
|
"@react-three/drei": "9.4.3",
|
|
20
20
|
"@react-three/fiber": "8.0.17",
|