@cuemath/leap 3.5.30-as8 → 3.5.30-gg2

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 (266) hide show
  1. package/dist/assets/illustrations/illustrations.js +0 -11
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/images/images.js +0 -8
  4. package/dist/assets/images/images.js.map +1 -1
  5. package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.js +3 -3
  6. package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.js.map +1 -1
  7. package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js +32 -16
  8. package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js.map +1 -1
  9. package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +87 -88
  10. package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
  11. package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component-styled.js.map +1 -0
  12. package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.js +26 -0
  13. package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.js.map +1 -0
  14. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +35 -35
  15. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
  16. package/dist/features/stickers/hooks/use-handle-sticker-send/use-handle-sticker-send.js +1 -0
  17. package/dist/features/stickers/hooks/use-handle-sticker-send/use-handle-sticker-send.js.map +1 -1
  18. package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +1 -1
  19. package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +11 -11
  20. package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +1 -1
  21. package/dist/features/worksheet/user-pointer-pin/hooks/use-user-location.js +21 -20
  22. package/dist/features/worksheet/user-pointer-pin/hooks/use-user-location.js.map +1 -1
  23. package/dist/features/worksheet/user-pointer-pin/user-pin.js +37 -35
  24. package/dist/features/worksheet/user-pointer-pin/user-pin.js.map +1 -1
  25. package/dist/features/worksheet/worksheet/hooks/use-active-question-observer.js +59 -0
  26. package/dist/features/worksheet/worksheet/hooks/use-active-question-observer.js.map +1 -0
  27. package/dist/features/worksheet/worksheet/hooks/use-create-imperative-handle.js +132 -132
  28. package/dist/features/worksheet/worksheet/hooks/use-create-imperative-handle.js.map +1 -1
  29. package/dist/features/worksheet/worksheet/hooks/use-time-on-questions.js +24 -19
  30. package/dist/features/worksheet/worksheet/hooks/use-time-on-questions.js.map +1 -1
  31. package/dist/features/worksheet/worksheet/hooks/use-worksheet-store.js +13 -0
  32. package/dist/features/worksheet/worksheet/hooks/use-worksheet-store.js.map +1 -0
  33. package/dist/features/worksheet/worksheet/question-tips.js +48 -47
  34. package/dist/features/worksheet/worksheet/question-tips.js.map +1 -1
  35. package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js +88 -132
  36. package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js.map +1 -1
  37. package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker-view.js +68 -0
  38. package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker-view.js.map +1 -0
  39. package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker.js +44 -55
  40. package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker.js.map +1 -1
  41. package/dist/features/worksheet/worksheet/worksheet-calculator/worksheet-calculator.js +17 -0
  42. package/dist/features/worksheet/worksheet/worksheet-calculator/worksheet-calculator.js.map +1 -0
  43. package/dist/features/worksheet/worksheet/worksheet-helpers.js +109 -112
  44. package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
  45. package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-navigation/worksheet-item-navigation.js +25 -27
  46. package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-navigation/worksheet-item-navigation.js.map +1 -1
  47. package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-number/worksheet-item-number.js +47 -47
  48. package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-number/worksheet-item-number.js.map +1 -1
  49. package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-navigation.js +66 -64
  50. package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-navigation.js.map +1 -1
  51. package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-section-navigation/worksheet-section-navigation.js +38 -40
  52. package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-section-navigation/worksheet-section-navigation.js.map +1 -1
  53. package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner-styled.js +20 -0
  54. package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner-styled.js.map +1 -0
  55. package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner.js +49 -0
  56. package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner.js.map +1 -0
  57. package/dist/features/worksheet/worksheet/worksheet-permissions/error.js.map +1 -1
  58. package/dist/features/worksheet/worksheet/worksheet-provider.js +20 -0
  59. package/dist/features/worksheet/worksheet/worksheet-provider.js.map +1 -0
  60. package/dist/features/worksheet/worksheet/worksheet-question/header/header.js +73 -71
  61. package/dist/features/worksheet/worksheet/worksheet-question/header/header.js.map +1 -1
  62. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +61 -59
  63. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
  64. package/dist/features/worksheet/worksheet/worksheet-question/subjective-review.js +21 -18
  65. package/dist/features/worksheet/worksheet/worksheet-question/subjective-review.js.map +1 -1
  66. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +269 -272
  67. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
  68. package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions-styled.js +16 -0
  69. package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions-styled.js.map +1 -0
  70. package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions.js +73 -0
  71. package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions.js.map +1 -0
  72. package/dist/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.js +32 -31
  73. package/dist/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.js.map +1 -1
  74. package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js +147 -149
  75. package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js.map +1 -1
  76. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +212 -223
  77. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
  78. package/dist/features/worksheet/worksheet/worksheet-questions-summary/worksheet-questions-summary.js +22 -20
  79. package/dist/features/worksheet/worksheet/worksheet-questions-summary/worksheet-questions-summary.js.map +1 -1
  80. package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js +57 -55
  81. package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js.map +1 -1
  82. package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js +47 -42
  83. package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js.map +1 -1
  84. package/dist/features/worksheet/worksheet/worksheet-store.js +293 -0
  85. package/dist/features/worksheet/worksheet/worksheet-store.js.map +1 -0
  86. package/dist/features/worksheet/worksheet/worksheet-styled.js +24 -34
  87. package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
  88. package/dist/features/worksheet/worksheet/worksheet-summary/worksheet-summary.js +16 -12
  89. package/dist/features/worksheet/worksheet/worksheet-summary/worksheet-summary.js.map +1 -1
  90. package/dist/features/worksheet/worksheet/worksheet-summary-controller/worksheet-summary-controller.js +8 -7
  91. package/dist/features/worksheet/worksheet/worksheet-summary-controller/worksheet-summary-controller.js.map +1 -1
  92. package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
  93. package/dist/features/worksheet/worksheet/worksheet-view.js +141 -0
  94. package/dist/features/worksheet/worksheet/worksheet-view.js.map +1 -0
  95. package/dist/features/worksheet/worksheet/worksheet.js +203 -441
  96. package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
  97. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
  98. package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js +1 -1
  99. package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js.map +1 -1
  100. package/dist/index.d.ts +26 -271
  101. package/dist/index.js +451 -465
  102. package/dist/index.js.map +1 -1
  103. package/dist/node_modules/zustand/esm/middleware.js +196 -0
  104. package/dist/node_modules/zustand/esm/middleware.js.map +1 -0
  105. package/dist/node_modules/zustand/esm/react/shallow.js +13 -0
  106. package/dist/node_modules/zustand/esm/react/shallow.js.map +1 -0
  107. package/dist/node_modules/zustand/esm/vanilla/shallow.js +31 -0
  108. package/dist/node_modules/zustand/esm/vanilla/shallow.js.map +1 -0
  109. package/package.json +3 -2
  110. package/dist/assets/line-icons/icons/carat-right.js +0 -26
  111. package/dist/assets/line-icons/icons/carat-right.js.map +0 -1
  112. package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js +0 -13
  113. package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js.map +0 -1
  114. package/dist/features/timeline/monthly-report/comps/achievements/achievements.js +0 -60
  115. package/dist/features/timeline/monthly-report/comps/achievements/achievements.js.map +0 -1
  116. package/dist/features/timeline/monthly-report/comps/achievements/achievements.styled.js +0 -15
  117. package/dist/features/timeline/monthly-report/comps/achievements/achievements.styled.js.map +0 -1
  118. package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.js +0 -128
  119. package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.js.map +0 -1
  120. package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.styled.js +0 -53
  121. package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.styled.js.map +0 -1
  122. package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js +0 -120
  123. package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js.map +0 -1
  124. package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.js +0 -58
  125. package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.js.map +0 -1
  126. package/dist/features/timeline/monthly-report/comps/activities/activities.js +0 -27
  127. package/dist/features/timeline/monthly-report/comps/activities/activities.js.map +0 -1
  128. package/dist/features/timeline/monthly-report/comps/activities/constants.js +0 -95
  129. package/dist/features/timeline/monthly-report/comps/activities/constants.js.map +0 -1
  130. package/dist/features/timeline/monthly-report/comps/activities/utils.js +0 -15
  131. package/dist/features/timeline/monthly-report/comps/activities/utils.js.map +0 -1
  132. package/dist/features/timeline/monthly-report/comps/attendance/attendance-constants.js +0 -29
  133. package/dist/features/timeline/monthly-report/comps/attendance/attendance-constants.js.map +0 -1
  134. package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js +0 -94
  135. package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js.map +0 -1
  136. package/dist/features/timeline/monthly-report/comps/attendance/attendance.js +0 -44
  137. package/dist/features/timeline/monthly-report/comps/attendance/attendance.js.map +0 -1
  138. package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js +0 -39
  139. package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js.map +0 -1
  140. package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js +0 -52
  141. package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js.map +0 -1
  142. package/dist/features/timeline/monthly-report/comps/feedback/feedback-styled.js +0 -9
  143. package/dist/features/timeline/monthly-report/comps/feedback/feedback-styled.js.map +0 -1
  144. package/dist/features/timeline/monthly-report/comps/feedback/feedback.js +0 -94
  145. package/dist/features/timeline/monthly-report/comps/feedback/feedback.js.map +0 -1
  146. package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js +0 -48
  147. package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js.map +0 -1
  148. package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card-styled.js +0 -28
  149. package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card-styled.js.map +0 -1
  150. package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js +0 -113
  151. package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js.map +0 -1
  152. package/dist/features/timeline/monthly-report/comps/goals/goals-constants.js +0 -30
  153. package/dist/features/timeline/monthly-report/comps/goals/goals-constants.js.map +0 -1
  154. package/dist/features/timeline/monthly-report/comps/goals/goals.js +0 -22
  155. package/dist/features/timeline/monthly-report/comps/goals/goals.js.map +0 -1
  156. package/dist/features/timeline/monthly-report/monthly-report-styled.js +0 -14
  157. package/dist/features/timeline/monthly-report/monthly-report-styled.js.map +0 -1
  158. package/dist/features/timeline/monthly-report/monthly-report-types.js +0 -5
  159. package/dist/features/timeline/monthly-report/monthly-report-types.js.map +0 -1
  160. package/dist/features/timeline/monthly-report/monthly-report.js +0 -69
  161. package/dist/features/timeline/monthly-report/monthly-report.js.map +0 -1
  162. package/dist/features/timeline/monthly-timeline/api/use-monthly-timeline-get.js +0 -10
  163. package/dist/features/timeline/monthly-timeline/api/use-monthly-timeline-get.js.map +0 -1
  164. package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js +0 -87
  165. package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js.map +0 -1
  166. package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.styled.js +0 -9
  167. package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.styled.js.map +0 -1
  168. package/dist/features/timeline/monthly-timeline/constants.js +0 -41
  169. package/dist/features/timeline/monthly-timeline/constants.js.map +0 -1
  170. package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js +0 -9
  171. package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js.map +0 -1
  172. package/dist/features/timeline/monthly-timeline/monthly-timeline-types.js +0 -6
  173. package/dist/features/timeline/monthly-timeline/monthly-timeline-types.js.map +0 -1
  174. package/dist/features/timeline/monthly-timeline/monthly-timeline-view.js +0 -28
  175. package/dist/features/timeline/monthly-timeline/monthly-timeline-view.js.map +0 -1
  176. package/dist/features/timeline/monthly-timeline/monthly-timeline.js +0 -56
  177. package/dist/features/timeline/monthly-timeline/monthly-timeline.js.map +0 -1
  178. package/dist/features/timeline/ptm-report/api/use-ptm-report-get.js +0 -9
  179. package/dist/features/timeline/ptm-report/api/use-ptm-report-get.js.map +0 -1
  180. package/dist/features/timeline/ptm-report/comps/key-need/key-need-styled.js +0 -9
  181. package/dist/features/timeline/ptm-report/comps/key-need/key-need-styled.js.map +0 -1
  182. package/dist/features/timeline/ptm-report/comps/key-need/key-need.js +0 -35
  183. package/dist/features/timeline/ptm-report/comps/key-need/key-need.js.map +0 -1
  184. package/dist/features/timeline/ptm-report/comps/parent-support/parent-support.js +0 -53
  185. package/dist/features/timeline/ptm-report/comps/parent-support/parent-support.js.map +0 -1
  186. package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects-styled.js +0 -19
  187. package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects-styled.js.map +0 -1
  188. package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects.js +0 -50
  189. package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects.js.map +0 -1
  190. package/dist/features/timeline/ptm-report/comps/report-card/report-card-styled.js +0 -9
  191. package/dist/features/timeline/ptm-report/comps/report-card/report-card-styled.js.map +0 -1
  192. package/dist/features/timeline/ptm-report/comps/report-card/report-card.js +0 -22
  193. package/dist/features/timeline/ptm-report/comps/report-card/report-card.js.map +0 -1
  194. package/dist/features/timeline/ptm-report/comps/school-support/school-support-styled.js +0 -9
  195. package/dist/features/timeline/ptm-report/comps/school-support/school-support-styled.js.map +0 -1
  196. package/dist/features/timeline/ptm-report/comps/school-support/school-support.js +0 -84
  197. package/dist/features/timeline/ptm-report/comps/school-support/school-support.js.map +0 -1
  198. package/dist/features/timeline/ptm-report/comps/strategies/strategies-constant.js +0 -11
  199. package/dist/features/timeline/ptm-report/comps/strategies/strategies-constant.js.map +0 -1
  200. package/dist/features/timeline/ptm-report/comps/strategies/strategies.js +0 -36
  201. package/dist/features/timeline/ptm-report/comps/strategies/strategies.js.map +0 -1
  202. package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card-styled.js +0 -55
  203. package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card-styled.js.map +0 -1
  204. package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card.js +0 -35
  205. package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card.js.map +0 -1
  206. package/dist/features/timeline/ptm-report/comps/student-info/student-info-styled.js +0 -21
  207. package/dist/features/timeline/ptm-report/comps/student-info/student-info-styled.js.map +0 -1
  208. package/dist/features/timeline/ptm-report/comps/student-info/student-info.js +0 -21
  209. package/dist/features/timeline/ptm-report/comps/student-info/student-info.js.map +0 -1
  210. package/dist/features/timeline/ptm-report/comps/support-card/support-card-styled.js +0 -9
  211. package/dist/features/timeline/ptm-report/comps/support-card/support-card-styled.js.map +0 -1
  212. package/dist/features/timeline/ptm-report/comps/support-card/support-card.js +0 -30
  213. package/dist/features/timeline/ptm-report/comps/support-card/support-card.js.map +0 -1
  214. package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations-constant.js +0 -9
  215. package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations-constant.js.map +0 -1
  216. package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations.js +0 -56
  217. package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations.js.map +0 -1
  218. package/dist/features/timeline/ptm-report/comps/upcoming-chapters/upcoming-chapters.js +0 -15
  219. package/dist/features/timeline/ptm-report/comps/upcoming-chapters/upcoming-chapters.js.map +0 -1
  220. package/dist/features/timeline/ptm-report/ptm-report-constants.js +0 -16
  221. package/dist/features/timeline/ptm-report/ptm-report-constants.js.map +0 -1
  222. package/dist/features/timeline/ptm-report/ptm-report-helpers.js +0 -8
  223. package/dist/features/timeline/ptm-report/ptm-report-helpers.js.map +0 -1
  224. package/dist/features/timeline/ptm-report/ptm-report-styled.js +0 -11
  225. package/dist/features/timeline/ptm-report/ptm-report-styled.js.map +0 -1
  226. package/dist/features/timeline/ptm-report/ptm-report-types.js +0 -5
  227. package/dist/features/timeline/ptm-report/ptm-report-types.js.map +0 -1
  228. package/dist/features/timeline/ptm-report/ptm-report.js +0 -113
  229. package/dist/features/timeline/ptm-report/ptm-report.js.map +0 -1
  230. package/dist/features/timeline/timeline-tabs/timeline-tabs-types.js +0 -5
  231. package/dist/features/timeline/timeline-tabs/timeline-tabs-types.js.map +0 -1
  232. package/dist/features/timeline/timeline-tabs/timeline-tabs.js +0 -41
  233. package/dist/features/timeline/timeline-tabs/timeline-tabs.js.map +0 -1
  234. package/dist/features/timeline/timeline-tabs/timeline-tabs.styled.js +0 -37
  235. package/dist/features/timeline/timeline-tabs/timeline-tabs.styled.js.map +0 -1
  236. package/dist/features/ui/swipable-carousel/swipable-carousel-styled.js +0 -57
  237. package/dist/features/ui/swipable-carousel/swipable-carousel-styled.js.map +0 -1
  238. package/dist/features/ui/swipable-carousel/swipable-carousel.js +0 -132
  239. package/dist/features/ui/swipable-carousel/swipable-carousel.js.map +0 -1
  240. package/dist/features/ui/swipeable-component/swipeable-component-styled.js.map +0 -1
  241. package/dist/features/ui/swipeable-component/swipeable-component.js +0 -27
  242. package/dist/features/ui/swipeable-component/swipeable-component.js.map +0 -1
  243. package/dist/features/worksheet/worksheet/hooks/use-get-active-question-id.js +0 -62
  244. package/dist/features/worksheet/worksheet/hooks/use-get-active-question-id.js.map +0 -1
  245. package/dist/features/worksheet/worksheet/worksheet-container.js +0 -87
  246. package/dist/features/worksheet/worksheet/worksheet-container.js.map +0 -1
  247. package/dist/static/2021.0683b580.png +0 -0
  248. package/dist/static/2022.d34ad7a5.png +0 -0
  249. package/dist/static/2023.fce87149.png +0 -0
  250. package/dist/static/2024.a275ee85.png +0 -0
  251. package/dist/static/2025.677cc187.png +0 -0
  252. package/dist/static/2026.63763214.png +0 -0
  253. package/dist/static/2027.b82dc039.png +0 -0
  254. package/dist/static/2028.580b8cc0.png +0 -0
  255. package/dist/static/coding-report-icon.91a1e900.svg +0 -1
  256. package/dist/static/elp-icon.d45b457d.svg +0 -1
  257. package/dist/static/english-icon.50c2e005.svg +0 -1
  258. package/dist/static/full-report.00112c74.svg +0 -1
  259. package/dist/static/math-fit-grey.c32f37b3.svg +0 -1
  260. package/dist/static/no-report.4158fad3.svg +0 -1
  261. package/dist/static/ptm-report-icon.5089218f.svg +0 -1
  262. package/dist/static/sat-report-icon.4331be86.svg +0 -1
  263. package/dist/static/science-report-icon.a0014c40.svg +0 -1
  264. package/dist/static/thumps-down.a1192a62.svg +0 -1
  265. package/dist/static/thumps-up.caa35a98.svg +0 -1
  266. /package/dist/features/{ui/swipeable-component → circle-games/game-launcher/comps/swipable-component}/swipeable-component-styled.js +0 -0
