@coorpacademy/app-review 0.6.0 → 0.6.1-alpha.0

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 (379) hide show
  1. package/lib/actions/api/fetch-correction.js +25 -0
  2. package/lib/actions/api/fetch-rank.js +43 -0
  3. package/lib/actions/api/fetch-skills.js +23 -0
  4. package/lib/actions/api/fetch-slide.js +38 -0
  5. package/lib/actions/api/post-answer.js +43 -0
  6. package/lib/actions/api/post-progression.js +27 -0
  7. package/lib/actions/data/token.js +9 -0
  8. package/lib/actions/ui/answers.js +61 -0
  9. package/lib/actions/ui/navigation.js +31 -0
  10. package/lib/actions/ui/next-slide.js +28 -0
  11. package/lib/actions/ui/quit-popin.js +11 -0
  12. package/lib/actions/ui/slides.js +9 -0
  13. package/lib/common/index.js +17 -0
  14. package/lib/configure-store.js +27 -0
  15. package/lib/helpers/css-register.js +7 -0
  16. package/lib/index.js +101 -0
  17. package/lib/reducers/data/corrections.js +26 -0
  18. package/lib/reducers/data/index.js +13 -0
  19. package/lib/reducers/data/progression.js +18 -0
  20. package/lib/reducers/data/rank.js +32 -0
  21. package/lib/reducers/data/skills.js +13 -0
  22. package/lib/reducers/data/slides.js +25 -0
  23. package/lib/reducers/data/token.js +13 -0
  24. package/lib/reducers/index.js +12 -0
  25. package/lib/reducers/ui/answers.js +27 -0
  26. package/lib/reducers/ui/current-slide-ref.js +18 -0
  27. package/lib/reducers/ui/index.js +22 -0
  28. package/lib/reducers/ui/navigation.js +20 -0
  29. package/lib/reducers/ui/positions.js +32 -0
  30. package/lib/reducers/ui/quit-popin.js +18 -0
  31. package/lib/reducers/ui/show-congrats.js +22 -0
  32. package/lib/reducers/ui/slide.js +53 -0
  33. package/lib/services/fetch-correction.js +21 -0
  34. package/lib/services/fetch-rank.js +17 -0
  35. package/lib/services/fetch-skills.js +17 -0
  36. package/lib/services/fetch-slide.js +17 -0
  37. package/lib/services/fetch-slides-to-review-by-skill-ref.js +15 -0
  38. package/lib/services/index.js +20 -0
  39. package/lib/services/post-answer.js +27 -0
  40. package/lib/services/post-progression.js +28 -0
  41. package/lib/services/tools/fetch-responses.js +40 -0
  42. package/lib/services/tools/sleep.js +7 -0
  43. package/lib/types/common.js +2 -0
  44. package/lib/types/slides.js +2 -0
  45. package/lib/{src/views → views}/skills/index.js +8 -4
  46. package/lib/views/slides/index.js +325 -0
  47. package/lib/views/slides/map-api-slide-to-ui.js +177 -0
  48. package/package.json +5 -13
  49. package/es/sandbox/index.d.ts +0 -9
  50. package/es/sandbox/index.js +0 -41
  51. package/es/src/actions/test/create-test-store.d.ts +0 -5
  52. package/es/src/actions/test/create-test-store.js +0 -16
  53. package/es/src/test/index.test.d.ts +0 -1
  54. package/es/src/test/index.test.js +0 -66
  55. package/es/src/test/util/services.mock.d.ts +0 -7
  56. package/es/src/test/util/services.mock.js +0 -444
  57. package/es/src/views/slides/test/fixtures/free-text.d.ts +0 -4
  58. package/es/src/views/slides/test/fixtures/free-text.js +0 -38
  59. package/es/src/views/slides/test/fixtures/qcm-drag.d.ts +0 -4
  60. package/es/src/views/slides/test/fixtures/qcm-drag.js +0 -108
  61. package/es/src/views/slides/test/fixtures/qcm-graphic.d.ts +0 -4
  62. package/es/src/views/slides/test/fixtures/qcm-graphic.js +0 -252
  63. package/es/src/views/slides/test/fixtures/qcm.d.ts +0 -4
  64. package/es/src/views/slides/test/fixtures/qcm.js +0 -109
  65. package/es/src/views/slides/test/fixtures/slider.d.ts +0 -4
  66. package/es/src/views/slides/test/fixtures/slider.js +0 -37
  67. package/es/src/views/slides/test/fixtures/template.d.ts +0 -4
  68. package/es/src/views/slides/test/fixtures/template.js +0 -170
  69. package/lib/sandbox/index.d.ts +0 -9
  70. package/lib/sandbox/index.js +0 -43
  71. package/lib/src/actions/api/fetch-correction.js +0 -19
  72. package/lib/src/actions/api/fetch-rank.js +0 -38
  73. package/lib/src/actions/api/fetch-skills.js +0 -17
  74. package/lib/src/actions/api/fetch-slide.js +0 -81
  75. package/lib/src/actions/api/post-answer.js +0 -92
  76. package/lib/src/actions/api/post-progression.js +0 -72
  77. package/lib/src/actions/data/token.js +0 -5
  78. package/lib/src/actions/test/create-test-store.d.ts +0 -5
  79. package/lib/src/actions/test/create-test-store.js +0 -18
  80. package/lib/src/actions/ui/answers.js +0 -65
  81. package/lib/src/actions/ui/navigation.js +0 -86
  82. package/lib/src/actions/ui/next-slide.js +0 -21
  83. package/lib/src/actions/ui/quit-popin.js +0 -8
  84. package/lib/src/actions/ui/slides.js +0 -5
  85. package/lib/src/common/index.js +0 -10
  86. package/lib/src/configure-store.js +0 -21
  87. package/lib/src/helpers/css-register.js +0 -2
  88. package/lib/src/index.js +0 -86
  89. package/lib/src/reducers/data/corrections.js +0 -22
  90. package/lib/src/reducers/data/index.js +0 -8
  91. package/lib/src/reducers/data/progression.js +0 -17
  92. package/lib/src/reducers/data/rank.js +0 -28
  93. package/lib/src/reducers/data/skills.js +0 -12
  94. package/lib/src/reducers/data/slides.js +0 -20
  95. package/lib/src/reducers/data/token.js +0 -12
  96. package/lib/src/reducers/index.js +0 -7
  97. package/lib/src/reducers/ui/answers.js +0 -25
  98. package/lib/src/reducers/ui/current-slide-ref.js +0 -17
  99. package/lib/src/reducers/ui/index.js +0 -17
  100. package/lib/src/reducers/ui/navigation.js +0 -28
  101. package/lib/src/reducers/ui/positions.js +0 -28
  102. package/lib/src/reducers/ui/quit-popin.js +0 -17
  103. package/lib/src/reducers/ui/show-congrats.js +0 -21
  104. package/lib/src/reducers/ui/slide.js +0 -48
  105. package/lib/src/services/fetch-correction.js +0 -58
  106. package/lib/src/services/fetch-rank.js +0 -54
  107. package/lib/src/services/fetch-skills.js +0 -54
  108. package/lib/src/services/fetch-slide.js +0 -54
  109. package/lib/src/services/fetch-slides-to-review-by-skill-ref.js +0 -52
  110. package/lib/src/services/index.js +0 -16
  111. package/lib/src/services/post-answer.js +0 -64
  112. package/lib/src/services/post-progression.js +0 -65
  113. package/lib/src/services/tools/fetch-responses.js +0 -112
  114. package/lib/src/services/tools/sleep.js +0 -5
  115. package/lib/src/test/index.test.d.ts +0 -1
  116. package/lib/src/test/index.test.js +0 -170
  117. package/lib/src/test/util/services.mock.d.ts +0 -7
  118. package/lib/src/test/util/services.mock.js +0 -448
  119. package/lib/src/types/common.js +0 -1
  120. package/lib/src/types/slides.js +0 -1
  121. package/lib/src/views/slides/index.js +0 -315
  122. package/lib/src/views/slides/map-api-slide-to-ui.js +0 -188
  123. package/lib/src/views/slides/test/fixtures/free-text.d.ts +0 -4
  124. package/lib/src/views/slides/test/fixtures/free-text.js +0 -38
  125. package/lib/src/views/slides/test/fixtures/qcm-drag.d.ts +0 -4
  126. package/lib/src/views/slides/test/fixtures/qcm-drag.js +0 -108
  127. package/lib/src/views/slides/test/fixtures/qcm-graphic.d.ts +0 -4
  128. package/lib/src/views/slides/test/fixtures/qcm-graphic.js +0 -252
  129. package/lib/src/views/slides/test/fixtures/qcm.d.ts +0 -4
  130. package/lib/src/views/slides/test/fixtures/qcm.js +0 -109
  131. package/lib/src/views/slides/test/fixtures/slider.d.ts +0 -4
  132. package/lib/src/views/slides/test/fixtures/slider.js +0 -37
  133. package/lib/src/views/slides/test/fixtures/template.d.ts +0 -4
  134. package/lib/src/views/slides/test/fixtures/template.js +0 -170
  135. package/src/actions/api/fetch-correction.ts +0 -39
  136. package/src/actions/api/fetch-rank.ts +0 -91
  137. package/src/actions/api/fetch-skills.ts +0 -31
  138. package/src/actions/api/fetch-slide.ts +0 -54
  139. package/src/actions/api/post-answer.ts +0 -55
  140. package/src/actions/api/post-progression.ts +0 -37
  141. package/src/actions/api/test/fetch-correction.test.ts +0 -119
  142. package/src/actions/api/test/fetch-rank.test.ts +0 -138
  143. package/src/actions/api/test/fetch-skills.test.ts +0 -78
  144. package/src/actions/api/test/fetch-slide.test.ts +0 -85
  145. package/src/actions/api/test/post-answer.test.ts +0 -266
  146. package/src/actions/api/test/post-progression.test.ts +0 -127
  147. package/src/actions/data/test/token.test.ts +0 -32
  148. package/src/actions/data/token.ts +0 -11
  149. package/src/actions/test/create-test-store.ts +0 -25
  150. package/src/actions/ui/answers.ts +0 -77
  151. package/src/actions/ui/navigation.ts +0 -62
  152. package/src/actions/ui/next-slide.ts +0 -44
  153. package/src/actions/ui/quit-popin.ts +0 -10
  154. package/src/actions/ui/slides.ts +0 -26
  155. package/src/actions/ui/test/answers.test.ts +0 -174
  156. package/src/actions/ui/test/navigation.test.ts +0 -95
  157. package/src/actions/ui/test/next-slide.test.ts +0 -87
  158. package/src/actions/ui/test/quit-popin.test.ts +0 -39
  159. package/src/actions/ui/test/slides.test.ts +0 -33
  160. package/src/common/index.ts +0 -15
  161. package/src/common/test/get-progression-slide-ref.test.ts +0 -35
  162. package/src/configure-store.ts +0 -28
  163. package/src/helpers/css-modules-require-hook.d.ts +0 -4
  164. package/src/helpers/css-register.ts +0 -3
  165. package/src/index.tsx +0 -107
  166. package/src/reducers/data/corrections.ts +0 -36
  167. package/src/reducers/data/index.ts +0 -19
  168. package/src/reducers/data/progression.ts +0 -23
  169. package/src/reducers/data/rank.ts +0 -44
  170. package/src/reducers/data/skills.ts +0 -16
  171. package/src/reducers/data/slides.ts +0 -31
  172. package/src/reducers/data/test/corrections.test.ts +0 -36
  173. package/src/reducers/data/test/progression.test.ts +0 -28
  174. package/src/reducers/data/test/rank.test.ts +0 -59
  175. package/src/reducers/data/test/skills.test.ts +0 -14
  176. package/src/reducers/data/test/slides.test.ts +0 -27
  177. package/src/reducers/data/test/token.test.ts +0 -13
  178. package/src/reducers/data/token.ts +0 -15
  179. package/src/reducers/index.ts +0 -14
  180. package/src/reducers/ui/answers.ts +0 -41
  181. package/src/reducers/ui/current-slide-ref.ts +0 -22
  182. package/src/reducers/ui/index.ts +0 -29
  183. package/src/reducers/ui/navigation.ts +0 -29
  184. package/src/reducers/ui/positions.ts +0 -34
  185. package/src/reducers/ui/quit-popin.ts +0 -22
  186. package/src/reducers/ui/show-congrats.ts +0 -26
  187. package/src/reducers/ui/slide.ts +0 -87
  188. package/src/reducers/ui/test/answers.test.ts +0 -105
  189. package/src/reducers/ui/test/current-slide-ref.test.ts +0 -14
  190. package/src/reducers/ui/test/navigation.test.ts +0 -19
  191. package/src/reducers/ui/test/positions.test.ts +0 -82
  192. package/src/reducers/ui/test/quit-popin.test.ts +0 -24
  193. package/src/reducers/ui/test/show-congrats.test.ts +0 -40
  194. package/src/reducers/ui/test/slide.test.ts +0 -110
  195. package/src/services/fetch-correction.ts +0 -26
  196. package/src/services/fetch-rank.ts +0 -14
  197. package/src/services/fetch-skills.ts +0 -14
  198. package/src/services/fetch-slide.ts +0 -14
  199. package/src/services/fetch-slides-to-review-by-skill-ref.ts +0 -18
  200. package/src/services/index.ts +0 -18
  201. package/src/services/post-answer.ts +0 -28
  202. package/src/services/post-progression.ts +0 -28
  203. package/src/services/test/fetch-correction.test.ts +0 -55
  204. package/src/services/test/fetch-rank.test.ts +0 -34
  205. package/src/services/test/fetch-skills.test.ts +0 -39
  206. package/src/services/test/fetch-slide.test.ts +0 -30
  207. package/src/services/test/fetch-slides-to-review-by-skill-ref.test.ts +0 -51
  208. package/src/services/test/post-answer.test.ts +0 -100
  209. package/src/services/test/post-progression.test.ts +0 -66
  210. package/src/services/tools/fetch-responses.ts +0 -40
  211. package/src/services/tools/sleep.ts +0 -4
  212. package/src/test/index.test.tsx +0 -99
  213. package/src/test/util/services.mock.ts +0 -465
  214. package/src/types/common.ts +0 -207
  215. package/src/types/globals.d.ts +0 -4
  216. package/src/types/slides.ts +0 -98
  217. package/src/views/skills/index.ts +0 -48
  218. package/src/views/skills/test/skills.test.ts +0 -104
  219. package/src/views/slides/index.ts +0 -398
  220. package/src/views/slides/map-api-slide-to-ui.ts +0 -287
  221. package/src/views/slides/test/fixtures/free-text.ts +0 -44
  222. package/src/views/slides/test/fixtures/qcm-drag.ts +0 -112
  223. package/src/views/slides/test/fixtures/qcm-graphic.ts +0 -264
  224. package/src/views/slides/test/fixtures/qcm.ts +0 -120
  225. package/src/views/slides/test/fixtures/slider.ts +0 -43
  226. package/src/views/slides/test/fixtures/template.ts +0 -177
  227. package/src/views/slides/test/header.on-click.test.ts +0 -46
  228. package/src/views/slides/test/index.test.ts +0 -1515
  229. package/src/views/slides/test/map-api-slide-to-ui.test.ts +0 -52
  230. package/src/views/slides/test/on-quit-popin.on-click.test.ts +0 -66
  231. package/src/views/slides/test/slide.free-text.on-change.test.ts +0 -116
  232. package/src/views/slides/test/slide.next-slide.on-click.test.ts +0 -178
  233. package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +0 -90
  234. package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +0 -90
  235. package/src/views/slides/test/slide.qcm.on-click.test.ts +0 -92
  236. package/src/views/slides/test/slide.slider.on-change.test.ts +0 -92
  237. package/src/views/slides/test/slide.slider.on-slider-change.test.ts +0 -91
  238. package/src/views/slides/test/slide.template.on-change.test.ts +0 -126
  239. /package/es/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
  240. /package/es/{src/actions → actions}/api/fetch-correction.js +0 -0
  241. /package/es/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
  242. /package/es/{src/actions → actions}/api/fetch-rank.js +0 -0
  243. /package/es/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
  244. /package/es/{src/actions → actions}/api/fetch-skills.js +0 -0
  245. /package/es/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
  246. /package/es/{src/actions → actions}/api/fetch-slide.js +0 -0
  247. /package/es/{src/actions → actions}/api/post-answer.d.ts +0 -0
  248. /package/es/{src/actions → actions}/api/post-answer.js +0 -0
  249. /package/es/{src/actions → actions}/api/post-progression.d.ts +0 -0
  250. /package/es/{src/actions → actions}/api/post-progression.js +0 -0
  251. /package/es/{src/actions → actions}/data/token.d.ts +0 -0
  252. /package/es/{src/actions → actions}/data/token.js +0 -0
  253. /package/es/{src/actions → actions}/ui/answers.d.ts +0 -0
  254. /package/es/{src/actions → actions}/ui/answers.js +0 -0
  255. /package/es/{src/actions → actions}/ui/navigation.d.ts +0 -0
  256. /package/es/{src/actions → actions}/ui/navigation.js +0 -0
  257. /package/es/{src/actions → actions}/ui/next-slide.d.ts +0 -0
  258. /package/es/{src/actions → actions}/ui/next-slide.js +0 -0
  259. /package/es/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
  260. /package/es/{src/actions → actions}/ui/quit-popin.js +0 -0
  261. /package/es/{src/actions → actions}/ui/slides.d.ts +0 -0
  262. /package/es/{src/actions → actions}/ui/slides.js +0 -0
  263. /package/es/{src/common → common}/index.d.ts +0 -0
  264. /package/es/{src/common → common}/index.js +0 -0
  265. /package/es/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
  266. /package/es/{src/configure-store.js → configure-store.js} +0 -0
  267. /package/es/{src/helpers → helpers}/css-register.d.ts +0 -0
  268. /package/es/{src/helpers → helpers}/css-register.js +0 -0
  269. /package/es/{src/index.d.ts → index.d.ts} +0 -0
  270. /package/es/{src/index.js → index.js} +0 -0
  271. /package/es/{src/reducers → reducers}/data/corrections.d.ts +0 -0
  272. /package/es/{src/reducers → reducers}/data/corrections.js +0 -0
  273. /package/es/{src/reducers → reducers}/data/index.d.ts +0 -0
  274. /package/es/{src/reducers → reducers}/data/index.js +0 -0
  275. /package/es/{src/reducers → reducers}/data/progression.d.ts +0 -0
  276. /package/es/{src/reducers → reducers}/data/progression.js +0 -0
  277. /package/es/{src/reducers → reducers}/data/rank.d.ts +0 -0
  278. /package/es/{src/reducers → reducers}/data/rank.js +0 -0
  279. /package/es/{src/reducers → reducers}/data/skills.d.ts +0 -0
  280. /package/es/{src/reducers → reducers}/data/skills.js +0 -0
  281. /package/es/{src/reducers → reducers}/data/slides.d.ts +0 -0
  282. /package/es/{src/reducers → reducers}/data/slides.js +0 -0
  283. /package/es/{src/reducers → reducers}/data/token.d.ts +0 -0
  284. /package/es/{src/reducers → reducers}/data/token.js +0 -0
  285. /package/es/{src/reducers → reducers}/index.d.ts +0 -0
  286. /package/es/{src/reducers → reducers}/index.js +0 -0
  287. /package/es/{src/reducers → reducers}/ui/answers.d.ts +0 -0
  288. /package/es/{src/reducers → reducers}/ui/answers.js +0 -0
  289. /package/es/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
  290. /package/es/{src/reducers → reducers}/ui/current-slide-ref.js +0 -0
  291. /package/es/{src/reducers → reducers}/ui/index.d.ts +0 -0
  292. /package/es/{src/reducers → reducers}/ui/index.js +0 -0
  293. /package/es/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
  294. /package/es/{src/reducers → reducers}/ui/navigation.js +0 -0
  295. /package/es/{src/reducers → reducers}/ui/positions.d.ts +0 -0
  296. /package/es/{src/reducers → reducers}/ui/positions.js +0 -0
  297. /package/es/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
  298. /package/es/{src/reducers → reducers}/ui/quit-popin.js +0 -0
  299. /package/es/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
  300. /package/es/{src/reducers → reducers}/ui/show-congrats.js +0 -0
  301. /package/es/{src/reducers → reducers}/ui/slide.d.ts +0 -0
  302. /package/es/{src/reducers → reducers}/ui/slide.js +0 -0
  303. /package/es/{src/services → services}/fetch-correction.d.ts +0 -0
  304. /package/es/{src/services → services}/fetch-correction.js +0 -0
  305. /package/es/{src/services → services}/fetch-rank.d.ts +0 -0
  306. /package/es/{src/services → services}/fetch-rank.js +0 -0
  307. /package/es/{src/services → services}/fetch-skills.d.ts +0 -0
  308. /package/es/{src/services → services}/fetch-skills.js +0 -0
  309. /package/es/{src/services → services}/fetch-slide.d.ts +0 -0
  310. /package/es/{src/services → services}/fetch-slide.js +0 -0
  311. /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
  312. /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.js +0 -0
  313. /package/es/{src/services → services}/index.d.ts +0 -0
  314. /package/es/{src/services → services}/index.js +0 -0
  315. /package/es/{src/services → services}/post-answer.d.ts +0 -0
  316. /package/es/{src/services → services}/post-answer.js +0 -0
  317. /package/es/{src/services → services}/post-progression.d.ts +0 -0
  318. /package/es/{src/services → services}/post-progression.js +0 -0
  319. /package/es/{src/services → services}/tools/fetch-responses.d.ts +0 -0
  320. /package/es/{src/services → services}/tools/fetch-responses.js +0 -0
  321. /package/es/{src/services → services}/tools/sleep.d.ts +0 -0
  322. /package/es/{src/services → services}/tools/sleep.js +0 -0
  323. /package/es/{src/types → types}/common.d.ts +0 -0
  324. /package/es/{src/types → types}/common.js +0 -0
  325. /package/es/{src/types → types}/slides.d.ts +0 -0
  326. /package/es/{src/types → types}/slides.js +0 -0
  327. /package/es/{src/views → views}/skills/index.d.ts +0 -0
  328. /package/es/{src/views → views}/skills/index.js +0 -0
  329. /package/es/{src/views → views}/slides/index.d.ts +0 -0
  330. /package/es/{src/views → views}/slides/index.js +0 -0
  331. /package/es/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
  332. /package/es/{src/views → views}/slides/map-api-slide-to-ui.js +0 -0
  333. /package/lib/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
  334. /package/lib/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
  335. /package/lib/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
  336. /package/lib/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
  337. /package/lib/{src/actions → actions}/api/post-answer.d.ts +0 -0
  338. /package/lib/{src/actions → actions}/api/post-progression.d.ts +0 -0
  339. /package/lib/{src/actions → actions}/data/token.d.ts +0 -0
  340. /package/lib/{src/actions → actions}/ui/answers.d.ts +0 -0
  341. /package/lib/{src/actions → actions}/ui/navigation.d.ts +0 -0
  342. /package/lib/{src/actions → actions}/ui/next-slide.d.ts +0 -0
  343. /package/lib/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
  344. /package/lib/{src/actions → actions}/ui/slides.d.ts +0 -0
  345. /package/lib/{src/common → common}/index.d.ts +0 -0
  346. /package/lib/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
  347. /package/lib/{src/helpers → helpers}/css-register.d.ts +0 -0
  348. /package/lib/{src/index.d.ts → index.d.ts} +0 -0
  349. /package/lib/{src/reducers → reducers}/data/corrections.d.ts +0 -0
  350. /package/lib/{src/reducers → reducers}/data/index.d.ts +0 -0
  351. /package/lib/{src/reducers → reducers}/data/progression.d.ts +0 -0
  352. /package/lib/{src/reducers → reducers}/data/rank.d.ts +0 -0
  353. /package/lib/{src/reducers → reducers}/data/skills.d.ts +0 -0
  354. /package/lib/{src/reducers → reducers}/data/slides.d.ts +0 -0
  355. /package/lib/{src/reducers → reducers}/data/token.d.ts +0 -0
  356. /package/lib/{src/reducers → reducers}/index.d.ts +0 -0
  357. /package/lib/{src/reducers → reducers}/ui/answers.d.ts +0 -0
  358. /package/lib/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
  359. /package/lib/{src/reducers → reducers}/ui/index.d.ts +0 -0
  360. /package/lib/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
  361. /package/lib/{src/reducers → reducers}/ui/positions.d.ts +0 -0
  362. /package/lib/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
  363. /package/lib/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
  364. /package/lib/{src/reducers → reducers}/ui/slide.d.ts +0 -0
  365. /package/lib/{src/services → services}/fetch-correction.d.ts +0 -0
  366. /package/lib/{src/services → services}/fetch-rank.d.ts +0 -0
  367. /package/lib/{src/services → services}/fetch-skills.d.ts +0 -0
  368. /package/lib/{src/services → services}/fetch-slide.d.ts +0 -0
  369. /package/lib/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
  370. /package/lib/{src/services → services}/index.d.ts +0 -0
  371. /package/lib/{src/services → services}/post-answer.d.ts +0 -0
  372. /package/lib/{src/services → services}/post-progression.d.ts +0 -0
  373. /package/lib/{src/services → services}/tools/fetch-responses.d.ts +0 -0
  374. /package/lib/{src/services → services}/tools/sleep.d.ts +0 -0
  375. /package/lib/{src/types → types}/common.d.ts +0 -0
  376. /package/lib/{src/types → types}/slides.d.ts +0 -0
  377. /package/lib/{src/views → views}/skills/index.d.ts +0 -0
  378. /package/lib/{src/views → views}/slides/index.d.ts +0 -0
  379. /package/lib/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
