@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.
Files changed (281) hide show
  1. package/es/actions/api/is-fetching.d.ts +6 -0
  2. package/es/actions/api/is-fetching.d.ts.map +1 -0
  3. package/es/actions/api/is-fetching.js +4 -0
  4. package/es/actions/api/validate-slide.d.ts +6 -0
  5. package/es/actions/api/validate-slide.d.ts.map +1 -0
  6. package/es/actions/api/validate-slide.js +6 -0
  7. package/es/actions/courses.d.ts +2 -2
  8. package/es/actions/courses.d.ts.map +1 -1
  9. package/es/actions/finished-slides.d.ts +8 -0
  10. package/es/actions/finished-slides.d.ts.map +1 -0
  11. package/es/actions/finished-slides.js +7 -0
  12. package/es/actions/index.d.ts +2 -4
  13. package/es/actions/index.d.ts.map +1 -1
  14. package/es/actions/index.js +1 -3
  15. package/es/actions/navigation.d.ts +5 -5
  16. package/es/actions/navigation.d.ts.map +1 -1
  17. package/es/actions/review-status.d.ts +8 -0
  18. package/es/actions/review-status.d.ts.map +1 -0
  19. package/es/actions/review-status.js +7 -0
  20. package/es/actions/slides.d.ts +21 -0
  21. package/es/actions/slides.d.ts.map +1 -0
  22. package/es/actions/slides.js +17 -0
  23. package/es/actions/step-items.d.ts +15 -0
  24. package/es/actions/step-items.d.ts.map +1 -0
  25. package/es/actions/step-items.js +12 -0
  26. package/es/common/index.d.ts +8 -0
  27. package/es/common/index.d.ts.map +1 -0
  28. package/es/common/index.js +7 -0
  29. package/es/configure-store.d.ts +3 -11
  30. package/es/configure-store.d.ts.map +1 -1
  31. package/es/configure-store.js +10 -6
  32. package/es/index.d.ts +5 -10
  33. package/es/index.d.ts.map +1 -1
  34. package/es/index.js +43 -11
  35. package/es/middlewares/on-start-app.d.ts +1 -1
  36. package/es/middlewares/on-start-app.d.ts.map +1 -1
  37. package/es/middlewares/on-start-app.js +18 -9
  38. package/es/reducers/api.d.ts +12 -0
  39. package/es/reducers/api.d.ts.map +1 -0
  40. package/es/reducers/api.js +69 -0
  41. package/es/reducers/courses.d.ts +2 -2
  42. package/es/reducers/courses.d.ts.map +1 -1
  43. package/es/reducers/courses.js +2 -1
  44. package/es/reducers/finished-slides.d.ts +7 -0
  45. package/es/reducers/finished-slides.d.ts.map +1 -0
  46. package/es/reducers/finished-slides.js +22 -0
  47. package/es/reducers/index.d.ts +13 -3
  48. package/es/reducers/index.d.ts.map +1 -1
  49. package/es/reducers/index.js +11 -2
  50. package/es/reducers/navigation.d.ts +4 -2
  51. package/es/reducers/navigation.d.ts.map +1 -1
  52. package/es/reducers/navigation.js +4 -1
  53. package/es/reducers/review-status.d.ts +6 -0
  54. package/es/reducers/review-status.d.ts.map +1 -0
  55. package/es/reducers/review-status.js +15 -0
  56. package/es/reducers/slides.d.ts +7 -0
  57. package/es/reducers/slides.d.ts.map +1 -0
  58. package/es/reducers/slides.js +100 -0
  59. package/es/reducers/step-items.d.ts +7 -0
  60. package/es/reducers/step-items.d.ts.map +1 -0
  61. package/es/reducers/step-items.js +68 -0
  62. package/es/reducers/token.d.ts +4 -3
  63. package/es/reducers/token.d.ts.map +1 -1
  64. package/es/reducers/token.js +5 -2
  65. package/es/services/fetch-demo.d.ts.map +1 -1
  66. package/es/services/fetch-responses.d.ts +6 -6
  67. package/es/services/fetch-responses.d.ts.map +1 -1
  68. package/es/services/fetch-responses.js +2 -2
  69. package/es/services/fetch.mocks.d.ts +3 -3
  70. package/es/services/fetch.mocks.d.ts.map +1 -1
  71. package/es/services/fetch.mocks.js +3 -3
  72. package/es/temp-fixture.d.ts +4 -0
  73. package/es/temp-fixture.d.ts.map +1 -0
  74. package/es/temp-fixture.js +84 -0
  75. package/es/types/api/index.d.ts +16 -0
  76. package/es/types/api/index.d.ts.map +1 -0
  77. package/es/types/api/index.js +1 -0
  78. package/es/types/common.d.ts +8 -0
  79. package/es/types/common.d.ts.map +1 -0
  80. package/es/types/common.js +1 -0
  81. package/es/types/dispatchers.d.ts +18 -0
  82. package/es/types/dispatchers.d.ts.map +1 -0
  83. package/es/types/dispatchers.js +1 -0
  84. package/es/types/finished-slides.d.ts +7 -0
  85. package/es/types/finished-slides.d.ts.map +1 -0
  86. package/es/types/finished-slides.js +1 -0
  87. package/es/types/review-status.d.ts +2 -0
  88. package/es/types/review-status.d.ts.map +1 -0
  89. package/es/types/review-status.js +1 -0
  90. package/es/types/slides.d.ts +85 -0
  91. package/es/types/slides.d.ts.map +1 -0
  92. package/es/types/slides.js +1 -0
  93. package/es/types/states.d.ts +8 -0
  94. package/es/types/states.d.ts.map +1 -0
  95. package/es/types/states.js +1 -0
  96. package/es/types/step-items.d.ts +24 -0
  97. package/es/types/step-items.d.ts.map +1 -0
  98. package/es/types/step-items.js +5 -0
  99. package/es/types/store-state.d.ts +12 -0
  100. package/es/types/store-state.d.ts.map +1 -0
  101. package/es/types/store-state.js +1 -0
  102. package/es/types/utils.d.ts +4 -0
  103. package/es/types/utils.d.ts.map +1 -0
  104. package/es/types/utils.js +1 -0
  105. package/es/types/views.d.ts +58 -0
  106. package/es/types/views.d.ts.map +1 -0
  107. package/es/types/views.js +1 -0
  108. package/lib/actions/api/is-fetching.d.ts +6 -0
  109. package/lib/actions/api/is-fetching.d.ts.map +1 -0
  110. package/lib/actions/api/is-fetching.js +4 -0
  111. package/lib/actions/api/validate-slide.d.ts +6 -0
  112. package/lib/actions/api/validate-slide.d.ts.map +1 -0
  113. package/lib/actions/api/validate-slide.js +6 -0
  114. package/lib/actions/courses.d.ts +2 -2
  115. package/lib/actions/courses.d.ts.map +1 -1
  116. package/lib/actions/finished-slides.d.ts +8 -0
  117. package/lib/actions/finished-slides.d.ts.map +1 -0
  118. package/lib/actions/finished-slides.js +7 -0
  119. package/lib/actions/index.d.ts +2 -4
  120. package/lib/actions/index.d.ts.map +1 -1
  121. package/lib/actions/index.js +1 -3
  122. package/lib/actions/navigation.d.ts +5 -5
  123. package/lib/actions/navigation.d.ts.map +1 -1
  124. package/lib/actions/review-status.d.ts +8 -0
  125. package/lib/actions/review-status.d.ts.map +1 -0
  126. package/lib/actions/review-status.js +7 -0
  127. package/lib/actions/slides.d.ts +21 -0
  128. package/lib/actions/slides.d.ts.map +1 -0
  129. package/lib/actions/slides.js +17 -0
  130. package/lib/actions/step-items.d.ts +15 -0
  131. package/lib/actions/step-items.d.ts.map +1 -0
  132. package/lib/actions/step-items.js +12 -0
  133. package/lib/common/index.d.ts +8 -0
  134. package/lib/common/index.d.ts.map +1 -0
  135. package/lib/common/index.js +7 -0
  136. package/lib/configure-store.d.ts +3 -11
  137. package/lib/configure-store.d.ts.map +1 -1
  138. package/lib/configure-store.js +21 -14
  139. package/lib/index.d.ts +5 -10
  140. package/lib/index.d.ts.map +1 -1
  141. package/lib/index.js +61 -24
  142. package/lib/middlewares/on-start-app.d.ts +1 -1
  143. package/lib/middlewares/on-start-app.d.ts.map +1 -1
  144. package/lib/middlewares/on-start-app.js +27 -16
  145. package/lib/reducers/api.d.ts +12 -0
  146. package/lib/reducers/api.d.ts.map +1 -0
  147. package/lib/reducers/api.js +70 -0
  148. package/lib/reducers/courses.d.ts +2 -2
  149. package/lib/reducers/courses.d.ts.map +1 -1
  150. package/lib/reducers/courses.js +19 -2
  151. package/lib/reducers/finished-slides.d.ts +7 -0
  152. package/lib/reducers/finished-slides.d.ts.map +1 -0
  153. package/lib/reducers/finished-slides.js +61 -0
  154. package/lib/reducers/index.d.ts +13 -3
  155. package/lib/reducers/index.d.ts.map +1 -1
  156. package/lib/reducers/index.js +11 -2
  157. package/lib/reducers/navigation.d.ts +4 -2
  158. package/lib/reducers/navigation.d.ts.map +1 -1
  159. package/lib/reducers/navigation.js +24 -3
  160. package/lib/reducers/review-status.d.ts +6 -0
  161. package/lib/reducers/review-status.d.ts.map +1 -0
  162. package/lib/reducers/review-status.js +16 -0
  163. package/lib/reducers/slides.d.ts +7 -0
  164. package/lib/reducers/slides.d.ts.map +1 -0
  165. package/lib/reducers/slides.js +167 -0
  166. package/lib/reducers/step-items.d.ts +7 -0
  167. package/lib/reducers/step-items.d.ts.map +1 -0
  168. package/lib/reducers/step-items.js +118 -0
  169. package/lib/reducers/token.d.ts +4 -3
  170. package/lib/reducers/token.d.ts.map +1 -1
  171. package/lib/reducers/token.js +4 -1
  172. package/lib/services/fetch-demo.d.ts.map +1 -1
  173. package/lib/services/fetch-demo.js +25 -23
  174. package/lib/services/fetch-responses.d.ts +6 -6
  175. package/lib/services/fetch-responses.d.ts.map +1 -1
  176. package/lib/services/fetch-responses.js +2 -2
  177. package/lib/services/fetch.mocks.d.ts +3 -3
  178. package/lib/services/fetch.mocks.d.ts.map +1 -1
  179. package/lib/services/fetch.mocks.js +28 -16
  180. package/lib/temp-fixture.d.ts +4 -0
  181. package/lib/temp-fixture.d.ts.map +1 -0
  182. package/lib/temp-fixture.js +84 -0
  183. package/lib/types/api/index.d.ts +16 -0
  184. package/lib/types/api/index.d.ts.map +1 -0
  185. package/lib/types/api/index.js +1 -0
  186. package/lib/types/common.d.ts +8 -0
  187. package/lib/types/common.d.ts.map +1 -0
  188. package/lib/types/common.js +1 -0
  189. package/lib/types/dispatchers.d.ts +18 -0
  190. package/lib/types/dispatchers.d.ts.map +1 -0
  191. package/lib/types/dispatchers.js +1 -0
  192. package/lib/types/finished-slides.d.ts +7 -0
  193. package/lib/types/finished-slides.d.ts.map +1 -0
  194. package/lib/types/finished-slides.js +1 -0
  195. package/lib/types/review-status.d.ts +2 -0
  196. package/lib/types/review-status.d.ts.map +1 -0
  197. package/lib/types/review-status.js +1 -0
  198. package/lib/types/slides.d.ts +85 -0
  199. package/lib/types/slides.d.ts.map +1 -0
  200. package/lib/types/slides.js +1 -0
  201. package/lib/types/states.d.ts +8 -0
  202. package/lib/types/states.d.ts.map +1 -0
  203. package/lib/types/states.js +1 -0
  204. package/lib/types/step-items.d.ts +24 -0
  205. package/lib/types/step-items.d.ts.map +1 -0
  206. package/lib/types/step-items.js +5 -0
  207. package/lib/types/store-state.d.ts +12 -0
  208. package/lib/types/store-state.d.ts.map +1 -0
  209. package/lib/types/store-state.js +1 -0
  210. package/lib/types/utils.d.ts +4 -0
  211. package/lib/types/utils.d.ts.map +1 -0
  212. package/lib/types/utils.js +1 -0
  213. package/lib/types/views.d.ts +58 -0
  214. package/lib/types/views.d.ts.map +1 -0
  215. package/lib/types/views.js +1 -0
  216. package/package.json +16 -5
  217. package/src/actions/api/is-fetching.ts +12 -0
  218. package/src/actions/api/validate-slide.ts +15 -0
  219. package/src/actions/courses.ts +2 -2
  220. package/src/actions/finished-slides.ts +21 -0
  221. package/src/actions/index.ts +8 -5
  222. package/src/actions/navigation.ts +6 -5
  223. package/src/actions/review-status.ts +19 -0
  224. package/src/actions/slides.ts +45 -0
  225. package/src/actions/step-items.ts +39 -0
  226. package/src/common/index.ts +12 -0
  227. package/src/configure-store.ts +23 -21
  228. package/src/index.tsx +57 -18
  229. package/src/middlewares/on-start-app.ts +33 -20
  230. package/src/reducers/api.ts +85 -0
  231. package/src/reducers/courses.ts +3 -2
  232. package/src/reducers/finished-slides.ts +33 -0
  233. package/src/reducers/index.ts +11 -3
  234. package/src/reducers/navigation.ts +7 -3
  235. package/src/reducers/review-status.ts +23 -0
  236. package/src/reducers/slides.ts +123 -0
  237. package/src/reducers/step-items.ts +102 -0
  238. package/src/reducers/token.ts +6 -3
  239. package/src/services/fetch-demo.ts +17 -15
  240. package/src/services/fetch-responses.ts +7 -7
  241. package/src/services/fetch.mocks.ts +29 -14
  242. package/src/temp-fixture.ts +94 -0
  243. package/src/types/api/index.ts +16 -0
  244. package/src/types/common.ts +8 -0
  245. package/src/types/dispatchers.ts +18 -0
  246. package/src/types/finished-slides.ts +6 -0
  247. package/src/types/review-status.ts +1 -0
  248. package/src/types/slides.ts +104 -0
  249. package/src/types/states.ts +7 -0
  250. package/src/types/step-items.ts +28 -0
  251. package/src/types/store-state.ts +20 -0
  252. package/src/types/utils.ts +4 -0
  253. package/src/types/views.tsx +62 -0
  254. package/es/components/__tmp-backup-vues-mobile/revision-home.d.ts +0 -10
  255. package/es/components/__tmp-backup-vues-mobile/revision-home.d.ts.map +0 -1
  256. package/es/components/__tmp-backup-vues-mobile/revision-home.js +0 -83
  257. package/es/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts +0 -1
  258. package/es/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts.map +0 -1
  259. package/es/components/__tmp-backup-vues-mobile/revision-home.stories.js +0 -14
  260. package/es/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts +0 -4
  261. package/es/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts.map +0 -1
  262. package/es/components/__tmp-backup-vues-mobile/revision-onboarding.js +0 -57
  263. package/es/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts +0 -19
  264. package/es/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts.map +0 -1
  265. package/es/components/__tmp-backup-vues-mobile/revision-quizzer.js +0 -120
  266. package/lib/components/__tmp-backup-vues-mobile/revision-home.d.ts +0 -10
  267. package/lib/components/__tmp-backup-vues-mobile/revision-home.d.ts.map +0 -1
  268. package/lib/components/__tmp-backup-vues-mobile/revision-home.js +0 -98
  269. package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts +0 -1
  270. package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts.map +0 -1
  271. package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.js +0 -14
  272. package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts +0 -4
  273. package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts.map +0 -1
  274. package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.js +0 -60
  275. package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts +0 -19
  276. package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts.map +0 -1
  277. package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.js +0 -128
  278. package/src/components/__tmp-backup-vues-mobile/revision-home.stories.tsx +0 -16
  279. package/src/components/__tmp-backup-vues-mobile/revision-home.tsx +0 -125
  280. package/src/components/__tmp-backup-vues-mobile/revision-onboarding.tsx +0 -84
  281. package/src/components/__tmp-backup-vues-mobile/revision-quizzer.tsx +0 -176