@@ -0,0 +1,26 @@
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import { memo as T, useRef as l, useCallback as o } from "react";
3
+ import { SwipeableWrapper as X } from "./swipeable-component-styled.js";
4
+ const C = T(
5
+ ({ onSwipeLeft: t, onSwipeRight: a, minSwipeDistance: e = 50, children: m }) => {
6
+ const s = l(0), n = l(0), u = o(() => {
7
+ const r = s.current - n.current;
8
+ Math.abs(r) < e || (r > 0 ? t == null || t() : a == null || a());
9
+ }, [e, t, a]), d = o((r) => {
10
+ var c;
11
+ s.current = ((c = r.changedTouches[0]) == null ? void 0 : c.clientX) || 0;
12
+ }, []), b = o(
13
+ (r) => {
14
+ var c;
15
+ n.current = ((c = r.changedTouches[0]) == null ? void 0 : c.clientX) || 0, u();
16
+ },
17
+ [u]
18
+ );
19
+ return /* @__PURE__ */ h(X, { onTouchStart: d, onTouchEnd: b, children: m });
20
+ }
21
+ );
22
+ C.displayName = "SwipeableComponent";
23
+ export {
24
+ C as default
25
+ };
26
+ //# sourceMappingURL=swipeable-component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swipeable-component.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.tsx"],"sourcesContent":["import { useRef, useCallback, memo } from 'react';\n\nimport * as Styled from './swipeable-component-styled';\nimport { type ISwipeableComponentProps } from './swipeable-component-types';\n\nconst SwipeableComponent: React.FC<ISwipeableComponentProps> = memo(\n ({ onSwipeLeft, onSwipeRight, minSwipeDistance = 50, children }) => {\n const touchStartX = useRef(0);\n const touchEndX = useRef(0);\n\n const handleSwipe = useCallback(() => {\n const distance = touchStartX.current - touchEndX.current;\n\n if (Math.abs(distance) < minSwipeDistance) return;\n\n if (distance > 0) {\n onSwipeLeft?.();\n } else {\n onSwipeRight?.();\n }\n }, [minSwipeDistance, onSwipeLeft, onSwipeRight]);\n\n const onTouchStart = useCallback((e: React.TouchEvent) => {\n touchStartX.current = e.changedTouches[0]?.clientX || 0;\n }, []);\n\n const onTouchEnd = useCallback(\n (e: React.TouchEvent) => {\n touchEndX.current = e.changedTouches[0]?.clientX || 0;\n handleSwipe();\n },\n [handleSwipe],\n );\n\n return (\n <Styled.SwipeableWrapper onTouchStart={onTouchStart} onTouchEnd={onTouchEnd}>\n {children}\n </Styled.SwipeableWrapper>\n );\n },\n);\n\nSwipeableComponent.displayName = 'SwipeableComponent';\n\nexport default SwipeableComponent;\n"],"names":["SwipeableComponent","memo","onSwipeLeft","onSwipeRight","minSwipeDistance","children","touchStartX","useRef","touchEndX","handleSwipe","useCallback","distance","onTouchStart","e","_a","onTouchEnd","Styled.SwipeableWrapper"],"mappings":";;;AAKA,MAAMA,IAAyDC;AAAA,EAC7D,CAAC,EAAE,aAAAC,GAAa,cAAAC,GAAc,kBAAAC,IAAmB,IAAI,UAAAC,QAAe;AAC5D,UAAAC,IAAcC,EAAO,CAAC,GACtBC,IAAYD,EAAO,CAAC,GAEpBE,IAAcC,EAAY,MAAM;AAC9B,YAAAC,IAAWL,EAAY,UAAUE,EAAU;AAEjD,MAAI,KAAK,IAAIG,CAAQ,IAAIP,MAErBO,IAAW,IACCT,KAAA,QAAAA,MAECC,KAAA,QAAAA;AAAA,IAEhB,GAAA,CAACC,GAAkBF,GAAaC,CAAY,CAAC,GAE1CS,IAAeF,EAAY,CAACG,MAAwB;;AACxD,MAAAP,EAAY,YAAUQ,IAAAD,EAAE,eAAe,CAAC,MAAlB,gBAAAC,EAAqB,YAAW;AAAA,IACxD,GAAG,CAAE,CAAA,GAECC,IAAaL;AAAA,MACjB,CAACG,MAAwB;;AACvB,QAAAL,EAAU,YAAUM,IAAAD,EAAE,eAAe,CAAC,MAAlB,gBAAAC,EAAqB,YAAW,GACxCL;MACd;AAAA,MACA,CAACA,CAAW;AAAA,IAAA;AAGd,6BACGO,GAAA,EAAwB,cAAAJ,GAA4B,YAAAG,GAClD,UAAAV,EACH,CAAA;AAAA,EAEJ;AACF;AAEAL,EAAmB,cAAc;"}
@@ -1,4 +1,4 @@
1
- import { jsx as n } from "react/jsx-runtime";
1
+ import { jsx as i } from "react/jsx-runtime";
2
2
  import { useRef as N, useCallback as f, useMemo as J, useEffect as X } from "react";
3
3
  import { useTheme as $ } from "styled-components";
4
4
  import { PLATFORM_EVENTS_STUDENT as B } from "../../../../analytics-events/platform-events-student.js";
@@ -9,35 +9,35 @@ import A from "../../../../ui/text/text.js";
9
9
  import { EDeviceType as Q } from "../../../../ui/theme/constants.js";
