@gamelearn/arcade-components 2.39.0 → 2.39.2

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.
@@ -172,10 +172,15 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
172
172
  var clearIntervalForCountDown = (0, _react.useCallback)(function () {
173
173
  clearInterval(intervalForCountDown.current);
174
174
  }, []);
175
- var pauseTheCounter = (0, _react.useCallback)(function () {
175
+ var pauseTheCounter = (0, _react.useCallback)(function (remainingTimeWhenPauseTheCounter) {
176
176
  pauseDate.current = Date.now();
177
- remainingTime.current = finalDate.current - pauseDate.current;
178
- clearListenerForActualDate();
177
+ if (!finalDate.current) {
178
+ remainingTime.current = pauseDate.current - (pauseDate.current - remainingTimeWhenPauseTheCounter * 1000);
179
+ clearListenerForActualDate();
180
+ } else {
181
+ remainingTime.current = finalDate.current - pauseDate.current;
182
+ clearListenerForActualDate();
183
+ }
179
184
  }, [clearListenerForActualDate]);
180
185
  var feedbackError = (0, _react.useCallback)(function () {
181
186
  setFeedbackData(function () {
@@ -342,7 +347,7 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
342
347
  if (hasClickOrder && area.index === clickedZones.length || !hasClickOrder) {
343
348
  var _specificFeedbacks$co2;
344
349
  if (timer) {
345
- pauseTheCounter();
350
+ pauseTheCounter(countDownTime);
346
351
  }
347
352
  handleClick();
348
353
  if (specificFeedbacks !== null && specificFeedbacks !== void 0 && (_specificFeedbacks$co2 = specificFeedbacks.correctFeedbacks) !== null && _specificFeedbacks$co2 !== void 0 && _specificFeedbacks$co2.length) {
@@ -367,7 +372,6 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
367
372
  });
368
373
  if (timer) {
369
374
  clearIntervalForCountDown();
370
- pauseTheCounter();
371
375
  }
372
376
  }
373
377
  }
@@ -399,7 +403,7 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
399
403
  setDialogForTimer(false);
400
404
  }
401
405
  }
402
- }, [createStartAndEndDate, defaultCompleted, firstTryForFrame, puzzlesAutoCompleted, slideNumber, timer]);
406
+ }, [defaultCompleted, firstTryForFrame, puzzlesAutoCompleted, slideNumber, timer]);
403
407
  (0, _react.useEffect)(function () {
404
408
  if (timer && countDownTime === 0) feedbackError();
405
409
  }, [countDownTime, feedbackError, timer]);
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.39.0",
5
+ "version": "2.39.2",
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.22.0",
17
+ "@gamelearn/arcade-styles": "2.22.1",
18
18
  "@gamelearn/arcade-three-core": "1.24.3",
19
19
  "@react-three/a11y": "^3.0.0",
20
20
  "@react-three/drei": "9.4.3",