@coorpacademy/app-review 0.46.14-alpha.9 → 0.46.14-react18.80
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/es/reducers/data/corrections.d.ts +1 -1
- package/es/reducers/data/current-skill.d.ts +1 -1
- package/es/reducers/data/index.d.ts +3 -3
- package/es/reducers/data/progression.d.ts +1 -1
- package/es/reducers/data/rank.d.ts +1 -1
- package/es/reducers/data/slides.d.ts +1 -1
- package/es/reducers/data/token.d.ts +1 -1
- package/es/reducers/data/videos.d.ts +1 -1
- package/es/reducers/index.d.ts +3 -7
- package/es/reducers/ui/answers.d.ts +1 -1
- package/es/reducers/ui/current-slide-ref.d.ts +1 -1
- package/es/reducers/ui/index.d.ts +1 -5
- package/es/reducers/ui/navigation.d.ts +1 -1
- package/es/reducers/ui/positions.d.ts +1 -1
- package/es/reducers/ui/quit-popin.d.ts +1 -1
- package/es/reducers/ui/show-button-revising.d.ts +1 -1
- package/es/reducers/ui/show-congrats.d.ts +1 -1
- package/es/reducers/ui/slide.d.ts +1 -1
- package/lib/reducers/data/corrections.d.ts +1 -1
- package/lib/reducers/data/current-skill.d.ts +1 -1
- package/lib/reducers/data/index.d.ts +3 -3
- package/lib/reducers/data/progression.d.ts +1 -1
- package/lib/reducers/data/rank.d.ts +1 -1
- package/lib/reducers/data/slides.d.ts +1 -1
- package/lib/reducers/data/token.d.ts +1 -1
- package/lib/reducers/data/videos.d.ts +1 -1
- package/lib/reducers/index.d.ts +3 -7
- package/lib/reducers/ui/answers.d.ts +1 -1
- package/lib/reducers/ui/current-slide-ref.d.ts +1 -1
- package/lib/reducers/ui/index.d.ts +1 -5
- package/lib/reducers/ui/navigation.d.ts +1 -1
- package/lib/reducers/ui/positions.d.ts +1 -1
- package/lib/reducers/ui/quit-popin.d.ts +1 -1
- package/lib/reducers/ui/show-button-revising.d.ts +1 -1
- package/lib/reducers/ui/show-congrats.d.ts +1 -1
- package/lib/reducers/ui/slide.d.ts +1 -1
- package/package.json +19 -10
- package/es/actions/api/fetch-correction.js +0 -18
- package/es/actions/api/fetch-rank.js +0 -34
- package/es/actions/api/fetch-skill.js +0 -16
- package/es/actions/api/fetch-slide.js +0 -31
- package/es/actions/api/fetch-slides-to-review-by-skill-ref.js +0 -32
- package/es/actions/api/fetch-video-props.js +0 -34
- package/es/actions/api/post-answer.js +0 -36
- package/es/actions/api/post-progression.js +0 -25
- package/es/actions/data/token.js +0 -5
- package/es/actions/ui/answers.js +0 -54
- package/es/actions/ui/navigation.js +0 -26
- package/es/actions/ui/next-slide.js +0 -33
- package/es/actions/ui/quit-popin.js +0 -8
- package/es/actions/ui/show-button-revising.js +0 -6
- package/es/actions/ui/slides.js +0 -10
- package/es/common/index.js +0 -10
- package/es/configure-store.js +0 -26
- package/es/helpers/css-register.js +0 -2
- package/es/index.js +0 -48
- package/es/reducers/data/corrections.js +0 -25
- package/es/reducers/data/current-skill.js +0 -13
- package/es/reducers/data/index.js +0 -17
- package/es/reducers/data/progression.js +0 -20
- package/es/reducers/data/rank.js +0 -27
- package/es/reducers/data/slides.js +0 -20
- package/es/reducers/data/token.js +0 -11
- package/es/reducers/data/videos.js +0 -33
- package/es/reducers/index.js +0 -7
- package/es/reducers/ui/answers.js +0 -28
- package/es/reducers/ui/current-slide-ref.js +0 -21
- package/es/reducers/ui/index.js +0 -19
- package/es/reducers/ui/navigation.js +0 -18
- package/es/reducers/ui/positions.js +0 -30
- package/es/reducers/ui/quit-popin.js +0 -16
- package/es/reducers/ui/show-button-revising.js +0 -17
- package/es/reducers/ui/show-congrats.js +0 -20
- package/es/reducers/ui/slide.js +0 -52
- package/es/types/common.js +0 -1
- package/es/types/slides.js +0 -1
- package/es/views/slides/index.js +0 -387
- package/es/views/slides/map-api-slide-to-ui.js +0 -177
- package/lib/actions/api/fetch-correction.js +0 -25
- package/lib/actions/api/fetch-rank.js +0 -43
- package/lib/actions/api/fetch-skill.js +0 -23
- package/lib/actions/api/fetch-slide.js +0 -38
- package/lib/actions/api/fetch-slides-to-review-by-skill-ref.js +0 -39
- package/lib/actions/api/fetch-video-props.js +0 -43
- package/lib/actions/api/post-answer.js +0 -43
- package/lib/actions/api/post-progression.js +0 -32
- package/lib/actions/data/token.js +0 -9
- package/lib/actions/ui/answers.js +0 -61
- package/lib/actions/ui/navigation.js +0 -31
- package/lib/actions/ui/next-slide.js +0 -40
- package/lib/actions/ui/quit-popin.js +0 -11
- package/lib/actions/ui/show-button-revising.js +0 -10
- package/lib/actions/ui/slides.js +0 -14
- package/lib/common/index.js +0 -17
- package/lib/configure-store.js +0 -32
- package/lib/helpers/css-register.js +0 -7
- package/lib/index.js +0 -76
- package/lib/reducers/data/corrections.js +0 -30
- package/lib/reducers/data/current-skill.js +0 -15
- package/lib/reducers/data/index.js +0 -22
- package/lib/reducers/data/progression.js +0 -22
- package/lib/reducers/data/rank.js +0 -32
- package/lib/reducers/data/slides.js +0 -26
- package/lib/reducers/data/token.js +0 -13
- package/lib/reducers/data/videos.js +0 -36
- package/lib/reducers/index.js +0 -12
- package/lib/reducers/ui/answers.js +0 -31
- package/lib/reducers/ui/current-slide-ref.js +0 -23
- package/lib/reducers/ui/index.js +0 -24
- package/lib/reducers/ui/navigation.js +0 -20
- package/lib/reducers/ui/positions.js +0 -35
- package/lib/reducers/ui/quit-popin.js +0 -18
- package/lib/reducers/ui/show-button-revising.js +0 -19
- package/lib/reducers/ui/show-congrats.js +0 -22
- package/lib/reducers/ui/slide.js +0 -58
- package/lib/types/common.js +0 -2
- package/lib/types/slides.js +0 -2
- package/lib/views/slides/index.js +0 -395
- package/lib/views/slides/map-api-slide-to-ui.js +0 -182
|
@@ -3,5 +3,5 @@ import { ReceivedCorrection, FetchCorrection } from '../../actions/api/fetch-cor
|
|
|
3
3
|
import { FetchProgression } from '../../actions/api/post-progression';
|
|
4
4
|
export declare type CorrectionsState = Record<string, CorrectionFromAPI>;
|
|
5
5
|
export declare type CorrectionsAction = ReceivedCorrection | FetchCorrection;
|
|
6
|
-
declare const reducer: (state: CorrectionsState
|
|
6
|
+
declare const reducer: (state: CorrectionsState, action: CorrectionsAction | FetchProgression) => CorrectionsState;
|
|
7
7
|
export default reducer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Skill } from '@coorpacademy/review-services';
|
|
2
2
|
import { ReceivedSkill } from '../../actions/api/fetch-skill';
|
|
3
3
|
export declare type CurrentSkillState = Skill | null;
|
|
4
|
-
declare const reducer: (state: CurrentSkillState
|
|
4
|
+
declare const reducer: (state: CurrentSkillState, action: ReceivedSkill) => CurrentSkillState;
|
|
5
5
|
export default reducer;
|
|
@@ -16,11 +16,11 @@ export declare type DataState = {
|
|
|
16
16
|
};
|
|
17
17
|
declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
18
18
|
corrections: CorrectionsState;
|
|
19
|
-
progression:
|
|
19
|
+
progression: import("@coorpacademy/review-services/lib/types/services-types").ProgressionFromAPI;
|
|
20
20
|
slides: SlidesState;
|
|
21
21
|
token: string;
|
|
22
22
|
rank: RankState;
|
|
23
|
-
currentSkill:
|
|
23
|
+
currentSkill: import("@coorpacademy/review-services/lib/types/services-types").Skill;
|
|
24
24
|
videos: VideoPropsState;
|
|
25
|
-
}>, import("
|
|
25
|
+
}>, import("redux").AnyAction>;
|
|
26
26
|
export default _default;
|
|
@@ -2,5 +2,5 @@ import type { ProgressionFromAPI } from '@coorpacademy/review-services';
|
|
|
2
2
|
import { PostAnswerSuccessAction } from '../../actions/api/post-answer';
|
|
3
3
|
import { FetchProgression, ReceivedProgression } from '../../actions/api/post-progression';
|
|
4
4
|
export declare type ProgressionState = ProgressionFromAPI | null;
|
|
5
|
-
declare const reducer: (state: ProgressionState
|
|
5
|
+
declare const reducer: (state: ProgressionState, action: ReceivedProgression | PostAnswerSuccessAction | FetchProgression) => ProgressionState;
|
|
6
6
|
export default reducer;
|
|
@@ -4,5 +4,5 @@ export declare type RankState = {
|
|
|
4
4
|
start: number;
|
|
5
5
|
end: number;
|
|
6
6
|
};
|
|
7
|
-
declare const reducer: (state: RankState
|
|
7
|
+
declare const reducer: (state: RankState, action: RankAction | FetchProgression) => RankState;
|
|
8
8
|
export default reducer;
|
|
@@ -4,5 +4,5 @@ import { FetchProgression } from '../../actions/api/post-progression';
|
|
|
4
4
|
export declare type SlidesAction = FetchSlide | ReceivedSlide;
|
|
5
5
|
export declare type SlidesState = Record<string, SlideFromAPI | null>;
|
|
6
6
|
export declare const initialState: SlidesState;
|
|
7
|
-
declare const reducer: (state: SlidesState
|
|
7
|
+
declare const reducer: (state: SlidesState, action: SlidesAction | FetchProgression) => SlidesState;
|
|
8
8
|
export default reducer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { StoreToken } from '../../actions/data/token';
|
|
2
2
|
export declare type TokenState = string;
|
|
3
|
-
declare const reducer: (state:
|
|
3
|
+
declare const reducer: (state: TokenState, action: StoreToken) => TokenState;
|
|
4
4
|
export default reducer;
|
|
@@ -4,5 +4,5 @@ import { NextSlideAction } from '../../actions/ui/next-slide';
|
|
|
4
4
|
import { SetCurrentSlideAction } from '../../actions/ui/slides';
|
|
5
5
|
export declare type VideoPropsState = Record<string, VideoPropsForPlayer>;
|
|
6
6
|
export declare const initialState: VideoPropsState;
|
|
7
|
-
declare const reducer: (state: VideoPropsState
|
|
7
|
+
declare const reducer: (state: VideoPropsState, action: SetVideoPropsAction | NextSlideAction | SetCurrentSlideAction | ShowVideoAction) => VideoPropsState;
|
|
8
8
|
export default reducer;
|
package/es/reducers/index.d.ts
CHANGED
|
@@ -7,11 +7,11 @@ export declare type StoreState = {
|
|
|
7
7
|
declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
8
8
|
data: import("redux").CombinedState<{
|
|
9
9
|
corrections: import("./data/corrections").CorrectionsState;
|
|
10
|
-
progression: import("
|
|
10
|
+
progression: import("@coorpacademy/review-services/lib/types/services-types").ProgressionFromAPI;
|
|
11
11
|
slides: import("./data/slides").SlidesState;
|
|
12
12
|
token: string;
|
|
13
13
|
rank: import("./data/rank").RankState;
|
|
14
|
-
currentSkill: import("
|
|
14
|
+
currentSkill: import("@coorpacademy/review-services/lib/types/services-types").Skill;
|
|
15
15
|
videos: import("./data/videos").VideoPropsState;
|
|
16
16
|
}>;
|
|
17
17
|
ui: import("redux").CombinedState<{
|
|
@@ -24,9 +24,5 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
24
24
|
showButtonRevising: boolean;
|
|
25
25
|
showCongrats: boolean;
|
|
26
26
|
}>;
|
|
27
|
-
}>, import("
|
|
28
|
-
type: "@@ui/OPEN_POPIN";
|
|
29
|
-
} | {
|
|
30
|
-
type: "@@ui/CLOSE_POPIN";
|
|
31
|
-
}>;
|
|
27
|
+
}>, import("redux").AnyAction>;
|
|
32
28
|
export default _default;
|
|
@@ -4,5 +4,5 @@ import { FetchProgression } from '../../actions/api/post-progression';
|
|
|
4
4
|
export declare type UISlideAnswer = string[];
|
|
5
5
|
export declare type UIAnswerState = Record<string, UISlideAnswer>;
|
|
6
6
|
export declare const initialState: UIAnswerState;
|
|
7
|
-
declare const reducer: (state: UIAnswerState
|
|
7
|
+
declare const reducer: (state: UIAnswerState, action: EditAnswerAction | NextSlideAction | FetchProgression) => UIAnswerState;
|
|
8
8
|
export default reducer;
|
|
@@ -2,5 +2,5 @@ import { NextSlideAction } from '../../actions/ui/next-slide';
|
|
|
2
2
|
import { SetCurrentSlideAction } from '../../actions/ui/slides';
|
|
3
3
|
import { FetchProgression } from '../../actions/api/post-progression';
|
|
4
4
|
export declare type CurrentSlideRefState = string;
|
|
5
|
-
declare const reducer: (state:
|
|
5
|
+
declare const reducer: (state: CurrentSlideRefState, action: SetCurrentSlideAction | NextSlideAction | FetchProgression) => CurrentSlideRefState;
|
|
6
6
|
export default reducer;
|
|
@@ -25,9 +25,5 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
25
25
|
showQuitPopin: boolean;
|
|
26
26
|
showButtonRevising: boolean;
|
|
27
27
|
showCongrats: boolean;
|
|
28
|
-
}>, import("
|
|
29
|
-
type: "@@ui/OPEN_POPIN";
|
|
30
|
-
} | {
|
|
31
|
-
type: "@@ui/CLOSE_POPIN";
|
|
32
|
-
}>;
|
|
28
|
+
}>, import("redux").AnyAction>;
|
|
33
29
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { NavigateToAction, NavigateBackAction } from '../../actions/ui/navigation';
|
|
2
2
|
export declare type NavigationState = Array<'slides' | 'loader'>;
|
|
3
|
-
declare const reducer: (state: NavigationState
|
|
3
|
+
declare const reducer: (state: NavigationState, action: NavigateToAction | NavigateBackAction) => NavigationState;
|
|
4
4
|
export default reducer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FetchProgression, ReceivedProgression } from '../../actions/api/post-progression';
|
|
2
2
|
import { NextSlideAction } from '../../actions/ui/next-slide';
|
|
3
3
|
export declare type UIPositionState = number[];
|
|
4
|
-
declare const reducer: (state: UIPositionState
|
|
4
|
+
declare const reducer: (state: UIPositionState, action: NextSlideAction | ReceivedProgression | FetchProgression) => UIPositionState;
|
|
5
5
|
export default reducer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { closeQuitPopin, openQuitPopin } from '../../actions/ui/quit-popin';
|
|
2
2
|
export declare type ShowQuitPopinState = boolean;
|
|
3
|
-
declare const reducer: (state:
|
|
3
|
+
declare const reducer: (state: ShowQuitPopinState, action: typeof openQuitPopin | typeof closeQuitPopin) => ShowQuitPopinState;
|
|
4
4
|
export default reducer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ShowButtonRevisingAction } from '../../actions/ui/show-button-revising';
|
|
2
2
|
import { FetchProgression } from '../../actions/api/post-progression';
|
|
3
3
|
export declare type UIShowButtonRevisingState = boolean;
|
|
4
|
-
declare const reducer: (state:
|
|
4
|
+
declare const reducer: (state: UIShowButtonRevisingState, action: ShowButtonRevisingAction | FetchProgression) => UIShowButtonRevisingState;
|
|
5
5
|
export default reducer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextSlideAction } from '../../actions/ui/next-slide';
|
|
2
2
|
import { FetchProgression } from '../../actions/api/post-progression';
|
|
3
3
|
export declare type UIShowCongratsState = boolean;
|
|
4
|
-
declare const reducer: (state:
|
|
4
|
+
declare const reducer: (state: UIShowCongratsState, action: NextSlideAction | FetchProgression) => UIShowCongratsState;
|
|
5
5
|
export default reducer;
|
|
@@ -14,5 +14,5 @@ export declare type UISlide = {
|
|
|
14
14
|
};
|
|
15
15
|
export declare type UISlideState = Record<string, UISlide>;
|
|
16
16
|
export declare const initialState: UISlideState;
|
|
17
|
-
declare const reducer: (state: UISlideState
|
|
17
|
+
declare const reducer: (state: UISlideState, action: FetchSlide | PostAnswerRequestAction | EditAnswerAction | ReceivedCorrection | NextSlideAction | FetchProgression) => UISlideState;
|
|
18
18
|
export default reducer;
|
|
@@ -3,5 +3,5 @@ import { ReceivedCorrection, FetchCorrection } from '../../actions/api/fetch-cor
|
|
|
3
3
|
import { FetchProgression } from '../../actions/api/post-progression';
|
|
4
4
|
export declare type CorrectionsState = Record<string, CorrectionFromAPI>;
|
|
5
5
|
export declare type CorrectionsAction = ReceivedCorrection | FetchCorrection;
|
|
6
|
-
declare const reducer: (state: CorrectionsState
|
|
6
|
+
declare const reducer: (state: CorrectionsState, action: CorrectionsAction | FetchProgression) => CorrectionsState;
|
|
7
7
|
export default reducer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Skill } from '@coorpacademy/review-services';
|
|
2
2
|
import { ReceivedSkill } from '../../actions/api/fetch-skill';
|
|
3
3
|
export declare type CurrentSkillState = Skill | null;
|
|
4
|
-
declare const reducer: (state: CurrentSkillState
|
|
4
|
+
declare const reducer: (state: CurrentSkillState, action: ReceivedSkill) => CurrentSkillState;
|
|
5
5
|
export default reducer;
|
|
@@ -16,11 +16,11 @@ export declare type DataState = {
|
|
|
16
16
|
};
|
|
17
17
|
declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
18
18
|
corrections: CorrectionsState;
|
|
19
|
-
progression:
|
|
19
|
+
progression: import("@coorpacademy/review-services/lib/types/services-types").ProgressionFromAPI;
|
|
20
20
|
slides: SlidesState;
|
|
21
21
|
token: string;
|
|
22
22
|
rank: RankState;
|
|
23
|
-
currentSkill:
|
|
23
|
+
currentSkill: import("@coorpacademy/review-services/lib/types/services-types").Skill;
|
|
24
24
|
videos: VideoPropsState;
|
|
25
|
-
}>, import("
|
|
25
|
+
}>, import("redux").AnyAction>;
|
|
26
26
|
export default _default;
|
|
@@ -2,5 +2,5 @@ import type { ProgressionFromAPI } from '@coorpacademy/review-services';
|
|
|
2
2
|
import { PostAnswerSuccessAction } from '../../actions/api/post-answer';
|
|
3
3
|
import { FetchProgression, ReceivedProgression } from '../../actions/api/post-progression';
|
|
4
4
|
export declare type ProgressionState = ProgressionFromAPI | null;
|
|
5
|
-
declare const reducer: (state: ProgressionState
|
|
5
|
+
declare const reducer: (state: ProgressionState, action: ReceivedProgression | PostAnswerSuccessAction | FetchProgression) => ProgressionState;
|
|
6
6
|
export default reducer;
|
|
@@ -4,5 +4,5 @@ export declare type RankState = {
|
|
|
4
4
|
start: number;
|
|
5
5
|
end: number;
|
|
6
6
|
};
|
|
7
|
-
declare const reducer: (state: RankState
|
|
7
|
+
declare const reducer: (state: RankState, action: RankAction | FetchProgression) => RankState;
|
|
8
8
|
export default reducer;
|
|
@@ -4,5 +4,5 @@ import { FetchProgression } from '../../actions/api/post-progression';
|
|
|
4
4
|
export declare type SlidesAction = FetchSlide | ReceivedSlide;
|
|
5
5
|
export declare type SlidesState = Record<string, SlideFromAPI | null>;
|
|
6
6
|
export declare const initialState: SlidesState;
|
|
7
|
-
declare const reducer: (state: SlidesState
|
|
7
|
+
declare const reducer: (state: SlidesState, action: SlidesAction | FetchProgression) => SlidesState;
|
|
8
8
|
export default reducer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { StoreToken } from '../../actions/data/token';
|
|
2
2
|
export declare type TokenState = string;
|
|
3
|
-
declare const reducer: (state:
|
|
3
|
+
declare const reducer: (state: TokenState, action: StoreToken) => TokenState;
|
|
4
4
|
export default reducer;
|
|
@@ -4,5 +4,5 @@ import { NextSlideAction } from '../../actions/ui/next-slide';
|
|
|
4
4
|
import { SetCurrentSlideAction } from '../../actions/ui/slides';
|
|
5
5
|
export declare type VideoPropsState = Record<string, VideoPropsForPlayer>;
|
|
6
6
|
export declare const initialState: VideoPropsState;
|
|
7
|
-
declare const reducer: (state: VideoPropsState
|
|
7
|
+
declare const reducer: (state: VideoPropsState, action: SetVideoPropsAction | NextSlideAction | SetCurrentSlideAction | ShowVideoAction) => VideoPropsState;
|
|
8
8
|
export default reducer;
|
package/lib/reducers/index.d.ts
CHANGED
|
@@ -7,11 +7,11 @@ export declare type StoreState = {
|
|
|
7
7
|
declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
8
8
|
data: import("redux").CombinedState<{
|
|
9
9
|
corrections: import("./data/corrections").CorrectionsState;
|
|
10
|
-
progression: import("
|
|
10
|
+
progression: import("@coorpacademy/review-services/lib/types/services-types").ProgressionFromAPI;
|
|
11
11
|
slides: import("./data/slides").SlidesState;
|
|
12
12
|
token: string;
|
|
13
13
|
rank: import("./data/rank").RankState;
|
|
14
|
-
currentSkill: import("
|
|
14
|
+
currentSkill: import("@coorpacademy/review-services/lib/types/services-types").Skill;
|
|
15
15
|
videos: import("./data/videos").VideoPropsState;
|
|
16
16
|
}>;
|
|
17
17
|
ui: import("redux").CombinedState<{
|
|
@@ -24,9 +24,5 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
24
24
|
showButtonRevising: boolean;
|
|
25
25
|
showCongrats: boolean;
|
|
26
26
|
}>;
|
|
27
|
-
}>, import("
|
|
28
|
-
type: "@@ui/OPEN_POPIN";
|
|
29
|
-
} | {
|
|
30
|
-
type: "@@ui/CLOSE_POPIN";
|
|
31
|
-
}>;
|
|
27
|
+
}>, import("redux").AnyAction>;
|
|
32
28
|
export default _default;
|
|
@@ -4,5 +4,5 @@ import { FetchProgression } from '../../actions/api/post-progression';
|
|
|
4
4
|
export declare type UISlideAnswer = string[];
|
|
5
5
|
export declare type UIAnswerState = Record<string, UISlideAnswer>;
|
|
6
6
|
export declare const initialState: UIAnswerState;
|
|
7
|
-
declare const reducer: (state: UIAnswerState
|
|
7
|
+
declare const reducer: (state: UIAnswerState, action: EditAnswerAction | NextSlideAction | FetchProgression) => UIAnswerState;
|
|
8
8
|
export default reducer;
|
|
@@ -2,5 +2,5 @@ import { NextSlideAction } from '../../actions/ui/next-slide';
|
|
|
2
2
|
import { SetCurrentSlideAction } from '../../actions/ui/slides';
|
|
3
3
|
import { FetchProgression } from '../../actions/api/post-progression';
|
|
4
4
|
export declare type CurrentSlideRefState = string;
|
|
5
|
-
declare const reducer: (state:
|
|
5
|
+
declare const reducer: (state: CurrentSlideRefState, action: SetCurrentSlideAction | NextSlideAction | FetchProgression) => CurrentSlideRefState;
|
|
6
6
|
export default reducer;
|
|
@@ -25,9 +25,5 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
25
25
|
showQuitPopin: boolean;
|
|
26
26
|
showButtonRevising: boolean;
|
|
27
27
|
showCongrats: boolean;
|
|
28
|
-
}>, import("
|
|
29
|
-
type: "@@ui/OPEN_POPIN";
|
|
30
|
-
} | {
|
|
31
|
-
type: "@@ui/CLOSE_POPIN";
|
|
32
|
-
}>;
|
|
28
|
+
}>, import("redux").AnyAction>;
|
|
33
29
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { NavigateToAction, NavigateBackAction } from '../../actions/ui/navigation';
|
|
2
2
|
export declare type NavigationState = Array<'slides' | 'loader'>;
|
|
3
|
-
declare const reducer: (state: NavigationState
|
|
3
|
+
declare const reducer: (state: NavigationState, action: NavigateToAction | NavigateBackAction) => NavigationState;
|
|
4
4
|
export default reducer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FetchProgression, ReceivedProgression } from '../../actions/api/post-progression';
|
|
2
2
|
import { NextSlideAction } from '../../actions/ui/next-slide';
|
|
3
3
|
export declare type UIPositionState = number[];
|
|
4
|
-
declare const reducer: (state: UIPositionState
|
|
4
|
+
declare const reducer: (state: UIPositionState, action: NextSlideAction | ReceivedProgression | FetchProgression) => UIPositionState;
|
|
5
5
|
export default reducer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { closeQuitPopin, openQuitPopin } from '../../actions/ui/quit-popin';
|
|
2
2
|
export declare type ShowQuitPopinState = boolean;
|
|
3
|
-
declare const reducer: (state:
|
|
3
|
+
declare const reducer: (state: ShowQuitPopinState, action: typeof openQuitPopin | typeof closeQuitPopin) => ShowQuitPopinState;
|
|
4
4
|
export default reducer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ShowButtonRevisingAction } from '../../actions/ui/show-button-revising';
|
|
2
2
|
import { FetchProgression } from '../../actions/api/post-progression';
|
|
3
3
|
export declare type UIShowButtonRevisingState = boolean;
|
|
4
|
-
declare const reducer: (state:
|
|
4
|
+
declare const reducer: (state: UIShowButtonRevisingState, action: ShowButtonRevisingAction | FetchProgression) => UIShowButtonRevisingState;
|
|
5
5
|
export default reducer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextSlideAction } from '../../actions/ui/next-slide';
|
|
2
2
|
import { FetchProgression } from '../../actions/api/post-progression';
|
|
3
3
|
export declare type UIShowCongratsState = boolean;
|
|
4
|
-
declare const reducer: (state:
|
|
4
|
+
declare const reducer: (state: UIShowCongratsState, action: NextSlideAction | FetchProgression) => UIShowCongratsState;
|
|
5
5
|
export default reducer;
|
|
@@ -14,5 +14,5 @@ export declare type UISlide = {
|
|
|
14
14
|
};
|
|
15
15
|
export declare type UISlideState = Record<string, UISlide>;
|
|
16
16
|
export declare const initialState: UISlideState;
|
|
17
|
-
declare const reducer: (state: UISlideState
|
|
17
|
+
declare const reducer: (state: UISlideState, action: FetchSlide | PostAnswerRequestAction | EditAnswerAction | ReceivedCorrection | NextSlideAction | FetchProgression) => UISlideState;
|
|
18
18
|
export default reducer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/app-review",
|
|
3
|
-
"version": "0.46.14-
|
|
3
|
+
"version": "0.46.14-react18.80+640762c72",
|
|
4
4
|
"description": "",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.12.0"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"static": "webpack --progress --output-path static",
|
|
11
11
|
"start": "cross-env BABEL_ENV=es webpack-dev-server",
|
|
12
12
|
"prepare": "npm run clean && npm run build --production",
|
|
13
|
-
"build:commonjs": "tsc -p tsconfig.lib.json",
|
|
14
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
13
|
+
"build:commonjs": "tsc -p tsconfig.lib.json || true",
|
|
14
|
+
"build:es": "tsc -p tsconfig.es.json || true",
|
|
15
15
|
"build": "concurrently \"npm run build:commonjs\" \"npm run build:es\"",
|
|
16
16
|
"clean:commonjs": "rm -rf lib",
|
|
17
17
|
"clean:es": "rm -rf es",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"main": "lib/index.js",
|
|
36
36
|
"module": "es/index.js",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@coorpacademy/components": "11.40.14-
|
|
38
|
+
"@coorpacademy/components": "11.40.14-react18.80+640762c72",
|
|
39
39
|
"@coorpacademy/progression-engine": "11.8.1",
|
|
40
40
|
"@coorpacademy/redux-task": "1.2.0",
|
|
41
41
|
"@coorpacademy/review-services": "1.7.0",
|
|
@@ -44,29 +44,38 @@
|
|
|
44
44
|
"cross-fetch": "^3.1.5",
|
|
45
45
|
"jwt-decode": "^3.1.2",
|
|
46
46
|
"lodash": "^4.17.21",
|
|
47
|
-
"react-redux": "^
|
|
47
|
+
"react-redux": "^8.1.0",
|
|
48
48
|
"redux": "^4.2.0",
|
|
49
49
|
"redux-thunk": "^2.4.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"react": "^
|
|
52
|
+
"react": "^18.3.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
+
"@babel/cli": "^7.26.4",
|
|
56
|
+
"@babel/core": "^7.26.7",
|
|
57
|
+
"@babel/preset-env": "^7.26.7",
|
|
58
|
+
"@babel/preset-react": "^7.26.3",
|
|
59
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
55
60
|
"@coorpacademy/css-modules-require-hook": "4.1.0",
|
|
56
61
|
"@coorpacademy/eslint-plugin-coorpacademy": "^11.0.0",
|
|
57
|
-
"@coorpacademy/webpack-config": "13.1.
|
|
58
|
-
"@testing-library/react": "^
|
|
62
|
+
"@coorpacademy/webpack-config": "13.1.4-react18.1108+640762c72",
|
|
63
|
+
"@testing-library/react": "^13.4.0",
|
|
59
64
|
"@types/lodash": "^4.14.182",
|
|
65
|
+
"@types/react": "^18.0.0",
|
|
66
|
+
"@types/react-dom": "^18.0.0",
|
|
60
67
|
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
|
61
68
|
"@typescript-eslint/parser": "^5.28.0",
|
|
62
69
|
"ava": "^4.3.0",
|
|
63
70
|
"browser-env": "^3.3.0",
|
|
64
71
|
"concurrently": "^5.2.0",
|
|
72
|
+
"cross-env": "^7.0.3",
|
|
65
73
|
"eslint": "^8.18.0",
|
|
66
74
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
67
75
|
"html-webpack-plugin": "^5.5.0",
|
|
68
76
|
"nock": "^13.2.9",
|
|
69
|
-
"react
|
|
77
|
+
"react": "18.3.1",
|
|
78
|
+
"react-dom": "18.3.1",
|
|
70
79
|
"ts-loader": "^9.5.2",
|
|
71
80
|
"ts-node": "^10.9.1",
|
|
72
81
|
"typescript": "^4.7.4",
|
|
@@ -74,5 +83,5 @@
|
|
|
74
83
|
"webpack-cli": "^4.10.0",
|
|
75
84
|
"webpack-dev-server": "^4.11.1"
|
|
76
85
|
},
|
|
77
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "640762c72462c8ab5522c61e58fe867a86bdac09"
|
|
78
87
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import buildTask from '@coorpacademy/redux-task';
|
|
2
|
-
import get from 'lodash/fp/get';
|
|
3
|
-
export const CORRECTION_FETCH_REQUEST = '@@correction/FETCH_REQUEST';
|
|
4
|
-
export const CORRECTION_FETCH_SUCCESS = '@@correction/FETCH_SUCCESS';
|
|
5
|
-
export const CORRECTION_FETCH_FAILURE = '@@correction/FETCH_FAILURE';
|
|
6
|
-
export const fetchCorrection = (dispatch, getState, { services }) => {
|
|
7
|
-
const state = getState();
|
|
8
|
-
const slideRef = get(['ui', 'currentSlideRef'], state);
|
|
9
|
-
const token = get(['data', 'token'], state);
|
|
10
|
-
const progressionId = get(['data', 'progression', '_id'], state);
|
|
11
|
-
const answer = get(['ui', 'answers', slideRef], state);
|
|
12
|
-
const action = buildTask({
|
|
13
|
-
types: [CORRECTION_FETCH_REQUEST, CORRECTION_FETCH_SUCCESS, CORRECTION_FETCH_FAILURE],
|
|
14
|
-
meta: { slideRef },
|
|
15
|
-
task: () => services.fetchCorrection(slideRef, token, progressionId, answer)
|
|
16
|
-
});
|
|
17
|
-
return dispatch(action);
|
|
18
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import buildTask from '@coorpacademy/redux-task';
|
|
2
|
-
import get from 'lodash/fp/get';
|
|
3
|
-
export const RANK_FETCH_START_REQUEST = '@@rank/FETCH_START_REQUEST';
|
|
4
|
-
export const RANK_FETCH_START_SUCCESS = '@@rank/FETCH_START_SUCCESS';
|
|
5
|
-
export const RANK_FETCH_START_FAILURE = '@@rank/FETCH_START_FAILURE';
|
|
6
|
-
export const RANK_FETCH_END_REQUEST = '@@rank/FETCH_END_REQUEST';
|
|
7
|
-
export const RANK_FETCH_END_SUCCESS = '@@rank/FETCH_END_SUCCESS';
|
|
8
|
-
export const RANK_FETCH_END_FAILURE = '@@rank/FETCH_END_FAILURE';
|
|
9
|
-
const bailout = (path) => (state) => {
|
|
10
|
-
const value = get(path, state);
|
|
11
|
-
return !Number.isNaN(value);
|
|
12
|
-
};
|
|
13
|
-
export const fetchRank = (dispatch, getState, services, types, path) => {
|
|
14
|
-
const action = buildTask({
|
|
15
|
-
types,
|
|
16
|
-
task: () => {
|
|
17
|
-
const state = getState();
|
|
18
|
-
const token = get(['data', 'token'], state);
|
|
19
|
-
return services.fetchRank(token);
|
|
20
|
-
},
|
|
21
|
-
bailout: path ? bailout(path) : undefined
|
|
22
|
-
});
|
|
23
|
-
return dispatch(action);
|
|
24
|
-
};
|
|
25
|
-
export const fetchStartRank = (dispatch, getState, { services }) => {
|
|
26
|
-
return fetchRank(dispatch, getState, services, [RANK_FETCH_START_REQUEST, RANK_FETCH_START_SUCCESS, RANK_FETCH_START_FAILURE], 'data.rank.start');
|
|
27
|
-
};
|
|
28
|
-
export const fetchEndRank = (dispatch, getState, { services }) => {
|
|
29
|
-
return fetchRank(dispatch, getState, services, [
|
|
30
|
-
RANK_FETCH_END_REQUEST,
|
|
31
|
-
RANK_FETCH_END_SUCCESS,
|
|
32
|
-
RANK_FETCH_END_FAILURE
|
|
33
|
-
]);
|
|
34
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import get from 'lodash/fp/get';
|
|
2
|
-
import buildTask from '@coorpacademy/redux-task';
|
|
3
|
-
export const SKILL_FETCH_REQUEST = '@@skill/FETCH_REQUEST';
|
|
4
|
-
export const SKILL_FETCH_SUCCESS = '@@skill/FETCH_SUCCESS';
|
|
5
|
-
export const SKILL_FETCH_FAILURE = '@@skill/FETCH_FAILURE';
|
|
6
|
-
export const fetchSkill = (skillRef) => (dispatch, getState, { services }) => {
|
|
7
|
-
const action = buildTask({
|
|
8
|
-
types: [SKILL_FETCH_REQUEST, SKILL_FETCH_SUCCESS, SKILL_FETCH_FAILURE],
|
|
9
|
-
task: () => {
|
|
10
|
-
const state = getState();
|
|
11
|
-
const token = get(['data', 'token'], state);
|
|
12
|
-
return services.fetchSkill(skillRef, token);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
return dispatch(action);
|
|
16
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import buildTask from '@coorpacademy/redux-task';
|
|
2
|
-
import get from 'lodash/fp/get';
|
|
3
|
-
import has from 'lodash/fp/has';
|
|
4
|
-
import isEmpty from 'lodash/fp/isEmpty';
|
|
5
|
-
import { setCurrentSlide } from '../ui/slides';
|
|
6
|
-
export const SLIDE_FETCH_REQUEST = '@@slides/FETCH_REQUEST';
|
|
7
|
-
export const SLIDE_FETCH_SUCCESS = '@@slides/FETCH_SUCCESS';
|
|
8
|
-
export const SLIDE_FETCH_FAILURE = '@@slides/FETCH_FAILURE';
|
|
9
|
-
export const fetchSlide = (slideRef) => async (dispatch, getState, { services }) => {
|
|
10
|
-
const action = buildTask({
|
|
11
|
-
types: [SLIDE_FETCH_REQUEST, SLIDE_FETCH_SUCCESS, SLIDE_FETCH_FAILURE],
|
|
12
|
-
bailout: (state) => {
|
|
13
|
-
return has(`data.slides.${slideRef}`, state);
|
|
14
|
-
},
|
|
15
|
-
task: () => {
|
|
16
|
-
const state = getState();
|
|
17
|
-
const token = get(['data', 'token'], state);
|
|
18
|
-
return services.fetchSlide(slideRef, token);
|
|
19
|
-
},
|
|
20
|
-
meta: { slideRef }
|
|
21
|
-
});
|
|
22
|
-
const response = await dispatch(action);
|
|
23
|
-
if (response.type === SLIDE_FETCH_SUCCESS) {
|
|
24
|
-
const slideFromAPI = response.payload;
|
|
25
|
-
const state = getState();
|
|
26
|
-
const slides = get('data.progression.state.slides', state);
|
|
27
|
-
if (isEmpty(slides)) {
|
|
28
|
-
dispatch(setCurrentSlide(slideFromAPI));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import buildTask from '@coorpacademy/redux-task';
|
|
2
|
-
import difference from 'lodash/fp/difference';
|
|
3
|
-
import map from 'lodash/fp/map';
|
|
4
|
-
import get from 'lodash/fp/get';
|
|
5
|
-
import { showButtonRevising } from '../ui/show-button-revising';
|
|
6
|
-
export const SLIDES_TO_REVIEW_FETCH_REQUEST = '@@slidesToReview/FETCH_REQUEST';
|
|
7
|
-
export const SLIDES_TO_REVIEW_FETCH_SUCCESS = '@@slidesToReview/FETCH_SUCCESS';
|
|
8
|
-
export const SLIDES_TO_REVIEW_FETCH_FAILURE = '@@slidesToReview/FETCH_FAILURE';
|
|
9
|
-
export const fetchSlidesToReviewBySkillRef = async (dispatch, getState, { services }) => {
|
|
10
|
-
const state = getState();
|
|
11
|
-
const action = buildTask({
|
|
12
|
-
types: [
|
|
13
|
-
SLIDES_TO_REVIEW_FETCH_REQUEST,
|
|
14
|
-
SLIDES_TO_REVIEW_FETCH_SUCCESS,
|
|
15
|
-
SLIDES_TO_REVIEW_FETCH_FAILURE
|
|
16
|
-
],
|
|
17
|
-
task: () => {
|
|
18
|
-
const token = state.data.token;
|
|
19
|
-
const progression = state.data.progression;
|
|
20
|
-
const skillRef = progression.content.ref;
|
|
21
|
-
return services.fetchSlidesToReviewBySkillRef(token, skillRef, 10);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
const response = await dispatch(action);
|
|
25
|
-
if (response.type === SLIDES_TO_REVIEW_FETCH_SUCCESS) {
|
|
26
|
-
const answeredSlidesRef = get(['data', 'progression', 'state', 'slides'], state);
|
|
27
|
-
const slidesToReview = map(({ slideId }) => slideId, response.payload);
|
|
28
|
-
if (difference(slidesToReview, answeredSlidesRef).length >= 5) {
|
|
29
|
-
dispatch(showButtonRevising);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import get from 'lodash/fp/get';
|
|
2
|
-
export const SET_VIDEO_PROPS = '@@slide/SET_VIDEO_PROPS';
|
|
3
|
-
export const SHOW_VIDEO = '@@slide/SHOW_VIDEO';
|
|
4
|
-
export const setVideoProps = (payload) => ({
|
|
5
|
-
type: SET_VIDEO_PROPS,
|
|
6
|
-
payload
|
|
7
|
-
});
|
|
8
|
-
export const showVideo = (slideId) => ({
|
|
9
|
-
type: SHOW_VIDEO,
|
|
10
|
-
payload: { slideId }
|
|
11
|
-
});
|
|
12
|
-
export const fetchPropsVideo = (slideId) => async (dispatch, getState, { appendVideoOptions }) => {
|
|
13
|
-
const state = getState();
|
|
14
|
-
const slideFromAPI = get(['data', 'slides', slideId], state);
|
|
15
|
-
if (!slideFromAPI) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const slideMedia = get(['question', 'medias', '0'], slideFromAPI);
|
|
19
|
-
if (slideMedia && slideMedia.type === 'video') {
|
|
20
|
-
const videoProps = get(['data', 'videos', slideId], state);
|
|
21
|
-
if (videoProps) {
|
|
22
|
-
dispatch(showVideo(slideId));
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const props = await appendVideoOptions(slideMedia);
|
|
26
|
-
props.src[0].loading = false; // set to false to not show it until the next slide is unstack
|
|
27
|
-
props.src[0].type = 'video';
|
|
28
|
-
dispatch(setVideoProps({
|
|
29
|
-
slideId,
|
|
30
|
-
props
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
return;
|
|
34
|
-
};
|