10
10
  import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as S } from "../../../enum/circle-onboarding-steps.js";
11
11
  import { CircularGameCard as D } from "../../comps/circular-game-card/circular-game-card.js";
12
- import j from "../../../../ui/swipeable-component/swipeable-component.js";
12
+ import j from "../../comps/swipable-component/swipeable-component.js";
13
13
  import { SHOW_NUDGE_AFTER_MS as V, SLIDE_TO_LESSON_MS as ee } from "./constants.js";
14
- import { SwipableArea as re } from "./use-game-launcher-journey-style.js";
15
- import { CarouselIndicator as te } from "../../comps/carousel/carousel-indicator/carousel-indicator.js";
16
- import { ProjectType as i } from "../../../games/web-view/enums/project-type-enum.js";
14
+ import { SwipableArea as te } from "./use-game-launcher-journey-style.js";
15
+ import { CarouselIndicator as re } from "../../comps/carousel/carousel-indicator/carousel-indicator.js";
16
+ import { ProjectType as n } from "../../../games/web-view/enums/project-type-enum.js";
17
17
  const Se = ({
18
18
  carouselRefs: o,
19
19
  onSegmentClick: d,
20
20
  onJourneyComplete: a
21
21
  }) => {
22
22
  const { device: W } = $(), l = W <= Q.TABLET, L = N([]), c = N(null), C = N(null), { nextCoachmark: u, setJourney: _, endJourney: h } = K(), { onEvent: p } = q(), E = f(
23
- (t) => {
23
+ (r) => {
24
24
  p(B.ONBOARDING_STEP_COMPLETED, {
25
- step: t
25
+ step: r
26
26
  });
27
27
  },
28
28
  [p]
29
29
  ), O = f(
30
- (t, e) => {
31
- d(t, i.PUZZLE), E(S.PUZZLE_ACTIVITY), h(e), a(e);
30
+ (r, e) => {
31
+ d(r, n.PUZZLE), E(S.PUZZLE_ACTIVITY), h(e), a(e);
32
32
  },
33
33
  [h, a, d, E]
34
34
  ), y = f(
35
- (t, e) => {
36
- d(t, i.LESSON), E(S.SKILL_ACTIVITY), h(e), a(e);
35
+ (r, e) => {
36
+ d(r, n.LESSON), E(S.SKILL_ACTIVITY), h(e), a(e);
37
37
  },
38
38
  [h, a, d, E]
39
39
  ), R = f(
40
- (t, e) => {
40
+ (r, e) => {
41
41
  var G, w, x, P, U, Y, Z, k, H, M, z;
42
42
  const T = (G = o.current) == null ? void 0 : G.indicatorRefs, s = ((x = (w = c.current) == null ? void 0 : w.circularCardWrapperRef.current) == null ? void 0 : x.getBoundingClientRect()) || {
43
43
  height: 0,
@@ -49,56 +49,56 @@ const Se = ({
49
49
  (P = e == null ? void 0 : e.games) != null && P.data.length && ((U = e == null ? void 0 : e.puzzles) != null && U.data.length) && g.push(
50
50
  {
51
51
  projectData: e.games.data[0],
52
- type: i.GAME
52
+ type: n.GAME
53
53
  },
54
54
  {
55
55
  projectData: e.puzzles.data[0],
56
- type: i.PUZZLE
56
+ type: n.PUZZLE
57
57
  }
58
58
  ), (Y = e == null ? void 0 : e.lessons) != null && Y.data.length && g.push(
59
- { projectData: e.lessons.data[0], type: i.LESSON },
60
- { projectData: e.lessons.data[1], type: i.LESSON }
59
+ { projectData: e.lessons.data[0], type: n.LESSON },
60
+ { projectData: e.lessons.data[1], type: n.LESSON }
61
61
  );
62
- const r = g[1];
62
+ const t = g[1];
63
63
  p(B.ONBOARDING_STEP_VIEWED, {
64
- step: ((Z = g[0]) == null ? void 0 : Z.type) === i.LESSON ? S.SKILL_ACTIVITY : S.GAMES_ACTIVITY
64
+ step: ((Z = g[0]) == null ? void 0 : Z.type) === n.LESSON ? S.SKILL_ACTIVITY : S.GAMES_ACTIVITY
65
65
  });
66
66
  const F = [
67
67
  l ? {
68
68
  originalElementToHighlightRef: c.current.circularCardWrapperRef,
69
69
  type: I.NUDGE,
70
- elementToHighlight: /* @__PURE__ */ n(
70
+ elementToHighlight: /* @__PURE__ */ i(
71
71
  j,
72
72
  {
73
73
  onSwipeLeft: () => {
74
74
  var m;
75
- (m = o.current) == null || m.goToIndex(1), u(t, !1, V);
75
+ (m = o.current) == null || m.goToIndex(1), u(r, !1, V);
76
76
  },
77
- children: /* @__PURE__ */ n(re, {})
77
+ children: /* @__PURE__ */ i(te, {})
78
78
  }
79
79
  ),
80
80
  indicator: {
81
81
  nudge: "swipe",
82
- content: /* @__PURE__ */ n(A, { $renderAs: "ab2-bold", children: "Swipe to explore" }),
82
+ content: /* @__PURE__ */ i(A, { $renderAs: "ab2-bold", children: "Swipe to explore" }),
83
83
  nudgePointerX: s.width / 2 - 30,
84
84
  nudgePointerY: s.height / 2
85
85
  }
86
86
  } : {
87
87
  originalElementToHighlightRef: T[1],
88
88
  type: I.NUDGE,
89
- elementToHighlight: /* @__PURE__ */ n(
90
- te,
89
+ elementToHighlight: /* @__PURE__ */ i(
90
+ re,
91
91
  {
92
92
  textToShowInsideIndicator: "2",
93
93
  onClick: () => {
94
94
  var m;
95
- (m = o.current) == null || m.goToIndex(1), u(t, !1, V);
95
+ (m = o.current) == null || m.goToIndex(1), u(r, !1, V);
96
96
  }
97
97
  }
98
98
  ),
99
99
  indicator: {
100
100
  nudge: "click",
101
- content: /* @__PURE__ */ n(A, { $renderAs: "ab1-bold", children: "Click to proceed" }),
101
+ content: /* @__PURE__ */ i(A, { $renderAs: "ab1-bold", children: "Click to proceed" }),
102
102
  nudgePointerX: 0,
103
103
  nudgePointerY: 0
104
104
  }
@@ -106,32 +106,32 @@ const Se = ({
106
106
  {
107
107
  originalElementToHighlightRef: C.current.circularCardWrapperRef,
108
108
  type: I.NUDGE,
109
- elementToHighlight: /* @__PURE__ */ n(
109
+ elementToHighlight: /* @__PURE__ */ i(
110
110
  D,
111
111
  {
112
112
  label: "",
113
113
  data: {
114
- card: ((k = r == null ? void 0 : r.projectData) == null ? void 0 : k.cardLottie) ?? "",
115
- name: ((H = r == null ? void 0 : r.projectData) == null ? void 0 : H.name) ?? "",
114
+ card: ((k = t == null ? void 0 : t.projectData) == null ? void 0 : k.cardLottie) ?? "",
115
+ name: ((H = t == null ? void 0 : t.projectData) == null ? void 0 : H.name) ?? "",
116
116
  isCompleted: !1,
117
- displayNameImage: (M = r == null ? void 0 : r.projectData) == null ? void 0 : M.displayNameImage,
117
+ displayNameImage: (M = t == null ? void 0 : t.projectData) == null ? void 0 : M.displayNameImage,
118
118
  onPress: () => {
119
- (r == null ? void 0 : r.type) === i.LESSON && y(r.projectData, t), (r == null ? void 0 : r.type) === i.PUZZLE && O(r.projectData, t);
119
+ (t == null ? void 0 : t.type) === n.LESSON && y(t.projectData, r), (t == null ? void 0 : t.type) === n.PUZZLE && O(t.projectData, r);
120
120
  }
121
121
  }
122
122
  }
123
123
  ),
124
124
  indicator: {
125
125
  nudge: "click",
126
- content: /* @__PURE__ */ n(A, { $renderAs: l ? "ab2-bold" : "ab1-bold", children: l ? "Tap to start" : " Click to start" }),
126
+ content: /* @__PURE__ */ i(A, { $renderAs: l ? "ab2-bold" : "ab1-bold", children: l ? "Tap to start" : " Click to start" }),
127
127
  nudgePointerX: l ? s.width / 2 : s.width / 1.3,
128
128
  nudgePointerY: l ? s.height / 2 : s.height / 1.3
129
129
  }
130
130
  }
131
131
  ];
132
- _(t, F), (z = o.current) == null || z.goToIndex(0);
132
+ _(r, F), (z = o.current) == null || z.goToIndex(0);
133
133
  const b = setTimeout(() => {
134
- clearTimeout(b), u(t);
134
+ clearTimeout(b), u(r);
135
135
  }, ee);
136
136
  L.current.push(b);
137
137
  },
@@ -153,7 +153,7 @@ const Se = ({
153
153
  [R]
154
154
  );
155
155
  return X(() => () => {
156
- L.current.forEach((t) => clearTimeout(t)), L.current = [];
156
+ L.current.forEach((r) => clearTimeout(r)), L.current = [];
157
157
  }, [o]), v;
158
158
  };
159
159
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport {\n PLATFORM_EVENTS_STUDENT as AnalyticsLabel,\n PLATFORM_EVENTS_STUDENT,\n} from '../../../../analytics-events/platform-events-student';\nimport { type JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../../../journey/use-journey/journey-context-types';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport { useUIContext } from '../../../../ui/context/context';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { CircularGameCard } from '../../comps/circular-game-card/circular-game-card';\nimport { type ICircularGameCardRefs } from '../../comps/circular-game-card/circular-game-card-types';\nimport SwipeableCard from '../../../../ui/swipeable-component/swipeable-component';\nimport type {\n Lesson,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport { type IProjectData } from '../../game-launcher-types';\nimport { SHOW_NUDGE_AFTER_MS, SLIDE_TO_LESSON_MS } from './constants';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\nimport { SwipableArea } from './use-game-launcher-journey-style';\nimport { CarouselIndicator } from '../../comps/carousel/carousel-indicator/carousel-indicator';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = useTheme();\n const isCompact = device <= EDeviceType.TABLET;\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const firstCardRefs = useRef<ICircularGameCardRefs>(null);\n const secondCardRefs = useRef<ICircularGameCardRefs>(null);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (journeyId: JOURNEY_ID_STUDENT, projectData?: IProjectData) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n\n const launcherDims =\n firstCardRefs.current?.circularCardWrapperRef.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n // Exit early if required refs or data are missing\n if (paginationList?.length < 2 || !secondCardRefs.current || !firstCardRefs.current) {\n return;\n }\n\n // prepare journey projects based on the data available as\n // games and puzzles are not aviailbale for K-1\n const journeyProjectsData = [];\n\n if (projectData?.games?.data.length && projectData?.puzzles?.data.length) {\n journeyProjectsData.push(\n {\n projectData: projectData.games.data[0],\n type: ProjectType.GAME,\n },\n {\n projectData: projectData.puzzles.data[0],\n type: ProjectType.PUZZLE,\n },\n );\n }\n\n if (projectData?.lessons?.data.length) {\n journeyProjectsData.push(\n { projectData: projectData.lessons.data[0], type: ProjectType.LESSON },\n { projectData: projectData.lessons.data[1], type: ProjectType.LESSON },\n );\n }\n\n const secondProjectData = journeyProjectsData[1];\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step:\n journeyProjectsData[0]?.type === ProjectType.LESSON\n ? ActionEvent.SKILL_ACTIVITY\n : ActionEvent.GAMES_ACTIVITY,\n });\n\n const coachmarks: TCoachmarkJourneyProps[] = [\n isCompact\n ? {\n originalElementToHighlightRef: firstCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SwipeableCard\n onSwipeLeft={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n >\n <SwipableArea />\n </SwipeableCard>\n ),\n indicator: {\n nudge: 'swipe',\n content: <Text $renderAs=\"ab2-bold\">Swipe to explore</Text>,\n nudgePointerX: launcherDims.width / 2 - 30,\n nudgePointerY: launcherDims.height / 2,\n } as INudgeProps,\n }\n : {\n originalElementToHighlightRef: paginationList[1] as React.RefObject<HTMLDivElement>,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CarouselIndicator\n textToShowInsideIndicator=\"2\"\n onClick={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: <Text $renderAs=\"ab1-bold\">Click to proceed</Text>,\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n {\n originalElementToHighlightRef: secondCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CircularGameCard\n label=\"\"\n data={{\n card: secondProjectData?.projectData?.cardLottie ?? '',\n name: secondProjectData?.projectData?.name ?? '',\n isCompleted: false,\n displayNameImage: secondProjectData?.projectData?.displayNameImage,\n onPress: () => {\n if (secondProjectData?.type === ProjectType.LESSON) {\n handleEndJourneyForLesson(secondProjectData.projectData as Lesson, journeyId);\n }\n\n if (secondProjectData?.type === ProjectType.PUZZLE) {\n handleEndJourneyForPuzzle(secondProjectData.projectData as Puzzle, journeyId);\n }\n },\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs={isCompact ? 'ab2-bold' : 'ab1-bold'}>\n {isCompact ? 'Tap to start' : ' Click to start'}\n </Text>\n ),\n nudgePointerX: isCompact ? launcherDims.width / 2 : launcherDims.width / 1.3,\n nudgePointerY: isCompact ? launcherDims.height / 2 : launcherDims.height / 1.3,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, coachmarks);\n carouselRefs.current?.goToIndex(0);\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [\n carouselRefs,\n trackAnalytics,\n isCompact,\n setJourney,\n nextCoachmark,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n ],\n );\n\n const data = useMemo(\n () => ({\n firstCardRefs,\n secondCardRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","onJourneyComplete","device","useTheme","isCompact","EDeviceType","timerRefs","useRef","firstCardRefs","secondCardRefs","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventCompleted","useCallback","step","AnalyticsLabel","handleEndJourneyForPuzzle","puzzlesData","journeyId","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","projectData","paginationList","_a","launcherDims","_c","_b","journeyProjectsData","_d","_e","_f","secondProjectData","PLATFORM_EVENTS_STUDENT","_g","coachmarks","IndicatorType","jsx","SwipeableCard","SHOW_NUDGE_AFTER_MS","SwipableArea","Text","CarouselIndicator","CircularGameCard","_h","_i","_j","_k","delayBeforeStart","SLIDE_TO_LESSON_MS","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;AA8BO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,MAAWC,KACbC,IAAYF,KAAUG,EAAY,QAElCC,IAAYC,EAAwC,CAAA,CAAE,GAEtDC,IAAgBD,EAA8B,IAAI,GAClDE,IAAiBF,EAA8B,IAAI,GACnD,EAAE,eAAAG,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GACvD,EAAE,SAASC,EAAe,IAAIC,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AA,QACF;AAAA,MAAA;AAGF,MAAApB,EAAWW,GAAWmB,CAAU,IACnBY,IAAAtD,EAAA,YAAA,QAAAsD,EAAS,UAAU;AAC1B,YAAAC,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GAC7B5C,EAAcY,CAAS;AAAA,SACtBiC,EAAkB;AAEX,MAAAjD,EAAA,QAAQ,KAAKgD,CAAgB;AAAA,IACzC;AAAA,IACA;AAAA,MACEvD;AAAA,MACAe;AAAA,MACAV;AAAA,MACAO;AAAA,MACAD;AAAA,MACAe;AAAA,MACAL;AAAA,IACF;AAAA,EAAA,GAGIoC,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,eAAAjD;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAkB;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA+B,EAAU,MACD,MAAM;AACX,IAAApD,EAAU,QAAQ,QAAQ,CAASqD,MAAA,aAAaA,CAAK,CAAC,GACtDrD,EAAU,UAAU;EAAC,GAEtB,CAACP,CAAY,CAAC,GAEVyD;AACT;"}
1
+ {"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport {\n PLATFORM_EVENTS_STUDENT as AnalyticsLabel,\n PLATFORM_EVENTS_STUDENT,\n} from '../../../../analytics-events/platform-events-student';\nimport { type JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../../../journey/use-journey/journey-context-types';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport { useUIContext } from '../../../../ui/context/context';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { CircularGameCard } from '../../comps/circular-game-card/circular-game-card';\nimport { type ICircularGameCardRefs } from '../../comps/circular-game-card/circular-game-card-types';\nimport SwipeableCard from '../../comps/swipable-component/swipeable-component';\nimport type {\n Lesson,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport { type IProjectData } from '../../game-launcher-types';\nimport { SHOW_NUDGE_AFTER_MS, SLIDE_TO_LESSON_MS } from './constants';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\nimport { SwipableArea } from './use-game-launcher-journey-style';\nimport { CarouselIndicator } from '../../comps/carousel/carousel-indicator/carousel-indicator';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = useTheme();\n const isCompact = device <= EDeviceType.TABLET;\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const firstCardRefs = useRef<ICircularGameCardRefs>(null);\n const secondCardRefs = useRef<ICircularGameCardRefs>(null);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (journeyId: JOURNEY_ID_STUDENT, projectData?: IProjectData) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n\n const launcherDims =\n firstCardRefs.current?.circularCardWrapperRef.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n // Exit early if required refs or data are missing\n if (paginationList?.length < 2 || !secondCardRefs.current || !firstCardRefs.current) {\n return;\n }\n\n // prepare journey projects based on the data available as\n // games and puzzles are not aviailbale for K-1\n const journeyProjectsData = [];\n\n if (projectData?.games?.data.length && projectData?.puzzles?.data.length) {\n journeyProjectsData.push(\n {\n projectData: projectData.games.data[0],\n type: ProjectType.GAME,\n },\n {\n projectData: projectData.puzzles.data[0],\n type: ProjectType.PUZZLE,\n },\n );\n }\n\n if (projectData?.lessons?.data.length) {\n journeyProjectsData.push(\n { projectData: projectData.lessons.data[0], type: ProjectType.LESSON },\n { projectData: projectData.lessons.data[1], type: ProjectType.LESSON },\n );\n }\n\n const secondProjectData = journeyProjectsData[1];\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step:\n journeyProjectsData[0]?.type === ProjectType.LESSON\n ? ActionEvent.SKILL_ACTIVITY\n : ActionEvent.GAMES_ACTIVITY,\n });\n\n const coachmarks: TCoachmarkJourneyProps[] = [\n isCompact\n ? {\n originalElementToHighlightRef: firstCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SwipeableCard\n onSwipeLeft={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n >\n <SwipableArea />\n </SwipeableCard>\n ),\n indicator: {\n nudge: 'swipe',\n content: <Text $renderAs=\"ab2-bold\">Swipe to explore</Text>,\n nudgePointerX: launcherDims.width / 2 - 30,\n nudgePointerY: launcherDims.height / 2,\n } as INudgeProps,\n }\n : {\n originalElementToHighlightRef: paginationList[1] as React.RefObject<HTMLDivElement>,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CarouselIndicator\n textToShowInsideIndicator=\"2\"\n onClick={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: <Text $renderAs=\"ab1-bold\">Click to proceed</Text>,\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n {\n originalElementToHighlightRef: secondCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CircularGameCard\n label=\"\"\n data={{\n card: secondProjectData?.projectData?.cardLottie ?? '',\n name: secondProjectData?.projectData?.name ?? '',\n isCompleted: false,\n displayNameImage: secondProjectData?.projectData?.displayNameImage,\n onPress: () => {\n if (secondProjectData?.type === ProjectType.LESSON) {\n handleEndJourneyForLesson(secondProjectData.projectData as Lesson, journeyId);\n }\n\n if (secondProjectData?.type === ProjectType.PUZZLE) {\n handleEndJourneyForPuzzle(secondProjectData.projectData as Puzzle, journeyId);\n }\n },\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs={isCompact ? 'ab2-bold' : 'ab1-bold'}>\n {isCompact ? 'Tap to start' : ' Click to start'}\n </Text>\n ),\n nudgePointerX: isCompact ? launcherDims.width / 2 : launcherDims.width / 1.3,\n nudgePointerY: isCompact ? launcherDims.height / 2 : launcherDims.height / 1.3,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, coachmarks);\n carouselRefs.current?.goToIndex(0);\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [\n carouselRefs,\n trackAnalytics,\n isCompact,\n setJourney,\n nextCoachmark,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n ],\n );\n\n const data = useMemo(\n () => ({\n firstCardRefs,\n secondCardRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","onJourneyComplete","device","useTheme","isCompact","EDeviceType","timerRefs","useRef","firstCardRefs","secondCardRefs","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventCompleted","useCallback","step","AnalyticsLabel","handleEndJourneyForPuzzle","puzzlesData","journeyId","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","projectData","paginationList","_a","launcherDims","_c","_b","journeyProjectsData","_d","_e","_f","secondProjectData","PLATFORM_EVENTS_STUDENT","_g","coachmarks","IndicatorType","jsx","SwipeableCard","SHOW_NUDGE_AFTER_MS","SwipableArea","Text","CarouselIndicator","CircularGameCard","_h","_i","_j","_k","delayBeforeStart","SLIDE_TO_LESSON_MS","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;AA8BO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,MAAWC,KACbC,IAAYF,KAAUG,EAAY,QAElCC,IAAYC,EAAwC,CAAA,CAAE,GAEtDC,IAAgBD,EAA8B,IAAI,GAClDE,IAAiBF,EAA8B,IAAI,GACnD,EAAE,eAAAG,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GACvD,EAAE,SAASC,EAAe,IAAIC,EAAa,GAE3CC,IAAsBC;AAAA,IAC1B,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,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,EAAA,YAAA,QAAAsD,EAAS,UAAU;AAC1B,YAAAC,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GAC7B5C,EAAcY,CAAS;AAAA,SACtBiC,EAAkB;AAEX,MAAAjD,EAAA,QAAQ,KAAKgD,CAAgB;AAAA,IACzC;AAAA,IACA;AAAA,MACEvD;AAAA,MACAe;AAAA,MACAV;AAAA,MACAO;AAAA,MACAD;AAAA,MACAe;AAAA,MACAL;AAAA,IACF;AAAA,EAAA,GAGIoC,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,eAAAjD;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAkB;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA+B,EAAU,MACD,MAAM;AACX,IAAApD,EAAU,QAAQ,QAAQ,CAASqD,MAAA,aAAaA,CAAK,CAAC,GACtDrD,EAAU,UAAU;EAAC,GAEtB,CAACP,CAAY,CAAC,GAEVyD;AACT;"}
@@ -37,6 +37,7 @@ const u = (t, s) => {
37
37
  n(r, { baseEventData: i });
38
38
  }
39
39
  },
40
+ // eslint-disable-next-line react-hooks/exhaustive-deps
40
41
  [n, e, a, t, c]
41
42
  );
42
43
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-handle-sticker-send.js","sources":["../../../../../src/features/stickers/hooks/use-handle-sticker-send/use-handle-sticker-send.tsx"],"sourcesContent":["import { useCallback } from 'react';\n\nimport useInClassMessageBroker from '../../../communication/hooks/use-inclass-message-broker/use-inclass-message-broker';\nimport { useUIContext } from '../../../ui/context/context';\nimport { STICKERS_ANALYTICS_EVENT } from '../../stickers-analytics-events';\nimport { useStickers } from '../../stickers-effects/hooks/use-stickers';\nimport type {\n IStickerData,\n TStickerAnimationEffects,\n TStickersPayload,\n} from '../../stickers-types';\nimport { useStickersErrorLogger } from '../use-stickers-error-logger';\nimport { type TUseStickerSendMetaData } from './use-handle-sticker-send-types';\n\nexport const useHandleStickerSend = (\n studentClassroomId: string,\n metaData: TUseStickerSendMetaData,\n) => {\n const { publish } = useInClassMessageBroker({\n studentClassroomId,\n });\n\n const { onEvent: trackEvent } = useUIContext();\n const logError = useStickersErrorLogger();\n\n const { showSticker } = useStickers();\n\n const sendSticker = useCallback(\n (sticker: IStickerData, effect: TStickerAnimationEffects) => {\n const baseEventData = {\n classroom_id: studentClassroomId,\n sticker: sticker.id,\n teacherClassroomId: metaData.teacherClassroomId,\n triggerType: metaData.triggerType,\n };\n\n try {\n const payload: TStickersPayload = {\n message: {\n data: {\n selectedSticker: {\n id: sticker.id,\n name: sticker.name,\n },\n effectId: effect,\n },\n },\n type: 'STICKERS',\n };\n\n showSticker(payload);\n\n publish?.({\n eventName: 'STICKERS',\n eventPayload: payload,\n });\n\n trackEvent(STICKERS_ANALYTICS_EVENT.STICKER_SENT, baseEventData);\n } catch (error) {\n logError(error, { baseEventData });\n }\n },\n [logError, publish, showSticker, studentClassroomId, trackEvent],\n );\n\n return sendSticker;\n};\n"],"names":["useHandleStickerSend","studentClassroomId","metaData","publish","useInClassMessageBroker","trackEvent","useUIContext","logError","useStickersErrorLogger","showSticker","useStickers","useCallback","sticker","effect","baseEventData","payload","STICKERS_ANALYTICS_EVENT","error"],"mappings":";;;;;;AAca,MAAAA,IAAuB,CAClCC,GACAC,MACG;AACG,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAwB;AAAA,IAC1C,oBAAAH;AAAA,EAAA,CACD,GAEK,EAAE,SAASI,EAAW,IAAIC,EAAa,GACvCC,IAAWC,KAEX,EAAE,aAAAC,MAAgBC;AAwCjB,SAtCaC;AAAA,IAClB,CAACC,GAAuBC,MAAqC;AAC3D,YAAMC,IAAgB;AAAA,QACpB,cAAcb;AAAA,QACd,SAASW,EAAQ;AAAA,QACjB,oBAAoBV,EAAS;AAAA,QAC7B,aAAaA,EAAS;AAAA,MAAA;AAGpB,UAAA;AACF,cAAMa,IAA4B;AAAA,UAChC,SAAS;AAAA,YACP,MAAM;AAAA,cACJ,iBAAiB;AAAA,gBACf,IAAIH,EAAQ;AAAA,gBACZ,MAAMA,EAAQ;AAAA,cAChB;AAAA,cACA,UAAUC;AAAA,YACZ;AAAA,UACF;AAAA,UACA,MAAM;AAAA,QAAA;AAGR,QAAAJ,EAAYM,CAAO,GAETZ,KAAA,QAAAA,EAAA;AAAA,UACR,WAAW;AAAA,UACX,cAAcY;AAAA,QAAA,IAGLV,EAAAW,EAAyB,cAAcF,CAAa;AAAA,eACxDG,GAAO;AACL,QAAAV,EAAAU,GAAO,EAAE,eAAAH,EAAA,CAAe;AAAA,MACnC;AAAA,IACF;AAAA,IACA,CAACP,GAAUJ,GAASM,GAAaR,GAAoBI,CAAU;AAAA,EAAA;AAInE;"}
1
+ {"version":3,"file":"use-handle-sticker-send.js","sources":["../../../../../src/features/stickers/hooks/use-handle-sticker-send/use-handle-sticker-send.tsx"],"sourcesContent":["import { useCallback } from 'react';\n\nimport useInClassMessageBroker from '../../../communication/hooks/use-inclass-message-broker/use-inclass-message-broker';\nimport { useUIContext } from '../../../ui/context/context';\nimport { STICKERS_ANALYTICS_EVENT } from '../../stickers-analytics-events';\nimport { useStickers } from '../../stickers-effects/hooks/use-stickers';\nimport type {\n IStickerData,\n TStickerAnimationEffects,\n TStickersPayload,\n} from '../../stickers-types';\nimport { useStickersErrorLogger } from '../use-stickers-error-logger';\nimport { type TUseStickerSendMetaData } from './use-handle-sticker-send-types';\n\nexport const useHandleStickerSend = (\n studentClassroomId: string,\n metaData: TUseStickerSendMetaData,\n) => {\n const { publish } = useInClassMessageBroker({\n studentClassroomId,\n });\n\n const { onEvent: trackEvent } = useUIContext();\n const logError = useStickersErrorLogger();\n\n const { showSticker } = useStickers();\n\n const sendSticker = useCallback(\n (sticker: IStickerData, effect: TStickerAnimationEffects) => {\n const baseEventData = {\n classroom_id: studentClassroomId,\n sticker: sticker.id,\n teacherClassroomId: metaData.teacherClassroomId,\n triggerType: metaData.triggerType,\n };\n\n try {\n const payload: TStickersPayload = {\n message: {\n data: {\n selectedSticker: {\n id: sticker.id,\n name: sticker.name,\n },\n effectId: effect,\n },\n },\n type: 'STICKERS',\n };\n\n showSticker(payload);\n\n publish?.({\n eventName: 'STICKERS',\n eventPayload: payload,\n });\n\n trackEvent(STICKERS_ANALYTICS_EVENT.STICKER_SENT, baseEventData);\n } catch (error) {\n logError(error, { baseEventData });\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [logError, publish, showSticker, studentClassroomId, trackEvent],\n );\n\n return sendSticker;\n};\n"],"names":["useHandleStickerSend","studentClassroomId","metaData","publish","useInClassMessageBroker","trackEvent","useUIContext","logError","useStickersErrorLogger","showSticker","useStickers","useCallback","sticker","effect","baseEventData","payload","STICKERS_ANALYTICS_EVENT","error"],"mappings":";;;;;;AAca,MAAAA,IAAuB,CAClCC,GACAC,MACG;AACG,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAwB;AAAA,IAC1C,oBAAAH;AAAA,EAAA,CACD,GAEK,EAAE,SAASI,EAAW,IAAIC,EAAa,GACvCC,IAAWC,KAEX,EAAE,aAAAC,MAAgBC;AAyCjB,SAvCaC;AAAA,IAClB,CAACC,GAAuBC,MAAqC;AAC3D,YAAMC,IAAgB;AAAA,QACpB,cAAcb;AAAA,QACd,SAASW,EAAQ;AAAA,QACjB,oBAAoBV,EAAS;AAAA,QAC7B,aAAaA,EAAS;AAAA,MAAA;AAGpB,UAAA;AACF,cAAMa,IAA4B;AAAA,UAChC,SAAS;AAAA,YACP,MAAM;AAAA,cACJ,iBAAiB;AAAA,gBACf,IAAIH,EAAQ;AAAA,gBACZ,MAAMA,EAAQ;AAAA,cAChB;AAAA,cACA,UAAUC;AAAA,YACZ;AAAA,UACF;AAAA,UACA,MAAM;AAAA,QAAA;AAGR,QAAAJ,EAAYM,CAAO,GAETZ,KAAA,QAAAA,EAAA;AAAA,UACR,WAAW;AAAA,UACX,cAAcY;AAAA,QAAA,IAGLV,EAAAW,EAAyB,cAAcF,CAAa;AAAA,eACxDG,GAAO;AACL,QAAAV,EAAAU,GAAO,EAAE,eAAAH,EAAA,CAAe;AAAA,MACnC;AAAA,IACF;AAAA;AAAA,IAEA,CAACP,GAAUJ,GAASM,GAAaR,GAAoBI,CAAU;AAAA,EAAA;AAInE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-body-styled.js","sources":["../../../../../src/features/ui/arrow-tooltip/comps/tooltip-body-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../layout/flex-view';\nimport { animateToolTip, arrowPosition, tooltipPosition } from '../arrow-tooltip-util';\nimport type { ITooltipBodyProps } from './tooltip-body-types';\n\nexport const TooltipBody = styled(FlexView)<ITooltipBodyProps>(({\n theme,\n $arrowColor,\n $arrowSize,\n $arrowXCoOrdinates,\n $arrowYCoOrdinates,\n $borderColor,\n $isAnimated,\n $position,\n $renderAs,\n $tooltipCoOrdinates,\n $tooltipOffset,\n $tooltipXCoOrdinates,\n $tooltipYCoOrdinates,\n $zIndex,\n $backgroundColor,\n}) => {\n const { gutter } = theme.layout;\n const { REAL_BLACK_15 } = theme.colors;\n const { tooltipVariants } = theme.arrowTooltip;\n let { backgroundColorName } = tooltipVariants[$renderAs];\n const { textColorName } = tooltipVariants[$renderAs];\n\n backgroundColorName = $backgroundColor || backgroundColorName;\n\n return `\n position: fixed;\n z-index: ${$zIndex || 1};\n padding: ${gutter * 0.25}px ${gutter * 0.5}px;\n color: ${textColorName};\n box-shadow: 0px 2px 15px 0px ${REAL_BLACK_15};\n background-color: ${theme.colors[backgroundColorName]};\n border: 1px solid ${$borderColor ? theme.colors[$borderColor] : 'transparent'};\n\n &::after {\n content: '';\n position: absolute;\n height: ${$arrowSize}px;\n width: ${$arrowSize}px;\n clip-path: polygon(0% 0%, 100% 100%, 0% 100%);\n background-color: ${\n $arrowColor ? theme.colors[$arrowColor] : theme.colors[backgroundColorName]\n };\n ${arrowPosition({\n position: $position,\n arrowXCoOrdinates: $arrowXCoOrdinates,\n arrowYCoOrdinates: $arrowYCoOrdinates,\n arrowSize: $arrowSize,\n })};\n }\n\n ${tooltipPosition({\n position: $position,\n arrowSize: $arrowSize,\n tooltipCoOrdinates: $tooltipCoOrdinates,\n tooltipOffset: $tooltipOffset,\n tooltipXCoOrdinates: $tooltipXCoOrdinates,\n tooltipYCoOrdinates: $tooltipYCoOrdinates,\n })};\n\n ${animateToolTip($isAnimated)};\n `;\n});\n"],"names":["TooltipBody","styled","FlexView","theme","$arrowColor","$arrowSize","$arrowXCoOrdinates","$arrowYCoOrdinates","$borderColor","$isAnimated","$position","$renderAs","$tooltipCoOrdinates","$tooltipOffset","$tooltipXCoOrdinates","$tooltipYCoOrdinates","$zIndex","$backgroundColor","gutter","REAL_BLACK_15","tooltipVariants","backgroundColorName","textColorName","arrowPosition","tooltipPosition","animateToolTip"],"mappings":";;;AAMO,MAAMA,IAAcC,EAAOC,CAAQ,EAAqB,CAAC;AAAA,EAC9D,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,kBAAAC;AACF,MAAM;AACE,QAAA,EAAE,QAAAC,EAAO,IAAIf,EAAM,QACnB,EAAE,eAAAgB,EAAc,IAAIhB,EAAM,QAC1B,EAAE,iBAAAiB,EAAgB,IAAIjB,EAAM;AAClC,MAAI,EAAE,qBAAAkB,EAAA,IAAwBD,EAAgBT,CAAS;AACvD,QAAM,EAAE,eAAAW,EAAA,IAAkBF,EAAgBT,CAAS;AAEnD,SAAAU,IAAsBJ,KAAoBI,GAEnC;AAAA;AAAA,eAEML,KAAW,CAAC;AAAA,eACZE,IAAS,IAAI,MAAMA,IAAS,GAAG;AAAA,aACjCI,CAAa;AAAA,mCACSH,CAAa;AAAA,wBACxBhB,EAAM,OAAOkB,CAAmB,CAAC;AAAA,wBACjCb,IAAeL,EAAM,OAAOK,CAAY,IAAI,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKjEH,CAAU;AAAA,eACXA,CAAU;AAAA;AAAA,0BAGjBD,IAAcD,EAAM,OAAOC,CAAW,IAAID,EAAM,OAAOkB,CAAmB,CAC5E;AAAA,QACEE,EAAc;AAAA,IACd,UAAUb;AAAA,IACV,mBAAmBJ;AAAA,IACnB,mBAAmBC;AAAA,IACnB,WAAWF;AAAA,EAAA,CACZ,CAAC;AAAA;AAAA;AAAA,MAGFmB,EAAgB;AAAA,IAChB,UAAUd;AAAA,IACV,WAAWL;AAAA,IACX,oBAAoBO;AAAA,IACpB,eAAeC;AAAA,IACf,qBAAqBC;AAAA,IACrB,qBAAqBC;AAAA,EAAA,CACtB,CAAC;AAAA;AAAA,MAEAU,EAAehB,CAAW,CAAC;AAAA;AAEjC,CAAC;"}
1
+ {"version":3,"file":"tooltip-body-styled.js","sources":["../../../../../src/features/ui/arrow-tooltip/comps/tooltip-body-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../layout/flex-view';\nimport { animateToolTip, arrowPosition, tooltipPosition } from '../arrow-tooltip-util';\nimport type { ITooltipBodyProps } from './tooltip-body-types';\n\nexport const TooltipBody = styled(FlexView)<Omit<ITooltipBodyProps, 'textVariant'>>(({\n theme,\n $arrowColor,\n $arrowSize,\n $arrowXCoOrdinates,\n $arrowYCoOrdinates,\n $borderColor,\n $isAnimated,\n $position,\n $renderAs,\n $tooltipCoOrdinates,\n $tooltipOffset,\n $tooltipXCoOrdinates,\n $tooltipYCoOrdinates,\n $zIndex,\n $backgroundColor,\n}) => {\n const { gutter } = theme.layout;\n const { REAL_BLACK_15 } = theme.colors;\n const { tooltipVariants } = theme.arrowTooltip;\n let { backgroundColorName } = tooltipVariants[$renderAs];\n const { textColorName } = tooltipVariants[$renderAs];\n\n backgroundColorName = $backgroundColor || backgroundColorName;\n\n return `\n position: fixed;\n z-index: ${$zIndex || 1};\n padding: ${gutter * 0.25}px ${gutter * 0.5}px;\n color: ${textColorName};\n box-shadow: 0px 2px 15px 0px ${REAL_BLACK_15};\n background-color: ${theme.colors[backgroundColorName]};\n border: 1px solid ${$borderColor ? theme.colors[$borderColor] : 'transparent'};\n\n &::after {\n content: '';\n position: absolute;\n height: ${$arrowSize}px;\n width: ${$arrowSize}px;\n clip-path: polygon(0% 0%, 100% 100%, 0% 100%);\n background-color: ${\n $arrowColor ? theme.colors[$arrowColor] : theme.colors[backgroundColorName]\n };\n ${arrowPosition({\n position: $position,\n arrowXCoOrdinates: $arrowXCoOrdinates,\n arrowYCoOrdinates: $arrowYCoOrdinates,\n arrowSize: $arrowSize,\n })};\n }\n\n ${tooltipPosition({\n position: $position,\n arrowSize: $arrowSize,\n tooltipCoOrdinates: $tooltipCoOrdinates,\n tooltipOffset: $tooltipOffset,\n tooltipXCoOrdinates: $tooltipXCoOrdinates,\n tooltipYCoOrdinates: $tooltipYCoOrdinates,\n })};\n\n ${animateToolTip($isAnimated)};\n `;\n});\n"],"names":["TooltipBody","styled","FlexView","theme","$arrowColor","$arrowSize","$arrowXCoOrdinates","$arrowYCoOrdinates","$borderColor","$isAnimated","$position","$renderAs","$tooltipCoOrdinates","$tooltipOffset","$tooltipXCoOrdinates","$tooltipYCoOrdinates","$zIndex","$backgroundColor","gutter","REAL_BLACK_15","tooltipVariants","backgroundColorName","textColorName","arrowPosition","tooltipPosition","animateToolTip"],"mappings":";;;AAMO,MAAMA,IAAcC,EAAOC,CAAQ,EAA0C,CAAC;AAAA,EACnF,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,kBAAAC;AACF,MAAM;AACE,QAAA,EAAE,QAAAC,EAAO,IAAIf,EAAM,QACnB,EAAE,eAAAgB,EAAc,IAAIhB,EAAM,QAC1B,EAAE,iBAAAiB,EAAgB,IAAIjB,EAAM;AAClC,MAAI,EAAE,qBAAAkB,EAAA,IAAwBD,EAAgBT,CAAS;AACvD,QAAM,EAAE,eAAAW,EAAA,IAAkBF,EAAgBT,CAAS;AAEnD,SAAAU,IAAsBJ,KAAoBI,GAEnC;AAAA;AAAA,eAEML,KAAW,CAAC;AAAA,eACZE,IAAS,IAAI,MAAMA,IAAS,GAAG;AAAA,aACjCI,CAAa;AAAA,mCACSH,CAAa;AAAA,wBACxBhB,EAAM,OAAOkB,CAAmB,CAAC;AAAA,wBACjCb,IAAeL,EAAM,OAAOK,CAAY,IAAI,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKjEH,CAAU;AAAA,eACXA,CAAU;AAAA;AAAA,0BAGjBD,IAAcD,EAAM,OAAOC,CAAW,IAAID,EAAM,OAAOkB,CAAmB,CAC5E;AAAA,QACEE,EAAc;AAAA,IACd,UAAUb;AAAA,IACV,mBAAmBJ;AAAA,IACnB,mBAAmBC;AAAA,IACnB,WAAWF;AAAA,EAAA,CACZ,CAAC;AAAA;AAAA;AAAA,MAGFmB,EAAgB;AAAA,IAChB,UAAUd;AAAA,IACV,WAAWL;AAAA,IACX,oBAAoBO;AAAA,IACpB,eAAeC;AAAA,IACf,qBAAqBC;AAAA,IACrB,qBAAqBC;AAAA,EAAA,CACtB,CAAC;AAAA;AAAA,MAEAU,EAAehB,CAAW,CAAC;AAAA;AAEjC,CAAC;"}
@@ -1,21 +1,21 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { memo as i } from "react";
3
- import { useTheme as n } from "styled-components";
4
- import l from "../../text/text.js";
5
- import { TooltipBody as m } from "./tooltip-body-styled.js";
6
- const d = (o) => {
7
- const { arrowTooltip: r } = n(), { tooltipVariants: e } = r;
8
- return /* @__PURE__ */ t(m, { ...o, children: typeof o.children == "string" ? /* @__PURE__ */ t(
9
- l,
2
+ import { memo as n } from "react";
3
+ import { useTheme as l } from "styled-components";
4
+ import m from "../../text/text.js";
5
+ import { TooltipBody as d } from "./tooltip-body-styled.js";
6
+ const a = (o) => {
7
+ const { textVariant: c, ...r } = o, { arrowTooltip: e } = l(), { tooltipVariants: i } = e;
8
+ return /* @__PURE__ */ t(d, { ...r, children: typeof o.children == "string" ? /* @__PURE__ */ t(
9
+ m,
10
10
  {
11
11
  $renderAs: o.textVariant || "body3",
12
- $color: e[o.$renderAs].textColorName,
12
+ $color: i[o.$renderAs].textColorName,
13
13
  $align: "center",
14
14
  children: o.children
15
15
  }
16
16
  ) : o.children });
17
- }, h = i(d);
17
+ }, y = n(a);
18
18
  export {
19
- h as default
19
+ y as default
20
20
  };
21
21
  //# sourceMappingURL=tooltip-body.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-body.js","sources":["../../../../../src/features/ui/arrow-tooltip/comps/tooltip-body.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Text from '../../text/text';\nimport * as Styled from './tooltip-body-styled';\nimport type { ITooltipBodyProps } from './tooltip-body-types';\n\nconst TooltipBody: FC<ITooltipBodyProps> = props => {\n const { arrowTooltip } = useTheme();\n const { tooltipVariants } = arrowTooltip;\n\n return (\n <Styled.TooltipBody {...props}>\n {typeof props.children === 'string' ? (\n <Text\n $renderAs={props.textVariant || 'body3'}\n $color={tooltipVariants[props.$renderAs].textColorName}\n $align=\"center\"\n >\n {props.children}\n </Text>\n ) : (\n props.children\n )}\n </Styled.TooltipBody>\n );\n};\n\nexport default memo(TooltipBody);\n"],"names":["TooltipBody","props","arrowTooltip","useTheme","tooltipVariants","jsx","Styled.TooltipBody","Text","TooltipBody$1","memo"],"mappings":";;;;;AAOA,MAAMA,IAAqC,CAASC,MAAA;AAC5C,QAAA,EAAE,cAAAC,MAAiBC,KACnB,EAAE,iBAAAC,EAAoB,IAAAF;AAG1B,SAAA,gBAAAG,EAACC,GAAA,EAAoB,GAAGL,GACrB,UAAA,OAAOA,EAAM,YAAa,WACzB,gBAAAI;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,WAAWN,EAAM,eAAe;AAAA,MAChC,QAAQG,EAAgBH,EAAM,SAAS,EAAE;AAAA,MACzC,QAAO;AAAA,MAEN,UAAMA,EAAA;AAAA,IAAA;AAAA,EAAA,IAGTA,EAAM,SAEV,CAAA;AAEJ,GAEeO,IAAAC,EAAKT,CAAW;"}
1
+ {"version":3,"file":"tooltip-body.js","sources":["../../../../../src/features/ui/arrow-tooltip/comps/tooltip-body.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Text from '../../text/text';\nimport * as Styled from './tooltip-body-styled';\nimport type { ITooltipBodyProps } from './tooltip-body-types';\n\nconst TooltipBody: FC<ITooltipBodyProps> = props => {\n const { textVariant, ...rest } = props;\n const { arrowTooltip } = useTheme();\n const { tooltipVariants } = arrowTooltip;\n\n return (\n <Styled.TooltipBody {...rest}>\n {typeof props.children === 'string' ? (\n <Text\n $renderAs={props.textVariant || 'body3'}\n $color={tooltipVariants[props.$renderAs].textColorName}\n $align=\"center\"\n >\n {props.children}\n </Text>\n ) : (\n props.children\n )}\n </Styled.TooltipBody>\n );\n};\n\nexport default memo(TooltipBody);\n"],"names":["TooltipBody","props","textVariant","rest","arrowTooltip","useTheme","tooltipVariants","jsx","Styled.TooltipBody","Text","TooltipBody$1","memo"],"mappings":";;;;;AAOA,MAAMA,IAAqC,CAASC,MAAA;AAClD,QAAM,EAAE,aAAAC,GAAa,GAAGC,EAAA,IAASF,GAC3B,EAAE,cAAAG,MAAiBC,KACnB,EAAE,iBAAAC,EAAoB,IAAAF;AAG1B,SAAA,gBAAAG,EAACC,GAAA,EAAoB,GAAGL,GACrB,UAAA,OAAOF,EAAM,YAAa,WACzB,gBAAAM;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,WAAWR,EAAM,eAAe;AAAA,MAChC,QAAQK,EAAgBL,EAAM,SAAS,EAAE;AAAA,MACzC,QAAO;AAAA,MAEN,UAAMA,EAAA;AAAA,IAAA;AAAA,EAAA,IAGTA,EAAM,SAEV,CAAA;AAEJ,GAEeS,IAAAC,EAAKX,CAAW;"}
@@ -1,31 +1,32 @@
1
- import { useState as u, useMemo as a, useCallback as I } from "react";
2
- import { useAVMessage as c } from "@cuemath/av";
3
- const N = ({
4
- questions: o,
5
- activeQuestionIndex: r,
6
- userType: p
7
- }) => {
8
- var n;
9
- const [t, i] = u(), e = a(
10
- () => o.findIndex((s) => s.response_id === t),
11
- [t, o]
12
- ), d = I((s, m) => {
13
- i(m.id);
1
+ import { useState as m, useMemo as a, useCallback as c } from "react";
2
+ import { useAVMessage as I } from "@cuemath/av";
3
+ import { useWorksheetStore as T } from "../../worksheet/hooks/use-worksheet-store.js";
4
+ const f = () => {
5
+ var r;
6
+ const { activeQuestionIndex: t, questions: s, userType: i } = T((e) => ({
7
+ activeQuestionIndex: e.activeQuestionIndex,
8
+ questions: e.questions,
9
+ userType: e.userType
10
+ })), [n, u] = m(), o = a(
11
+ () => s.findIndex((e) => e.response_id === n),
12
+ [n, s]
13
+ ), p = c((e, d) => {
14
+ u(d.id);
14
15
  }, []);
15
- return c({
16
+ return I({
16
17
  type: "STUDENT_MOUSE_POINTER_POSITION_CHANGED",
17
- onMessage: d
18
- }), p !== "TEACHER" || e === -1 || r === e ? {
18
+ onMessage: p
19
+ }), i !== "TEACHER" || o === -1 || t === o ? {
19
20
  peerLocation: void 0,
20
21
  peerQuestionIndex: void 0,
21
22
  peerItemNumber: void 0
22
23
  } : {
23
- peerLocation: e > r ? "down" : "up",
24
- peerQuestionIndex: e,
25
- peerItemNumber: (n = o[e]) == null ? void 0 : n.item_number
24
+ peerLocation: o > t ? "down" : "up",
25
+ peerQuestionIndex: o,
26
+ peerItemNumber: (r = s[o]) == null ? void 0 : r.item_number
26
27
  };
27
28
  };
28
29
  export {
29
- N as default
30
+ f as default
30
31
  };
31
32
  //# sourceMappingURL=use-user-location.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-user-location.js","sources":["../../../../../src/features/worksheet/user-pointer-pin/hooks/use-user-location.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react';\n\nimport { useAVMessage } from '@cuemath/av';\n\nimport type { TUserTypes } from '../../../ui/types';\nimport type { IWorksheetQuestion } from '../../worksheet/worksheet-types';\n\ninterface IUseRemoteUserLocationProps {\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n userType?: TUserTypes;\n}\n\ntype TpointerLocation = 'up' | 'down' | undefined;\n\ninterface IUseRemoteUserLocation {\n peerLocation: TpointerLocation;\n peerQuestionIndex: number | undefined;\n peerItemNumber: number | undefined;\n}\n\nconst useRemoteUserLocation = ({\n questions,\n activeQuestionIndex,\n userType,\n}: IUseRemoteUserLocationProps): IUseRemoteUserLocation => {\n const [peerResponseId, setPeerResponseId] = useState<string | undefined>();\n const peerQuestionIndex = useMemo(\n () => questions.findIndex(qs => qs.response_id === peerResponseId),\n [peerResponseId, questions],\n );\n const onPointerReceive = useCallback((_: string, data: Record<string, unknown>) => {\n setPeerResponseId(data.id as string);\n }, []);\n\n useAVMessage<Record<string, unknown>>({\n type: 'STUDENT_MOUSE_POINTER_POSITION_CHANGED',\n onMessage: onPointerReceive,\n });\n\n if (\n userType !== 'TEACHER' ||\n peerQuestionIndex === -1 ||\n activeQuestionIndex === peerQuestionIndex\n ) {\n return {\n peerLocation: undefined,\n peerQuestionIndex: undefined,\n peerItemNumber: undefined,\n };\n }\n\n return {\n peerLocation: peerQuestionIndex > activeQuestionIndex ? 'down' : 'up',\n peerQuestionIndex,\n peerItemNumber: questions[peerQuestionIndex]?.item_number,\n };\n};\n\nexport default useRemoteUserLocation;\n"],"names":["useRemoteUserLocation","questions","activeQuestionIndex","userType","peerResponseId","setPeerResponseId","useState","peerQuestionIndex","useMemo","qs","onPointerReceive","useCallback","_","data","useAVMessage","_a"],"mappings":";;AAqBA,MAAMA,IAAwB,CAAC;AAAA,EAC7B,WAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,UAAAC;AACF,MAA2D;;AACzD,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAA6B,GACnEC,IAAoBC;AAAA,IACxB,MAAMP,EAAU,UAAU,CAAMQ,MAAAA,EAAG,gBAAgBL,CAAc;AAAA,IACjE,CAACA,GAAgBH,CAAS;AAAA,EAAA,GAEtBS,IAAmBC,EAAY,CAACC,GAAWC,MAAkC;AACjF,IAAAR,EAAkBQ,EAAK,EAAY;AAAA,EACrC,GAAG,CAAE,CAAA;AAOL,SALsCC,EAAA;AAAA,IACpC,MAAM;AAAA,IACN,WAAWJ;AAAA,EAAA,CACZ,GAGCP,MAAa,aACbI,MAAsB,MACtBL,MAAwBK,IAEjB;AAAA,IACL,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,EAAA,IAIb;AAAA,IACL,cAAcA,IAAoBL,IAAsB,SAAS;AAAA,IACjE,mBAAAK;AAAA,IACA,iBAAgBQ,IAAAd,EAAUM,CAAiB,MAA3B,gBAAAQ,EAA8B;AAAA,EAAA;AAElD;"}
1
+ {"version":3,"file":"use-user-location.js","sources":["../../../../../src/features/worksheet/user-pointer-pin/hooks/use-user-location.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react';\n\nimport { useAVMessage } from '@cuemath/av';\n\nimport { useWorksheetStore } from '../../worksheet/hooks/use-worksheet-store';\n\ntype TPointerLocation = 'up' | 'down' | undefined;\n\ninterface IUseRemoteUserLocation {\n peerLocation: TPointerLocation;\n peerQuestionIndex: number | undefined;\n peerItemNumber: number | undefined;\n}\n\nconst useRemoteUserLocation = (): IUseRemoteUserLocation => {\n const { activeQuestionIndex, questions, userType } = useWorksheetStore(store => ({\n activeQuestionIndex: store.activeQuestionIndex,\n questions: store.questions,\n userType: store.userType,\n }));\n const [peerResponseId, setPeerResponseId] = useState<string | undefined>();\n const peerQuestionIndex = useMemo(\n () => questions.findIndex(qs => qs.response_id === peerResponseId),\n [peerResponseId, questions],\n );\n const onPointerReceive = useCallback((_: string, data: Record<string, unknown>) => {\n setPeerResponseId(data.id as string);\n }, []);\n\n useAVMessage<Record<string, unknown>>({\n type: 'STUDENT_MOUSE_POINTER_POSITION_CHANGED',\n onMessage: onPointerReceive,\n });\n\n if (\n userType !== 'TEACHER' ||\n peerQuestionIndex === -1 ||\n activeQuestionIndex === peerQuestionIndex\n ) {\n return {\n peerLocation: undefined,\n peerQuestionIndex: undefined,\n peerItemNumber: undefined,\n };\n }\n\n return {\n peerLocation: peerQuestionIndex > activeQuestionIndex ? 'down' : 'up',\n peerQuestionIndex,\n peerItemNumber: questions[peerQuestionIndex]?.item_number,\n };\n};\n\nexport default useRemoteUserLocation;\n"],"names":["useRemoteUserLocation","activeQuestionIndex","questions","userType","useWorksheetStore","store","peerResponseId","setPeerResponseId","useState","peerQuestionIndex","useMemo","qs","onPointerReceive","useCallback","_","data","useAVMessage","_a"],"mappings":";;;AAcA,MAAMA,IAAwB,MAA8B;;AAC1D,QAAM,EAAE,qBAAAC,GAAqB,WAAAC,GAAW,UAAAC,EAAS,IAAIC,EAAkB,CAAUC,OAAA;AAAA,IAC/E,qBAAqBA,EAAM;AAAA,IAC3B,WAAWA,EAAM;AAAA,IACjB,UAAUA,EAAM;AAAA,EAChB,EAAA,GACI,CAACC,GAAgBC,CAAiB,IAAIC,EAA6B,GACnEC,IAAoBC;AAAA,IACxB,MAAMR,EAAU,UAAU,CAAMS,MAAAA,EAAG,gBAAgBL,CAAc;AAAA,IACjE,CAACA,GAAgBJ,CAAS;AAAA,EAAA,GAEtBU,IAAmBC,EAAY,CAACC,GAAWC,MAAkC;AACjF,IAAAR,EAAkBQ,EAAK,EAAY;AAAA,EACrC,GAAG,CAAE,CAAA;AAOL,SALsCC,EAAA;AAAA,IACpC,MAAM;AAAA,IACN,WAAWJ;AAAA,EAAA,CACZ,GAGCT,MAAa,aACbM,MAAsB,MACtBR,MAAwBQ,IAEjB;AAAA,IACL,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,EAAA,IAIb;AAAA,IACL,cAAcA,IAAoBR,IAAsB,SAAS;AAAA,IACjE,mBAAAQ;AAAA,IACA,iBAAgBQ,IAAAf,EAAUO,CAAiB,MAA3B,gBAAAQ,EAA8B;AAAA,EAAA;AAElD;"}
@@ -1,55 +1,57 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { memo as U, useCallback as S } from "react";
3
- import a from "styled-components";
4
- import { ILLUSTRATIONS as f } from "../../../assets/illustrations/illustrations.js";
5
- import _ from "../../ui/buttons/clickable/clickable.js";
6
- import C from "../../ui/layout/flex-view.js";
7
- import { scrollToQuestion as E } from "../worksheet/worksheet-helpers.js";
8
- import R from "./hooks/use-user-location.js";
9
- const c = 32, u = 36, T = a.img`
2
+ import { memo as h, useCallback as x } from "react";
3
+ import l from "styled-components";
4
+ import { ILLUSTRATIONS as a } from "../../../assets/illustrations/illustrations.js";
5
+ import I from "../../ui/buttons/clickable/clickable.js";
6
+ import U from "../../ui/layout/flex-view.js";
7
+ import { useWorksheetStore as y } from "../worksheet/hooks/use-worksheet-store.js";
8
+ import { scrollToQuestion as S } from "../worksheet/worksheet-helpers.js";
9
+ import T from "./hooks/use-user-location.js";
10
+ const c = 32, f = 36, b = l.img`
10
11
  position: absolute;
11
- transform: ${({ $pointer: t }) => t === "down" ? `translate(-${c / 2}px, -${u}px)` : `translate(-${c / 2}px, 0)`};
12
- `, b = a(C)(
13
- ({ $pointer: t, $topOffset: r, $bottomOffset: i }) => `
12
+ transform: ${({ $pointer: e }) => e === "down" ? `translate(-${c / 2}px, -${f}px)` : `translate(-${c / 2}px, 0)`};
13
+ `, _ = l(U)(
14
+ ({ $pointer: e, $topOffset: n, $bottomOffset: o }) => `
14
15
  position: sticky;
15
- top: ${t === "down" ? `calc(100% - ${i}px)` : `calc(${r + 48 + 8}px)`};
16
+ top: ${e === "down" ? `calc(100% - ${o}px)` : `calc(${n + 48 + 8}px)`};
16
17
  z-index: 1;
17
18
  `
18
- ), H = U(function(r) {
19
- const { activeQuestionIndex: i, questions: o, bottomOffset: d, topOffset: $, userType: l } = r, { peerLocation: e, peerQuestionIndex: n } = R({
20
- questions: o,
21
- activeQuestionIndex: i,
22
- userType: l
23
- }), x = S(() => {
24
- var p, m;
25
- if (n === void 0)
19
+ ), q = h(function() {
20
+ const { topOffset: n, questions: o, userType: m, actionbarHeight: u } = y((t) => ({
21
+ topOffset: t.layout.topOffset,
22
+ questions: t.questions,
23
+ userType: t.userType,
24
+ actionbarHeight: t.actionbarHeight
25
+ })), { peerLocation: r, peerQuestionIndex: i } = T(), d = x(() => {
26
+ var t, p;
27
+ if (i === void 0)
26
28
  return null;
27
- if ((p = o[n]) != null && p.response_id) {
28
- const I = (m = o[n]) == null ? void 0 : m.response_id;
29
- E(I);
29
+ if ((t = o[i]) != null && t.response_id) {
30
+ const $ = (p = o[i]) == null ? void 0 : p.response_id;
31
+ S($);
30
32
  }
31
- }, [n, o]);
32
- return !e || l !== "TEACHER" ? null : /* @__PURE__ */ s(
33
- b,
33
+ }, [i, o]);
34
+ return !r || m !== "TEACHER" ? null : /* @__PURE__ */ s(
35
+ _,
34
36
  {
35
37
  $alignItems: "center",
36
38
  $justifyContent: "center",
37
- $pointer: e,
38
- $bottomOffset: d,
39
- $topOffset: $,
40
- children: /* @__PURE__ */ s(_, { label: "User Location Pointer", onClick: x, children: /* @__PURE__ */ s(
41
- T,
39
+ $pointer: r,
40
+ $bottomOffset: u,
41
+ $topOffset: n,
42
+ children: /* @__PURE__ */ s(I, { label: "User Location Pointer", onClick: d, children: /* @__PURE__ */ s(
43
+ b,
42
44
  {
43
- $pointer: e,
45
+ $pointer: r,
44
46
  width: c,
45
- height: u,
46
- src: e === "up" ? f.USER_UP : f.USER_DOWN
47
+ height: f,
48
+ src: r === "up" ? a.USER_UP : a.USER_DOWN
47
49
  }
48
50
  ) })
49
51
  }
50
52
  );
51
53
  });
52
54
  export {
53
- H as default
55
+ q as default
54
56
  };
55
57
  //# sourceMappingURL=user-pin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"user-pin.js","sources":["../../../../src/features/worksheet/user-pointer-pin/user-pin.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\nimport styled from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport FlexView from '../../ui/layout/flex-view';\nimport type { TUserTypes } from '../../ui/types';\nimport { scrollToQuestion } from '../worksheet/worksheet-helpers';\nimport type { IWorksheetQuestion } from '../worksheet/worksheet-types';\nimport useRemoteUserLocation from './hooks/use-user-location';\n\nconst USER_PIN_WIDTH = 32;\nconst USER_PIN_HEIGHT = 36;\n\nconst StyledImage = styled.img<{ $pointer: 'up' | 'down' | undefined }>`\n position: absolute;\n transform: ${({ $pointer }) =>\n $pointer === 'down'\n ? `translate(-${USER_PIN_WIDTH / 2}px, -${USER_PIN_HEIGHT}px)`\n : `translate(-${USER_PIN_WIDTH / 2}px, 0)`};\n`;\n\nconst StickyContainer = styled(FlexView)<{\n $pointer: 'up' | 'down' | undefined;\n $topOffset: number;\n $bottomOffset: number;\n}>(\n ({ $pointer, $topOffset, $bottomOffset }) => `\n position: sticky;\n top: ${\n $pointer === 'down' ? `calc(100% - ${$bottomOffset}px)` : `calc(${$topOffset + 48 + 8}px)`\n };\n z-index: 1;\n`,\n);\n\ninterface IUserPointerProps {\n activeQuestionIndex: number;\n onClick: (questionId: string) => void;\n questions: IWorksheetQuestion[];\n bottomOffset: number;\n topOffset: number;\n userType: TUserTypes;\n}\n\nconst UserPointer: FC<IUserPointerProps> = memo(function UserPointer(props) {\n const { activeQuestionIndex, questions, bottomOffset, topOffset, userType } = props;\n const { peerLocation, peerQuestionIndex } = useRemoteUserLocation({\n questions,\n activeQuestionIndex,\n userType,\n });\n\n const handleClick = useCallback(() => {\n if (peerQuestionIndex === undefined) {\n return null;\n }\n\n if (questions[peerQuestionIndex]?.response_id) {\n const qrId = questions[peerQuestionIndex]?.response_id as string;\n\n scrollToQuestion(qrId);\n }\n }, [peerQuestionIndex, questions]);\n\n if (!peerLocation || userType !== 'TEACHER') {\n return null;\n }\n\n return (\n <StickyContainer\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $pointer={peerLocation}\n $bottomOffset={bottomOffset}\n $topOffset={topOffset}\n >\n <Clickable label=\"User Location Pointer\" onClick={handleClick}>\n <StyledImage\n $pointer={peerLocation}\n width={USER_PIN_WIDTH}\n height={USER_PIN_HEIGHT}\n src={peerLocation === 'up' ? ILLUSTRATIONS.USER_UP : ILLUSTRATIONS.USER_DOWN}\n />\n </Clickable>\n </StickyContainer>\n );\n});\n\nexport default UserPointer;\n"],"names":["USER_PIN_WIDTH","USER_PIN_HEIGHT","StyledImage","styled","$pointer","StickyContainer","FlexView","$topOffset","$bottomOffset","UserPointer","memo","props","activeQuestionIndex","questions","bottomOffset","topOffset","userType","peerLocation","peerQuestionIndex","useRemoteUserLocation","handleClick","useCallback","_a","qrId","_b","scrollToQuestion","jsx","Clickable","ILLUSTRATIONS"],"mappings":";;;;;;;;AAWA,MAAMA,IAAiB,IACjBC,IAAkB,IAElBC,IAAcC,EAAO;AAAA;AAAA,eAEZ,CAAC,EAAE,UAAAC,QACdA,MAAa,SACT,cAAcJ,IAAiB,CAAC,QAAQC,CAAe,QACvD,cAAcD,IAAiB,CAAC,QAAQ;AAAA,GAG1CK,IAAkBF,EAAOG,CAAQ;AAAA,EAKrC,CAAC,EAAE,UAAAF,GAAU,YAAAG,GAAY,eAAAC,EAAoB,MAAA;AAAA;AAAA,SAG3CJ,MAAa,SAAS,eAAeI,CAAa,QAAQ,QAAQD,IAAa,KAAK,CAAC,KACvF;AAAA;AAAA;AAGF,GAWME,IAAqCC,EAAK,SAAqBC,GAAO;AAC1E,QAAM,EAAE,qBAAAC,GAAqB,WAAAC,GAAW,cAAAC,GAAc,WAAAC,GAAW,UAAAC,EAAa,IAAAL,GACxE,EAAE,cAAAM,GAAc,mBAAAC,EAAkB,IAAIC,EAAsB;AAAA,IAChE,WAAAN;AAAA,IACA,qBAAAD;AAAA,IACA,UAAAI;AAAA,EAAA,CACD,GAEKI,IAAcC,EAAY,MAAM;;AACpC,QAAIH,MAAsB;AACjB,aAAA;AAGL,SAAAI,IAAAT,EAAUK,CAAiB,MAA3B,QAAAI,EAA8B,aAAa;AACvC,YAAAC,KAAOC,IAAAX,EAAUK,CAAiB,MAA3B,gBAAAM,EAA8B;AAE3C,MAAAC,EAAiBF,CAAI;AAAA,IACvB;AAAA,EAAA,GACC,CAACL,GAAmBL,CAAS,CAAC;AAE7B,SAAA,CAACI,KAAgBD,MAAa,YACzB,OAIP,gBAAAU;AAAA,IAACrB;AAAA,IAAA;AAAA,MACC,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,UAAUY;AAAA,MACV,eAAeH;AAAA,MACf,YAAYC;AAAA,MAEZ,UAAC,gBAAAW,EAAAC,GAAA,EAAU,OAAM,yBAAwB,SAASP,GAChD,UAAA,gBAAAM;AAAA,QAACxB;AAAA,QAAA;AAAA,UACC,UAAUe;AAAA,UACV,OAAOjB;AAAA,UACP,QAAQC;AAAA,UACR,KAAKgB,MAAiB,OAAOW,EAAc,UAAUA,EAAc;AAAA,QAAA;AAAA,MAAA,GAEvE;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"user-pin.js","sources":["../../../../src/features/worksheet/user-pointer-pin/user-pin.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\nimport styled from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport FlexView from '../../ui/layout/flex-view';\nimport { useWorksheetStore } from '../worksheet/hooks/use-worksheet-store';\nimport { scrollToQuestion } from '../worksheet/worksheet-helpers';\nimport useRemoteUserLocation from './hooks/use-user-location';\n\nconst USER_PIN_WIDTH = 32;\nconst USER_PIN_HEIGHT = 36;\n\nconst StyledImage = styled.img<{ $pointer: 'up' | 'down' | undefined }>`\n position: absolute;\n transform: ${({ $pointer }) =>\n $pointer === 'down'\n ? `translate(-${USER_PIN_WIDTH / 2}px, -${USER_PIN_HEIGHT}px)`\n : `translate(-${USER_PIN_WIDTH / 2}px, 0)`};\n`;\n\nconst StickyContainer = styled(FlexView)<{\n $pointer: 'up' | 'down' | undefined;\n $topOffset: number;\n $bottomOffset: number;\n}>(\n ({ $pointer, $topOffset, $bottomOffset }) => `\n position: sticky;\n top: ${\n $pointer === 'down' ? `calc(100% - ${$bottomOffset}px)` : `calc(${$topOffset + 48 + 8}px)`\n };\n z-index: 1;\n`,\n);\n\nconst UserPointer: FC = memo(function UserPointer() {\n const { topOffset, questions, userType, actionbarHeight } = useWorksheetStore(store => ({\n topOffset: store.layout.topOffset,\n questions: store.questions,\n userType: store.userType,\n actionbarHeight: store.actionbarHeight,\n }));\n const { peerLocation, peerQuestionIndex } = useRemoteUserLocation();\n\n const handleClick = useCallback(() => {\n if (peerQuestionIndex === undefined) {\n return null;\n }\n\n if (questions[peerQuestionIndex]?.response_id) {\n const qrId = questions[peerQuestionIndex]?.response_id as string;\n\n scrollToQuestion(qrId);\n }\n }, [peerQuestionIndex, questions]);\n\n if (!peerLocation || userType !== 'TEACHER') {\n return null;\n }\n\n return (\n <StickyContainer\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $pointer={peerLocation}\n $bottomOffset={actionbarHeight}\n $topOffset={topOffset}\n >\n <Clickable label=\"User Location Pointer\" onClick={handleClick}>\n <StyledImage\n $pointer={peerLocation}\n width={USER_PIN_WIDTH}\n height={USER_PIN_HEIGHT}\n src={peerLocation === 'up' ? ILLUSTRATIONS.USER_UP : ILLUSTRATIONS.USER_DOWN}\n />\n </Clickable>\n </StickyContainer>\n );\n});\n\nexport default UserPointer;\n"],"names":["USER_PIN_WIDTH","USER_PIN_HEIGHT","StyledImage","styled","$pointer","StickyContainer","FlexView","$topOffset","$bottomOffset","UserPointer","memo","topOffset","questions","userType","actionbarHeight","useWorksheetStore","store","peerLocation","peerQuestionIndex","useRemoteUserLocation","handleClick","useCallback","_a","qrId","_b","scrollToQuestion","jsx","Clickable","ILLUSTRATIONS"],"mappings":";;;;;;;;;AAUA,MAAMA,IAAiB,IACjBC,IAAkB,IAElBC,IAAcC,EAAO;AAAA;AAAA,eAEZ,CAAC,EAAE,UAAAC,QACdA,MAAa,SACT,cAAcJ,IAAiB,CAAC,QAAQC,CAAe,QACvD,cAAcD,IAAiB,CAAC,QAAQ;AAAA,GAG1CK,IAAkBF,EAAOG,CAAQ;AAAA,EAKrC,CAAC,EAAE,UAAAF,GAAU,YAAAG,GAAY,eAAAC,EAAoB,MAAA;AAAA;AAAA,SAG3CJ,MAAa,SAAS,eAAeI,CAAa,QAAQ,QAAQD,IAAa,KAAK,CAAC,KACvF;AAAA;AAAA;AAGF,GAEME,IAAkBC,EAAK,WAAuB;AAClD,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,iBAAAC,MAAoBC,EAAkB,CAAUC,OAAA;AAAA,IACtF,WAAWA,EAAM,OAAO;AAAA,IACxB,WAAWA,EAAM;AAAA,IACjB,UAAUA,EAAM;AAAA,IAChB,iBAAiBA,EAAM;AAAA,EACvB,EAAA,GACI,EAAE,cAAAC,GAAc,mBAAAC,EAAkB,IAAIC,EAAsB,GAE5DC,IAAcC,EAAY,MAAM;;AACpC,QAAIH,MAAsB;AACjB,aAAA;AAGL,SAAAI,IAAAV,EAAUM,CAAiB,MAA3B,QAAAI,EAA8B,aAAa;AACvC,YAAAC,KAAOC,IAAAZ,EAAUM,CAAiB,MAA3B,gBAAAM,EAA8B;AAE3C,MAAAC,EAAiBF,CAAI;AAAA,IACvB;AAAA,EAAA,GACC,CAACL,GAAmBN,CAAS,CAAC;A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