@magmamath/students-features 1.2.0 → 1.2.1-rc.10

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 (398) hide show
  1. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +2 -1
  2. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js +2 -1
  4. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
  5. package/dist/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js +1 -1
  6. package/dist/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js.map +1 -1
  7. package/dist/commonjs/features/pmProgress/PmProgress.js +62 -0
  8. package/dist/commonjs/features/pmProgress/PmProgress.js.map +1 -0
  9. package/dist/commonjs/features/pmProgress/components/chart/chart.helpers.js +22 -0
  10. package/dist/commonjs/features/pmProgress/components/chart/chart.helpers.js.map +1 -0
  11. package/dist/commonjs/features/pmProgress/components/chart/chart.types.js +2 -0
  12. package/dist/commonjs/features/pmProgress/components/chart/chart.types.js.map +1 -0
  13. package/dist/commonjs/features/pmProgress/components/chart/components/PracticeProgressPieChart.js +44 -0
  14. package/dist/commonjs/features/pmProgress/components/chart/components/PracticeProgressPieChart.js.map +1 -0
  15. package/dist/commonjs/features/pmProgress/components/chart/components/SlicesClipPaths.js +26 -0
  16. package/dist/commonjs/features/pmProgress/components/chart/components/SlicesClipPaths.js.map +1 -0
  17. package/dist/commonjs/features/pmProgress/components/chart/components/SlicesPaths.js +69 -0
  18. package/dist/commonjs/features/pmProgress/components/chart/components/SlicesPaths.js.map +1 -0
  19. package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceArcPattern.js +38 -0
  20. package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceArcPattern.js.map +1 -0
  21. package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.js +21 -0
  22. package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.js.map +1 -0
  23. package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceFillColor.js +82 -0
  24. package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceFillColor.js.map +1 -0
  25. package/dist/commonjs/features/pmProgress/components/chart/model/ArcPatternGenerator.js +49 -0
  26. package/dist/commonjs/features/pmProgress/components/chart/model/ArcPatternGenerator.js.map +1 -0
  27. package/dist/commonjs/features/pmProgress/components/chart/model/PieChartManager.js +25 -0
  28. package/dist/commonjs/features/pmProgress/components/chart/model/PieChartManager.js.map +1 -0
  29. package/dist/commonjs/features/pmProgress/components/chart/model/SliceHighlight.js +20 -0
  30. package/dist/commonjs/features/pmProgress/components/chart/model/SliceHighlight.js.map +1 -0
  31. package/dist/commonjs/features/pmProgress/components/chart/model/SliceShapeGenerator.js +79 -0
  32. package/dist/commonjs/features/pmProgress/components/chart/model/SliceShapeGenerator.js.map +1 -0
  33. package/dist/commonjs/features/pmProgress/components/header/PmProgressHeader.js +199 -0
  34. package/dist/commonjs/features/pmProgress/components/header/PmProgressHeader.js.map +1 -0
  35. package/dist/commonjs/features/pmProgress/components/insights/PmInsights.js +71 -0
  36. package/dist/commonjs/features/pmProgress/components/insights/PmInsights.js.map +1 -0
  37. package/dist/commonjs/features/pmProgress/components/insights/PmTimeframeStats.js +95 -0
  38. package/dist/commonjs/features/pmProgress/components/insights/PmTimeframeStats.js.map +1 -0
  39. package/dist/commonjs/features/pmProgress/components/insights/StatsCard.js +71 -0
  40. package/dist/commonjs/features/pmProgress/components/insights/StatsCard.js.map +1 -0
  41. package/dist/commonjs/features/pmProgress/components/list/Fluency.js +70 -0
  42. package/dist/commonjs/features/pmProgress/components/list/Fluency.js.map +1 -0
  43. package/dist/commonjs/features/pmProgress/components/list/ListCard.js +187 -0
  44. package/dist/commonjs/features/pmProgress/components/list/ListCard.js.map +1 -0
  45. package/dist/commonjs/features/pmProgress/components/list/ListItem.js +119 -0
  46. package/dist/commonjs/features/pmProgress/components/list/ListItem.js.map +1 -0
  47. package/dist/commonjs/features/pmProgress/components/list/PmDomainList.js +86 -0
  48. package/dist/commonjs/features/pmProgress/components/list/PmDomainList.js.map +1 -0
  49. package/dist/commonjs/features/pmProgress/components/recs/PmTeacherRecs.js +118 -0
  50. package/dist/commonjs/features/pmProgress/components/recs/PmTeacherRecs.js.map +1 -0
  51. package/dist/commonjs/features/pmProgress/context/PmProgressContext.js +18 -0
  52. package/dist/commonjs/features/pmProgress/context/PmProgressContext.js.map +1 -0
  53. package/dist/commonjs/features/pmProgress/index.js +36 -0
  54. package/dist/commonjs/features/pmProgress/index.js.map +1 -0
  55. package/dist/commonjs/features/pmProgress/model/PmInsightsModel.js +22 -0
  56. package/dist/commonjs/features/pmProgress/model/PmInsightsModel.js.map +1 -0
  57. package/dist/commonjs/features/pmProgress/model/PmProgressApi.js +18 -0
  58. package/dist/commonjs/features/pmProgress/model/PmProgressApi.js.map +1 -0
  59. package/dist/commonjs/features/pmProgress/model/PmProgressModel.js +45 -0
  60. package/dist/commonjs/features/pmProgress/model/PmProgressModel.js.map +1 -0
  61. package/dist/commonjs/features/pmProgress/model/PmRecommendationsModel.js +47 -0
  62. package/dist/commonjs/features/pmProgress/model/PmRecommendationsModel.js.map +1 -0
  63. package/dist/commonjs/features/pmProgress/model/PmSolvingFlowModel.js +79 -0
  64. package/dist/commonjs/features/pmProgress/model/PmSolvingFlowModel.js.map +1 -0
  65. package/dist/commonjs/features/pmProgress/model/PmTreeModel.js +148 -0
  66. package/dist/commonjs/features/pmProgress/model/PmTreeModel.js.map +1 -0
  67. package/dist/commonjs/features/pmProgress/shared/pmProgress.constants.js +33 -0
  68. package/dist/commonjs/features/pmProgress/shared/pmProgress.constants.js.map +1 -0
  69. package/dist/commonjs/features/pmProgress/shared/pmProgress.helpers.js +193 -0
  70. package/dist/commonjs/features/pmProgress/shared/pmProgress.helpers.js.map +1 -0
  71. package/dist/commonjs/features/pmProgress/shared/pmProgress.types.js +12 -0
  72. package/dist/commonjs/features/pmProgress/shared/pmProgress.types.js.map +1 -0
  73. package/dist/commonjs/index.js +15 -3
  74. package/dist/commonjs/index.js.map +1 -1
  75. package/dist/commonjs/shared/icons/PentagonIcon.js +32 -0
  76. package/dist/commonjs/shared/icons/PentagonIcon.js.map +1 -0
  77. package/dist/commonjs/shared/icons/SketchArrowRight.js +33 -0
  78. package/dist/commonjs/shared/icons/SketchArrowRight.js.map +1 -0
  79. package/dist/commonjs/shared/icons/SliceDiamondIcon.js +32 -0
  80. package/dist/commonjs/shared/icons/SliceDiamondIcon.js.map +1 -0
  81. package/dist/commonjs/shared/icons/StarIcon.js +32 -0
  82. package/dist/commonjs/shared/icons/StarIcon.js.map +1 -0
  83. package/dist/commonjs/shared/icons/TimerIcon.js +35 -0
  84. package/dist/commonjs/shared/icons/TimerIcon.js.map +1 -0
  85. package/dist/commonjs/shared/translation/localization/ca.json +19 -0
  86. package/dist/commonjs/shared/translation/localization/de.json +19 -0
  87. package/dist/commonjs/shared/translation/localization/en.json +19 -0
  88. package/dist/commonjs/shared/translation/localization/gb.json +19 -0
  89. package/dist/commonjs/shared/translation/localization/sct.json +19 -0
  90. package/dist/commonjs/shared/translation/localization/sw.json +19 -0
  91. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +2 -1
  92. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
  93. package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js +2 -1
  94. package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
  95. package/dist/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js +2 -2
  96. package/dist/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js.map +1 -1
  97. package/dist/module/features/pmProgress/PmProgress.js +56 -0
  98. package/dist/module/features/pmProgress/PmProgress.js.map +1 -0
  99. package/dist/module/features/pmProgress/components/chart/chart.helpers.js +15 -0
  100. package/dist/module/features/pmProgress/components/chart/chart.helpers.js.map +1 -0
  101. package/dist/module/features/pmProgress/components/chart/chart.types.js +2 -0
  102. package/dist/module/features/pmProgress/components/chart/chart.types.js.map +1 -0
  103. package/dist/module/features/pmProgress/components/chart/components/PracticeProgressPieChart.js +38 -0
  104. package/dist/module/features/pmProgress/components/chart/components/PracticeProgressPieChart.js.map +1 -0
  105. package/dist/module/features/pmProgress/components/chart/components/SlicesClipPaths.js +20 -0
  106. package/dist/module/features/pmProgress/components/chart/components/SlicesClipPaths.js.map +1 -0
  107. package/dist/module/features/pmProgress/components/chart/components/SlicesPaths.js +63 -0
  108. package/dist/module/features/pmProgress/components/chart/components/SlicesPaths.js.map +1 -0
  109. package/dist/module/features/pmProgress/components/chart/components/layers/SliceArcPattern.js +32 -0
  110. package/dist/module/features/pmProgress/components/chart/components/layers/SliceArcPattern.js.map +1 -0
  111. package/dist/module/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.js +15 -0
  112. package/dist/module/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.js.map +1 -0
  113. package/dist/module/features/pmProgress/components/chart/components/layers/SliceFillColor.js +76 -0
  114. package/dist/module/features/pmProgress/components/chart/components/layers/SliceFillColor.js.map +1 -0
  115. package/dist/module/features/pmProgress/components/chart/model/ArcPatternGenerator.js +44 -0
  116. package/dist/module/features/pmProgress/components/chart/model/ArcPatternGenerator.js.map +1 -0
  117. package/dist/module/features/pmProgress/components/chart/model/PieChartManager.js +20 -0
  118. package/dist/module/features/pmProgress/components/chart/model/PieChartManager.js.map +1 -0
  119. package/dist/module/features/pmProgress/components/chart/model/SliceHighlight.js +15 -0
  120. package/dist/module/features/pmProgress/components/chart/model/SliceHighlight.js.map +1 -0
  121. package/dist/module/features/pmProgress/components/chart/model/SliceShapeGenerator.js +74 -0
  122. package/dist/module/features/pmProgress/components/chart/model/SliceShapeGenerator.js.map +1 -0
  123. package/dist/module/features/pmProgress/components/header/PmProgressHeader.js +192 -0
  124. package/dist/module/features/pmProgress/components/header/PmProgressHeader.js.map +1 -0
  125. package/dist/module/features/pmProgress/components/insights/PmInsights.js +64 -0
  126. package/dist/module/features/pmProgress/components/insights/PmInsights.js.map +1 -0
  127. package/dist/module/features/pmProgress/components/insights/PmTimeframeStats.js +90 -0
  128. package/dist/module/features/pmProgress/components/insights/PmTimeframeStats.js.map +1 -0
  129. package/dist/module/features/pmProgress/components/insights/StatsCard.js +65 -0
  130. package/dist/module/features/pmProgress/components/insights/StatsCard.js.map +1 -0
  131. package/dist/module/features/pmProgress/components/list/Fluency.js +64 -0
  132. package/dist/module/features/pmProgress/components/list/Fluency.js.map +1 -0
  133. package/dist/module/features/pmProgress/components/list/ListCard.js +180 -0
  134. package/dist/module/features/pmProgress/components/list/ListCard.js.map +1 -0
  135. package/dist/module/features/pmProgress/components/list/ListItem.js +112 -0
  136. package/dist/module/features/pmProgress/components/list/ListItem.js.map +1 -0
  137. package/dist/module/features/pmProgress/components/list/PmDomainList.js +80 -0
  138. package/dist/module/features/pmProgress/components/list/PmDomainList.js.map +1 -0
  139. package/dist/module/features/pmProgress/components/recs/PmTeacherRecs.js +112 -0
  140. package/dist/module/features/pmProgress/components/recs/PmTeacherRecs.js.map +1 -0
  141. package/dist/module/features/pmProgress/context/PmProgressContext.js +13 -0
  142. package/dist/module/features/pmProgress/context/PmProgressContext.js.map +1 -0
  143. package/dist/module/features/pmProgress/index.js +9 -0
  144. package/dist/module/features/pmProgress/index.js.map +1 -0
  145. package/dist/module/features/pmProgress/model/PmInsightsModel.js +17 -0
  146. package/dist/module/features/pmProgress/model/PmInsightsModel.js.map +1 -0
  147. package/dist/module/features/pmProgress/model/PmProgressApi.js +13 -0
  148. package/dist/module/features/pmProgress/model/PmProgressApi.js.map +1 -0
  149. package/dist/module/features/pmProgress/model/PmProgressModel.js +40 -0
  150. package/dist/module/features/pmProgress/model/PmProgressModel.js.map +1 -0
  151. package/dist/module/features/pmProgress/model/PmRecommendationsModel.js +42 -0
  152. package/dist/module/features/pmProgress/model/PmRecommendationsModel.js.map +1 -0
  153. package/dist/module/features/pmProgress/model/PmSolvingFlowModel.js +74 -0
  154. package/dist/module/features/pmProgress/model/PmSolvingFlowModel.js.map +1 -0
  155. package/dist/module/features/pmProgress/model/PmTreeModel.js +143 -0
  156. package/dist/module/features/pmProgress/model/PmTreeModel.js.map +1 -0
  157. package/dist/module/features/pmProgress/shared/pmProgress.constants.js +30 -0
  158. package/dist/module/features/pmProgress/shared/pmProgress.constants.js.map +1 -0
  159. package/dist/module/features/pmProgress/shared/pmProgress.helpers.js +177 -0
  160. package/dist/module/features/pmProgress/shared/pmProgress.helpers.js.map +1 -0
  161. package/dist/module/features/pmProgress/shared/pmProgress.types.js +10 -0
  162. package/dist/module/features/pmProgress/shared/pmProgress.types.js.map +1 -0
  163. package/dist/module/index.js +1 -0
  164. package/dist/module/index.js.map +1 -1
  165. package/dist/module/shared/icons/PentagonIcon.js +24 -0
  166. package/dist/module/shared/icons/PentagonIcon.js.map +1 -0
  167. package/dist/module/shared/icons/SketchArrowRight.js +25 -0
  168. package/dist/module/shared/icons/SketchArrowRight.js.map +1 -0
  169. package/dist/module/shared/icons/SliceDiamondIcon.js +24 -0
  170. package/dist/module/shared/icons/SliceDiamondIcon.js.map +1 -0
  171. package/dist/module/shared/icons/StarIcon.js +24 -0
  172. package/dist/module/shared/icons/StarIcon.js.map +1 -0
  173. package/dist/module/shared/icons/TimerIcon.js +27 -0
  174. package/dist/module/shared/icons/TimerIcon.js.map +1 -0
  175. package/dist/module/shared/translation/localization/ca.json +19 -0
  176. package/dist/module/shared/translation/localization/de.json +19 -0
  177. package/dist/module/shared/translation/localization/en.json +19 -0
  178. package/dist/module/shared/translation/localization/gb.json +19 -0
  179. package/dist/module/shared/translation/localization/sct.json +19 -0
  180. package/dist/module/shared/translation/localization/sw.json +19 -0
  181. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
  182. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +1 -1
  183. package/dist/typescript/commonjs/features/pmProgress/PmProgress.d.ts +9 -0
  184. package/dist/typescript/commonjs/features/pmProgress/PmProgress.d.ts.map +1 -0
  185. package/dist/typescript/commonjs/features/pmProgress/components/chart/chart.helpers.d.ts +4 -0
  186. package/dist/typescript/commonjs/features/pmProgress/components/chart/chart.helpers.d.ts.map +1 -0
  187. package/dist/typescript/commonjs/features/pmProgress/components/chart/chart.types.d.ts +36 -0
  188. package/dist/typescript/commonjs/features/pmProgress/components/chart/chart.types.d.ts.map +1 -0
  189. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/PracticeProgressPieChart.d.ts +9 -0
  190. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/PracticeProgressPieChart.d.ts.map +1 -0
  191. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/SlicesClipPaths.d.ts +10 -0
  192. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/SlicesClipPaths.d.ts.map +1 -0
  193. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/SlicesPaths.d.ts +11 -0
  194. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/SlicesPaths.d.ts.map +1 -0
  195. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceArcPattern.d.ts +12 -0
  196. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceArcPattern.d.ts.map +1 -0
  197. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.d.ts +8 -0
  198. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.d.ts.map +1 -0
  199. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceFillColor.d.ts +14 -0
  200. package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceFillColor.d.ts.map +1 -0
  201. package/dist/typescript/commonjs/features/pmProgress/components/chart/model/ArcPatternGenerator.d.ts +12 -0
  202. package/dist/typescript/commonjs/features/pmProgress/components/chart/model/ArcPatternGenerator.d.ts.map +1 -0
  203. package/dist/typescript/commonjs/features/pmProgress/components/chart/model/PieChartManager.d.ts +16 -0
  204. package/dist/typescript/commonjs/features/pmProgress/components/chart/model/PieChartManager.d.ts.map +1 -0
  205. package/dist/typescript/commonjs/features/pmProgress/components/chart/model/SliceHighlight.d.ts +10 -0
  206. package/dist/typescript/commonjs/features/pmProgress/components/chart/model/SliceHighlight.d.ts.map +1 -0
  207. package/dist/typescript/commonjs/features/pmProgress/components/chart/model/SliceShapeGenerator.d.ts +17 -0
  208. package/dist/typescript/commonjs/features/pmProgress/components/chart/model/SliceShapeGenerator.d.ts.map +1 -0
  209. package/dist/typescript/commonjs/features/pmProgress/components/header/PmProgressHeader.d.ts +3 -0
  210. package/dist/typescript/commonjs/features/pmProgress/components/header/PmProgressHeader.d.ts.map +1 -0
  211. package/dist/typescript/commonjs/features/pmProgress/components/insights/PmInsights.d.ts +3 -0
  212. package/dist/typescript/commonjs/features/pmProgress/components/insights/PmInsights.d.ts.map +1 -0
  213. package/dist/typescript/commonjs/features/pmProgress/components/insights/PmTimeframeStats.d.ts +3 -0
  214. package/dist/typescript/commonjs/features/pmProgress/components/insights/PmTimeframeStats.d.ts.map +1 -0
  215. package/dist/typescript/commonjs/features/pmProgress/components/insights/StatsCard.d.ts +10 -0
  216. package/dist/typescript/commonjs/features/pmProgress/components/insights/StatsCard.d.ts.map +1 -0
  217. package/dist/typescript/commonjs/features/pmProgress/components/list/Fluency.d.ts +8 -0
  218. package/dist/typescript/commonjs/features/pmProgress/components/list/Fluency.d.ts.map +1 -0
  219. package/dist/typescript/commonjs/features/pmProgress/components/list/ListCard.d.ts +26 -0
  220. package/dist/typescript/commonjs/features/pmProgress/components/list/ListCard.d.ts.map +1 -0
  221. package/dist/typescript/commonjs/features/pmProgress/components/list/ListItem.d.ts +10 -0
  222. package/dist/typescript/commonjs/features/pmProgress/components/list/ListItem.d.ts.map +1 -0
  223. package/dist/typescript/commonjs/features/pmProgress/components/list/PmDomainList.d.ts +3 -0
  224. package/dist/typescript/commonjs/features/pmProgress/components/list/PmDomainList.d.ts.map +1 -0
  225. package/dist/typescript/commonjs/features/pmProgress/components/recs/PmTeacherRecs.d.ts +3 -0
  226. package/dist/typescript/commonjs/features/pmProgress/components/recs/PmTeacherRecs.d.ts.map +1 -0
  227. package/dist/typescript/commonjs/features/pmProgress/context/PmProgressContext.d.ts +12 -0
  228. package/dist/typescript/commonjs/features/pmProgress/context/PmProgressContext.d.ts.map +1 -0
  229. package/dist/typescript/commonjs/features/pmProgress/index.d.ts +4 -0
  230. package/dist/typescript/commonjs/features/pmProgress/index.d.ts.map +1 -0
  231. package/dist/typescript/commonjs/features/pmProgress/model/PmInsightsModel.d.ts +14 -0
  232. package/dist/typescript/commonjs/features/pmProgress/model/PmInsightsModel.d.ts.map +1 -0
  233. package/dist/typescript/commonjs/features/pmProgress/model/PmProgressApi.d.ts +17 -0
  234. package/dist/typescript/commonjs/features/pmProgress/model/PmProgressApi.d.ts.map +1 -0
  235. package/dist/typescript/commonjs/features/pmProgress/model/PmProgressModel.d.ts +21 -0
  236. package/dist/typescript/commonjs/features/pmProgress/model/PmProgressModel.d.ts.map +1 -0
  237. package/dist/typescript/commonjs/features/pmProgress/model/PmRecommendationsModel.d.ts +102 -0
  238. package/dist/typescript/commonjs/features/pmProgress/model/PmRecommendationsModel.d.ts.map +1 -0
  239. package/dist/typescript/commonjs/features/pmProgress/model/PmSolvingFlowModel.d.ts +19 -0
  240. package/dist/typescript/commonjs/features/pmProgress/model/PmSolvingFlowModel.d.ts.map +1 -0
  241. package/dist/typescript/commonjs/features/pmProgress/model/PmTreeModel.d.ts +24 -0
  242. package/dist/typescript/commonjs/features/pmProgress/model/PmTreeModel.d.ts.map +1 -0
  243. package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.constants.d.ts +23 -0
  244. package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.constants.d.ts.map +1 -0
  245. package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.helpers.d.ts +59 -0
  246. package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.helpers.d.ts.map +1 -0
  247. package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.types.d.ts +185 -0
  248. package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.types.d.ts.map +1 -0
  249. package/dist/typescript/commonjs/index.d.ts +1 -0
  250. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  251. package/dist/typescript/commonjs/shared/icons/PentagonIcon.d.ts +4 -0
  252. package/dist/typescript/commonjs/shared/icons/PentagonIcon.d.ts.map +1 -0
  253. package/dist/typescript/commonjs/shared/icons/SketchArrowRight.d.ts +4 -0
  254. package/dist/typescript/commonjs/shared/icons/SketchArrowRight.d.ts.map +1 -0
  255. package/dist/typescript/commonjs/shared/icons/SliceDiamondIcon.d.ts +4 -0
  256. package/dist/typescript/commonjs/shared/icons/SliceDiamondIcon.d.ts.map +1 -0
  257. package/dist/typescript/commonjs/shared/icons/StarIcon.d.ts +4 -0
  258. package/dist/typescript/commonjs/shared/icons/StarIcon.d.ts.map +1 -0
  259. package/dist/typescript/commonjs/shared/icons/TimerIcon.d.ts +4 -0
  260. package/dist/typescript/commonjs/shared/icons/TimerIcon.d.ts.map +1 -0
  261. package/dist/typescript/commonjs/shared/translation/constants.d.ts +114 -0
  262. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  263. package/dist/typescript/commonjs/shared/translation/model.d.ts +38 -0
  264. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  265. package/dist/typescript/module/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
  266. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +1 -1
  267. package/dist/typescript/module/features/pmProgress/PmProgress.d.ts +9 -0
  268. package/dist/typescript/module/features/pmProgress/PmProgress.d.ts.map +1 -0
  269. package/dist/typescript/module/features/pmProgress/components/chart/chart.helpers.d.ts +4 -0
  270. package/dist/typescript/module/features/pmProgress/components/chart/chart.helpers.d.ts.map +1 -0
  271. package/dist/typescript/module/features/pmProgress/components/chart/chart.types.d.ts +36 -0
  272. package/dist/typescript/module/features/pmProgress/components/chart/chart.types.d.ts.map +1 -0
  273. package/dist/typescript/module/features/pmProgress/components/chart/components/PracticeProgressPieChart.d.ts +9 -0
  274. package/dist/typescript/module/features/pmProgress/components/chart/components/PracticeProgressPieChart.d.ts.map +1 -0
  275. package/dist/typescript/module/features/pmProgress/components/chart/components/SlicesClipPaths.d.ts +10 -0
  276. package/dist/typescript/module/features/pmProgress/components/chart/components/SlicesClipPaths.d.ts.map +1 -0
  277. package/dist/typescript/module/features/pmProgress/components/chart/components/SlicesPaths.d.ts +11 -0
  278. package/dist/typescript/module/features/pmProgress/components/chart/components/SlicesPaths.d.ts.map +1 -0
  279. package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceArcPattern.d.ts +12 -0
  280. package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceArcPattern.d.ts.map +1 -0
  281. package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.d.ts +8 -0
  282. package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.d.ts.map +1 -0
  283. package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceFillColor.d.ts +14 -0
  284. package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceFillColor.d.ts.map +1 -0
  285. package/dist/typescript/module/features/pmProgress/components/chart/model/ArcPatternGenerator.d.ts +12 -0
  286. package/dist/typescript/module/features/pmProgress/components/chart/model/ArcPatternGenerator.d.ts.map +1 -0
  287. package/dist/typescript/module/features/pmProgress/components/chart/model/PieChartManager.d.ts +16 -0
  288. package/dist/typescript/module/features/pmProgress/components/chart/model/PieChartManager.d.ts.map +1 -0
  289. package/dist/typescript/module/features/pmProgress/components/chart/model/SliceHighlight.d.ts +10 -0
  290. package/dist/typescript/module/features/pmProgress/components/chart/model/SliceHighlight.d.ts.map +1 -0
  291. package/dist/typescript/module/features/pmProgress/components/chart/model/SliceShapeGenerator.d.ts +17 -0
  292. package/dist/typescript/module/features/pmProgress/components/chart/model/SliceShapeGenerator.d.ts.map +1 -0
  293. package/dist/typescript/module/features/pmProgress/components/header/PmProgressHeader.d.ts +3 -0
  294. package/dist/typescript/module/features/pmProgress/components/header/PmProgressHeader.d.ts.map +1 -0
  295. package/dist/typescript/module/features/pmProgress/components/insights/PmInsights.d.ts +3 -0
  296. package/dist/typescript/module/features/pmProgress/components/insights/PmInsights.d.ts.map +1 -0
  297. package/dist/typescript/module/features/pmProgress/components/insights/PmTimeframeStats.d.ts +3 -0
  298. package/dist/typescript/module/features/pmProgress/components/insights/PmTimeframeStats.d.ts.map +1 -0
  299. package/dist/typescript/module/features/pmProgress/components/insights/StatsCard.d.ts +10 -0
  300. package/dist/typescript/module/features/pmProgress/components/insights/StatsCard.d.ts.map +1 -0
  301. package/dist/typescript/module/features/pmProgress/components/list/Fluency.d.ts +8 -0
  302. package/dist/typescript/module/features/pmProgress/components/list/Fluency.d.ts.map +1 -0
  303. package/dist/typescript/module/features/pmProgress/components/list/ListCard.d.ts +26 -0
  304. package/dist/typescript/module/features/pmProgress/components/list/ListCard.d.ts.map +1 -0
  305. package/dist/typescript/module/features/pmProgress/components/list/ListItem.d.ts +10 -0
  306. package/dist/typescript/module/features/pmProgress/components/list/ListItem.d.ts.map +1 -0
  307. package/dist/typescript/module/features/pmProgress/components/list/PmDomainList.d.ts +3 -0
  308. package/dist/typescript/module/features/pmProgress/components/list/PmDomainList.d.ts.map +1 -0
  309. package/dist/typescript/module/features/pmProgress/components/recs/PmTeacherRecs.d.ts +3 -0
  310. package/dist/typescript/module/features/pmProgress/components/recs/PmTeacherRecs.d.ts.map +1 -0
  311. package/dist/typescript/module/features/pmProgress/context/PmProgressContext.d.ts +12 -0
  312. package/dist/typescript/module/features/pmProgress/context/PmProgressContext.d.ts.map +1 -0
  313. package/dist/typescript/module/features/pmProgress/index.d.ts +4 -0
  314. package/dist/typescript/module/features/pmProgress/index.d.ts.map +1 -0
  315. package/dist/typescript/module/features/pmProgress/model/PmInsightsModel.d.ts +14 -0
  316. package/dist/typescript/module/features/pmProgress/model/PmInsightsModel.d.ts.map +1 -0
  317. package/dist/typescript/module/features/pmProgress/model/PmProgressApi.d.ts +17 -0
  318. package/dist/typescript/module/features/pmProgress/model/PmProgressApi.d.ts.map +1 -0
  319. package/dist/typescript/module/features/pmProgress/model/PmProgressModel.d.ts +21 -0
  320. package/dist/typescript/module/features/pmProgress/model/PmProgressModel.d.ts.map +1 -0
  321. package/dist/typescript/module/features/pmProgress/model/PmRecommendationsModel.d.ts +102 -0
  322. package/dist/typescript/module/features/pmProgress/model/PmRecommendationsModel.d.ts.map +1 -0
  323. package/dist/typescript/module/features/pmProgress/model/PmSolvingFlowModel.d.ts +19 -0
  324. package/dist/typescript/module/features/pmProgress/model/PmSolvingFlowModel.d.ts.map +1 -0
  325. package/dist/typescript/module/features/pmProgress/model/PmTreeModel.d.ts +24 -0
  326. package/dist/typescript/module/features/pmProgress/model/PmTreeModel.d.ts.map +1 -0
  327. package/dist/typescript/module/features/pmProgress/shared/pmProgress.constants.d.ts +23 -0
  328. package/dist/typescript/module/features/pmProgress/shared/pmProgress.constants.d.ts.map +1 -0
  329. package/dist/typescript/module/features/pmProgress/shared/pmProgress.helpers.d.ts +59 -0
  330. package/dist/typescript/module/features/pmProgress/shared/pmProgress.helpers.d.ts.map +1 -0
  331. package/dist/typescript/module/features/pmProgress/shared/pmProgress.types.d.ts +185 -0
  332. package/dist/typescript/module/features/pmProgress/shared/pmProgress.types.d.ts.map +1 -0
  333. package/dist/typescript/module/index.d.ts +1 -0
  334. package/dist/typescript/module/index.d.ts.map +1 -1
  335. package/dist/typescript/module/shared/icons/PentagonIcon.d.ts +4 -0
  336. package/dist/typescript/module/shared/icons/PentagonIcon.d.ts.map +1 -0
  337. package/dist/typescript/module/shared/icons/SketchArrowRight.d.ts +4 -0
  338. package/dist/typescript/module/shared/icons/SketchArrowRight.d.ts.map +1 -0
  339. package/dist/typescript/module/shared/icons/SliceDiamondIcon.d.ts +4 -0
  340. package/dist/typescript/module/shared/icons/SliceDiamondIcon.d.ts.map +1 -0
  341. package/dist/typescript/module/shared/icons/StarIcon.d.ts +4 -0
  342. package/dist/typescript/module/shared/icons/StarIcon.d.ts.map +1 -0
  343. package/dist/typescript/module/shared/icons/TimerIcon.d.ts +4 -0
  344. package/dist/typescript/module/shared/icons/TimerIcon.d.ts.map +1 -0
  345. package/dist/typescript/module/shared/translation/constants.d.ts +114 -0
  346. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  347. package/dist/typescript/module/shared/translation/model.d.ts +38 -0
  348. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  349. package/package.json +13 -2
  350. package/src/features/chatbot/components/ChatInput/ChatInput.tsx +2 -1
  351. package/src/features/chatbot/components/ChatMessage/MessageContent.tsx +2 -1
  352. package/src/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.tsx +2 -2
  353. package/src/features/pmProgress/PmProgress.tsx +52 -0
  354. package/src/features/pmProgress/__tests__/.keep +0 -0
  355. package/src/features/pmProgress/components/chart/chart.helpers.ts +14 -0
  356. package/src/features/pmProgress/components/chart/chart.types.ts +37 -0
  357. package/src/features/pmProgress/components/chart/components/PracticeProgressPieChart.tsx +32 -0
  358. package/src/features/pmProgress/components/chart/components/SlicesClipPaths.tsx +22 -0
  359. package/src/features/pmProgress/components/chart/components/SlicesPaths.tsx +75 -0
  360. package/src/features/pmProgress/components/chart/components/layers/SliceArcPattern.tsx +44 -0
  361. package/src/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.tsx +11 -0
  362. package/src/features/pmProgress/components/chart/components/layers/SliceFillColor.tsx +88 -0
  363. package/src/features/pmProgress/components/chart/model/ArcPatternGenerator.ts +48 -0
  364. package/src/features/pmProgress/components/chart/model/PieChartManager.ts +20 -0
  365. package/src/features/pmProgress/components/chart/model/SliceHighlight.ts +17 -0
  366. package/src/features/pmProgress/components/chart/model/SliceShapeGenerator.ts +90 -0
  367. package/src/features/pmProgress/components/header/PmProgressHeader.tsx +187 -0
  368. package/src/features/pmProgress/components/insights/PmInsights.tsx +60 -0
  369. package/src/features/pmProgress/components/insights/PmTimeframeStats.tsx +85 -0
  370. package/src/features/pmProgress/components/insights/StatsCard.tsx +53 -0
  371. package/src/features/pmProgress/components/list/Fluency.tsx +59 -0
  372. package/src/features/pmProgress/components/list/ListCard.tsx +216 -0
  373. package/src/features/pmProgress/components/list/ListItem.tsx +132 -0
  374. package/src/features/pmProgress/components/list/PmDomainList.tsx +66 -0
  375. package/src/features/pmProgress/components/recs/PmTeacherRecs.tsx +108 -0
  376. package/src/features/pmProgress/context/PmProgressContext.tsx +23 -0
  377. package/src/features/pmProgress/index.ts +6 -0
  378. package/src/features/pmProgress/model/PmInsightsModel.ts +23 -0
  379. package/src/features/pmProgress/model/PmProgressApi.ts +34 -0
  380. package/src/features/pmProgress/model/PmProgressModel.ts +50 -0
  381. package/src/features/pmProgress/model/PmRecommendationsModel.ts +47 -0
  382. package/src/features/pmProgress/model/PmSolvingFlowModel.ts +105 -0
  383. package/src/features/pmProgress/model/PmTreeModel.ts +148 -0
  384. package/src/features/pmProgress/shared/pmProgress.constants.ts +73 -0
  385. package/src/features/pmProgress/shared/pmProgress.helpers.ts +239 -0
  386. package/src/features/pmProgress/shared/pmProgress.types.ts +207 -0
  387. package/src/index.ts +1 -0
  388. package/src/shared/icons/PentagonIcon.tsx +17 -0
  389. package/src/shared/icons/SketchArrowRight.tsx +18 -0
  390. package/src/shared/icons/SliceDiamondIcon.tsx +16 -0
  391. package/src/shared/icons/StarIcon.tsx +17 -0
  392. package/src/shared/icons/TimerIcon.tsx +21 -0
  393. package/src/shared/translation/localization/ca.json +19 -0
  394. package/src/shared/translation/localization/de.json +19 -0
  395. package/src/shared/translation/localization/en.json +19 -0
  396. package/src/shared/translation/localization/gb.json +19 -0
  397. package/src/shared/translation/localization/sct.json +19 -0
  398. package/src/shared/translation/localization/sw.json +19 -0