@@ -1,64 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import crossFetch from 'cross-fetch';
38
- import decode from 'jwt-decode';
39
- import { toJSON } from './tools/fetch-responses';
40
- export var postAnswer = function (progression, token, answer) { return __awaiter(void 0, void 0, void 0, function () {
41
- var progressionId, slideRef, host, response;
42
- return __generator(this, function (_a) {
43
- switch (_a.label) {
44
- case 0:
45
- progressionId = progression._id;
46
- slideRef = progression.state.nextContent.ref;
47
- host = decode(token).host;
48
- return [4 /*yield*/, crossFetch("".concat(host, "/api/v2/progressions/").concat(progressionId, "/answers"), {
49
- method: 'post',
50
- headers: { authorization: token, 'content-type': 'application/json' },
51
- body: JSON.stringify({
52
- content: {
53
- ref: slideRef,
54
- type: 'slide'
55
- },
56
- answer: answer
57
- })
58
- })];
59
- case 1:
60
- response = _a.sent();
61
- return [2 /*return*/, toJSON(response)];
62
- }
63
- });
64
- }); };
@@ -1,65 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import crossFetch from 'cross-fetch';
38
- import decode from 'jwt-decode';
39
- import { toJSON } from './tools/fetch-responses';
40
- export var postProgression = function (skillRef, token) { return __awaiter(void 0, void 0, void 0, function () {
41
- var host, response;
42
- return __generator(this, function (_a) {
43
- switch (_a.label) {
44
- case 0:
45
- host = decode(token).host;
46
- return [4 /*yield*/, crossFetch("".concat(host, "/api/v2/progressions"), {
47
- method: 'post',
48
- headers: { authorization: token, 'content-type': 'application/json' },
49
- body: JSON.stringify({
50
- content: {
51
- ref: skillRef,
52
- type: 'skill'
53
- },
54
- engine: {
55
- ref: 'review',
56
- version: '1'
57
- }
58
- })
59
- })];
60
- case 1:
61
- response = _a.sent();
62
- return [2 /*return*/, toJSON(response)];
63
- }
64
- });
65
- }); };
@@ -1,112 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
- return new (P || (P = Promise))(function (resolve, reject) {
19
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
- step((generator = generator.apply(thisArg, _arguments || [])).next());
23
- });
24
- };
25
- var __generator = (this && this.__generator) || function (thisArg, body) {
26
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
27
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
- function verb(n) { return function (v) { return step([n, v]); }; }
29
- function step(op) {
30
- if (f) throw new TypeError("Generator is already executing.");
31
- while (_) try {
32
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
33
- if (y = 0, t) op = [op[0] & 2, t.value];
34
- switch (op[0]) {
35
- case 0: case 1: t = op; break;
36
- case 4: _.label++; return { value: op[1], done: false };
37
- case 5: _.label++; y = op[1]; op = [0]; continue;
38
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
- default:
40
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
- if (t[2]) _.ops.pop();
45
- _.trys.pop(); continue;
46
- }
47
- op = body.call(thisArg, _);
48
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
- }
51
- };
52
- var ResponseError = /** @class */ (function (_super) {
53
- __extends(ResponseError, _super);
54
- function ResponseError(statusCode, statusText, body) {
55
- if (body === void 0) { body = ''; }
56
- var _this = _super.call(this, "".concat(statusText, " ").concat(body).trim()) || this;
57
- _this.name = 'ResponseError';
58
- _this.statusCode = statusCode;
59
- return _this;
60
- }
61
- return ResponseError;
62
- }(Error));
63
- export { ResponseError };
64
- export var toJSON = function (response) { return __awaiter(void 0, void 0, void 0, function () {
65
- var body, err_1;
66
- return __generator(this, function (_a) {
67
- switch (_a.label) {
68
- case 0:
69
- if (!!response.ok) return [3 /*break*/, 2];
70
- return [4 /*yield*/, response.text()];
71
- case 1:
72
- body = _a.sent();
73
- throw new ResponseError(response.status, response.statusText, body);
74
- case 2:
75
- _a.trys.push([2, 4, , 5]);
76
- return [4 /*yield*/, response.json()];
77
- case 3: return [2 /*return*/, _a.sent()];
78
- case 4:
79
- err_1 = _a.sent();
80
- throw new ResponseError(response.status, response.statusText);
81
- case 5: return [2 /*return*/];
82
- }
83
- });
84
- }); };
85
- export var toText = function (response) { return __awaiter(void 0, void 0, void 0, function () {
86
- var body;
87
- return __generator(this, function (_a) {
88
- switch (_a.label) {
89
- case 0: return [4 /*yield*/, response.text()];
90
- case 1:
91
- body = _a.sent();
92
- if (!response.ok) {
93
- throw new ResponseError(response.status, response.statusText, body);
94
- }
95
- return [2 /*return*/, body];
96
- }
97
- });
98
- }); };
99
- export var toVoid = function (response) { return __awaiter(void 0, void 0, void 0, function () {
100
- var body;
101
- return __generator(this, function (_a) {
102
- switch (_a.label) {
103
- case 0:
104
- if (!!response.ok) return [3 /*break*/, 2];
105
- return [4 /*yield*/, response.text()];
106
- case 1:
107
- body = _a.sent();
108
- throw new ResponseError(response.status, response.statusText, body);
109
- case 2: return [2 /*return*/];
110
- }
111
- });
112
- }); };
@@ -1,5 +0,0 @@
1
- export var sleep = function (msToSleep) {
2
- return new Promise(function (resolve) {
3
- setTimeout(resolve, msToSleep);
4
- });
5
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,170 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import browserEnv from 'browser-env';
38
- import identity from 'lodash/fp/identity';
39
- import test from 'ava';
40
- import React from 'react';
41
- import { render, fireEvent, act } from '@testing-library/react';
42
- import { sleep } from '../services/tools/sleep';
43
- import AppReview from '..';
44
- import { services } from './util/services.mock';
45
- browserEnv({ pretendToBeVisual: true });
46
- var elementExists = function (foundElements) {
47
- return foundElements && foundElements[0];
48
- };
49
- var waitForChanges = function (msToWait) {
50
- if (msToWait === void 0) { msToWait = 3000; }
51
- return __awaiter(void 0, void 0, void 0, function () {
52
- return __generator(this, function (_a) {
53
- switch (_a.label) {
54
- case 0: return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
55
- return __generator(this, function (_a) {
56
- switch (_a.label) {
57
- case 0: return [4 /*yield*/, sleep(msToWait)];
58
- case 1:
59
- _a.sent(); // wait *just* a little longer than the timeout in the component
60
- return [2 /*return*/];
61
- }
62
- });
63
- }); })];
64
- case 1:
65
- _a.sent();
66
- return [2 /*return*/];
67
- }
68
- });
69
- });
70
- };
71
- var LIMIT = 5;
72
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
73
- var clickAllSlides = function (t, container, accumulator) {
74
- if (accumulator === void 0) { accumulator = 0; }
75
- return __awaiter(void 0, void 0, void 0, function () {
76
- var validateButton, nextButton;
77
- return __generator(this, function (_a) {
78
- switch (_a.label) {
79
- case 0:
80
- if (accumulator === LIMIT)
81
- return [2 /*return*/];
82
- if (!(accumulator === 4)) return [3 /*break*/, 2];
83
- return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
84
- return __generator(this, function (_a) {
85
- switch (_a.label) {
86
- case 0: return [4 /*yield*/, sleep(1000)];
87
- case 1:
88
- _a.sent();
89
- return [2 /*return*/];
90
- }
91
- });
92
- }); })];
93
- case 1:
94
- _a.sent();
95
- _a.label = 2;
96
- case 2:
97
- validateButton = container.querySelectorAll("[data-name=\"slide-validate-button-".concat(accumulator, "\"]"));
98
- t.truthy(elementExists(validateButton));
99
- return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
100
- return __generator(this, function (_a) {
101
- switch (_a.label) {
102
- case 0: return [4 /*yield*/, fireEvent.click(validateButton[0])];
103
- case 1:
104
- _a.sent();
105
- return [2 /*return*/];
106
- }
107
- });
108
- }); })];
109
- case 3:
110
- _a.sent();
111
- nextButton = container.querySelectorAll("[data-name=\"next-question-button-".concat(accumulator, "\"]"));
112
- t.truthy(elementExists(nextButton));
113
- return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
114
- return __generator(this, function (_a) {
115
- switch (_a.label) {
116
- case 0: return [4 /*yield*/, fireEvent.click(nextButton[0])];
117
- case 1:
118
- _a.sent();
119
- return [2 /*return*/];
120
- }
121
- });
122
- }); })];
123
- case 4:
124
- _a.sent();
125
- return [4 /*yield*/, clickAllSlides(t, container, accumulator + 1)];
126
- case 5:
127
- _a.sent();
128
- return [2 /*return*/];
129
- }
130
- });
131
- });
132
- };
133
- var appOptions = {
134
- token: process.env.API_TEST_TOKEN || '',
135
- skillRef: 'skill_NJC0jFKoH',
136
- services: services,
137
- onQuitClick: identity,
138
- url: process.env.LAMBDA_API_REVIEW_GET_SLIDES_URL || 'http://localhost:7006'
139
- };
140
- test('should show the loader while the app is fetching the data', function (t) { return __awaiter(void 0, void 0, void 0, function () {
141
- var container, loader;
142
- return __generator(this, function (_a) {
143
- switch (_a.label) {
144
- case 0:
145
- t.plan(2);
146
- container = render(React.createElement(AppReview, { options: appOptions })).container;
147
- return [4 /*yield*/, waitForChanges(1000)];
148
- case 1:
149
- _a.sent();
150
- loader = container.querySelector('[data-name="loader"]');
151
- t.truthy(loader);
152
- // await waitFor(async () => {
153
- // // await sleep(500);
154
- // const result = await t.try(tt => {
155
- // // rerender(<AppReview options={appOptions} />);
156
- // const slidesContainer = container.querySelector('[data-name="slides-revision-container"]');
157
- // tt.truthy(slidesContainer);
158
- // });
159
- // if (result.passed) return result.commit();
160
- // result.discard();
161
- // throw result.errors;
162
- // });
163
- // const stackedSlidesContainer = container.querySelector('[data-name="stacked-slides-container"]');
164
- // t.truthy(stackedSlidesContainer);
165
- // await clickAllSlides(t, container);
166
- t.pass();
167
- return [2 /*return*/];
168
- }
169
- });
170
- }); });
@@ -1,7 +0,0 @@
1
- import { CorrectionFromAPI, ProgressionFromAPI, Services } from '../../types/common';
2
- export declare const postProgressionResponse: ProgressionFromAPI;
3
- export declare const postAnswerResponses: Record<string, ProgressionFromAPI>;
4
- export declare const incorrectFreeTextPostAnswerResponse: ProgressionFromAPI;
5
- export declare const progressionSlideWithPendingSlide: ProgressionFromAPI;
6
- export declare const getChoicesCorrection: (ref: string, wrongChoice?: boolean) => CorrectionFromAPI;
7
- export declare const services: Services;