@@ -0,0 +1,6 @@
1
+ export declare const IS_FETCHING_TRUE = "@@is-fetching/TRUE";
2
+ export declare type IsFetching = {
3
+ type: typeof IS_FETCHING_TRUE;
4
+ };
5
+ export declare const setIsFetching: () => IsFetching;
6
+ //# sourceMappingURL=is-fetching.d.ts.map
@@ -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,6 @@
1
+ export declare const VALIDATE_SLIDE = "@@api/VALIDATE_SLIDE";
2
+ export declare type ValidateSlide = {
3
+ type: typeof VALIDATE_SLIDE;
4
+ };
5
+ export declare const validateSlide: () => ValidateSlide;
6
+ //# sourceMappingURL=validate-slide.d.ts.map
@@ -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
+ });
@@ -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: string;
4
+ payload: unknown;
5
5
  };
6
- export declare const receivedCourse: (course: any) => ReceivedCourse;
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,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,cAAc,WAAY,GAAG,KAAG,cAG3C,CAAC"}
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
+ });
@@ -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
- export * from './courses';
5
- export * from './navigation';
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;AAEnC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AAExB,oBAAY,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,cAAc,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"}
@@ -1,3 +1 @@
1
- export * from './courses';
2
- export * from './navigation';
3
- export * from './token';
1
+ export {};
@@ -1,11 +1,11 @@
1
- import { ActionCreator } from 'redux';
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: string;
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: ActionCreator<NavigateTo>;
18
- export declare const navigateBack: ActionCreator<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,aAAa,EAAC,MAAM,OAAO,CAAC;AACpC,OAAO,EAAC,UAAU,EAAC,MAAM,IAAI,CAAC;AAE9B,eAAO,MAAM,WAAW,6BAA6B,CAAC;AACtD,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAC1D,eAAO,MAAM,SAAS,2BAA2B,CAAC;AAElD,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB,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,EAAE,aAAa,CAAC,UAAU,CAG/C,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,YAAY,CAEnD,CAAC;AAEH,eAAO,MAAM,QAAQ,YAAa,UAAU,KAAG,QAG7C,CAAC"}
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,8 @@
1
+ export declare const TOTAL_SLIDES_STACK = 5;
2
+ export declare const HIGHEST_INDEX: number;
3
+ export declare const VIEWS: {
4
+ readonly home: 'home';
5
+ readonly onboarding: 'onboarding';
6
+ readonly slides: 'slides';
7
+ };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -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"}
@@ -0,0 +1,7 @@
1
+ export const TOTAL_SLIDES_STACK = 5;
2
+ export const HIGHEST_INDEX = TOTAL_SLIDES_STACK - 1;
3
+ export const VIEWS = {
4
+ home: 'home',
5
+ onboarding: 'onboarding',
6
+ slides: 'slides'
7
+ };
@@ -1,14 +1,6 @@
1
- import { State as NavigationState } from './reducers/navigation';
2
- import { State as TokenState } from './reducers/token';
3
- export default function configureStore(): Promise<import("redux").Store<import("redux").EmptyObject & {
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":"AAKA,OAAO,EAAC,KAAK,IAAI,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAC,KAAK,IAAI,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAOrD,wBAA8B,cAAc;;;;;;GAgB3C;AAID,oBAAY,UAAU,GAAG;IACvB,UAAU,EAAE,eAAe,CAAC;IAC5B,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC"}
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"}
@@ -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
- let _compose = compose;
9
- if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) {
10
- const { composeWithDevTools } = await import('redux-devtools-extension');
11
- _compose = composeWithDevTools({
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
- declare const AppRevision: ({ options }: Props) => JSX.Element;
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
- declare type Props = {
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":";AAmBA,QAAA,MAAM,WAAW,gBAAe,KAAK,gBAoBpC,CAAC;AAIF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,4BAA4B,CAAC,EAAE,OAAO,CAAC;KACxC;CACF;AAED,aAAK,KAAK,GAAG;IAAC,OAAO,EAAE,UAAU,CAAA;CAAC,CAAC;AAEnC,oBAAY,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC;AAEF,eAAe,WAAW,CAAC"}
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 AppReviewRootView from '@coorpacademy/components/es/template/app-review/root-view/root-view';
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 mapStateToProps = (state, ownProps) => {
9
- return { ...ownProps, viewName: getCurrentViewName(state) };
14
+ const mapDispatchToProps = {
15
+ navigateTo,
16
+ navigateBack,
17
+ validateSlide,
18
+ updateSlidesOnValidation,
19
+ updateSlidesOnNext,
20
+ updateReviewStatus,
21
+ updateStepItemsOnValidation,
22
+ updateStepItemsOnNext,
23
+ updateFinishedSlides
10
24
  };
11
- const mapDispatchToProps = { navigateTo, navigateBack };
12
- const App = connect(mapStateToProps, mapDispatchToProps)(AppReviewRootView);
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 AppRevision = ({ options }) => {
44
+ const AppReview = ({ options }) => {
15
45
  const [store, setStore] = useState(null);
16
46
  useEffect(() => {
17
47
  const _configure = async () => {
18
- const store = await configureStore();
19
- store.dispatch(startApp(options));
20
- setStore(store);
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
- export default AppRevision;
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 '../configure-store';
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":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,MAAM,EAAwC,MAAM,YAAY,CAAC;AACzE,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAG9C,QAAA,MAAM,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAmB5D,CAAC;AAEF,eAAe,UAAU,CAAC"}
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 { receivedCourse, START_APP, storeToken } from '../actions';
2
- import fetchCourse from '../services/fetch-demo';
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 { token } = action.payload;
6
- dispatch(storeToken(token));
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
- dispatch(receivedCourse(course));
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;
@@ -1,5 +1,5 @@
1
- import { ReceivedCourse } from '../actions';
2
- export declare type State = Array<any>;
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,YAAY,CAAC;AAI3D,oBAAY,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAC/B,eAAO,MAAM,YAAY,EAAE,KAAU,CAAC;AAItC,QAAA,MAAM,OAAO,yBAAyC,cAAc,UAQnE,CAAC;AAIF,eAAe,OAAO,CAAC"}
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"}
@@ -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;