@@ -0,0 +1,88 @@
1
+ import React from 'react'
2
+ import { ClipPath, Defs, G, Path } from 'react-native-svg'
3
+ import { getSliceClipId } from '../../chart.helpers'
4
+
5
+ type SliceFillColorProps = {
6
+ clipPathId: string
7
+ shapeSvg: string
8
+ fillSvg: string
9
+ fillBorderSvg: string
10
+ color: string
11
+ percent: number
12
+ borderColor?: string
13
+ borderWidth?: number
14
+ }
15
+
16
+ export const SliceFillColor = ({
17
+ clipPathId,
18
+ shapeSvg,
19
+ fillSvg,
20
+ fillBorderSvg,
21
+ color,
22
+ percent,
23
+ borderColor,
24
+ borderWidth,
25
+ }: SliceFillColorProps) => {
26
+ const isFullyFilled = percent >= 100
27
+ const isPartiallyFilled = percent > 0
28
+ const hasBorder = borderColor != null && borderWidth != null && borderWidth > 0
29
+
30
+ const sliceClipId = getSliceClipId(clipPathId)
31
+ const borderClipId = `${sliceClipId}-border`
32
+
33
+ if (isFullyFilled) {
34
+ return (
35
+ <>
36
+ {hasBorder && (
37
+ <Defs>
38
+ <ClipPath id={borderClipId}>
39
+ <Path d={fillBorderSvg} />
40
+ </ClipPath>
41
+ </Defs>
42
+ )}
43
+ <G clipPath={`url(#${sliceClipId})`}>
44
+ <Path d={shapeSvg} fill={color} />
45
+ {hasBorder && (
46
+ <G clipPath={`url(#${borderClipId})`}>
47
+ <Path
48
+ d={fillBorderSvg}
49
+ fill="none"
50
+ stroke={borderColor}
51
+ strokeWidth={borderWidth! * 2}
52
+ />
53
+ </G>
54
+ )}
55
+ </G>
56
+ </>
57
+ )
58
+ }
59
+
60
+ if (isPartiallyFilled) {
61
+ return (
62
+ <>
63
+ {hasBorder && (
64
+ <Defs>
65
+ <ClipPath id={borderClipId}>
66
+ <Path d={fillBorderSvg} />
67
+ </ClipPath>
68
+ </Defs>
69
+ )}
70
+ <G clipPath={`url(#${sliceClipId})`}>
71
+ <Path d={fillSvg} fill={color} />
72
+ {hasBorder && (
73
+ <G clipPath={`url(#${borderClipId})`}>
74
+ <Path
75
+ d={fillBorderSvg}
76
+ fill="none"
77
+ stroke={borderColor}
78
+ strokeWidth={borderWidth! * 2}
79
+ />
80
+ </G>
81
+ )}
82
+ </G>
83
+ </>
84
+ )
85
+ }
86
+
87
+ return null
88
+ }
@@ -0,0 +1,48 @@
1
+ import type { PieChartManagerConfig, SliceShape } from '../chart.types'
2
+
3
+ export class OuterArcPatternGenerator {
4
+ constructor(private readonly config: PieChartManagerConfig) {}
5
+
6
+ public generateArcPath(slice: SliceShape, radius: number) {
7
+ const gapAngle = this.config.gapBetweenSlices / (2 * radius)
8
+ const startAngle = slice.startAngle + gapAngle
9
+ const endAngle = slice.endAngle - gapAngle
10
+
11
+ const startPoint = this.polarToCartesian(radius, startAngle)
12
+ const endPoint = this.polarToCartesian(radius, endAngle)
13
+ const largeArcFlag = endAngle - startAngle > Math.PI ? 1 : 0
14
+
15
+ return `M ${startPoint.x} ${startPoint.y} A ${radius} ${radius} 0 ${largeArcFlag} 1 ${endPoint.x} ${endPoint.y}`
16
+ }
17
+
18
+ /** Returns the sizes of the two rings where the checkerboard dashes are drawn. */
19
+ public getPatternTrackSizes(): [number, number] {
20
+ const { outerRadius, outerArc } = this.config
21
+ return [
22
+ outerRadius - outerArc.strokeWidth / 2,
23
+ outerRadius - outerArc.strokeWidth * 1.5,
24
+ ]
25
+ }
26
+
27
+ public getDashWidthForRadius(radius: number) {
28
+ return this.config.outerArc.dashWidth * (radius / this.config.outerRadius)
29
+ }
30
+
31
+ public getDashOffset(rowIndex: number, radius: number) {
32
+ const dashAngle = this.config.outerArc.dashWidth / this.config.outerRadius
33
+ const dashWidthAtRadius = dashAngle * radius
34
+ const baseOffset = dashWidthAtRadius / 2
35
+
36
+ if (rowIndex === 1) {
37
+ return baseOffset - dashWidthAtRadius
38
+ }
39
+ return baseOffset
40
+ }
41
+
42
+ private polarToCartesian(radius: number, angleInRadians: number) {
43
+ return {
44
+ x: radius * Math.sin(angleInRadians),
45
+ y: -radius * Math.cos(angleInRadians),
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,20 @@
1
+ import { SliceShapeGenerator } from './SliceShapeGenerator'
2
+ import { OuterArcPatternGenerator } from './ArcPatternGenerator'
3
+ import { SliceHighlight } from './SliceHighlight'
4
+ import type { PieChartManagerConfig } from '../chart.types'
5
+
6
+ export class PieChartManager {
7
+ public readonly shape: SliceShapeGenerator
8
+ public readonly pattern: OuterArcPatternGenerator
9
+ public readonly highlight: SliceHighlight
10
+
11
+ constructor(public readonly config: PieChartManagerConfig) {
12
+ this.shape = new SliceShapeGenerator(config)
13
+ this.pattern = new OuterArcPatternGenerator(config)
14
+ this.highlight = new SliceHighlight(config)
15
+ }
16
+
17
+ public getCenter() {
18
+ return { x: this.config.size / 2, y: this.config.size / 2 }
19
+ }
20
+ }
@@ -0,0 +1,17 @@
1
+ import { createEvent, createStore } from 'effector'
2
+ import type { PieChartManagerConfig } from '../chart.types'
3
+
4
+ export class SliceHighlight {
5
+ public readonly set = createEvent<number>()
6
+ public readonly reset = createEvent()
7
+
8
+ public readonly $highlightedIndex = createStore<number | null>(null)
9
+ .on(this.set, (_, index) => index)
10
+ .reset(this.reset)
11
+
12
+ constructor(private readonly config: PieChartManagerConfig) {}
13
+
14
+ public getTranslateY(isHighlighted: boolean): number {
15
+ return isHighlighted ? -this.config.pressOffset : 0
16
+ }
17
+ }
@@ -0,0 +1,90 @@
1
+ import { arc, pie } from 'd3-shape'
2
+ import type { PieChartManagerConfig, SliceInputData, SliceShape } from '../chart.types'
3
+
4
+ export class SliceShapeGenerator {
5
+ private innerRadius = 0
6
+ private readonly d3Pie = pie<SliceInputData>()
7
+ .value(({ value }) => value)
8
+ .sort(null)
9
+
10
+ constructor(private readonly config: PieChartManagerConfig) {}
11
+
12
+ public generateSlices(data: SliceInputData[]): SliceShape[] {
13
+ this.innerRadius = this.getInnerRadius(data.length)
14
+
15
+ return this.d3Pie(data).map((datum, index) => ({
16
+ index,
17
+ startAngle: datum.startAngle,
18
+ endAngle: datum.endAngle,
19
+ fillPercent: datum.data.fillPercent ?? 0,
20
+ backgroundColor: datum.data.backgroundColor ?? this.config.colors.background,
21
+ fillColor: datum.data.fillColor,
22
+ borderColor: datum.data.borderColor,
23
+ data: datum.data,
24
+ }))
25
+ }
26
+
27
+ public generateSlicePath(slice: SliceShape): string {
28
+ return this.buildArc(slice, this.config.outerRadius, this.getCornerRadius(100))
29
+ }
30
+
31
+ public generateFillPath(slice: SliceShape): string {
32
+ const fillRadius = this.getFillRadius(slice)
33
+ const cornerRadius = this.getCornerRadius(slice.fillPercent)
34
+
35
+ // Build with innerRadius 0 so d3 only rounds the outer corners.
36
+ // The slice clip path will cut the inner edge to the correct boundary.
37
+ return arc()
38
+ .outerRadius(fillRadius)
39
+ .innerRadius(0)
40
+ .cornerRadius(cornerRadius)
41
+ .padAngle(this.padAngle)
42
+ .padRadius(this.config.outerRadius)({
43
+ startAngle: slice.startAngle,
44
+ endAngle: slice.endAngle,
45
+ innerRadius: 0,
46
+ outerRadius: fillRadius,
47
+ }) as string
48
+ }
49
+
50
+ public generateFillBorderPath(slice: SliceShape): string {
51
+ const fillRadius = this.getFillRadius(slice)
52
+ const cornerRadius = this.getCornerRadius(slice.fillPercent)
53
+ return this.buildArc(slice, fillRadius, cornerRadius)
54
+ }
55
+
56
+
57
+ private getFillRadius(slice: SliceShape): number {
58
+ return this.innerRadius + (this.config.outerRadius - this.innerRadius) * (slice.fillPercent / 100)
59
+ }
60
+
61
+ private getInnerRadius(sliceCount: number): number {
62
+ const { innerRadius } = this.config
63
+ return typeof innerRadius === 'function' ? innerRadius(sliceCount) : innerRadius
64
+ }
65
+
66
+ private getCornerRadius(fillPercent: number): number {
67
+ const { cornerRadius } = this.config
68
+ return typeof cornerRadius === 'function' ? cornerRadius(fillPercent) : cornerRadius
69
+ }
70
+
71
+ private get padAngle(): number {
72
+ return this.config.gapBetweenSlices / this.config.outerRadius
73
+ }
74
+
75
+ private buildArc(slice: SliceShape, outerRadius: number, cornerRadius: number): string {
76
+ const innerRadius = this.innerRadius
77
+
78
+ return arc()
79
+ .outerRadius(outerRadius)
80
+ .innerRadius(innerRadius)
81
+ .cornerRadius(cornerRadius)
82
+ .padAngle(this.padAngle)
83
+ .padRadius(this.config.outerRadius)({
84
+ startAngle: slice.startAngle,
85
+ endAngle: slice.endAngle,
86
+ innerRadius,
87
+ outerRadius,
88
+ }) as string
89
+ }
90
+ }
@@ -0,0 +1,187 @@
1
+ import React, { useState } from 'react'
2
+ import { StyleSheet, View } from 'react-native'
3
+ import { Portal } from 'react-native-portalize'
4
+ import {
5
+ Button,
6
+ ButtonColor,
7
+ ButtonSize,
8
+ ButtonVariant,
9
+ CaretDownIcon,
10
+ CaretUpIcon,
11
+ COLORS,
12
+ Dropdown,
13
+ HeadingVariants,
14
+ Menu,
15
+ PlayIcon,
16
+ SPACING,
17
+ Typography,
18
+ } from '@magmamath/react-native-ui'
19
+ import { SketchArrowRight } from '../../../../shared/icons/SketchArrowRight'
20
+ import { SliceDiamondIcon } from '../../../../shared/icons/SliceDiamondIcon'
21
+ import { useText } from '../../../../shared/translation'
22
+ import { useStoreMap, useUnit } from 'effector-react'
23
+ import { usePmProgress } from '../../context/PmProgressContext'
24
+ import { isFluencyDomain } from '../../shared/pmProgress.helpers'
25
+ import { SolvingFlow } from '../../shared/pmProgress.constants'
26
+
27
+ export const PmProgressHeader = () => {
28
+ const t = useText()
29
+ const { model, onStartPress } = usePmProgress()
30
+ const [isDropdownOpen, setIsDropdownOpen] = useState(false)
31
+
32
+ const grade = useUnit(model.tree.$grade)
33
+ const grades = useStoreMap(model.tree.$grades, (grades) =>
34
+ grades.map((grade) => ({
35
+ key: grade.value,
36
+ title: grade.name,
37
+ disabled: grade.isLocked,
38
+ })),
39
+ )
40
+
41
+ const nextUp = useStoreMap(model.tree.$domains, (domains) =>
42
+ domains.find((domain) => {
43
+ const isFluency = isFluencyDomain(domain.title)
44
+ const isCompleted = domain.skillsCount.achieved === domain.skillsCount.total
45
+ return !isFluency && !isCompleted
46
+ }),
47
+ )
48
+
49
+ return (
50
+ <View style={styles.container}>
51
+ <View style={styles.title}>
52
+ <Typography variant={HeadingVariants.H2} style={styles.dark}>
53
+ {t('pmProgress.title')}
54
+ </Typography>
55
+ <Dropdown
56
+ isOpen={isDropdownOpen}
57
+ Portal={Portal}
58
+ onDismiss={() => setIsDropdownOpen(false)}
59
+ anchor={
60
+ <Button
61
+ variant={ButtonVariant.TERTIARY}
62
+ onPress={() => setIsDropdownOpen((prev) => !prev)}
63
+ >
64
+ <Typography variant={HeadingVariants.H8} style={styles.dark}>
65
+ {t('pmProgress.grade')} {grade}
66
+ </Typography>
67
+ <View style={styles.caret}>
68
+ {isDropdownOpen ? (
69
+ <CaretUpIcon color={COLORS.NEUTRAL_9} />
70
+ ) : (
71
+ <CaretDownIcon color={COLORS.NEUTRAL_9} />
72
+ )}
73
+ </View>
74
+ </Button>
75
+ }
76
+ >
77
+ <Menu
78
+ style={styles.menu}
79
+ items={grades}
80
+ onItemPress={(item) => model.tree.setGrade(item.key as number)}
81
+ />
82
+ </Dropdown>
83
+ </View>
84
+
85
+ <View style={styles.nextUp}>
86
+ <View style={styles.content}>
87
+ <View style={styles.subtitle}>
88
+ <Typography variant={HeadingVariants.H2} style={styles.dark}>
89
+ {t('pmProgress.nextUp')}
90
+ </Typography>
91
+ </View>
92
+ <View style={[styles.row, styles.tilted]}>
93
+ <Typography variant={HeadingVariants.H7} style={styles.muted}>
94
+ {nextUp?.title}
95
+ </Typography>
96
+ <View style={styles.diamond}>
97
+ <SliceDiamondIcon color={nextUp?.color} />
98
+ </View>
99
+ </View>
100
+ </View>
101
+ <View style={styles.arrow}>
102
+ <SketchArrowRight />
103
+ </View>
104
+ <Button
105
+ onPress={async () => {
106
+ const skill = await model.solving.start({ type: SolvingFlow.MAGMA })
107
+
108
+ // @ts-ignore
109
+ onStartPress?.(skill)
110
+ }}
111
+ icon={<PlayIcon size={16} color={COLORS.NEUTRAL_1} />}
112
+ variant={ButtonVariant.PRIMARY}
113
+ size={ButtonSize.LARGE}
114
+ colorScheme={ButtonColor.YELLOW}
115
+ raiseLevel={6}
116
+ style={{ container: styles.startButton }}
117
+ >
118
+ <Typography variant={HeadingVariants.H6} style={styles.startButtonText}>
119
+ {t('pmProgress.startButton')}
120
+ </Typography>
121
+ </Button>
122
+ </View>
123
+ </View>
124
+ )
125
+ }
126
+
127
+ const styles = StyleSheet.create({
128
+ container: {
129
+ flexDirection: 'row',
130
+ justifyContent: 'space-between',
131
+ alignItems: 'center',
132
+ marginBottom: SPACING[400],
133
+ },
134
+ title: {
135
+ flexDirection: 'row',
136
+ alignItems: 'center',
137
+ gap: SPACING[200],
138
+ },
139
+ dark: {
140
+ color: COLORS.NEUTRAL_9,
141
+ },
142
+ caret: {
143
+ marginLeft: SPACING[100],
144
+ },
145
+ menu: {
146
+ top: SPACING[100],
147
+ minWidth: 110,
148
+ },
149
+ nextUp: {
150
+ flexDirection: 'row',
151
+ alignItems: 'center',
152
+ gap: SPACING[400],
153
+ },
154
+ content: {
155
+ alignItems: 'center',
156
+ gap: SPACING[100],
157
+ },
158
+ subtitle: {
159
+ transform: [{ rotate: '355deg' }],
160
+ marginRight: SPACING[300],
161
+ },
162
+ tilted: {
163
+ transform: [{ rotate: '355deg' }],
164
+ },
165
+ row: {
166
+ flexDirection: 'row',
167
+ gap: SPACING[100],
168
+ },
169
+ muted: {
170
+ color: COLORS.NEUTRAL_8,
171
+ },
172
+ diamond: {
173
+ bottom: 10,
174
+ transform: [{ rotate: '5deg' }],
175
+ },
176
+ arrow: {
177
+ transform: [{ rotate: '358deg' }],
178
+ },
179
+ startButton: {
180
+ minWidth: 145,
181
+ },
182
+ startButtonText: {
183
+ fontWeight: '700',
184
+ textTransform: 'uppercase',
185
+ color: COLORS.NEUTRAL_1,
186
+ },
187
+ })
@@ -0,0 +1,60 @@
1
+ import React, { useMemo, useState } from 'react'
2
+ import { LayoutChangeEvent, StyleSheet, View } from 'react-native'
3
+ import { BORDER_RADIUS, COLORS, SPACING } from '@magmamath/react-native-ui'
4
+ import { useStoreMap } from 'effector-react'
5
+ import { PracticeProgressPieChart } from '../chart/components/PracticeProgressPieChart'
6
+ import { PmTimeframeStats } from './PmTimeframeStats'
7
+ import { usePmProgress } from '../../context/PmProgressContext'
8
+ import { createChartConfig } from '../../shared/pmProgress.helpers'
9
+ import { STATS_MAX_HEIGHT } from '../../shared/pmProgress.constants'
10
+
11
+ export const PmInsights = () => {
12
+ const { model } = usePmProgress()
13
+ const [chartSize, setChartSize] = useState(0)
14
+ const chartData = useStoreMap(model.tree.$domains, (domains) =>
15
+ domains.map((domain) => ({
16
+ value: 1,
17
+ fillPercent: Math.round(domain.scorePercentage),
18
+ fillColor: domain.color,
19
+ borderColor: domain.borderColor,
20
+ backgroundColor: domain.backgroundColor,
21
+ })),
22
+ )
23
+
24
+ const chartConfig = useMemo(() => {
25
+ const size = Math.max(0, chartSize - SPACING[400])
26
+ return createChartConfig(size)
27
+ }, [chartSize])
28
+
29
+ const measureLayout = (event: LayoutChangeEvent) => {
30
+ const height = event.nativeEvent.layout.height
31
+ const size = height - STATS_MAX_HEIGHT - SPACING[800]
32
+ setChartSize(size)
33
+ }
34
+
35
+ if (!chartData) return null
36
+
37
+ return (
38
+ <View style={styles.container} onLayout={measureLayout}>
39
+ <View style={[styles.chart, { width: chartSize, height: chartSize }]}>
40
+ <PracticeProgressPieChart data={chartData} config={chartConfig} />
41
+ </View>
42
+ <PmTimeframeStats />
43
+ </View>
44
+ )
45
+ }
46
+
47
+ const styles = StyleSheet.create({
48
+ container: {
49
+ height: '100%',
50
+ },
51
+ chart: {
52
+ alignItems: 'center',
53
+ justifyContent: 'center',
54
+ backgroundColor: COLORS.NEUTRAL_1,
55
+ borderRadius: BORDER_RADIUS[250],
56
+ padding: SPACING[400],
57
+ marginBottom: SPACING[400],
58
+ marginTop: SPACING[400],
59
+ },
60
+ })
@@ -0,0 +1,85 @@
1
+ import React from 'react'
2
+ import { StyleSheet, View } from 'react-native'
3
+ import {
4
+ COLORS,
5
+ SelectGroup,
6
+ SelectOptionColor,
7
+ SelectOptionProps,
8
+ SPACING,
9
+ } from '@magmamath/react-native-ui'
10
+ import { StatsCard } from './StatsCard'
11
+ import { StarIcon } from '../../../../shared/icons/StarIcon'
12
+ import { TimerIcon } from '../../../../shared/icons/TimerIcon'
13
+ import { BORDER_RADIUS } from '@magmamath/react-native-ui'
14
+ import { useText } from '../../../../shared/translation'
15
+ import { useUnit } from 'effector-react'
16
+ import { formatTime } from '../../shared/pmProgress.helpers'
17
+ import { InsightsTimeframe, STATS_MAX_HEIGHT } from '../../shared/pmProgress.constants'
18
+ import { usePmProgress } from '../../context/PmProgressContext'
19
+
20
+ export const PmTimeframeStats = () => {
21
+ const t = useText()
22
+ const { model } = usePmProgress()
23
+ const timeframe = useUnit(model.insights.$timeframe)
24
+ const insights = useUnit(model.insights.$insights)
25
+
26
+ const OPTIONS: SelectOptionProps[] = [
27
+ { key: InsightsTimeframe.WEEK, title: t('pmProgress.thisWeek') },
28
+ { key: InsightsTimeframe.LAST_WEEK, title: t('pmProgress.lastWeek') },
29
+ { key: InsightsTimeframe.ALL, title: t('pmProgress.allTime') },
30
+ ]
31
+
32
+ if (!insights) return null
33
+
34
+ return (
35
+ <View style={styles.container}>
36
+ <View style={styles.content}>
37
+ <View style={styles.cards}>
38
+ <StatsCard
39
+ value={insights.numberOfStars}
40
+ label={t('pmProgress.stars')}
41
+ color={COLORS.PRIMARY_YELLOW}
42
+ icon={<StarIcon />}
43
+ />
44
+ <StatsCard
45
+ value={formatTime(insights.timeInPracticeMs)}
46
+ label={t('pmProgress.time')}
47
+ color={COLORS.PRIMARY_PURPLE}
48
+ icon={<TimerIcon />}
49
+ />
50
+ </View>
51
+
52
+ <SelectGroup
53
+ color={SelectOptionColor.GREY}
54
+ options={OPTIONS}
55
+ selectedOptions={OPTIONS.filter(({ key }) => key === timeframe)}
56
+ onOptionChange={({ key }) => model.insights.setTimeframe(key as InsightsTimeframe)}
57
+ />
58
+ </View>
59
+ </View>
60
+ )
61
+ }
62
+
63
+ const styles = StyleSheet.create({
64
+ container: {
65
+ maxHeight: STATS_MAX_HEIGHT,
66
+ height: '100%',
67
+ padding: SPACING[200],
68
+ backgroundColor: COLORS.NEUTRAL_1,
69
+ borderRadius: BORDER_RADIUS[300],
70
+ shadowColor: COLORS.NEUTRAL_9,
71
+ shadowOffset: { width: 0, height: 1 },
72
+ shadowOpacity: 0.1,
73
+ shadowRadius: 3,
74
+ elevation: 2,
75
+ },
76
+ content: {
77
+ gap: SPACING[100],
78
+ marginBottom: 4,
79
+ },
80
+ cards: {
81
+ flexDirection: 'row',
82
+ justifyContent: 'space-between',
83
+ gap: SPACING[300],
84
+ },
85
+ })
@@ -0,0 +1,53 @@
1
+ import React, { ReactNode } from 'react'
2
+ import { View, StyleSheet, Text, Platform } from 'react-native'
3
+ import { COLORS, FONT_FAMILY } from '@magmamath/react-native-ui'
4
+
5
+ type StatsCardProps = {
6
+ value: number | string
7
+ label: string
8
+ color: string
9
+ icon: ReactNode
10
+ }
11
+
12
+ export const StatsCard = ({ value, label, color, icon }: StatsCardProps) => {
13
+ return (
14
+ <View style={[styles.card, { borderColor: color }]}>
15
+ <View style={[styles.iconContainer, { backgroundColor: color }]}>{icon}</View>
16
+ <View>
17
+ <Text style={[styles.value, { color }]}>{value}</Text>
18
+ <Text style={styles.label}>{label}</Text>
19
+ </View>
20
+ </View>
21
+ )
22
+ }
23
+
24
+ const styles = StyleSheet.create({
25
+ card: {
26
+ flex: 1,
27
+ height: 65,
28
+ alignItems: 'center',
29
+ flexDirection: 'row',
30
+ borderRadius: 12,
31
+ borderWidth: 4,
32
+ padding: 8,
33
+ gap: 8,
34
+ },
35
+ iconContainer: {
36
+ width: 42,
37
+ height: 42,
38
+ alignItems: 'center',
39
+ justifyContent: 'center',
40
+ borderRadius: 100,
41
+ },
42
+ value: {
43
+ fontSize: 32,
44
+ fontWeight: '700',
45
+ fontFamily: FONT_FAMILY.buenosAires,
46
+ },
47
+ label: {
48
+ color: COLORS.NEUTRAL_8,
49
+ fontSize: 12,
50
+ fontFamily: FONT_FAMILY.buenosAires,
51
+ top: -6,
52
+ },
53
+ })