@coorpacademy/app-review 0.5.7-alpha.0 → 0.6.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 (280) hide show
  1. package/es/sandbox/index.d.ts +9 -0
  2. package/es/sandbox/index.js +41 -0
  3. package/es/{actions → src/actions}/api/fetch-correction.d.ts +2 -2
  4. package/{lib → es/src}/actions/api/fetch-rank.d.ts +3 -3
  5. package/{lib → es/src}/actions/api/fetch-skills.d.ts +2 -2
  6. package/{lib → es/src}/actions/api/fetch-slide.d.ts +2 -2
  7. package/{lib → es/src}/actions/api/post-answer.d.ts +2 -2
  8. package/es/{actions → src/actions}/api/post-progression.d.ts +2 -2
  9. package/es/{actions → src/actions}/test/create-test-store.d.ts +2 -2
  10. package/es/{actions → src/actions}/test/create-test-store.js +2 -2
  11. package/es/src/actions/ui/navigation.d.ts +19 -0
  12. package/es/src/actions/ui/navigation.js +26 -0
  13. package/{lib → es/src}/common/index.d.ts +0 -5
  14. package/es/{common → src/common}/index.js +0 -5
  15. package/es/{configure-store.js → src/configure-store.js} +5 -1
  16. package/es/{index.js → src/index.js} +3 -3
  17. package/{lib → es/src}/reducers/index.d.ts +1 -1
  18. package/es/{reducers → src/reducers}/ui/index.d.ts +1 -1
  19. package/{lib → es/src}/reducers/ui/navigation.d.ts +2 -2
  20. package/es/{reducers → src/reducers}/ui/navigation.js +1 -1
  21. package/{lib → es/src}/types/common.d.ts +7 -4
  22. package/{lib → es/src}/views/skills/index.d.ts +1 -3
  23. package/es/{views → src/views}/skills/index.js +0 -2
  24. package/es/src/views/slides/index.d.ts +34 -0
  25. package/es/{views → src/views}/slides/index.js +6 -4
  26. package/lib/sandbox/index.d.ts +9 -0
  27. package/lib/sandbox/index.js +43 -0
  28. package/lib/{actions → src/actions}/api/fetch-correction.d.ts +2 -2
  29. package/{es → lib/src}/actions/api/fetch-rank.d.ts +3 -3
  30. package/{es → lib/src}/actions/api/fetch-skills.d.ts +2 -2
  31. package/{es → lib/src}/actions/api/fetch-slide.d.ts +2 -2
  32. package/{es → lib/src}/actions/api/post-answer.d.ts +2 -2
  33. package/lib/{actions → src/actions}/api/post-progression.d.ts +2 -2
  34. package/lib/{actions → src/actions}/test/create-test-store.d.ts +2 -2
  35. package/lib/{actions → src/actions}/test/create-test-store.js +2 -2
  36. package/lib/src/actions/ui/navigation.d.ts +19 -0
  37. package/lib/src/actions/ui/navigation.js +86 -0
  38. package/{es → lib/src}/common/index.d.ts +0 -5
  39. package/lib/{common → src/common}/index.js +0 -5
  40. package/lib/{configure-store.js → src/configure-store.js} +5 -1
  41. package/lib/{index.js → src/index.js} +3 -3
  42. package/{es → lib/src}/reducers/index.d.ts +1 -1
  43. package/lib/{reducers → src/reducers}/ui/index.d.ts +1 -1
  44. package/{es → lib/src}/reducers/ui/navigation.d.ts +2 -2
  45. package/lib/{reducers → src/reducers}/ui/navigation.js +1 -1
  46. package/{es → lib/src}/types/common.d.ts +7 -4
  47. package/{es → lib/src}/views/skills/index.d.ts +1 -3
  48. package/lib/{views → src/views}/skills/index.js +0 -2
  49. package/lib/src/views/slides/index.d.ts +34 -0
  50. package/lib/{views → src/views}/slides/index.js +6 -4
  51. package/package.json +3 -3
  52. package/src/actions/api/fetch-correction.ts +2 -2
  53. package/src/actions/api/fetch-rank.ts +3 -3
  54. package/src/actions/api/fetch-skills.ts +2 -2
  55. package/src/actions/api/fetch-slide.ts +6 -2
  56. package/src/actions/api/post-answer.ts +2 -2
  57. package/src/actions/api/post-progression.ts +6 -2
  58. package/src/actions/api/test/fetch-correction.test.ts +2 -2
  59. package/src/actions/api/test/fetch-rank.test.ts +4 -4
  60. package/src/actions/api/test/fetch-skills.test.ts +2 -2
  61. package/src/actions/api/test/fetch-slide.test.ts +2 -2
  62. package/src/actions/api/test/post-answer.test.ts +11 -7
  63. package/src/actions/api/test/post-progression.test.ts +2 -2
  64. package/src/actions/data/test/token.test.ts +1 -1
  65. package/src/actions/test/create-test-store.ts +3 -3
  66. package/src/actions/ui/navigation.ts +49 -17
  67. package/src/actions/ui/test/answers.test.ts +8 -8
  68. package/src/actions/ui/test/navigation.test.ts +95 -0
  69. package/src/actions/ui/test/next-slide.test.ts +2 -2
  70. package/src/actions/ui/test/quit-popin.test.ts +2 -2
  71. package/src/actions/ui/test/slides.test.ts +1 -1
  72. package/src/common/index.ts +0 -10
  73. package/src/configure-store.ts +8 -2
  74. package/src/index.tsx +8 -6
  75. package/src/reducers/ui/navigation.ts +5 -5
  76. package/src/reducers/ui/test/navigation.test.ts +5 -5
  77. package/src/types/common.ts +9 -5
  78. package/src/views/skills/index.ts +1 -5
  79. package/src/views/skills/test/skills.test.ts +0 -4
  80. package/src/views/slides/index.ts +20 -132
  81. package/src/views/slides/test/header.on-click.test.ts +1 -1
  82. package/src/views/slides/test/index.test.ts +21 -6
  83. package/src/views/slides/test/on-quit-popin.on-click.test.ts +6 -5
  84. package/src/views/slides/test/slide.free-text.on-change.test.ts +3 -4
  85. package/src/views/slides/test/slide.next-slide.on-click.test.ts +7 -5
  86. package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +1 -1
  87. package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +1 -1
  88. package/src/views/slides/test/slide.qcm.on-click.test.ts +1 -1
  89. package/src/views/slides/test/slide.slider.on-change.test.ts +1 -1
  90. package/src/views/slides/test/slide.slider.on-slider-change.test.ts +1 -1
  91. package/src/views/slides/test/slide.template.on-change.test.ts +2 -2
  92. package/es/actions/index.d.ts +0 -5
  93. package/es/actions/index.js +0 -1
  94. package/es/actions/ui/navigation.d.ts +0 -18
  95. package/es/actions/ui/navigation.js +0 -10
  96. package/es/views/slides/index.d.ts +0 -142
  97. package/lib/actions/index.d.ts +0 -5
  98. package/lib/actions/index.js +0 -1
  99. package/lib/actions/ui/navigation.d.ts +0 -18
  100. package/lib/actions/ui/navigation.js +0 -10
  101. package/lib/views/slides/index.d.ts +0 -142
  102. package/src/actions/index.ts +0 -6
  103. /package/es/{actions → src/actions}/api/fetch-correction.js +0 -0
  104. /package/es/{actions → src/actions}/api/fetch-rank.js +0 -0
  105. /package/es/{actions → src/actions}/api/fetch-skills.js +0 -0
  106. /package/es/{actions → src/actions}/api/fetch-slide.js +0 -0
  107. /package/es/{actions → src/actions}/api/post-answer.js +0 -0
  108. /package/es/{actions → src/actions}/api/post-progression.js +0 -0
  109. /package/es/{actions → src/actions}/data/token.d.ts +0 -0
  110. /package/es/{actions → src/actions}/data/token.js +0 -0
  111. /package/es/{actions → src/actions}/ui/answers.d.ts +0 -0
  112. /package/es/{actions → src/actions}/ui/answers.js +0 -0
  113. /package/es/{actions → src/actions}/ui/next-slide.d.ts +0 -0
  114. /package/es/{actions → src/actions}/ui/next-slide.js +0 -0
  115. /package/es/{actions → src/actions}/ui/quit-popin.d.ts +0 -0
  116. /package/es/{actions → src/actions}/ui/quit-popin.js +0 -0
  117. /package/es/{actions → src/actions}/ui/slides.d.ts +0 -0
  118. /package/es/{actions → src/actions}/ui/slides.js +0 -0
  119. /package/es/{configure-store.d.ts → src/configure-store.d.ts} +0 -0
  120. /package/es/{helpers → src/helpers}/css-register.d.ts +0 -0
  121. /package/es/{helpers → src/helpers}/css-register.js +0 -0
  122. /package/es/{index.d.ts → src/index.d.ts} +0 -0
  123. /package/es/{reducers → src/reducers}/data/corrections.d.ts +0 -0
  124. /package/es/{reducers → src/reducers}/data/corrections.js +0 -0
  125. /package/es/{reducers → src/reducers}/data/index.d.ts +0 -0
  126. /package/es/{reducers → src/reducers}/data/index.js +0 -0
  127. /package/es/{reducers → src/reducers}/data/progression.d.ts +0 -0
  128. /package/es/{reducers → src/reducers}/data/progression.js +0 -0
  129. /package/es/{reducers → src/reducers}/data/rank.d.ts +0 -0
  130. /package/es/{reducers → src/reducers}/data/rank.js +0 -0
  131. /package/es/{reducers → src/reducers}/data/skills.d.ts +0 -0
  132. /package/es/{reducers → src/reducers}/data/skills.js +0 -0
  133. /package/es/{reducers → src/reducers}/data/slides.d.ts +0 -0
  134. /package/es/{reducers → src/reducers}/data/slides.js +0 -0
  135. /package/es/{reducers → src/reducers}/data/token.d.ts +0 -0
  136. /package/es/{reducers → src/reducers}/data/token.js +0 -0
  137. /package/es/{reducers → src/reducers}/index.js +0 -0
  138. /package/es/{reducers → src/reducers}/ui/answers.d.ts +0 -0
  139. /package/es/{reducers → src/reducers}/ui/answers.js +0 -0
  140. /package/es/{reducers → src/reducers}/ui/current-slide-ref.d.ts +0 -0
  141. /package/es/{reducers → src/reducers}/ui/current-slide-ref.js +0 -0
  142. /package/es/{reducers → src/reducers}/ui/index.js +0 -0
  143. /package/es/{reducers → src/reducers}/ui/positions.d.ts +0 -0
  144. /package/es/{reducers → src/reducers}/ui/positions.js +0 -0
  145. /package/es/{reducers → src/reducers}/ui/quit-popin.d.ts +0 -0
  146. /package/es/{reducers → src/reducers}/ui/quit-popin.js +0 -0
  147. /package/es/{reducers → src/reducers}/ui/show-congrats.d.ts +0 -0
  148. /package/es/{reducers → src/reducers}/ui/show-congrats.js +0 -0
  149. /package/es/{reducers → src/reducers}/ui/slide.d.ts +0 -0
  150. /package/es/{reducers → src/reducers}/ui/slide.js +0 -0
  151. /package/es/{services → src/services}/fetch-correction.d.ts +0 -0
  152. /package/es/{services → src/services}/fetch-correction.js +0 -0
  153. /package/es/{services → src/services}/fetch-rank.d.ts +0 -0
  154. /package/es/{services → src/services}/fetch-rank.js +0 -0
  155. /package/es/{services → src/services}/fetch-skills.d.ts +0 -0
  156. /package/es/{services → src/services}/fetch-skills.js +0 -0
  157. /package/es/{services → src/services}/fetch-slide.d.ts +0 -0
  158. /package/es/{services → src/services}/fetch-slide.js +0 -0
  159. /package/es/{services → src/services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
  160. /package/es/{services → src/services}/fetch-slides-to-review-by-skill-ref.js +0 -0
  161. /package/es/{services → src/services}/index.d.ts +0 -0
  162. /package/es/{services → src/services}/index.js +0 -0
  163. /package/es/{services → src/services}/post-answer.d.ts +0 -0
  164. /package/es/{services → src/services}/post-answer.js +0 -0
  165. /package/es/{services → src/services}/post-progression.d.ts +0 -0
  166. /package/es/{services → src/services}/post-progression.js +0 -0
  167. /package/es/{services → src/services}/tools/fetch-responses.d.ts +0 -0
  168. /package/es/{services → src/services}/tools/fetch-responses.js +0 -0
  169. /package/es/{services → src/services}/tools/sleep.d.ts +0 -0
  170. /package/es/{services → src/services}/tools/sleep.js +0 -0
  171. /package/es/{test → src/test}/index.test.d.ts +0 -0
  172. /package/es/{test → src/test}/index.test.js +0 -0
  173. /package/es/{test → src/test}/util/services.mock.d.ts +0 -0
  174. /package/es/{test → src/test}/util/services.mock.js +0 -0
  175. /package/es/{types → src/types}/common.js +0 -0
  176. /package/es/{types → src/types}/slides.d.ts +0 -0
  177. /package/es/{types → src/types}/slides.js +0 -0
  178. /package/es/{views → src/views}/slides/map-api-slide-to-ui.d.ts +0 -0
  179. /package/es/{views → src/views}/slides/map-api-slide-to-ui.js +0 -0
  180. /package/es/{views → src/views}/slides/test/fixtures/free-text.d.ts +0 -0
  181. /package/es/{views → src/views}/slides/test/fixtures/free-text.js +0 -0
  182. /package/es/{views → src/views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
  183. /package/es/{views → src/views}/slides/test/fixtures/qcm-drag.js +0 -0
  184. /package/es/{views → src/views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
  185. /package/es/{views → src/views}/slides/test/fixtures/qcm-graphic.js +0 -0
  186. /package/es/{views → src/views}/slides/test/fixtures/qcm.d.ts +0 -0
  187. /package/es/{views → src/views}/slides/test/fixtures/qcm.js +0 -0
  188. /package/es/{views → src/views}/slides/test/fixtures/slider.d.ts +0 -0
  189. /package/es/{views → src/views}/slides/test/fixtures/slider.js +0 -0
  190. /package/es/{views → src/views}/slides/test/fixtures/template.d.ts +0 -0
  191. /package/es/{views → src/views}/slides/test/fixtures/template.js +0 -0
  192. /package/lib/{actions → src/actions}/api/fetch-correction.js +0 -0
  193. /package/lib/{actions → src/actions}/api/fetch-rank.js +0 -0
  194. /package/lib/{actions → src/actions}/api/fetch-skills.js +0 -0
  195. /package/lib/{actions → src/actions}/api/fetch-slide.js +0 -0
  196. /package/lib/{actions → src/actions}/api/post-answer.js +0 -0
  197. /package/lib/{actions → src/actions}/api/post-progression.js +0 -0
  198. /package/lib/{actions → src/actions}/data/token.d.ts +0 -0
  199. /package/lib/{actions → src/actions}/data/token.js +0 -0
  200. /package/lib/{actions → src/actions}/ui/answers.d.ts +0 -0
  201. /package/lib/{actions → src/actions}/ui/answers.js +0 -0
  202. /package/lib/{actions → src/actions}/ui/next-slide.d.ts +0 -0
  203. /package/lib/{actions → src/actions}/ui/next-slide.js +0 -0
  204. /package/lib/{actions → src/actions}/ui/quit-popin.d.ts +0 -0
  205. /package/lib/{actions → src/actions}/ui/quit-popin.js +0 -0
  206. /package/lib/{actions → src/actions}/ui/slides.d.ts +0 -0
  207. /package/lib/{actions → src/actions}/ui/slides.js +0 -0
  208. /package/lib/{configure-store.d.ts → src/configure-store.d.ts} +0 -0
  209. /package/lib/{helpers → src/helpers}/css-register.d.ts +0 -0
  210. /package/lib/{helpers → src/helpers}/css-register.js +0 -0
  211. /package/lib/{index.d.ts → src/index.d.ts} +0 -0
  212. /package/lib/{reducers → src/reducers}/data/corrections.d.ts +0 -0
  213. /package/lib/{reducers → src/reducers}/data/corrections.js +0 -0
  214. /package/lib/{reducers → src/reducers}/data/index.d.ts +0 -0
  215. /package/lib/{reducers → src/reducers}/data/index.js +0 -0
  216. /package/lib/{reducers → src/reducers}/data/progression.d.ts +0 -0
  217. /package/lib/{reducers → src/reducers}/data/progression.js +0 -0
  218. /package/lib/{reducers → src/reducers}/data/rank.d.ts +0 -0
  219. /package/lib/{reducers → src/reducers}/data/rank.js +0 -0
  220. /package/lib/{reducers → src/reducers}/data/skills.d.ts +0 -0
  221. /package/lib/{reducers → src/reducers}/data/skills.js +0 -0
  222. /package/lib/{reducers → src/reducers}/data/slides.d.ts +0 -0
  223. /package/lib/{reducers → src/reducers}/data/slides.js +0 -0
  224. /package/lib/{reducers → src/reducers}/data/token.d.ts +0 -0
  225. /package/lib/{reducers → src/reducers}/data/token.js +0 -0
  226. /package/lib/{reducers → src/reducers}/index.js +0 -0
  227. /package/lib/{reducers → src/reducers}/ui/answers.d.ts +0 -0
  228. /package/lib/{reducers → src/reducers}/ui/answers.js +0 -0
  229. /package/lib/{reducers → src/reducers}/ui/current-slide-ref.d.ts +0 -0
  230. /package/lib/{reducers → src/reducers}/ui/current-slide-ref.js +0 -0
  231. /package/lib/{reducers → src/reducers}/ui/index.js +0 -0
  232. /package/lib/{reducers → src/reducers}/ui/positions.d.ts +0 -0
  233. /package/lib/{reducers → src/reducers}/ui/positions.js +0 -0
  234. /package/lib/{reducers → src/reducers}/ui/quit-popin.d.ts +0 -0
  235. /package/lib/{reducers → src/reducers}/ui/quit-popin.js +0 -0
  236. /package/lib/{reducers → src/reducers}/ui/show-congrats.d.ts +0 -0
  237. /package/lib/{reducers → src/reducers}/ui/show-congrats.js +0 -0
  238. /package/lib/{reducers → src/reducers}/ui/slide.d.ts +0 -0
  239. /package/lib/{reducers → src/reducers}/ui/slide.js +0 -0
  240. /package/lib/{services → src/services}/fetch-correction.d.ts +0 -0
  241. /package/lib/{services → src/services}/fetch-correction.js +0 -0
  242. /package/lib/{services → src/services}/fetch-rank.d.ts +0 -0
  243. /package/lib/{services → src/services}/fetch-rank.js +0 -0
  244. /package/lib/{services → src/services}/fetch-skills.d.ts +0 -0
  245. /package/lib/{services → src/services}/fetch-skills.js +0 -0
  246. /package/lib/{services → src/services}/fetch-slide.d.ts +0 -0
  247. /package/lib/{services → src/services}/fetch-slide.js +0 -0
  248. /package/lib/{services → src/services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
  249. /package/lib/{services → src/services}/fetch-slides-to-review-by-skill-ref.js +0 -0
  250. /package/lib/{services → src/services}/index.d.ts +0 -0
  251. /package/lib/{services → src/services}/index.js +0 -0
  252. /package/lib/{services → src/services}/post-answer.d.ts +0 -0
  253. /package/lib/{services → src/services}/post-answer.js +0 -0
  254. /package/lib/{services → src/services}/post-progression.d.ts +0 -0
  255. /package/lib/{services → src/services}/post-progression.js +0 -0
  256. /package/lib/{services → src/services}/tools/fetch-responses.d.ts +0 -0
  257. /package/lib/{services → src/services}/tools/fetch-responses.js +0 -0
  258. /package/lib/{services → src/services}/tools/sleep.d.ts +0 -0
  259. /package/lib/{services → src/services}/tools/sleep.js +0 -0
  260. /package/lib/{test → src/test}/index.test.d.ts +0 -0
  261. /package/lib/{test → src/test}/index.test.js +0 -0
  262. /package/lib/{test → src/test}/util/services.mock.d.ts +0 -0
  263. /package/lib/{test → src/test}/util/services.mock.js +0 -0
  264. /package/lib/{types → src/types}/common.js +0 -0
  265. /package/lib/{types → src/types}/slides.d.ts +0 -0
  266. /package/lib/{types → src/types}/slides.js +0 -0
  267. /package/lib/{views → src/views}/slides/map-api-slide-to-ui.d.ts +0 -0
  268. /package/lib/{views → src/views}/slides/map-api-slide-to-ui.js +0 -0
  269. /package/lib/{views → src/views}/slides/test/fixtures/free-text.d.ts +0 -0
  270. /package/lib/{views → src/views}/slides/test/fixtures/free-text.js +0 -0
  271. /package/lib/{views → src/views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
  272. /package/lib/{views → src/views}/slides/test/fixtures/qcm-drag.js +0 -0
  273. /package/lib/{views → src/views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
  274. /package/lib/{views → src/views}/slides/test/fixtures/qcm-graphic.js +0 -0
  275. /package/lib/{views → src/views}/slides/test/fixtures/qcm.d.ts +0 -0
  276. /package/lib/{views → src/views}/slides/test/fixtures/qcm.js +0 -0
  277. /package/lib/{views → src/views}/slides/test/fixtures/slider.d.ts +0 -0
  278. /package/lib/{views → src/views}/slides/test/fixtures/slider.js +0 -0
  279. /package/lib/{views → src/views}/slides/test/fixtures/template.d.ts +0 -0
  280. /package/lib/{views → src/views}/slides/test/fixtures/template.js +0 -0
@@ -0,0 +1,9 @@
1
+ declare type SandboxOptions = {
2
+ container: string;
3
+ };
4
+ declare global {
5
+ interface Window {
6
+ createSandbox?: (sandboxOptions: SandboxOptions) => void;
7
+ }
8
+ }
9
+ export {};
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { render } from 'react-dom';
3
+ import isNil from 'lodash/fp/isNil';
4
+ import get from 'lodash/fp/get';
5
+ import pipe from 'lodash/fp/pipe';
6
+ import { WebContext } from '@coorpacademy/components/es/atom/provider';
7
+ import { identity } from 'lodash/fp';
8
+ import AppReview from '../src';
9
+ import { services } from '../src/test/util/services.mock';
10
+ const isContainerAvailable = (options) => !pipe(get('container'), isNil)(options);
11
+ const createSandbox = (options) => {
12
+ if (!isContainerAvailable(options)) {
13
+ // eslint-disable-next-line no-console
14
+ console.error('[AppReview sandbox] Requires a container.');
15
+ }
16
+ else {
17
+ const container = document.getElementById(options.container);
18
+ // mode mobile/web
19
+ const appOptions = {
20
+ token: process.env.API_TEST_TOKEN || '',
21
+ skillRef: '123',
22
+ services,
23
+ onQuitClick: () => {
24
+ location.reload();
25
+ },
26
+ url: process.env.LAMBDA_API_REVIEW_GET_SLIDES_URL || 'http://localhost:7006'
27
+ };
28
+ const skin = {
29
+ common: {
30
+ primary: '#248e59'
31
+ }
32
+ };
33
+ render(React.createElement(WebContext, { skin: skin, translate: identity },
34
+ React.createElement(AppReview, { options: appOptions })), container);
35
+ }
36
+ };
37
+ // -----------------------------------------------------------------------------
38
+ if (window && !window.createSandbox) {
39
+ window.createSandbox = createSandbox;
40
+ }
41
+ createSandbox({ container: 'root' });
@@ -1,6 +1,6 @@
1
1
  import type { Dispatch } from 'redux';
2
2
  import type { StoreState } from '../../reducers';
3
- import type { CorrectionFromAPI, Options } from '../../types/common';
3
+ import type { CorrectionFromAPI, ThunkOptions } from '../../types/common';
4
4
  export declare const CORRECTION_FETCH_REQUEST: "@@correction/FETCH_REQUEST";
5
5
  export declare const CORRECTION_FETCH_SUCCESS: "@@correction/FETCH_SUCCESS";
6
6
  export declare const CORRECTION_FETCH_FAILURE: "@@correction/FETCH_FAILURE";
@@ -17,4 +17,4 @@ export declare type ReceivedCorrection = {
17
17
  slideRef: string;
18
18
  };
19
19
  };
20
- export declare const fetchCorrection: (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => ReceivedCorrection;
20
+ export declare const fetchCorrection: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => ReceivedCorrection;
@@ -1,6 +1,6 @@
1
1
  import type { Dispatch } from 'redux';
2
2
  import type { StoreState } from '../../reducers';
3
- import type { Rank, Services, Options } from '../../types/common';
3
+ import type { Rank, Services, ThunkOptions } from '../../types/common';
4
4
  export declare const RANK_FETCH_START_REQUEST: "@@rank/FETCH_START_REQUEST";
5
5
  export declare const RANK_FETCH_START_SUCCESS: "@@rank/FETCH_START_SUCCESS";
6
6
  export declare const RANK_FETCH_START_FAILURE: "@@rank/FETCH_START_FAILURE";
@@ -27,6 +27,6 @@ export declare type RankAction = RankRequestAction | RankSuccessAction | RankFai
27
27
  declare type RankStart = [RankFetchStartRequestType, RankFetchStartSuccessType, RankFetchStartFailureType];
28
28
  declare type RankEnd = [RankFetchEndRequestType, RankFetchEndSuccessType, RankFetchEndFailureType];
29
29
  export declare const fetchRank: (dispatch: Dispatch, getState: () => StoreState, services: Services, types: RankStart | RankEnd, path?: string) => RankAction;
30
- export declare const fetchStartRank: (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => RankAction;
31
- export declare const fetchEndRank: (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => RankAction;
30
+ export declare const fetchStartRank: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => RankAction;
31
+ export declare const fetchEndRank: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => RankAction;
32
32
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { Dispatch } from 'redux';
2
2
  import type { StoreState } from '../../reducers';
3
- import type { Options, Skill } from '../../types/common';
3
+ import type { ThunkOptions, Skill } from '../../types/common';
4
4
  export declare const SKILLS_FETCH_REQUEST: "@@skills/FETCH_REQUEST";
5
5
  export declare const SKILLS_FETCH_SUCCESS: "@@skills/FETCH_SUCCESS";
6
6
  export declare const SKILLS_FETCH_FAILURE: "@@skills/FETCH_FAILURE";
@@ -8,4 +8,4 @@ export declare type ReceivedSkills = {
8
8
  type: typeof SKILLS_FETCH_SUCCESS;
9
9
  payload: Skill[];
10
10
  };
11
- export declare const fetchSkills: (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => ReceivedSkills;
11
+ export declare const fetchSkills: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => ReceivedSkills;
@@ -1,6 +1,6 @@
1
1
  import type { Dispatch } from 'redux';
2
2
  import type { StoreState } from '../../reducers';
3
- import type { Options, SlideFromAPI } from '../../types/common';
3
+ import type { ThunkOptions, SlideFromAPI } from '../../types/common';
4
4
  export declare const SLIDE_FETCH_REQUEST: "@@slides/FETCH_REQUEST";
5
5
  export declare const SLIDE_FETCH_SUCCESS: "@@slides/FETCH_SUCCESS";
6
6
  export declare const SLIDE_FETCH_FAILURE: "@@slides/FETCH_FAILURE";
@@ -17,4 +17,4 @@ export declare type ReceivedSlide = {
17
17
  slideRef: string;
18
18
  };
19
19
  };
20
- export declare const fetchSlide: (slideRef: string) => (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => Promise<void>;
20
+ export declare const fetchSlide: (slideRef: string) => (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { Dispatch } from 'redux';
2
- import type { Options, ProgressionFromAPI } from '../../types/common';
2
+ import type { ThunkOptions, ProgressionFromAPI } from '../../types/common';
3
3
  import type { StoreState } from '../../reducers';
4
4
  export declare const POST_ANSWER_REQUEST: "@@answer/POST_REQUEST";
5
5
  export declare const POST_ANSWER_SUCCESS: "@@answer/POST_SUCCESS";
@@ -17,4 +17,4 @@ export declare type PostAnswerSuccessAction = {
17
17
  };
18
18
  payload: ProgressionFromAPI;
19
19
  };
20
- export declare const postAnswer: (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => Promise<void>;
20
+ export declare const postAnswer: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { Dispatch } from 'redux';
2
- import type { Options, ProgressionFromAPI } from '../../types/common';
2
+ import type { ThunkOptions, ProgressionFromAPI } from '../../types/common';
3
3
  import type { StoreState } from '../../reducers';
4
4
  export declare const POST_PROGRESSION_REQUEST: "@@progression/POST_REQUEST";
5
5
  export declare const POST_PROGRESSION_SUCCESS: "@@progression/POST_SUCCESS";
@@ -8,4 +8,4 @@ export declare type ReceivedProgression = {
8
8
  type: typeof POST_PROGRESSION_SUCCESS;
9
9
  payload: ProgressionFromAPI;
10
10
  };
11
- export declare const postProgression: (skillRef: string) => (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => Promise<void>;
11
+ export declare const postProgression: (skillRef: string) => (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { ExecutionContext } from 'ava';
2
2
  import { AnyAction, Store } from 'redux';
3
+ import { ThunkOptions } from '../../types/common';
3
4
  import { StoreState } from '../../reducers';
4
- import { Services } from '../../types/common';
5
- export declare const createTestStore: (t: ExecutionContext, initialState: StoreState, services: Services, actions: AnyAction[]) => Store<StoreState, AnyAction>;
5
+ export declare const createTestStore: (t: ExecutionContext, initialState: StoreState, thunkOptions: ThunkOptions, actions: AnyAction[]) => Store<StoreState, AnyAction>;
@@ -9,8 +9,8 @@ const assertActionsMiddleware = (t, ACTIONS) => constant((next) => (action) => {
9
9
  t.deepEqual(action, expectedAction);
10
10
  return next(action);
11
11
  });
12
- export const createTestStore = (t, initialState, services, actions) => {
13
- const thunkMiddleware = thunk.withExtraArgument({ services });
12
+ export const createTestStore = (t, initialState, thunkOptions, actions) => {
13
+ const thunkMiddleware = thunk.withExtraArgument(thunkOptions);
14
14
  const enhancer = compose(applyMiddleware(thunkMiddleware, assertActionsMiddleware(t, actions)));
15
15
  return createStore(rootReducer, initialState, enhancer);
16
16
  };
@@ -0,0 +1,19 @@
1
+ import { Dispatch } from 'redux';
2
+ import type { StoreState } from '../../reducers';
3
+ import { ThunkOptions, AppOptions, ViewName } from '../../types/common';
4
+ export declare type NavigateToAction = {
5
+ type: '@@navigation/NAVIGATE_TO';
6
+ payload: ViewName;
7
+ };
8
+ export declare type NavigateBackAction = {
9
+ type: '@@navigation/NAVIGATE_BACK';
10
+ };
11
+ export declare type StartApp = {
12
+ type: '@@navigation/START_APP';
13
+ payload: AppOptions;
14
+ };
15
+ export declare const NAVIGATE_TO = "@@navigation/NAVIGATE_TO";
16
+ export declare const NAVIGATE_BACK = "@@navigation/NAVIGATE_BACK";
17
+ export declare const START_APP = "@@navigation/START_APP";
18
+ export declare const navigateTo: (newViewName: ViewName) => (dispatch: Dispatch, getState: () => StoreState, { callbackOnViewChanged }: ThunkOptions) => Promise<NavigateToAction>;
19
+ export declare const navigateBack: (dispatch: Dispatch, getState: () => StoreState, { callbackOnViewChanged }: ThunkOptions) => Promise<NavigateBackAction>;
@@ -0,0 +1,26 @@
1
+ export const NAVIGATE_TO = '@@navigation/NAVIGATE_TO';
2
+ export const NAVIGATE_BACK = '@@navigation/NAVIGATE_BACK';
3
+ export const START_APP = '@@navigation/START_APP';
4
+ export const navigateTo = (newViewName) => async (dispatch, getState, { callbackOnViewChanged }) => {
5
+ const action = {
6
+ type: NAVIGATE_TO,
7
+ payload: newViewName
8
+ };
9
+ const res = await dispatch(action);
10
+ if (callbackOnViewChanged) {
11
+ callbackOnViewChanged(newViewName);
12
+ }
13
+ return res;
14
+ };
15
+ export const navigateBack = async (dispatch, getState, { callbackOnViewChanged }) => {
16
+ const action = {
17
+ type: NAVIGATE_BACK
18
+ };
19
+ const res = await dispatch(action);
20
+ if (callbackOnViewChanged) {
21
+ const storeState = getState();
22
+ const viewName = storeState.ui.navigation[storeState.ui.navigation.length - 1];
23
+ callbackOnViewChanged(viewName);
24
+ }
25
+ return res;
26
+ };
@@ -1,9 +1,4 @@
1
1
  import type { ProgressionFromAPI } from '../types/common';
2
- export declare const VIEWS: {
3
- readonly skills: 'skills';
4
- readonly onboarding: 'onboarding';
5
- readonly slides: 'slides';
6
- };
7
2
  export declare const slideIndexes: readonly ["0", "1", "2", "3", "4"];
8
3
  export declare type SlideIndexes = typeof slideIndexes[number];
9
4
  export declare const getProgressionSlidesRefs: (progression: ProgressionFromAPI) => string[];
@@ -1,10 +1,5 @@
1
1
  import concat from 'lodash/fp/concat';
2
2
  import slice from 'lodash/fp/slice';
3
- export const VIEWS = {
4
- skills: 'skills',
5
- onboarding: 'onboarding',
6
- slides: 'slides'
7
- };
8
3
  export const slideIndexes = ['0', '1', '2', '3', '4'];
9
4
  export const getProgressionSlidesRefs = (progression) => {
10
5
  if (progression.state.step.current <= 5) {
@@ -10,7 +10,11 @@ export default function configureStore(options) {
10
10
  traceLimit: 25
11
11
  })
12
12
  : compose;
13
- const thunkMiddleware = thunk.withExtraArgument({ services: options.services || getServices() });
13
+ const thunkOptions = {
14
+ services: options.services || getServices(),
15
+ callbackOnViewChanged: options.callbackOnViewChanged
16
+ };
17
+ const thunkMiddleware = thunk.withExtraArgument(thunkOptions);
14
18
  const enhancer = _compose(applyMiddleware(thunkMiddleware));
15
19
  const store = createStore(rootReducer, undefined, enhancer);
16
20
  return store;
@@ -4,16 +4,16 @@ import AppReviewTemplate from '@coorpacademy/components/es/template/app-review';
4
4
  import isEmpty from 'lodash/fp/isEmpty';
5
5
  import get from 'lodash/fp/get';
6
6
  import configureStore from './configure-store';
7
- import { navigateTo } from './actions/ui/navigation';
7
+ import { navigateBack, navigateTo } from './actions/ui/navigation';
8
8
  import { storeToken } from './actions/data/token';
9
9
  import { fetchSkills } from './actions/api/fetch-skills';
10
10
  import { postProgression } from './actions/api/post-progression';
11
- import { VIEWS } from './common';
12
11
  import { mapStateToSlidesProps } from './views/slides';
13
12
  import { mapStateToSkillsProps } from './views/skills';
14
13
  const ConnectedApp = ({ onQuitClick }) => {
15
14
  const dispatch = useDispatch();
16
15
  const props = {
16
+ navigateBack: () => dispatch(navigateBack),
17
17
  viewName: useSelector((state) => state.ui.navigation[state.ui.navigation.length - 1]),
18
18
  slides: useSelector((state) => mapStateToSlidesProps(state, dispatch, onQuitClick)),
19
19
  skills: useSelector((state) => mapStateToSkillsProps(state)),
@@ -62,7 +62,7 @@ const AppReview = ({ options }) => {
62
62
  store.dispatch(navigateTo('loader')); // use loader while posting progression
63
63
  return;
64
64
  }
65
- const initialView = skillRef ? VIEWS.slides : VIEWS.skills;
65
+ const initialView = skillRef ? 'slides' : 'skills';
66
66
  store.dispatch(navigateTo(initialView));
67
67
  }, [isProgressionCreated, options, store]);
68
68
  if (!store)
@@ -22,7 +22,7 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
22
22
  showQuitPopin: boolean;
23
23
  showCongrats: boolean;
24
24
  }>;
25
- }>, import("./data/corrections").CorrectionsAction | import("../actions/ui/slides").SetCurrentSlideAction | import("../actions/api/fetch-rank").RankAction | import("../actions/api/post-answer").PostAnswerRequestAction | import("../actions/api/post-answer").PostAnswerSuccessAction | import("../actions/api/post-progression").ReceivedProgression | import("../actions/api/fetch-skills").ReceivedSkills | import("./data/slides").SlidesAction | import("../actions/data/token").StoreToken | import("../actions/ui/next-slide").NextSlideAction | import("../actions/ui/navigation").NavigateTo | import("../actions/ui/navigation").NavigateBack | import("../actions/ui/answers").EditAnswerAction | {
25
+ }>, import("./data/corrections").CorrectionsAction | import("../actions/ui/slides").SetCurrentSlideAction | import("../actions/api/fetch-rank").RankAction | import("../actions/api/post-answer").PostAnswerRequestAction | import("../actions/api/post-answer").PostAnswerSuccessAction | import("../actions/api/post-progression").ReceivedProgression | import("../actions/api/fetch-skills").ReceivedSkills | import("./data/slides").SlidesAction | import("../actions/data/token").StoreToken | import("../actions/ui/next-slide").NextSlideAction | import("../actions/ui/navigation").NavigateToAction | import("../actions/ui/navigation").NavigateBackAction | import("../actions/ui/answers").EditAnswerAction | {
26
26
  type: "@@ui/OPEN_POPIN";
27
27
  } | {
28
28
  type: "@@ui/CLOSE_POPIN";
@@ -22,7 +22,7 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
22
22
  positions: UIPositionState;
23
23
  showQuitPopin: boolean;
24
24
  showCongrats: boolean;
25
- }>, import("../../actions/api/fetch-correction").ReceivedCorrection | import("../../actions/ui/slides").SetCurrentSlideAction | import("../../actions/api/fetch-slide").FetchSlide | import("../../actions/api/post-answer").PostAnswerRequestAction | import("../../actions/api/post-progression").ReceivedProgression | import("../../actions/ui/next-slide").NextSlideAction | import("../../actions/ui/navigation").NavigateTo | import("../../actions/ui/navigation").NavigateBack | import("../../actions/ui/answers").EditAnswerAction | {
25
+ }>, import("../../actions/api/fetch-correction").ReceivedCorrection | import("../../actions/ui/slides").SetCurrentSlideAction | import("../../actions/api/fetch-slide").FetchSlide | import("../../actions/api/post-answer").PostAnswerRequestAction | import("../../actions/api/post-progression").ReceivedProgression | import("../../actions/ui/next-slide").NextSlideAction | import("../../actions/ui/navigation").NavigateToAction | import("../../actions/ui/navigation").NavigateBackAction | import("../../actions/ui/answers").EditAnswerAction | {
26
26
  type: "@@ui/OPEN_POPIN";
27
27
  } | {
28
28
  type: "@@ui/CLOSE_POPIN";
@@ -1,4 +1,4 @@
1
- import { type NavigateTo, type NavigateBack } from '../../actions/ui/navigation';
1
+ import { NavigateToAction, NavigateBackAction } from '../../actions/ui/navigation';
2
2
  export declare type NavigationState = Array<'skills' | 'onboarding' | 'slides' | 'loader'>;
3
- declare const reducer: (state: NavigationState | undefined, action: NavigateTo | NavigateBack) => NavigationState;
3
+ declare const reducer: (state: NavigationState | undefined, action: NavigateToAction | NavigateBackAction) => NavigationState;
4
4
  export default reducer;
@@ -1,4 +1,4 @@
1
- import { NAVIGATE_BACK, NAVIGATE_TO } from '../../actions/ui/navigation';
1
+ import { NAVIGATE_TO, NAVIGATE_BACK } from '../../actions/ui/navigation';
2
2
  const reducer = (
3
3
  // eslint-disable-next-line default-param-last
4
4
  state = [], action) => {
@@ -1,3 +1,4 @@
1
+ export declare type ViewName = 'skills' | 'onboarding' | 'slides' | 'loader';
1
2
  export declare type ChoiceFromAPI = {
2
3
  _id: string;
3
4
  id?: string;
@@ -136,15 +137,17 @@ export declare type Services = {
136
137
  fetchRank(token: string): Promise<Rank>;
137
138
  fetchSlidesToReviewBySkillRef(url: string, token: string, skillRef: string): Promise<SlideIdFromAPI[]>;
138
139
  };
139
- export declare type Options = {
140
- services: Services;
141
- };
142
140
  export declare type AppOptions = {
143
141
  token: string;
144
142
  skillRef?: string;
145
143
  services: Services;
146
- onQuitClick: Function;
144
+ onQuitClick: () => void;
147
145
  url: string;
146
+ callbackOnViewChanged?: (viewName: ViewName) => void;
147
+ };
148
+ export declare type ThunkOptions = {
149
+ callbackOnViewChanged?: AppOptions['callbackOnViewChanged'];
150
+ services: Services;
148
151
  };
149
152
  export declare type JWT = {
150
153
  exp: number;
@@ -8,11 +8,9 @@ declare type SkillCard = {
8
8
  reviseLabel: string;
9
9
  reviseAriaLabel: string;
10
10
  isCustom: boolean;
11
- onClick: Function;
11
+ onClick: () => void;
12
12
  };
13
13
  declare type NoSkillsProps = {
14
- titleNoSkills: string;
15
- textNoSkills: string;
16
14
  iconSkillAriaLabel: string;
17
15
  };
18
16
  declare type SkillsProps = NoSkillsProps & {
@@ -1,8 +1,6 @@
1
1
  export const mapStateToSkillsProps = (state) => {
2
2
  return {
3
3
  title: '@todo title',
4
- titleNoSkills: '@todo titleNoSkills',
5
- textNoSkills: '@todo textNoSkills',
6
4
  iconSkillAriaLabel: '@todo iconSkillAriaLabel',
7
5
  isLoading: false,
8
6
  isLoadingAriaLabel: '@todo loading',
@@ -0,0 +1,34 @@
1
+ import type { Dispatch } from 'redux';
2
+ import { ReviewPlayerProps } from '@coorpacademy/components/es/template/app-review/player/prop-types';
3
+ import { SlideProps } from '@coorpacademy/components/es/organism/review-slide/prop-types';
4
+ import type { StoreState } from '../../reducers';
5
+ import type { AnswerUI } from '../../types/slides';
6
+ declare const ICON_VALUES: {
7
+ readonly right: "right";
8
+ readonly wrong: "wrong";
9
+ readonly 'no-answer': "no-answer";
10
+ };
11
+ declare type IconValue = keyof typeof ICON_VALUES;
12
+ declare type StepItem = {
13
+ current: boolean;
14
+ icon: IconValue;
15
+ value: string;
16
+ };
17
+ declare type SlideUIAnimations = 'unstack' | 'restack';
18
+ export declare type ReviewSlide = {
19
+ position: number;
20
+ loading: boolean;
21
+ showCorrectionPopin?: boolean;
22
+ animateCorrectionPopin?: boolean;
23
+ parentContentTitle?: string;
24
+ questionText?: string;
25
+ answerUI?: AnswerUI;
26
+ animationType?: SlideUIAnimations;
27
+ };
28
+ declare type SlidesStack = {
29
+ [key: string]: SlideProps;
30
+ };
31
+ export declare const initialState: SlidesStack;
32
+ export declare const buildStepItems: (state: StoreState) => StepItem[];
33
+ export declare const mapStateToSlidesProps: (state: StoreState, dispatch: Dispatch, onQuitClick: () => void) => ReviewPlayerProps;
34
+ export {};
@@ -180,7 +180,7 @@ const getCorrectionPopinProps = (dispatch) => (isCorrect, correctAnswer, klf) =>
180
180
  message: isCorrect ? klf : join(',', correctAnswer)
181
181
  },
182
182
  next: {
183
- ariaLabel: '_correctionNextAriaLabel',
183
+ 'aria-label': '_correctionNextAriaLabel',
184
184
  label: '_correctionNextLabel',
185
185
  onClick: () => {
186
186
  dispatch(nextSlide);
@@ -202,7 +202,7 @@ const buildQuitPopinProps = (dispatch) => (onQuitClick) => {
202
202
  color: '#ED3436'
203
203
  },
204
204
  handleOnclick: onQuitClick,
205
- ariaLabel: 'Stop session'
205
+ 'aria-label': 'Stop session'
206
206
  },
207
207
  secondButton: {
208
208
  label: `Continuer d'apprendre`,
@@ -210,7 +210,7 @@ const buildQuitPopinProps = (dispatch) => (onQuitClick) => {
210
210
  handleOnclick: () => {
211
211
  dispatch(closeQuitPopin);
212
212
  },
213
- ariaLabel: 'Continue review'
213
+ 'aria-label': 'Continue review'
214
214
  }
215
215
  };
216
216
  };
@@ -288,6 +288,7 @@ export const mapStateToSlidesProps = (state, dispatch, onQuitClick) => {
288
288
  const isCorrect = get(['data', 'progression', 'state', 'isCorrect'], state);
289
289
  const klf = getOr('', ['data', 'slides', currentSlideRef, 'klf'], state);
290
290
  const showQuitPopin = get(['ui', 'showQuitPopin'], state);
291
+ const showCongrats = get(['ui', 'showCongrats'], state);
291
292
  return {
292
293
  header: {
293
294
  mode: '__revision_mode',
@@ -295,7 +296,8 @@ export const mapStateToSlidesProps = (state, dispatch, onQuitClick) => {
295
296
  onQuitClick: () => dispatch(openQuitPopin),
296
297
  'aria-label': 'aria-header-wrapper',
297
298
  closeButtonAriaLabel: 'aria-close-button',
298
- steps: buildStepItems(state)
299
+ steps: buildStepItems(state),
300
+ hiddenSteps: showCongrats
299
301
  },
300
302
  stack: {
301
303
  slides: buildStackSlides(state, dispatch),
@@ -0,0 +1,9 @@
1
+ declare type SandboxOptions = {
2
+ container: string;
3
+ };
4
+ declare global {
5
+ interface Window {
6
+ createSandbox?: (sandboxOptions: SandboxOptions) => void;
7
+ }
8
+ }
9
+ export {};
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { render } from 'react-dom';
3
+ import isNil from 'lodash/fp/isNil';
4
+ import get from 'lodash/fp/get';
5
+ import pipe from 'lodash/fp/pipe';
6
+ import { WebContext } from '@coorpacademy/components/es/atom/provider';
7
+ import { identity } from 'lodash/fp';
8
+ import AppReview from '../src';
9
+ import { services } from '../src/test/util/services.mock';
10
+ var isContainerAvailable = function (options) {
11
+ return !pipe(get('container'), isNil)(options);
12
+ };
13
+ var createSandbox = function (options) {
14
+ if (!isContainerAvailable(options)) {
15
+ // eslint-disable-next-line no-console
16
+ console.error('[AppReview sandbox] Requires a container.');
17
+ }
18
+ else {
19
+ var container = document.getElementById(options.container);
20
+ // mode mobile/web
21
+ var appOptions = {
22
+ token: process.env.API_TEST_TOKEN || '',
23
+ skillRef: '123',
24
+ services: services,
25
+ onQuitClick: function () {
26
+ location.reload();
27
+ },
28
+ url: process.env.LAMBDA_API_REVIEW_GET_SLIDES_URL || 'http://localhost:7006'
29
+ };
30
+ var skin = {
31
+ common: {
32
+ primary: '#248e59'
33
+ }
34
+ };
35
+ render(React.createElement(WebContext, { skin: skin, translate: identity },
36
+ React.createElement(AppReview, { options: appOptions })), container);
37
+ }
38
+ };
39
+ // -----------------------------------------------------------------------------
40
+ if (window && !window.createSandbox) {
41
+ window.createSandbox = createSandbox;
42
+ }
43
+ createSandbox({ container: 'root' });
@@ -1,6 +1,6 @@
1
1
  import type { Dispatch } from 'redux';
2
2
  import type { StoreState } from '../../reducers';
3
- import type { CorrectionFromAPI, Options } from '../../types/common';
3
+ import type { CorrectionFromAPI, ThunkOptions } from '../../types/common';
4
4
  export declare const CORRECTION_FETCH_REQUEST: "@@correction/FETCH_REQUEST";
5
5
  export declare const CORRECTION_FETCH_SUCCESS: "@@correction/FETCH_SUCCESS";
6
6
  export declare const CORRECTION_FETCH_FAILURE: "@@correction/FETCH_FAILURE";
@@ -17,4 +17,4 @@ export declare type ReceivedCorrection = {
17
17
  slideRef: string;
18
18
  };
19
19
  };
20
- export declare const fetchCorrection: (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => ReceivedCorrection;
20
+ export declare const fetchCorrection: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => ReceivedCorrection;
@@ -1,6 +1,6 @@
1
1
  import type { Dispatch } from 'redux';
2
2
  import type { StoreState } from '../../reducers';
3
- import type { Rank, Services, Options } from '../../types/common';
3
+ import type { Rank, Services, ThunkOptions } from '../../types/common';
4
4
  export declare const RANK_FETCH_START_REQUEST: "@@rank/FETCH_START_REQUEST";
5
5
  export declare const RANK_FETCH_START_SUCCESS: "@@rank/FETCH_START_SUCCESS";
6
6
  export declare const RANK_FETCH_START_FAILURE: "@@rank/FETCH_START_FAILURE";
@@ -27,6 +27,6 @@ export declare type RankAction = RankRequestAction | RankSuccessAction | RankFai
27
27
  declare type RankStart = [RankFetchStartRequestType, RankFetchStartSuccessType, RankFetchStartFailureType];
28
28
  declare type RankEnd = [RankFetchEndRequestType, RankFetchEndSuccessType, RankFetchEndFailureType];
29
29
  export declare const fetchRank: (dispatch: Dispatch, getState: () => StoreState, services: Services, types: RankStart | RankEnd, path?: string) => RankAction;
30
- export declare const fetchStartRank: (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => RankAction;
31
- export declare const fetchEndRank: (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => RankAction;
30
+ export declare const fetchStartRank: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => RankAction;
31
+ export declare const fetchEndRank: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => RankAction;
32
32
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { Dispatch } from 'redux';
2
2
  import type { StoreState } from '../../reducers';
3
- import type { Options, Skill } from '../../types/common';
3
+ import type { ThunkOptions, Skill } from '../../types/common';
4
4
  export declare const SKILLS_FETCH_REQUEST: "@@skills/FETCH_REQUEST";
5
5
  export declare const SKILLS_FETCH_SUCCESS: "@@skills/FETCH_SUCCESS";
6
6
  export declare const SKILLS_FETCH_FAILURE: "@@skills/FETCH_FAILURE";
@@ -8,4 +8,4 @@ export declare type ReceivedSkills = {
8
8
  type: typeof SKILLS_FETCH_SUCCESS;
9
9
  payload: Skill[];
10
10
  };
11
- export declare const fetchSkills: (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => ReceivedSkills;
11
+ export declare const fetchSkills: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => ReceivedSkills;
@@ -1,6 +1,6 @@
1
1
  import type { Dispatch } from 'redux';
2
2
  import type { StoreState } from '../../reducers';
3
- import type { Options, SlideFromAPI } from '../../types/common';
3
+ import type { ThunkOptions, SlideFromAPI } from '../../types/common';
4
4
  export declare const SLIDE_FETCH_REQUEST: "@@slides/FETCH_REQUEST";
5
5
  export declare const SLIDE_FETCH_SUCCESS: "@@slides/FETCH_SUCCESS";
6
6
  export declare const SLIDE_FETCH_FAILURE: "@@slides/FETCH_FAILURE";
@@ -17,4 +17,4 @@ export declare type ReceivedSlide = {
17
17
  slideRef: string;
18
18
  };
19
19
  };
20
- export declare const fetchSlide: (slideRef: string) => (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => Promise<void>;
20
+ export declare const fetchSlide: (slideRef: string) => (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { Dispatch } from 'redux';
2
- import type { Options, ProgressionFromAPI } from '../../types/common';
2
+ import type { ThunkOptions, ProgressionFromAPI } from '../../types/common';
3
3
  import type { StoreState } from '../../reducers';
4
4
  export declare const POST_ANSWER_REQUEST: "@@answer/POST_REQUEST";
5
5
  export declare const POST_ANSWER_SUCCESS: "@@answer/POST_SUCCESS";
@@ -17,4 +17,4 @@ export declare type PostAnswerSuccessAction = {
17
17
  };
18
18
  payload: ProgressionFromAPI;
19
19
  };
20
- export declare const postAnswer: (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => Promise<void>;
20
+ export declare const postAnswer: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { Dispatch } from 'redux';
2
- import type { Options, ProgressionFromAPI } from '../../types/common';
2
+ import type { ThunkOptions, ProgressionFromAPI } from '../../types/common';
3
3
  import type { StoreState } from '../../reducers';
4
4
  export declare const POST_PROGRESSION_REQUEST: "@@progression/POST_REQUEST";
5
5
  export declare const POST_PROGRESSION_SUCCESS: "@@progression/POST_SUCCESS";
@@ -8,4 +8,4 @@ export declare type ReceivedProgression = {
8
8
  type: typeof POST_PROGRESSION_SUCCESS;
9
9
  payload: ProgressionFromAPI;
10
10
  };
11
- export declare const postProgression: (skillRef: string) => (dispatch: Dispatch, getState: () => StoreState, { services }: Options) => Promise<void>;
11
+ export declare const postProgression: (skillRef: string) => (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { ExecutionContext } from 'ava';
2
2
  import { AnyAction, Store } from 'redux';
3
+ import { ThunkOptions } from '../../types/common';
3
4
  import { StoreState } from '../../reducers';
4
- import { Services } from '../../types/common';
5
- export declare const createTestStore: (t: ExecutionContext, initialState: StoreState, services: Services, actions: AnyAction[]) => Store<StoreState, AnyAction>;
5
+ export declare const createTestStore: (t: ExecutionContext, initialState: StoreState, thunkOptions: ThunkOptions, actions: AnyAction[]) => Store<StoreState, AnyAction>;
@@ -11,8 +11,8 @@ var assertActionsMiddleware = function (t, ACTIONS) {
11
11
  return next(action);
12
12
  }; });
13
13
  };
14
- export var createTestStore = function (t, initialState, services, actions) {
15
- var thunkMiddleware = thunk.withExtraArgument({ services: services });
14
+ export var createTestStore = function (t, initialState, thunkOptions, actions) {
15
+ var thunkMiddleware = thunk.withExtraArgument(thunkOptions);
16
16
  var enhancer = compose(applyMiddleware(thunkMiddleware, assertActionsMiddleware(t, actions)));
17
17
  return createStore(rootReducer, initialState, enhancer);
18
18
  };