@coorpacademy/app-review 0.0.21-alpha.4 → 0.0.21-alpha.8
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/actions/api/is-fetching.d.ts +6 -0
- package/es/actions/api/is-fetching.d.ts.map +1 -0
- package/es/actions/api/is-fetching.js +4 -0
- package/es/actions/api/validate-slide.d.ts +6 -0
- package/es/actions/api/validate-slide.d.ts.map +1 -0
- package/es/actions/api/validate-slide.js +6 -0
- package/es/actions/courses.d.ts +2 -2
- package/es/actions/courses.d.ts.map +1 -1
- package/es/actions/finished-slides.d.ts +8 -0
- package/es/actions/finished-slides.d.ts.map +1 -0
- package/es/actions/finished-slides.js +7 -0
- package/es/actions/index.d.ts +2 -4
- package/es/actions/index.d.ts.map +1 -1
- package/es/actions/index.js +1 -3
- package/es/actions/navigation.d.ts +5 -5
- package/es/actions/navigation.d.ts.map +1 -1
- package/es/actions/review-status.d.ts +8 -0
- package/es/actions/review-status.d.ts.map +1 -0
- package/es/actions/review-status.js +7 -0
- package/es/actions/slides.d.ts +21 -0
- package/es/actions/slides.d.ts.map +1 -0
- package/es/actions/slides.js +17 -0
- package/es/actions/step-items.d.ts +15 -0
- package/es/actions/step-items.d.ts.map +1 -0
- package/es/actions/step-items.js +12 -0
- package/es/common/index.d.ts +8 -0
- package/es/common/index.d.ts.map +1 -0
- package/es/common/index.js +7 -0
- package/es/configure-store.d.ts +3 -11
- package/es/configure-store.d.ts.map +1 -1
- package/es/configure-store.js +10 -6
- package/es/index.d.ts +5 -10
- package/es/index.d.ts.map +1 -1
- package/es/index.js +43 -11
- package/es/middlewares/on-start-app.d.ts +1 -1
- package/es/middlewares/on-start-app.d.ts.map +1 -1
- package/es/middlewares/on-start-app.js +18 -9
- package/es/reducers/api.d.ts +12 -0
- package/es/reducers/api.d.ts.map +1 -0
- package/es/reducers/api.js +69 -0
- package/es/reducers/courses.d.ts +2 -2
- package/es/reducers/courses.d.ts.map +1 -1
- package/es/reducers/courses.js +2 -1
- package/es/reducers/finished-slides.d.ts +7 -0
- package/es/reducers/finished-slides.d.ts.map +1 -0
- package/es/reducers/finished-slides.js +22 -0
- package/es/reducers/index.d.ts +13 -3
- package/es/reducers/index.d.ts.map +1 -1
- package/es/reducers/index.js +11 -2
- package/es/reducers/navigation.d.ts +4 -2
- package/es/reducers/navigation.d.ts.map +1 -1
- package/es/reducers/navigation.js +4 -1
- package/es/reducers/review-status.d.ts +6 -0
- package/es/reducers/review-status.d.ts.map +1 -0
- package/es/reducers/review-status.js +15 -0
- package/es/reducers/slides.d.ts +7 -0
- package/es/reducers/slides.d.ts.map +1 -0
- package/es/reducers/slides.js +100 -0
- package/es/reducers/step-items.d.ts +7 -0
- package/es/reducers/step-items.d.ts.map +1 -0
- package/es/reducers/step-items.js +68 -0
- package/es/reducers/token.d.ts +4 -3
- package/es/reducers/token.d.ts.map +1 -1
- package/es/reducers/token.js +5 -2
- package/es/services/fetch-demo.d.ts.map +1 -1
- package/es/services/fetch-responses.d.ts +6 -6
- package/es/services/fetch-responses.d.ts.map +1 -1
- package/es/services/fetch-responses.js +2 -2
- package/es/services/fetch.mocks.d.ts +3 -3
- package/es/services/fetch.mocks.d.ts.map +1 -1
- package/es/services/fetch.mocks.js +3 -3
- package/es/temp-fixture.d.ts +4 -0
- package/es/temp-fixture.d.ts.map +1 -0
- package/es/temp-fixture.js +84 -0
- package/es/types/api/index.d.ts +16 -0
- package/es/types/api/index.d.ts.map +1 -0
- package/es/types/api/index.js +1 -0
- package/es/types/common.d.ts +8 -0
- package/es/types/common.d.ts.map +1 -0
- package/es/types/common.js +1 -0
- package/es/types/dispatchers.d.ts +18 -0
- package/es/types/dispatchers.d.ts.map +1 -0
- package/es/types/dispatchers.js +1 -0
- package/es/types/finished-slides.d.ts +7 -0
- package/es/types/finished-slides.d.ts.map +1 -0
- package/es/types/finished-slides.js +1 -0
- package/es/types/review-status.d.ts +2 -0
- package/es/types/review-status.d.ts.map +1 -0
- package/es/types/review-status.js +1 -0
- package/es/types/slides.d.ts +85 -0
- package/es/types/slides.d.ts.map +1 -0
- package/es/types/slides.js +1 -0
- package/es/types/states.d.ts +8 -0
- package/es/types/states.d.ts.map +1 -0
- package/es/types/states.js +1 -0
- package/es/types/step-items.d.ts +24 -0
- package/es/types/step-items.d.ts.map +1 -0
- package/es/types/step-items.js +5 -0
- package/es/types/store-state.d.ts +12 -0
- package/es/types/store-state.d.ts.map +1 -0
- package/es/types/store-state.js +1 -0
- package/es/types/utils.d.ts +4 -0
- package/es/types/utils.d.ts.map +1 -0
- package/es/types/utils.js +1 -0
- package/es/types/views.d.ts +58 -0
- package/es/types/views.d.ts.map +1 -0
- package/es/types/views.js +1 -0
- package/lib/actions/api/is-fetching.d.ts +6 -0
- package/lib/actions/api/is-fetching.d.ts.map +1 -0
- package/lib/actions/api/is-fetching.js +4 -0
- package/lib/actions/api/validate-slide.d.ts +6 -0
- package/lib/actions/api/validate-slide.d.ts.map +1 -0
- package/lib/actions/api/validate-slide.js +6 -0
- package/lib/actions/courses.d.ts +2 -2
- package/lib/actions/courses.d.ts.map +1 -1
- package/lib/actions/finished-slides.d.ts +8 -0
- package/lib/actions/finished-slides.d.ts.map +1 -0
- package/lib/actions/finished-slides.js +7 -0
- package/lib/actions/index.d.ts +2 -4
- package/lib/actions/index.d.ts.map +1 -1
- package/lib/actions/index.js +1 -3
- package/lib/actions/navigation.d.ts +5 -5
- package/lib/actions/navigation.d.ts.map +1 -1
- package/lib/actions/review-status.d.ts +8 -0
- package/lib/actions/review-status.d.ts.map +1 -0
- package/lib/actions/review-status.js +7 -0
- package/lib/actions/slides.d.ts +21 -0
- package/lib/actions/slides.d.ts.map +1 -0
- package/lib/actions/slides.js +17 -0
- package/lib/actions/step-items.d.ts +15 -0
- package/lib/actions/step-items.d.ts.map +1 -0
- package/lib/actions/step-items.js +12 -0
- package/lib/common/index.d.ts +8 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +7 -0
- package/lib/configure-store.d.ts +3 -11
- package/lib/configure-store.d.ts.map +1 -1
- package/lib/configure-store.js +21 -14
- package/lib/index.d.ts +5 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +61 -24
- package/lib/middlewares/on-start-app.d.ts +1 -1
- package/lib/middlewares/on-start-app.d.ts.map +1 -1
- package/lib/middlewares/on-start-app.js +27 -16
- package/lib/reducers/api.d.ts +12 -0
- package/lib/reducers/api.d.ts.map +1 -0
- package/lib/reducers/api.js +70 -0
- package/lib/reducers/courses.d.ts +2 -2
- package/lib/reducers/courses.d.ts.map +1 -1
- package/lib/reducers/courses.js +19 -2
- package/lib/reducers/finished-slides.d.ts +7 -0
- package/lib/reducers/finished-slides.d.ts.map +1 -0
- package/lib/reducers/finished-slides.js +61 -0
- package/lib/reducers/index.d.ts +13 -3
- package/lib/reducers/index.d.ts.map +1 -1
- package/lib/reducers/index.js +11 -2
- package/lib/reducers/navigation.d.ts +4 -2
- package/lib/reducers/navigation.d.ts.map +1 -1
- package/lib/reducers/navigation.js +24 -3
- package/lib/reducers/review-status.d.ts +6 -0
- package/lib/reducers/review-status.d.ts.map +1 -0
- package/lib/reducers/review-status.js +16 -0
- package/lib/reducers/slides.d.ts +7 -0
- package/lib/reducers/slides.d.ts.map +1 -0
- package/lib/reducers/slides.js +167 -0
- package/lib/reducers/step-items.d.ts +7 -0
- package/lib/reducers/step-items.d.ts.map +1 -0
- package/lib/reducers/step-items.js +118 -0
- package/lib/reducers/token.d.ts +4 -3
- package/lib/reducers/token.d.ts.map +1 -1
- package/lib/reducers/token.js +4 -1
- package/lib/services/fetch-demo.d.ts.map +1 -1
- package/lib/services/fetch-demo.js +25 -23
- package/lib/services/fetch-responses.d.ts +6 -6
- package/lib/services/fetch-responses.d.ts.map +1 -1
- package/lib/services/fetch-responses.js +2 -2
- package/lib/services/fetch.mocks.d.ts +3 -3
- package/lib/services/fetch.mocks.d.ts.map +1 -1
- package/lib/services/fetch.mocks.js +28 -16
- package/lib/temp-fixture.d.ts +4 -0
- package/lib/temp-fixture.d.ts.map +1 -0
- package/lib/temp-fixture.js +84 -0
- package/lib/types/api/index.d.ts +16 -0
- package/lib/types/api/index.d.ts.map +1 -0
- package/lib/types/api/index.js +1 -0
- package/lib/types/common.d.ts +8 -0
- package/lib/types/common.d.ts.map +1 -0
- package/lib/types/common.js +1 -0
- package/lib/types/dispatchers.d.ts +18 -0
- package/lib/types/dispatchers.d.ts.map +1 -0
- package/lib/types/dispatchers.js +1 -0
- package/lib/types/finished-slides.d.ts +7 -0
- package/lib/types/finished-slides.d.ts.map +1 -0
- package/lib/types/finished-slides.js +1 -0
- package/lib/types/review-status.d.ts +2 -0
- package/lib/types/review-status.d.ts.map +1 -0
- package/lib/types/review-status.js +1 -0
- package/lib/types/slides.d.ts +85 -0
- package/lib/types/slides.d.ts.map +1 -0
- package/lib/types/slides.js +1 -0
- package/lib/types/states.d.ts +8 -0
- package/lib/types/states.d.ts.map +1 -0
- package/lib/types/states.js +1 -0
- package/lib/types/step-items.d.ts +24 -0
- package/lib/types/step-items.d.ts.map +1 -0
- package/lib/types/step-items.js +5 -0
- package/lib/types/store-state.d.ts +12 -0
- package/lib/types/store-state.d.ts.map +1 -0
- package/lib/types/store-state.js +1 -0
- package/lib/types/utils.d.ts +4 -0
- package/lib/types/utils.d.ts.map +1 -0
- package/lib/types/utils.js +1 -0
- package/lib/types/views.d.ts +58 -0
- package/lib/types/views.d.ts.map +1 -0
- package/lib/types/views.js +1 -0
- package/package.json +16 -5
- package/src/actions/api/is-fetching.ts +12 -0
- package/src/actions/api/validate-slide.ts +15 -0
- package/src/actions/courses.ts +2 -2
- package/src/actions/finished-slides.ts +21 -0
- package/src/actions/index.ts +8 -5
- package/src/actions/navigation.ts +6 -5
- package/src/actions/review-status.ts +19 -0
- package/src/actions/slides.ts +45 -0
- package/src/actions/step-items.ts +39 -0
- package/src/common/index.ts +12 -0
- package/src/configure-store.ts +23 -21
- package/src/index.tsx +57 -18
- package/src/middlewares/on-start-app.ts +33 -20
- package/src/reducers/api.ts +85 -0
- package/src/reducers/courses.ts +3 -2
- package/src/reducers/finished-slides.ts +33 -0
- package/src/reducers/index.ts +11 -3
- package/src/reducers/navigation.ts +7 -3
- package/src/reducers/review-status.ts +23 -0
- package/src/reducers/slides.ts +123 -0
- package/src/reducers/step-items.ts +102 -0
- package/src/reducers/token.ts +6 -3
- package/src/services/fetch-demo.ts +17 -15
- package/src/services/fetch-responses.ts +7 -7
- package/src/services/fetch.mocks.ts +29 -14
- package/src/temp-fixture.ts +94 -0
- package/src/types/api/index.ts +16 -0
- package/src/types/common.ts +8 -0
- package/src/types/dispatchers.ts +18 -0
- package/src/types/finished-slides.ts +6 -0
- package/src/types/review-status.ts +1 -0
- package/src/types/slides.ts +104 -0
- package/src/types/states.ts +7 -0
- package/src/types/step-items.ts +28 -0
- package/src/types/store-state.ts +20 -0
- package/src/types/utils.ts +4 -0
- package/src/types/views.tsx +62 -0
- package/es/components/__tmp-backup-vues-mobile/revision-home.d.ts +0 -10
- package/es/components/__tmp-backup-vues-mobile/revision-home.d.ts.map +0 -1
- package/es/components/__tmp-backup-vues-mobile/revision-home.js +0 -83
- package/es/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts +0 -1
- package/es/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts.map +0 -1
- package/es/components/__tmp-backup-vues-mobile/revision-home.stories.js +0 -14
- package/es/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts +0 -4
- package/es/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts.map +0 -1
- package/es/components/__tmp-backup-vues-mobile/revision-onboarding.js +0 -57
- package/es/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts +0 -19
- package/es/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts.map +0 -1
- package/es/components/__tmp-backup-vues-mobile/revision-quizzer.js +0 -120
- package/lib/components/__tmp-backup-vues-mobile/revision-home.d.ts +0 -10
- package/lib/components/__tmp-backup-vues-mobile/revision-home.d.ts.map +0 -1
- package/lib/components/__tmp-backup-vues-mobile/revision-home.js +0 -98
- package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts +0 -1
- package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts.map +0 -1
- package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.js +0 -14
- package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts +0 -4
- package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts.map +0 -1
- package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.js +0 -60
- package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts +0 -19
- package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts.map +0 -1
- package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.js +0 -128
- package/src/components/__tmp-backup-vues-mobile/revision-home.stories.tsx +0 -16
- package/src/components/__tmp-backup-vues-mobile/revision-home.tsx +0 -125
- package/src/components/__tmp-backup-vues-mobile/revision-onboarding.tsx +0 -84
- package/src/components/__tmp-backup-vues-mobile/revision-quizzer.tsx +0 -176
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-fetching.d.ts","sourceRoot":"","sources":["../../../src/actions/api/is-fetching.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AAIrD,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,OAAO,gBAAgB,CAAC;CAC/B,CAAC;AAGF,eAAO,MAAM,aAAa,QAAO,UAAwC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
export const IS_FETCHING_TRUE = '@@is-fetching/TRUE';
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const setIsFetching = () => ({ type: IS_FETCHING_TRUE });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-slide.d.ts","sourceRoot":"","sources":["../../../src/actions/api/validate-slide.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,yBAAyB,CAAC;AAIrD,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,OAAO,cAAc,CAAC;CAC7B,CAAC;AAIF,eAAO,MAAM,aAAa,QAAO,aAE/B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
export const VALIDATE_SLIDE = '@@api/VALIDATE_SLIDE';
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const validateSlide = () => ({
|
|
5
|
+
type: VALIDATE_SLIDE
|
|
6
|
+
});
|
package/es/actions/courses.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const RECEIVED_COURSE = "@@api/RECEIVED_COURSE";
|
|
2
2
|
export declare type ReceivedCourse = {
|
|
3
3
|
type: '@@api/RECEIVED_COURSE';
|
|
4
|
-
payload:
|
|
4
|
+
payload: unknown;
|
|
5
5
|
};
|
|
6
|
-
export declare const receivedCourse: (course:
|
|
6
|
+
export declare const receivedCourse: (course: unknown) => ReceivedCourse;
|
|
7
7
|
//# sourceMappingURL=courses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"courses.d.ts","sourceRoot":"","sources":["../../src/actions/courses.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAEvD,oBAAY,cAAc,GAAG;IAC3B,IAAI,EAAE,uBAAuB,CAAC;IAC9B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"courses.d.ts","sourceRoot":"","sources":["../../src/actions/courses.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAEvD,oBAAY,cAAc,GAAG;IAC3B,IAAI,EAAE,uBAAuB,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,cAAc,WAAY,OAAO,KAAG,cAG/C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UpdateFinishedSlidesPayload } from '../types/finished-slides';
|
|
2
|
+
export declare const UPDATE_FINISHED_SLIDES = "@@finished-slides/UPDATE_FINISHED_SLIDES";
|
|
3
|
+
export declare type UpdateFinishedSlides = {
|
|
4
|
+
type: typeof UPDATE_FINISHED_SLIDES;
|
|
5
|
+
payload: UpdateFinishedSlidesPayload;
|
|
6
|
+
};
|
|
7
|
+
export declare const updateFinishedSlides: (payload: UpdateFinishedSlidesPayload) => UpdateFinishedSlides;
|
|
8
|
+
//# sourceMappingURL=finished-slides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finished-slides.d.ts","sourceRoot":"","sources":["../../src/actions/finished-slides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,2BAA2B,EAAC,MAAM,0BAA0B,CAAC;AAIrE,eAAO,MAAM,sBAAsB,6CAA6C,CAAC;AAIjF,oBAAY,oBAAoB,GAAG;IACjC,IAAI,EAAE,OAAO,sBAAsB,CAAC;IACpC,OAAO,EAAE,2BAA2B,CAAC;CACtC,CAAC;AAIF,eAAO,MAAM,oBAAoB,YACtB,2BAA2B,KACnC,oBAGD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
export const UPDATE_FINISHED_SLIDES = '@@finished-slides/UPDATE_FINISHED_SLIDES';
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const updateFinishedSlides = (payload) => ({
|
|
5
|
+
type: UPDATE_FINISHED_SLIDES,
|
|
6
|
+
payload
|
|
7
|
+
});
|
package/es/actions/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ReceivedCourse } from './courses';
|
|
2
2
|
import { NavigateBack, NavigateTo, StartApp } from './navigation';
|
|
3
3
|
import { StoreToken } from './token';
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export * from './token';
|
|
7
|
-
export declare type Action = StartApp | StoreToken | NavigateBack | NavigateTo | ReceivedCourse;
|
|
4
|
+
import { StoreFirstSlide } from './slides';
|
|
5
|
+
export declare type Action = NavigateBack | NavigateTo | ReceivedCourse | StartApp | StoreFirstSlide | StoreToken;
|
|
8
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AACzC,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AACzC,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAEzC,oBAAY,MAAM,GACd,YAAY,GACZ,UAAU,GACV,cAAc,GACd,QAAQ,GACR,eAAe,GACf,UAAU,CAAC"}
|
package/es/actions/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppOptions } from '..';
|
|
1
|
+
import { AppOptions } from '../types/common';
|
|
3
2
|
export declare const NAVIGATE_TO = "@@navigation/NAVIGATE_TO";
|
|
4
3
|
export declare const NAVIGATE_BACK = "@@navigation/NAVIGATE_BACK";
|
|
5
4
|
export declare const START_APP = "@@navigation/START_APP";
|
|
5
|
+
export declare type ViewPath = 'home' | 'onboarding' | 'slides';
|
|
6
6
|
export declare type NavigateTo = {
|
|
7
7
|
type: '@@navigation/NAVIGATE_TO';
|
|
8
|
-
payload:
|
|
8
|
+
payload: ViewPath;
|
|
9
9
|
};
|
|
10
10
|
export declare type NavigateBack = {
|
|
11
11
|
type: '@@navigation/NAVIGATE_BACK';
|
|
@@ -14,7 +14,7 @@ export declare type StartApp = {
|
|
|
14
14
|
type: '@@navigation/START_APP';
|
|
15
15
|
payload: AppOptions;
|
|
16
16
|
};
|
|
17
|
-
export declare const navigateTo:
|
|
18
|
-
export declare const navigateBack:
|
|
17
|
+
export declare const navigateTo: (newPath: ViewPath) => NavigateTo;
|
|
18
|
+
export declare const navigateBack: () => NavigateBack;
|
|
19
19
|
export declare const startApp: (options: AppOptions) => StartApp;
|
|
20
20
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/actions/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/actions/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAE3C,eAAO,MAAM,WAAW,6BAA6B,CAAC;AACtD,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAC1D,eAAO,MAAM,SAAS,2BAA2B,CAAC;AAElD,oBAAY,QAAQ,GAAG,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAC;AAExD,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,4BAA4B,CAAC;CACpC,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,YAAa,QAAQ,KAAG,UAG7C,CAAC;AAEH,eAAO,MAAM,YAAY,QAAO,YAE9B,CAAC;AAEH,eAAO,MAAM,QAAQ,YAAa,UAAU,KAAG,QAG7C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UpdateReviewStatusPayload } from '../types/review-status';
|
|
2
|
+
export declare const UPDATE_REVIEW_STATUS = "@@review-status/UPDATE_REVIEW_STATUS";
|
|
3
|
+
export declare type UpdateReviewStatus = {
|
|
4
|
+
type: typeof UPDATE_REVIEW_STATUS;
|
|
5
|
+
payload: UpdateReviewStatusPayload;
|
|
6
|
+
};
|
|
7
|
+
export declare const updateReviewStatus: (payload: UpdateReviewStatusPayload) => UpdateReviewStatus;
|
|
8
|
+
//# sourceMappingURL=review-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-status.d.ts","sourceRoot":"","sources":["../../src/actions/review-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;AAIjE,eAAO,MAAM,oBAAoB,yCAAyC,CAAC;AAI3E,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,oBAAoB,CAAC;IAClC,OAAO,EAAE,yBAAyB,CAAC;CACpC,CAAC;AAIF,eAAO,MAAM,kBAAkB,YAAa,yBAAyB,KAAG,kBAGtE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
export const UPDATE_REVIEW_STATUS = '@@review-status/UPDATE_REVIEW_STATUS';
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const updateReviewStatus = (payload) => ({
|
|
5
|
+
type: UPDATE_REVIEW_STATUS,
|
|
6
|
+
payload
|
|
7
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Slide, UpdateSlidesOnNextPayload, UpdateSlidesOnValidationPayload } from '../types/slides';
|
|
2
|
+
export declare const STORE_FIRST_SLIDE = "@@slide/STORE_FIRST_SLIDE";
|
|
3
|
+
export declare const UPDATE_SLIDES_ON_VALIDATION = "@@slide/UPDATE_SLIDES_ON_VALIDATION";
|
|
4
|
+
export declare const UPDATE_SLIDES_ON_NEXT = "@@slide/UPDATE_SLIDES_ON_NEXT";
|
|
5
|
+
export declare type StoreFirstSlide = {
|
|
6
|
+
type: typeof STORE_FIRST_SLIDE;
|
|
7
|
+
payload: Slide;
|
|
8
|
+
};
|
|
9
|
+
export declare type UpdateSlidesOnValidation = {
|
|
10
|
+
type: typeof UPDATE_SLIDES_ON_VALIDATION;
|
|
11
|
+
payload: UpdateSlidesOnValidationPayload;
|
|
12
|
+
};
|
|
13
|
+
export declare type UpdateSlidesOnNext = {
|
|
14
|
+
type: typeof UPDATE_SLIDES_ON_NEXT;
|
|
15
|
+
payload: UpdateSlidesOnNextPayload;
|
|
16
|
+
};
|
|
17
|
+
export declare type SlidesAction = StoreFirstSlide | UpdateSlidesOnValidation | UpdateSlidesOnNext;
|
|
18
|
+
export declare const storeFirstSlide: (slide: Slide) => StoreFirstSlide;
|
|
19
|
+
export declare const updateSlidesOnValidation: (payload: UpdateSlidesOnValidationPayload) => UpdateSlidesOnValidation;
|
|
20
|
+
export declare const updateSlidesOnNext: (payload: UpdateSlidesOnNextPayload) => UpdateSlidesOnNext;
|
|
21
|
+
//# sourceMappingURL=slides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slides.d.ts","sourceRoot":"","sources":["../../src/actions/slides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,yBAAyB,EAAE,+BAA+B,EAAC,MAAM,iBAAiB,CAAC;AAIlG,eAAO,MAAM,iBAAiB,8BAA8B,CAAC;AAC7D,eAAO,MAAM,2BAA2B,wCAAwC,CAAC;AACjF,eAAO,MAAM,qBAAqB,kCAAkC,CAAC;AAIrE,oBAAY,eAAe,GAAG;IAC5B,IAAI,EAAE,OAAO,iBAAiB,CAAC;IAC/B,OAAO,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,IAAI,EAAE,OAAO,2BAA2B,CAAC;IACzC,OAAO,EAAE,+BAA+B,CAAC;CAC1C,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,qBAAqB,CAAC;IACnC,OAAO,EAAE,yBAAyB,CAAC;CACpC,CAAC;AAEF,oBAAY,YAAY,GAAG,eAAe,GAAG,wBAAwB,GAAG,kBAAkB,CAAC;AAI3F,eAAO,MAAM,eAAe,UAAW,KAAK,KAAG,eAG7C,CAAC;AAEH,eAAO,MAAM,wBAAwB,YAC1B,+BAA+B,KACvC,wBAGD,CAAC;AAEH,eAAO,MAAM,kBAAkB,YAAa,yBAAyB,KAAG,kBAGtE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
export const STORE_FIRST_SLIDE = '@@slide/STORE_FIRST_SLIDE';
|
|
3
|
+
export const UPDATE_SLIDES_ON_VALIDATION = '@@slide/UPDATE_SLIDES_ON_VALIDATION';
|
|
4
|
+
export const UPDATE_SLIDES_ON_NEXT = '@@slide/UPDATE_SLIDES_ON_NEXT';
|
|
5
|
+
// -----------------------------------------------------------------------------
|
|
6
|
+
export const storeFirstSlide = (slide) => ({
|
|
7
|
+
type: STORE_FIRST_SLIDE,
|
|
8
|
+
payload: slide
|
|
9
|
+
});
|
|
10
|
+
export const updateSlidesOnValidation = (payload) => ({
|
|
11
|
+
type: UPDATE_SLIDES_ON_VALIDATION,
|
|
12
|
+
payload
|
|
13
|
+
});
|
|
14
|
+
export const updateSlidesOnNext = (payload) => ({
|
|
15
|
+
type: UPDATE_SLIDES_ON_NEXT,
|
|
16
|
+
payload
|
|
17
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UpdateStepItemsOnNextClickPayload, UpdateStepItemsOnValidationClickPayload } from '../types/step-items';
|
|
2
|
+
export declare const UPDATE_STEP_ITEMS_ON_VALIDATION = "@@step-items/UPDATE_STEP_ITEMS_ON_VALIDATION";
|
|
3
|
+
export declare const UPDATE_STEP_ITEMS_ON_NEXT = "@@step-items/UPDATE_STEP_ITEMS_ON_NEXT";
|
|
4
|
+
export declare type UpdateStepItemsOnValidation = {
|
|
5
|
+
type: typeof UPDATE_STEP_ITEMS_ON_VALIDATION;
|
|
6
|
+
payload: UpdateStepItemsOnValidationClickPayload;
|
|
7
|
+
};
|
|
8
|
+
export declare type UpdateStepItemsOnNext = {
|
|
9
|
+
type: typeof UPDATE_STEP_ITEMS_ON_NEXT;
|
|
10
|
+
payload: UpdateStepItemsOnNextClickPayload;
|
|
11
|
+
};
|
|
12
|
+
export declare type StepItemsAction = UpdateStepItemsOnValidation | UpdateStepItemsOnNext;
|
|
13
|
+
export declare const updateStepItemsOnValidation: (payload: UpdateStepItemsOnValidationClickPayload) => UpdateStepItemsOnValidation;
|
|
14
|
+
export declare const updateStepItemsOnNext: (payload: UpdateStepItemsOnNextClickPayload) => UpdateStepItemsOnNext;
|
|
15
|
+
//# sourceMappingURL=step-items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-items.d.ts","sourceRoot":"","sources":["../../src/actions/step-items.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,uCAAuC,EACxC,MAAM,qBAAqB,CAAC;AAI7B,eAAO,MAAM,+BAA+B,iDAAiD,CAAC;AAC9F,eAAO,MAAM,yBAAyB,2CAA2C,CAAC;AAIlF,oBAAY,2BAA2B,GAAG;IACxC,IAAI,EAAE,OAAO,+BAA+B,CAAC;IAC7C,OAAO,EAAE,uCAAuC,CAAC;CAClD,CAAC;AAEF,oBAAY,qBAAqB,GAAG;IAClC,IAAI,EAAE,OAAO,yBAAyB,CAAC;IACvC,OAAO,EAAE,iCAAiC,CAAC;CAC5C,CAAC;AAEF,oBAAY,eAAe,GAAG,2BAA2B,GAAG,qBAAqB,CAAC;AAIlF,eAAO,MAAM,2BAA2B,YAC7B,uCAAuC,KAC/C,2BAGD,CAAC;AAEH,eAAO,MAAM,qBAAqB,YACvB,iCAAiC,KACzC,qBAGD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
export const UPDATE_STEP_ITEMS_ON_VALIDATION = '@@step-items/UPDATE_STEP_ITEMS_ON_VALIDATION';
|
|
3
|
+
export const UPDATE_STEP_ITEMS_ON_NEXT = '@@step-items/UPDATE_STEP_ITEMS_ON_NEXT';
|
|
4
|
+
// -----------------------------------------------------------------------------
|
|
5
|
+
export const updateStepItemsOnValidation = (payload) => ({
|
|
6
|
+
type: UPDATE_STEP_ITEMS_ON_VALIDATION,
|
|
7
|
+
payload
|
|
8
|
+
});
|
|
9
|
+
export const updateStepItemsOnNext = (payload) => ({
|
|
10
|
+
type: UPDATE_STEP_ITEMS_ON_NEXT,
|
|
11
|
+
payload
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,aAAa,QAAyB,CAAC;AAEpD,eAAO,MAAM,KAAK,EAAE;IAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAK3B,CAAC"}
|
package/es/configure-store.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export default function configureStore(): Promise<
|
|
4
|
-
courses: import("./reducers/courses").State;
|
|
5
|
-
navigation: NavigationState;
|
|
6
|
-
token: string;
|
|
7
|
-
}, import("redux").AnyAction> & {
|
|
1
|
+
import { AnyAction, EmptyObject, Store } from 'redux';
|
|
2
|
+
import { StoreState } from './types/store-state';
|
|
3
|
+
export default function configureStore(): Promise<Store<EmptyObject & StoreState, AnyAction> & {
|
|
8
4
|
dispatch: {};
|
|
9
5
|
}>;
|
|
10
|
-
export declare type StoreState = {
|
|
11
|
-
navigation: NavigationState;
|
|
12
|
-
token: TokenState;
|
|
13
|
-
};
|
|
14
6
|
//# sourceMappingURL=configure-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure-store.d.ts","sourceRoot":"","sources":["../src/configure-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configure-store.d.ts","sourceRoot":"","sources":["../src/configure-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAyC,WAAW,EAAE,KAAK,EAAC,MAAM,OAAO,CAAC;AAO3F,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAM/C,wBAA8B,cAAc,IAAI,OAAO,CACrD,KAAK,CAAC,WAAW,GAAG,UAAU,EAAE,SAAS,CAAC,GAAG;IAC3C,QAAQ,EAAE,EAAE,CAAC;CACd,CACF,CAqBA"}
|
package/es/configure-store.js
CHANGED
|
@@ -5,15 +5,19 @@ import onStartApp from './middlewares/on-start-app';
|
|
|
5
5
|
const preloadedState = undefined;
|
|
6
6
|
// -----------------------------------------------------------------------------
|
|
7
7
|
export default async function configureStore() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const isExtensionEnabled = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
9
|
+
const isProd = process.env.NODE_ENV !== 'production';
|
|
10
|
+
const { composeWithDevTools } = isProd
|
|
11
|
+
? { composeWithDevTools: null }
|
|
12
|
+
: // eslint-disable-next-line node/no-unsupported-features/es-syntax, import/dynamic-import-chunkname
|
|
13
|
+
await import('redux-devtools-extension');
|
|
14
|
+
const _compose = !isProd && isExtensionEnabled
|
|
15
|
+
? composeWithDevTools({
|
|
12
16
|
name: 'app-review',
|
|
13
17
|
trace: true,
|
|
14
18
|
traceLimit: 25
|
|
15
|
-
})
|
|
16
|
-
|
|
19
|
+
})
|
|
20
|
+
: compose;
|
|
17
21
|
const enhancer = _compose(applyMiddleware(thunk, onStartApp));
|
|
18
22
|
const store = createStore(rootReducer, preloadedState, enhancer);
|
|
19
23
|
return store;
|
package/es/index.d.ts
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { AppOptions } from './types/common';
|
|
3
|
+
declare const AppReview: ({ options }: {
|
|
4
|
+
options: AppOptions;
|
|
5
|
+
}) => JSX.Element;
|
|
3
6
|
declare global {
|
|
4
7
|
interface Window {
|
|
5
8
|
__REDUX_DEVTOOLS_EXTENSION__?: boolean;
|
|
6
9
|
}
|
|
7
10
|
}
|
|
8
|
-
|
|
9
|
-
options: AppOptions;
|
|
10
|
-
};
|
|
11
|
-
export declare type AppOptions = {
|
|
12
|
-
token: string;
|
|
13
|
-
theme?: any;
|
|
14
|
-
translations?: any;
|
|
15
|
-
};
|
|
16
|
-
export default AppRevision;
|
|
11
|
+
export default AppReview;
|
|
17
12
|
//# sourceMappingURL=index.d.ts.map
|
package/es/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAoD1C,QAAA,MAAM,SAAS;aAAyB,UAAU;MAAI,WAoBrD,CAAC;AAIF,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,MAAM;QACd,4BAA4B,CAAC,EAAE,OAAO,CAAC;KACxC;CACF;AAMD,eAAe,SAAS,CAAC"}
|
package/es/index.js
CHANGED
|
@@ -1,29 +1,61 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { connect, Provider } from 'react-redux';
|
|
3
|
-
import
|
|
3
|
+
import AppReviewTemplate from '@coorpacademy/components/es/template/app-review';
|
|
4
4
|
import configureStore from './configure-store';
|
|
5
5
|
import { navigateTo, navigateBack, startApp } from './actions/navigation';
|
|
6
|
+
import { updateSlidesOnNext, updateSlidesOnValidation } from './actions/slides';
|
|
6
7
|
import { getCurrentViewName } from './reducers/navigation';
|
|
8
|
+
import { congratsProps, correctionPopinProps } from './temp-fixture';
|
|
9
|
+
import { updateFinishedSlides } from './actions/finished-slides';
|
|
10
|
+
import { updateReviewStatus } from './actions/review-status';
|
|
11
|
+
import { updateStepItemsOnValidation, updateStepItemsOnNext } from './actions/step-items';
|
|
12
|
+
import { validateSlide } from './actions/api/validate-slide';
|
|
7
13
|
// -----------------------------------------------------------------------------
|
|
8
|
-
const
|
|
9
|
-
|
|
14
|
+
const mapDispatchToProps = {
|
|
15
|
+
navigateTo,
|
|
16
|
+
navigateBack,
|
|
17
|
+
validateSlide,
|
|
18
|
+
updateSlidesOnValidation,
|
|
19
|
+
updateSlidesOnNext,
|
|
20
|
+
updateReviewStatus,
|
|
21
|
+
updateStepItemsOnValidation,
|
|
22
|
+
updateStepItemsOnNext,
|
|
23
|
+
updateFinishedSlides
|
|
10
24
|
};
|
|
11
|
-
|
|
12
|
-
const
|
|
25
|
+
// StaticProps
|
|
26
|
+
const mapStateToProps = (state) => ({
|
|
27
|
+
viewName: getCurrentViewName(state),
|
|
28
|
+
slides: {
|
|
29
|
+
slides: state.slides,
|
|
30
|
+
validate: {
|
|
31
|
+
label: '__validate'
|
|
32
|
+
},
|
|
33
|
+
finishedSlides: state.finishedSlides,
|
|
34
|
+
stepItems: state.stepItems,
|
|
35
|
+
reviewStatus: state.reviewStatus,
|
|
36
|
+
correctionPopinProps,
|
|
37
|
+
congratsProps,
|
|
38
|
+
slideValidationResult: state.api.entities.slideValidationResult
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
// Props = StaticProps && Dispatchers
|
|
42
|
+
const App = connect(mapStateToProps, mapDispatchToProps)(AppReviewTemplate);
|
|
13
43
|
// -----------------------------------------------------------------------------
|
|
14
|
-
const
|
|
44
|
+
const AppReview = ({ options }) => {
|
|
15
45
|
const [store, setStore] = useState(null);
|
|
16
46
|
useEffect(() => {
|
|
17
47
|
const _configure = async () => {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
setStore(
|
|
48
|
+
const _store = await configureStore();
|
|
49
|
+
_store.dispatch(startApp(options));
|
|
50
|
+
setStore(_store);
|
|
21
51
|
};
|
|
22
52
|
_configure();
|
|
23
|
-
}, []);
|
|
53
|
+
}, [options]);
|
|
24
54
|
if (!store)
|
|
25
55
|
return null;
|
|
26
56
|
return (React.createElement(Provider, { store: store },
|
|
27
57
|
React.createElement(App, null)));
|
|
28
58
|
};
|
|
29
|
-
|
|
59
|
+
// type Props = {options: AppOptions};
|
|
60
|
+
// -----------------------------------------------------------------------------
|
|
61
|
+
export default AppReview;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Middleware } from 'redux';
|
|
2
2
|
import { Dispatch } from 'redux';
|
|
3
3
|
import { Action } from '../actions';
|
|
4
|
-
import { StoreState } from '../
|
|
4
|
+
import { StoreState } from '../types/store-state';
|
|
5
5
|
declare const onStartApp: Middleware<{}, StoreState, Dispatch<Action>>;
|
|
6
6
|
export default onStartApp;
|
|
7
7
|
//# sourceMappingURL=on-start-app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-start-app.d.ts","sourceRoot":"","sources":["../../src/middlewares/on-start-app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"on-start-app.d.ts","sourceRoot":"","sources":["../../src/middlewares/on-start-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,MAAM,EAAC,MAAM,YAAY,CAAC;AAOlC,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEhD,QAAA,MAAM,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CA4B1D,CAAC;AAEJ,eAAe,UAAU,CAAC"}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
// import fetchCourse from '../services/fetch-demo';
|
|
2
|
+
import { VIEWS } from '../common';
|
|
3
|
+
import { navigateTo, START_APP } from '../actions/navigation';
|
|
4
|
+
import { storeToken } from '../actions/token';
|
|
5
|
+
import { storeFirstSlide } from '../actions/slides';
|
|
3
6
|
const onStartApp = ({ dispatch }) => next => (action) => {
|
|
4
7
|
if (action.type === START_APP) {
|
|
5
|
-
const {
|
|
6
|
-
|
|
8
|
+
const { slide } = action.payload;
|
|
9
|
+
if (slide) {
|
|
10
|
+
const { token } = action.payload;
|
|
11
|
+
dispatch(storeToken(token));
|
|
12
|
+
dispatch(storeFirstSlide(slide));
|
|
13
|
+
}
|
|
14
|
+
const initialView = slide ? VIEWS.slides : VIEWS.onboarding;
|
|
15
|
+
dispatch(navigateTo(initialView));
|
|
7
16
|
// --------------
|
|
8
17
|
// demo service
|
|
9
|
-
const language = 'fr';
|
|
10
|
-
const universalRef = 'dis_xxx15';
|
|
11
|
-
fetchCourse(token, language, universalRef).then(course => {
|
|
12
|
-
|
|
13
|
-
});
|
|
18
|
+
// const language = 'fr';
|
|
19
|
+
// const universalRef = 'dis_xxx15';
|
|
20
|
+
// fetchCourse(token, language, universalRef).then(course => {
|
|
21
|
+
// dispatch(receivedCourse(course));
|
|
22
|
+
// });
|
|
14
23
|
}
|
|
15
24
|
return next(action);
|
|
16
25
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IsFetching } from '../actions/api/is-fetching';
|
|
2
|
+
import { ValidateSlide } from '../actions/api/validate-slide';
|
|
3
|
+
import { ApiState } from '../types/api';
|
|
4
|
+
declare type ApiActions = IsFetching | ValidateSlide;
|
|
5
|
+
declare const api: (state: {
|
|
6
|
+
entities: {
|
|
7
|
+
isFetching: boolean;
|
|
8
|
+
slideValidationResult: any;
|
|
9
|
+
};
|
|
10
|
+
}, action: ApiActions) => ApiState;
|
|
11
|
+
export default api;
|
|
12
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/reducers/api.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAmB,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAC,aAAa,EAAiB,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAMtC,aAAK,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC;AAG7C,QAAA,MAAM,GAAG;;;;;WAAkC,UAAU,KAAG,QAoEvD,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import getOr from 'lodash/fp/getOr';
|
|
2
|
+
import noop from 'lodash/fp/noop';
|
|
3
|
+
import set from 'lodash/fp/set';
|
|
4
|
+
import { IS_FETCHING_TRUE } from '../actions/api/is-fetching';
|
|
5
|
+
import { VALIDATE_SLIDE } from '../actions/api/validate-slide';
|
|
6
|
+
const defaultState = {
|
|
7
|
+
entities: { isFetching: true, slideValidationResult: null }
|
|
8
|
+
};
|
|
9
|
+
// eslint-disable-next-line default-param-last
|
|
10
|
+
const api = (state = defaultState, action) => {
|
|
11
|
+
switch (action.type) {
|
|
12
|
+
case VALIDATE_SLIDE: {
|
|
13
|
+
const previousSlideNumber = getOr(-1, 'entities.slideValidationResult.slideNumber', state);
|
|
14
|
+
// hard coded for now
|
|
15
|
+
return set(['entities', 'slideValidationResult'], {
|
|
16
|
+
slideNumber: previousSlideNumber + 1,
|
|
17
|
+
result: 'success',
|
|
18
|
+
// exitNode
|
|
19
|
+
nextSlide: {
|
|
20
|
+
questionText: 'Test',
|
|
21
|
+
answerUI: {
|
|
22
|
+
model: {
|
|
23
|
+
answers: [
|
|
24
|
+
{
|
|
25
|
+
title: 'There is no need for a password',
|
|
26
|
+
onClick: noop,
|
|
27
|
+
selected: false
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: 'Lorem ipsum',
|
|
31
|
+
onClick: noop,
|
|
32
|
+
selected: false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: 'Lorem',
|
|
36
|
+
onClick: noop,
|
|
37
|
+
selected: true,
|
|
38
|
+
order: 1
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
title: 'You need to have a password',
|
|
42
|
+
onClick: noop,
|
|
43
|
+
selected: false
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
title: 'Pouet',
|
|
47
|
+
onClick: noop,
|
|
48
|
+
selected: true,
|
|
49
|
+
order: 0
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
type: 'qcmDrag'
|
|
53
|
+
},
|
|
54
|
+
help: 'Help text will appear here'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}, state);
|
|
58
|
+
}
|
|
59
|
+
case IS_FETCHING_TRUE: {
|
|
60
|
+
return set('entities.isFetching', true, state);
|
|
61
|
+
}
|
|
62
|
+
// case VALIDATE_SLIDE_FAILURE: {
|
|
63
|
+
// return set('entities.isFetching', false, state);
|
|
64
|
+
// }
|
|
65
|
+
default:
|
|
66
|
+
return state;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
export default api;
|
package/es/reducers/courses.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReceivedCourse } from '../actions';
|
|
2
|
-
export declare type State = Array<
|
|
1
|
+
import { ReceivedCourse } from '../actions/courses';
|
|
2
|
+
export declare type State = Array<unknown>;
|
|
3
3
|
export declare const initialState: State;
|
|
4
4
|
declare const reducer: (state: State, action: ReceivedCourse) => State;
|
|
5
5
|
export default reducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"courses.d.ts","sourceRoot":"","sources":["../../src/reducers/courses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAkB,MAAM,
|
|
1
|
+
{"version":3,"file":"courses.d.ts","sourceRoot":"","sources":["../../src/reducers/courses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAkB,MAAM,oBAAoB,CAAC;AAInE,oBAAY,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;AACnC,eAAO,MAAM,YAAY,EAAE,KAAU,CAAC;AAKtC,QAAA,MAAM,OAAO,yBAAyC,cAAc,UAQnE,CAAC;AAIF,eAAe,OAAO,CAAC"}
|
package/es/reducers/courses.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { RECEIVED_COURSE } from '../actions';
|
|
1
|
+
import { RECEIVED_COURSE } from '../actions/courses';
|
|
2
2
|
export const initialState = [];
|
|
3
3
|
// -----------------------------------------------------------------------------
|
|
4
|
+
// eslint-disable-next-line default-param-last
|
|
4
5
|
const reducer = (state = initialState, action) => {
|
|
5
6
|
switch (action.type) {
|
|
6
7
|
case RECEIVED_COURSE: {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UpdateFinishedSlides } from '../actions/finished-slides';
|
|
2
|
+
import { FinishedSlides } from '../types/finished-slides';
|
|
3
|
+
export declare type State = FinishedSlides;
|
|
4
|
+
export declare const initialState: State;
|
|
5
|
+
declare const reducer: (state: FinishedSlides, action: UpdateFinishedSlides) => FinishedSlides;
|
|
6
|
+
export default reducer;
|
|
7
|
+
//# sourceMappingURL=finished-slides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finished-slides.d.ts","sourceRoot":"","sources":["../../src/reducers/finished-slides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAyB,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AAIxD,oBAAY,KAAK,GAAG,cAAc,CAAC;AACnC,eAAO,MAAM,YAAY,EAAE,KAA+B,CAAC;AAK3D,QAAA,MAAM,OAAO,kCAAyC,oBAAoB,mBAiBzE,CAAC;AAIF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UPDATE_FINISHED_SLIDES } from '../actions/finished-slides';
|
|
2
|
+
export const initialState = new Map();
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
// eslint-disable-next-line default-param-last
|
|
5
|
+
const reducer = (state = initialState, action) => {
|
|
6
|
+
switch (action.type) {
|
|
7
|
+
case UPDATE_FINISHED_SLIDES: {
|
|
8
|
+
const { slideNumber, value } = action.payload;
|
|
9
|
+
const _state = new Map();
|
|
10
|
+
// eslint-disable-next-line fp/no-loops
|
|
11
|
+
for (const [index, previousValue] of state) {
|
|
12
|
+
_state.set(index, previousValue);
|
|
13
|
+
}
|
|
14
|
+
_state.set(slideNumber, value);
|
|
15
|
+
return _state;
|
|
16
|
+
}
|
|
17
|
+
default:
|
|
18
|
+
return state;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
// -----------------------------------------------------------------------------
|
|
22
|
+
export default reducer;
|