@gamelearn/arcade-components 2.5.9 → 2.5.11-hotfix-arrows-dialog-tablets

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.
@@ -56,30 +56,35 @@ var AutoEvaluation = function AutoEvaluation(_ref) {
56
56
  emitEvent = _ref.emitEvent,
57
57
  soundActions = _ref.soundActions;
58
58
 
59
- var _useState = (0, _react.useState)('start'),
59
+ var _useState = (0, _react.useState)(null),
60
60
  _useState2 = _slicedToArray(_useState, 2),
61
- phase = _useState2[0],
62
- setPhase = _useState2[1];
61
+ pointIsBeingTouched = _useState2[0],
62
+ setPointIsBeingTouched = _useState2[1];
63
63
 
64
- var _useState3 = (0, _react.useState)(false),
64
+ var _useState3 = (0, _react.useState)('start'),
65
65
  _useState4 = _slicedToArray(_useState3, 2),
66
- finish = _useState4[0],
67
- setFinish = _useState4[1];
66
+ phase = _useState4[0],
67
+ setPhase = _useState4[1];
68
68
 
69
- var _useState5 = (0, _react.useState)(0),
69
+ var _useState5 = (0, _react.useState)(false),
70
70
  _useState6 = _slicedToArray(_useState5, 2),
71
- currentQuestion = _useState6[0],
72
- setCurrentQuestion = _useState6[1];
71
+ finish = _useState6[0],
72
+ setFinish = _useState6[1];
73
73
 
74
- var _useState7 = (0, _react.useState)({
74
+ var _useState7 = (0, _react.useState)(0),
75
+ _useState8 = _slicedToArray(_useState7, 2),
76
+ currentQuestion = _useState8[0],
77
+ setCurrentQuestion = _useState8[1];
78
+
79
+ var _useState9 = (0, _react.useState)({
75
80
  current: {
76
81
  questions: [],
77
82
  type: type
78
83
  }
79
84
  }),
80
- _useState8 = _slicedToArray(_useState7, 2),
81
- surveyData = _useState8[0],
82
- setSurveyData = _useState8[1];
85
+ _useState10 = _slicedToArray(_useState9, 2),
86
+ surveyData = _useState10[0],
87
+ setSurveyData = _useState10[1];
83
88
 
84
89
  var _soundActions = _slicedToArray(soundActions, 1),
85
90
  play = _soundActions[0];
@@ -182,10 +187,16 @@ var AutoEvaluation = function AutoEvaluation(_ref) {
182
187
 
183
188
  return /*#__PURE__*/_react.default.createElement("li", {
184
189
  key: "".concat(0 + i),
190
+ onTouchStart: function onTouchStart() {
191
+ setPointIsBeingTouched(i);
192
+ },
193
+ onTouchEnd: function onTouchEnd() {
194
+ setPointIsBeingTouched(null);
195
+ },
185
196
  onClick: function onClick() {
186
197
  handleNextQuestion(i, false);
187
198
  },
188
- className: "survey--points__item ".concat(((_surveyData$current$q2 = surveyData.current.questions[currentQuestion]) === null || _surveyData$current$q2 === void 0 ? void 0 : _surveyData$current$q2.answer) === i ? 'selected' : '')
199
+ className: "survey--points__item ".concat(((_surveyData$current$q2 = surveyData.current.questions[currentQuestion]) === null || _surveyData$current$q2 === void 0 ? void 0 : _surveyData$current$q2.answer) === i || pointIsBeingTouched === i ? 'selected' : '')
189
200
  }, i);
190
201
  }))))), /*#__PURE__*/_react.default.createElement("div", {
191
202
  className: "test--buttons next"
@@ -123,7 +123,7 @@ var CartelComponent = function CartelComponent(_ref) {
123
123
  className: "position--absolute top right"
124
124
  }, /*#__PURE__*/_react.default.createElement("button", {
125
125
  type: "button",
126
- className: "gat--btn__round",
126
+ className: "gat--btn__round gat--btn__close",
127
127
  onClick: function onClick() {
128
128
  return close();
129
129
  }
@@ -186,7 +186,7 @@ var ComicComponent = function ComicComponent(_ref) {
186
186
  className: "position--absolute top right"
187
187
  }, /*#__PURE__*/_react.default.createElement("button", {
188
188
  type: "button",
189
- className: "gat--btn__round",
189
+ className: "gat--btn__round gat--btn__close",
190
190
  "data-testid": "btn-cls",
191
191
  onClick: function onClick() {
192
192
  play('click-ui');
@@ -28,6 +28,9 @@ var BubbleWrapper = function BubbleWrapper(_ref) {
28
28
  return /*#__PURE__*/_react.default.createElement("group", {
29
29
  ref: group
30
30
  }, /*#__PURE__*/_react.default.createElement(_arcadeThreeCore.HtmlPro, {
31
+ onOcclude: function onOcclude() {
32
+ return null;
33
+ },
31
34
  zIndexRange: [5, 5],
32
35
  portal: container ? {
33
36
  current: container
@@ -783,7 +783,8 @@ var DialogComponent = function DialogComponent(_ref) {
783
783
  }) : null, /*#__PURE__*/_react.default.createElement(_arcadeThreeCore.HtmlPro, {
784
784
  style: {
785
785
  width: '100vw',
786
- height: '100vh'
786
+ height: '100vh',
787
+ position: 'static'
787
788
  },
788
789
  portal: container ? {
789
790
  current: container
@@ -81,7 +81,7 @@ var ImageComponent = function ImageComponent(_ref) {
81
81
  className: !imgUrl ? 'position--absolute top right' : 'readings--image--closeBtn'
82
82
  }, /*#__PURE__*/_react.default.createElement("button", {
83
83
  type: "button",
84
- className: "gat--btn__round",
84
+ className: "gat--btn__round gat--btn__close",
85
85
  onClick: close
86
86
  }, /*#__PURE__*/_react.default.createElement("span", {
87
87
  className: "icon-close"
@@ -73,17 +73,21 @@ var InventoryItem = function InventoryItem(_ref) {
73
73
  className: "inventory--layer__info",
74
74
  dir: "auto"
75
75
  }, /*#__PURE__*/_react.default.createElement("div", {
76
- className: "inventory--layer__info--popup fadeIn--animation"
76
+ className: "inventory-popup fadeIn--animation ".concat(description ? 'inventory-popup--withdescription' : '')
77
77
  }, /*#__PURE__*/_react.default.createElement("div", {
78
- className: "inventory--info__close",
78
+ className: "inventory-popup__close",
79
79
  onClick: function onClick() {
80
80
  playSound('click-ui');
81
81
  onFinish();
82
82
  }
83
83
  }, /*#__PURE__*/_react.default.createElement("span", {
84
84
  className: "icon-close"
85
- })), /*#__PURE__*/_react.default.createElement("div", {
86
- className: "inventory--layer__info--image"
85
+ })), /*#__PURE__*/_react.default.createElement("h1", {
86
+ className: "inventory-popup__title"
87
+ }, name), description && /*#__PURE__*/_react.default.createElement("div", {
88
+ className: "inventory-popup__description"
89
+ }, description), /*#__PURE__*/_react.default.createElement("div", {
90
+ className: "inventory-popup__image"
87
91
  }, /*#__PURE__*/_react.default.createElement(_fiber.Canvas, {
88
92
  style: {
89
93
  height: '100%'
@@ -111,9 +115,7 @@ var InventoryItem = function InventoryItem(_ref) {
111
115
  enablePan: false
112
116
  }), /*#__PURE__*/_react.default.createElement(_drei.Preload, {
113
117
  all: true
114
- })))), /*#__PURE__*/_react.default.createElement("div", {
115
- className: "inventory--layer__info--description"
116
- }, /*#__PURE__*/_react.default.createElement("h1", null, name), /*#__PURE__*/_react.default.createElement("p", null, description))));
118
+ }))))));
117
119
  };
118
120
 
119
121
  var _default = InventoryItem;
@@ -114,7 +114,7 @@ var VideoVisor = function VideoVisor(_ref) {
114
114
  })) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
115
115
  className: "position--absolute right top z-index1"
116
116
  }, /*#__PURE__*/_react.default.createElement("div", {
117
- className: "gat--btn__round",
117
+ className: "gat--btn__round gat--btn__close",
118
118
  onClick: endVideo
119
119
  }, /*#__PURE__*/_react.default.createElement("span", {
120
120
  className: "icon-close"
@@ -41,7 +41,7 @@ var NoticeComponent = function NoticeComponent(_ref) {
41
41
  return /*#__PURE__*/_react.default.createElement("div", {
42
42
  className: "popup--layer"
43
43
  }, /*#__PURE__*/_react.default.createElement("div", {
44
- className: "popup"
44
+ className: "popup popup--notice"
45
45
  }, /*#__PURE__*/_react.default.createElement("span", {
46
46
  className: "popup--head__title"
47
47
  }, title), /*#__PURE__*/_react.default.createElement("div", {
@@ -70,7 +70,7 @@ var PatternComponent = function PatternComponent(_ref) {
70
70
  className: "pattern__title"
71
71
  }, translate('phone.pattern')), /*#__PURE__*/_react.default.createElement("button", {
72
72
  type: "button",
73
- className: "pattern__close gat--btn__round",
73
+ className: "pattern__close gat--btn__round gat--btn__close",
74
74
  onClick: function onClick() {
75
75
  return close();
76
76
  }
@@ -117,7 +117,7 @@ var PdfComponent = function PdfComponent(_ref) {
117
117
  className: "position--absolute top right z-index1"
118
118
  }, /*#__PURE__*/_react.default.createElement("button", {
119
119
  type: "button",
120
- className: "gat--btn__round",
120
+ className: "gat--btn__round gat--btn__close",
121
121
  onClick: function onClick() {
122
122
  emitFinish();
123
123
  play('click-ui');
@@ -72,7 +72,7 @@ var SurveyComponent = function SurveyComponent(_ref) {
72
72
  var _useState5 = (0, _react.useState)(false),
73
73
  _useState6 = _slicedToArray(_useState5, 2),
74
74
  finished = _useState6[0],
75
- finish = _useState6[1];
75
+ setFinished = _useState6[1];
76
76
 
77
77
  var _soundActions = _slicedToArray(soundActions, 1),
78
78
  play = _soundActions[0];
@@ -90,8 +90,12 @@ var SurveyComponent = function SurveyComponent(_ref) {
90
90
  play('click-ui');
91
91
 
92
92
  if (!backward && page + 1 >= PAGES.length) {
93
- finish(true);
93
+ setFinished(true);
94
94
  } else {
95
+ if (backward) {
96
+ setFinished(false);
97
+ }
98
+
95
99
  var destinationPage = backward ? page - 1 : page + 1;
96
100
  setPage(destinationPage);
97
101
  }
@@ -121,12 +125,22 @@ var SurveyComponent = function SurveyComponent(_ref) {
121
125
  id: PAGES[page].id,
122
126
  survey: survey,
123
127
  translate: translate,
124
- changePage: function changePage() {
125
- return _changePage(false);
128
+ changePage: function changePage(e) {
129
+ return _changePage(false, e);
126
130
  }
127
131
  })), /*#__PURE__*/_react.default.createElement("div", {
128
132
  className: "test--buttons next"
129
- }, finished ? /*#__PURE__*/_react.default.createElement("button", {
133
+ }, /*#__PURE__*/_react.default.createElement("button", {
134
+ id: "survey-button-back",
135
+ type: "button",
136
+ disabled: page === 0,
137
+ onClick: function onClick() {
138
+ return _changePage(true);
139
+ },
140
+ className: "gat--btn__navigation ".concat(page === 0 ? 'disabled' : '')
141
+ }, /*#__PURE__*/_react.default.createElement("span", {
142
+ className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
143
+ })), finished && page === PAGES.length - 1 ? /*#__PURE__*/_react.default.createElement("button", {
130
144
  id: "survey-button",
131
145
  type: "button",
132
146
  disabled: !survey[PAGES[page].id],
@@ -138,17 +152,7 @@ var SurveyComponent = function SurveyComponent(_ref) {
138
152
  });
139
153
  },
140
154
  className: "gat--btn gat--btn__primary ".concat(!survey[PAGES[page].id] ? 'disabled' : '', " not-transition")
141
- }, translate('survey.finish')) : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("button", {
142
- id: "survey-button-back",
143
- type: "button",
144
- disabled: page === 0,
145
- onClick: function onClick() {
146
- return _changePage(true);
147
- },
148
- className: "gat--btn__navigation ".concat(page === 0 ? 'disabled' : '')
149
- }, /*#__PURE__*/_react.default.createElement("span", {
150
- className: (0, _LangIsRtl.default)() ? 'icon-next' : 'icon-back'
151
- })), /*#__PURE__*/_react.default.createElement("button", {
155
+ }, translate('survey.finish')) : null, !finished && page !== PAGES.length ? /*#__PURE__*/_react.default.createElement("button", {
152
156
  id: "survey-button",
153
157
  type: "button",
154
158
  disabled: !survey[PAGES[page].id],
@@ -158,7 +162,7 @@ var SurveyComponent = function SurveyComponent(_ref) {
158
162
  className: "gat--btn__navigation ".concat(!survey[PAGES[page].id] ? 'disabled' : '')
159
163
  }, /*#__PURE__*/_react.default.createElement("span", {
160
164
  className: (0, _LangIsRtl.default)() ? 'icon-back' : 'icon-next'
161
- })))))));
165
+ })) : null))));
162
166
  };
163
167
 
164
168
  var _default = SurveyComponent;
@@ -18,7 +18,7 @@ var skipButton = function skipButton(_ref) {
18
18
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, mandatory && viewed || !mandatory || finished || mandatoryHasBeenViewed ? /*#__PURE__*/_react.default.createElement("div", {
19
19
  className: "position--absolute right top z-index1"
20
20
  }, /*#__PURE__*/_react.default.createElement("div", {
21
- className: "gat--btn__round",
21
+ className: "gat--btn__round gat--btn__close",
22
22
  onClick: function onClick() {
23
23
  skip();
24
24
  }
@@ -289,7 +289,7 @@ var VideoVisor = function VideoVisor(_ref) {
289
289
  }, /*#__PURE__*/_react.default.createElement("p", null, Math.floor(loadedPercentage))))) : null) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
290
290
  className: "position--absolute right top z-index1"
291
291
  }, /*#__PURE__*/_react.default.createElement("div", {
292
- className: "gat--btn__round",
292
+ className: "gat--btn__round gat--btn__close",
293
293
  onClick: function onClick() {
294
294
  playSound('click-ui');
295
295
  endVideo();
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.9",
5
+ "version": "2.5.11-hotfix-arrows-dialog-tablets",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",
@@ -14,8 +14,8 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@babel/runtime": "^7.18.6",
17
- "@gamelearn/arcade-styles": "2.5.6",
18
- "@gamelearn/arcade-three-core": "1.17.1",
17
+ "@gamelearn/arcade-styles": "2.5.6-hotfix-arrows-dialog-tablets",
18
+ "@gamelearn/arcade-three-core": "1.17.2",
19
19
  "@react-three/drei": "9.4.3",
20
20
  "@react-three/fiber": "8.0.17",
21
21
  "@testing-library/jest-dom": "^5.16.4",