@coorpacademy/app-review 0.8.1-alpha.3 → 0.8.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.
@@ -60,9 +60,6 @@ const getCurrentSlideRef = (state) => {
60
60
  const content = progression.state.content;
61
61
  return content.ref;
62
62
  };
63
- const isLastSlideAnswered = (slidesRef, slideRef) => {
64
- return last(slidesRef) === slideRef;
65
- };
66
63
  const buildStackSlides = (state, dispatch, options) => {
67
64
  const { translate } = options;
68
65
  const currentSlideRef = getCurrentSlideRef(state);
@@ -73,12 +70,9 @@ const buildStackSlides = (state, dispatch, options) => {
73
70
  // @ts-expect-error typescript does not support capped versions of lodash functions
74
71
  const stack = reduce.convert({ cap: false })((acc, uiSlide, _index) => {
75
72
  const index = toInteger(_index);
76
- const slideRef = slideRefs[index];
77
- const lastAnsweredSlideRef = isLastSlideAnswered(progression.state.slides, slideRef);
78
73
  const positions = state.ui.positions;
79
- // when unstack the last answered slide (position -1), we set the position to 0 only during the animation
80
- // to avoid to hide the slide (caused by the position -1).
81
- const position = lastAnsweredSlideRef && positions[index] === -1 ? 0 : positions[index];
74
+ const position = positions[index];
75
+ const slideRef = slideRefs[index];
82
76
  if (!slideRef)
83
77
  return set(index, { ...uiSlide, position }, acc);
84
78
  const slideFromAPI = get(slideRef, state.data.slides);
@@ -91,7 +85,7 @@ const buildStackSlides = (state, dispatch, options) => {
91
85
  const slideUI = get(['ui', 'slide', slideRef], state);
92
86
  const animateCorrectionPopin = isCurrentSlideRef && slideUI.animateCorrectionPopin;
93
87
  const showCorrectionPopin = isCurrentSlideRef && slideUI.showCorrectionPopin;
94
- const animationType = lastAnsweredSlideRef ? slideUI.animationType : undefined;
88
+ const animationType = slideUI.animationType;
95
89
  const updatedUiSlide = {
96
90
  ...uiSlide,
97
91
  position,
@@ -66,9 +66,6 @@ const getCurrentSlideRef = (state) => {
66
66
  const content = progression.state.content;
67
67
  return content.ref;
68
68
  };
69
- const isLastSlideAnswered = (slidesRef, slideRef) => {
70
- return (0, last_1.default)(slidesRef) === slideRef;
71
- };
72
69
  const buildStackSlides = (state, dispatch, options) => {
73
70
  const { translate } = options;
74
71
  const currentSlideRef = getCurrentSlideRef(state);
@@ -79,12 +76,9 @@ const buildStackSlides = (state, dispatch, options) => {
79
76
  // @ts-expect-error typescript does not support capped versions of lodash functions
80
77
  const stack = reduce_1.default.convert({ cap: false })((acc, uiSlide, _index) => {
81
78
  const index = (0, toInteger_1.default)(_index);
82
- const slideRef = slideRefs[index];
83
- const lastAnsweredSlideRef = isLastSlideAnswered(progression.state.slides, slideRef);
84
79
  const positions = state.ui.positions;
85
- // when unstack the last answered slide (position -1), we set the position to 0 only during the animation
86
- // to avoid to hide the slide (caused by the position -1).
87
- const position = lastAnsweredSlideRef && positions[index] === -1 ? 0 : positions[index];
80
+ const position = positions[index];
81
+ const slideRef = slideRefs[index];
88
82
  if (!slideRef)
89
83
  return (0, set_1.default)(index, { ...uiSlide, position }, acc);
90
84
  const slideFromAPI = (0, get_1.default)(slideRef, state.data.slides);
@@ -97,7 +91,7 @@ const buildStackSlides = (state, dispatch, options) => {
97
91
  const slideUI = (0, get_1.default)(['ui', 'slide', slideRef], state);
98
92
  const animateCorrectionPopin = isCurrentSlideRef && slideUI.animateCorrectionPopin;
99
93
  const showCorrectionPopin = isCurrentSlideRef && slideUI.showCorrectionPopin;
100
- const animationType = lastAnsweredSlideRef ? slideUI.animationType : undefined;
94
+ const animationType = slideUI.animationType;
101
95
  const updatedUiSlide = {
102
96
  ...uiSlide,
103
97
  position,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/app-review",
3
- "version": "0.8.1-alpha.3+db8ebf908",
3
+ "version": "0.8.1",
4
4
  "description": "",
5
5
  "engines": {
6
6
  "node": ">=16.15.0"
@@ -35,9 +35,9 @@
35
35
  "main": "lib/index.js",
36
36
  "module": "es/index.js",
37
37
  "dependencies": {
38
- "@coorpacademy/components": "10.28.1-alpha.3+db8ebf908",
38
+ "@coorpacademy/components": "10.28.1",
39
39
  "@coorpacademy/redux-task": "1.1.6",
40
- "@coorpacademy/translate": "6.1.5",
40
+ "@coorpacademy/translate": "^6.1.5",
41
41
  "cross-fetch": "^3.1.5",
42
42
  "jwt-decode": "^3.1.2",
43
43
  "react-redux": "^7.2.9",
@@ -51,7 +51,7 @@
51
51
  "devDependencies": {
52
52
  "@coorpacademy/css-modules-require-hook": "3.0.0",
53
53
  "@coorpacademy/eslint-plugin-coorpacademy": "^11.0.0",
54
- "@coorpacademy/webpack-config": "12.0.0",
54
+ "@coorpacademy/webpack-config": "12.0.1",
55
55
  "@testing-library/react": "^12.1.5",
56
56
  "@types/lodash": "^4.14.182",
57
57
  "@typescript-eslint/eslint-plugin": "^5.28.0",
@@ -71,5 +71,5 @@
71
71
  "webpack-cli": "^4.10.0",
72
72
  "webpack-dev-server": "^4.11.1"
73
73
  },
74
- "gitHead": "db8ebf908a93696a7f98439354e1710aef50ea82"
74
+ "gitHead": "f16cc5fd899c3a83f60b9909d29ea52a3a9c8c60"
75
75
  }