@coorpacademy/app-review 0.21.0 → 0.21.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/es/configure-store.js +1 -4
- package/es/types/common.d.ts +4 -19
- package/es/types/slides.d.ts +2 -1
- package/es/views/slides/map-api-slide-to-ui.d.ts +3 -2
- package/lib/configure-store.js +1 -4
- package/lib/types/common.d.ts +4 -19
- package/lib/types/slides.d.ts +2 -1
- package/lib/views/slides/map-api-slide-to-ui.d.ts +3 -2
- package/package.json +4 -4
package/es/configure-store.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { applyMiddleware, compose, createStore } from 'redux';
|
|
2
2
|
import thunk from 'redux-thunk';
|
|
3
3
|
import { getServices } from '@coorpacademy/review-services';
|
|
4
|
-
import { identity } from 'lodash/fp';
|
|
5
4
|
import rootReducer from './reducers';
|
|
6
5
|
export default function configureStore(options) {
|
|
7
6
|
const _compose = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
|
@@ -14,9 +13,7 @@ export default function configureStore(options) {
|
|
|
14
13
|
const thunkOptions = {
|
|
15
14
|
services: options.services || getServices(),
|
|
16
15
|
callbackOnViewChanged: options.callbackOnViewChanged,
|
|
17
|
-
appendVideoOptions: options.appendVideoOptions
|
|
18
|
-
// this identity is temporary added to avoir errors on mobile application,
|
|
19
|
-
// while the function to compute the props is made
|
|
16
|
+
appendVideoOptions: options.appendVideoOptions
|
|
20
17
|
};
|
|
21
18
|
const thunkMiddleware = thunk.withExtraArgument(thunkOptions);
|
|
22
19
|
const enhancer = _compose(applyMiddleware(thunkMiddleware));
|
package/es/types/common.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Media } from '@coorpacademy/components/es/molecule/questions/types';
|
|
1
2
|
import type { Services, VideoMedia } from '@coorpacademy/review-services';
|
|
2
3
|
export declare type WithRequired<T, K extends keyof T> = T & {
|
|
3
4
|
[P in K]-?: T[P];
|
|
@@ -11,22 +12,9 @@ export declare type Skin = {
|
|
|
11
12
|
primary: string;
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
|
-
declare type VideoSrcPropsForPlayer = {
|
|
15
|
-
mimeType: string;
|
|
16
|
-
videoId: string;
|
|
17
|
-
jwpOptions: unknown;
|
|
18
|
-
loading?: boolean;
|
|
19
|
-
type: string;
|
|
20
|
-
};
|
|
21
15
|
export declare type VideoPropsForPlayer = {
|
|
22
16
|
type: string;
|
|
23
|
-
src:
|
|
24
|
-
};
|
|
25
|
-
export declare type MediaPropsForPlayer = {
|
|
26
|
-
type: 'img' | 'audio';
|
|
27
|
-
url: string;
|
|
28
|
-
_id: string;
|
|
29
|
-
mimeType: string;
|
|
17
|
+
src: Media[];
|
|
30
18
|
};
|
|
31
19
|
export declare type ConnectedOptions = {
|
|
32
20
|
translate: Translate;
|
|
@@ -39,14 +27,11 @@ export declare type AppOptions = ConnectedOptions & {
|
|
|
39
27
|
skillRef?: string;
|
|
40
28
|
services?: Services;
|
|
41
29
|
callbackOnViewChanged?: (viewName: ViewName) => void;
|
|
42
|
-
appendVideoOptions
|
|
30
|
+
appendVideoOptions: (media: VideoMedia) => Promise<VideoPropsForPlayer>;
|
|
43
31
|
};
|
|
44
|
-
export declare type ThunkOptions = {
|
|
45
|
-
callbackOnViewChanged?: AppOptions['callbackOnViewChanged'];
|
|
32
|
+
export declare type ThunkOptions = Pick<AppOptions, 'callbackOnViewChanged' | 'appendVideoOptions'> & {
|
|
46
33
|
services: Services;
|
|
47
|
-
appendVideoOptions: (media: VideoMedia) => Promise<VideoPropsForPlayer>;
|
|
48
34
|
};
|
|
49
35
|
export declare type Options = {
|
|
50
36
|
services: Services;
|
|
51
37
|
};
|
|
52
|
-
export {};
|
package/es/types/slides.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Media } from '@coorpacademy/components/es/molecule/questions/types';
|
|
1
2
|
export declare type Choice = {
|
|
2
3
|
order?: number;
|
|
3
4
|
selected: boolean;
|
|
@@ -74,6 +75,6 @@ export declare type Template = {
|
|
|
74
75
|
export declare type AnswerUI = {
|
|
75
76
|
model: QcmDrag | Qcm | QcmGraphic | FreeText | DropDown | QuestionRange | Template;
|
|
76
77
|
help: string;
|
|
77
|
-
media?:
|
|
78
|
+
media?: Media;
|
|
78
79
|
};
|
|
79
80
|
export declare type SlideUIAnimations = 'unstack' | 'restack';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Dispatch } from 'redux';
|
|
2
2
|
import type { Question, SlideFromAPI } from '@coorpacademy/review-services';
|
|
3
|
+
import { Media } from '@coorpacademy/components/es/molecule/questions/types';
|
|
3
4
|
import { AnswerUI } from '../../types/slides';
|
|
4
|
-
import {
|
|
5
|
+
import { Translate } from '../../types/common';
|
|
5
6
|
export declare const getQuestionType: (question: Question) => Question['type'];
|
|
6
|
-
export declare const mapApiSlideToUi: (dispatch: Dispatch, translate: Translate) => (slide: SlideFromAPI, answers: string[], media
|
|
7
|
+
export declare const mapApiSlideToUi: (dispatch: Dispatch, translate: Translate) => (slide: SlideFromAPI, answers: string[], media?: Media) => {
|
|
7
8
|
questionText: string;
|
|
8
9
|
answerUI: AnswerUI;
|
|
9
10
|
};
|
package/lib/configure-store.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const redux_1 = require("redux");
|
|
7
7
|
const redux_thunk_1 = __importDefault(require("redux-thunk"));
|
|
8
8
|
const review_services_1 = require("@coorpacademy/review-services");
|
|
9
|
-
const fp_1 = require("lodash/fp");
|
|
10
9
|
const reducers_1 = __importDefault(require("./reducers"));
|
|
11
10
|
function configureStore(options) {
|
|
12
11
|
const _compose = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
|
@@ -19,9 +18,7 @@ function configureStore(options) {
|
|
|
19
18
|
const thunkOptions = {
|
|
20
19
|
services: options.services || (0, review_services_1.getServices)(),
|
|
21
20
|
callbackOnViewChanged: options.callbackOnViewChanged,
|
|
22
|
-
appendVideoOptions: options.appendVideoOptions
|
|
23
|
-
// this identity is temporary added to avoir errors on mobile application,
|
|
24
|
-
// while the function to compute the props is made
|
|
21
|
+
appendVideoOptions: options.appendVideoOptions
|
|
25
22
|
};
|
|
26
23
|
const thunkMiddleware = redux_thunk_1.default.withExtraArgument(thunkOptions);
|
|
27
24
|
const enhancer = _compose((0, redux_1.applyMiddleware)(thunkMiddleware));
|
package/lib/types/common.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Media } from '@coorpacademy/components/es/molecule/questions/types';
|
|
1
2
|
import type { Services, VideoMedia } from '@coorpacademy/review-services';
|
|
2
3
|
export declare type WithRequired<T, K extends keyof T> = T & {
|
|
3
4
|
[P in K]-?: T[P];
|
|
@@ -11,22 +12,9 @@ export declare type Skin = {
|
|
|
11
12
|
primary: string;
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
|
-
declare type VideoSrcPropsForPlayer = {
|
|
15
|
-
mimeType: string;
|
|
16
|
-
videoId: string;
|
|
17
|
-
jwpOptions: unknown;
|
|
18
|
-
loading?: boolean;
|
|
19
|
-
type: string;
|
|
20
|
-
};
|
|
21
15
|
export declare type VideoPropsForPlayer = {
|
|
22
16
|
type: string;
|
|
23
|
-
src:
|
|
24
|
-
};
|
|
25
|
-
export declare type MediaPropsForPlayer = {
|
|
26
|
-
type: 'img' | 'audio';
|
|
27
|
-
url: string;
|
|
28
|
-
_id: string;
|
|
29
|
-
mimeType: string;
|
|
17
|
+
src: Media[];
|
|
30
18
|
};
|
|
31
19
|
export declare type ConnectedOptions = {
|
|
32
20
|
translate: Translate;
|
|
@@ -39,14 +27,11 @@ export declare type AppOptions = ConnectedOptions & {
|
|
|
39
27
|
skillRef?: string;
|
|
40
28
|
services?: Services;
|
|
41
29
|
callbackOnViewChanged?: (viewName: ViewName) => void;
|
|
42
|
-
appendVideoOptions
|
|
30
|
+
appendVideoOptions: (media: VideoMedia) => Promise<VideoPropsForPlayer>;
|
|
43
31
|
};
|
|
44
|
-
export declare type ThunkOptions = {
|
|
45
|
-
callbackOnViewChanged?: AppOptions['callbackOnViewChanged'];
|
|
32
|
+
export declare type ThunkOptions = Pick<AppOptions, 'callbackOnViewChanged' | 'appendVideoOptions'> & {
|
|
46
33
|
services: Services;
|
|
47
|
-
appendVideoOptions: (media: VideoMedia) => Promise<VideoPropsForPlayer>;
|
|
48
34
|
};
|
|
49
35
|
export declare type Options = {
|
|
50
36
|
services: Services;
|
|
51
37
|
};
|
|
52
|
-
export {};
|
package/lib/types/slides.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Media } from '@coorpacademy/components/es/molecule/questions/types';
|
|
1
2
|
export declare type Choice = {
|
|
2
3
|
order?: number;
|
|
3
4
|
selected: boolean;
|
|
@@ -74,6 +75,6 @@ export declare type Template = {
|
|
|
74
75
|
export declare type AnswerUI = {
|
|
75
76
|
model: QcmDrag | Qcm | QcmGraphic | FreeText | DropDown | QuestionRange | Template;
|
|
76
77
|
help: string;
|
|
77
|
-
media?:
|
|
78
|
+
media?: Media;
|
|
78
79
|
};
|
|
79
80
|
export declare type SlideUIAnimations = 'unstack' | 'restack';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Dispatch } from 'redux';
|
|
2
2
|
import type { Question, SlideFromAPI } from '@coorpacademy/review-services';
|
|
3
|
+
import { Media } from '@coorpacademy/components/es/molecule/questions/types';
|
|
3
4
|
import { AnswerUI } from '../../types/slides';
|
|
4
|
-
import {
|
|
5
|
+
import { Translate } from '../../types/common';
|
|
5
6
|
export declare const getQuestionType: (question: Question) => Question['type'];
|
|
6
|
-
export declare const mapApiSlideToUi: (dispatch: Dispatch, translate: Translate) => (slide: SlideFromAPI, answers: string[], media
|
|
7
|
+
export declare const mapApiSlideToUi: (dispatch: Dispatch, translate: Translate) => (slide: SlideFromAPI, answers: string[], media?: Media) => {
|
|
7
8
|
questionText: string;
|
|
8
9
|
answerUI: AnswerUI;
|
|
9
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/app-review",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.15.0"
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"main": "lib/index.js",
|
|
36
36
|
"module": "es/index.js",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@coorpacademy/components": "11.10.
|
|
38
|
+
"@coorpacademy/components": "11.10.1",
|
|
39
39
|
"@coorpacademy/progression-engine": "11.5.3",
|
|
40
40
|
"@coorpacademy/redux-task": "1.1.6",
|
|
41
41
|
"@coorpacademy/review-services": "1.4.0",
|
|
42
|
-
"@coorpacademy/review-services-mocks": "1.4.
|
|
42
|
+
"@coorpacademy/review-services-mocks": "1.4.1",
|
|
43
43
|
"@coorpacademy/translate": "6.2.0",
|
|
44
44
|
"cross-fetch": "^3.1.5",
|
|
45
45
|
"jwt-decode": "^3.1.2",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"webpack-cli": "^4.10.0",
|
|
75
75
|
"webpack-dev-server": "^4.11.1"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "bc1f5ec13303d3386ede87aeab585f48b4ca6593"
|
|
78
78
|
}
|