@cuemath/leap 3.2.17-mb → 3.2.17-pzd-0.1

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 (240) hide show
  1. package/dist/assets/illustrations/illustrations.js +6 -5
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/line-icons/icons/cue-board-filled.js +33 -0
  4. package/dist/assets/line-icons/icons/cue-board-filled.js.map +1 -0
  5. package/dist/assets/line-icons/icons/cue-board.js +23 -0
  6. package/dist/assets/line-icons/icons/cue-board.js.map +1 -0
  7. package/dist/assets/line-icons/icons/hint-fill.js +35 -0
  8. package/dist/assets/line-icons/icons/hint-fill.js.map +1 -0
  9. package/dist/assets/line-icons/icons/screen-grab-filled.js +35 -0
  10. package/dist/assets/line-icons/icons/screen-grab-filled.js.map +1 -0
  11. package/dist/assets/line-icons/icons/screen-grab.js +23 -0
  12. package/dist/assets/line-icons/icons/screen-grab.js.map +1 -0
  13. package/dist/assets/line-icons/icons/sticker-filled.js +64 -0
  14. package/dist/assets/line-icons/icons/sticker-filled.js.map +1 -0
  15. package/dist/assets/line-icons/icons/sticker.js +46 -0
  16. package/dist/assets/line-icons/icons/sticker.js.map +1 -0
  17. package/dist/assets/lottie/lottie.js +6 -1
  18. package/dist/assets/lottie/lottie.js.map +1 -1
  19. package/dist/features/analytics-events/platform-events-student.js +2 -1
  20. package/dist/features/analytics-events/platform-events-student.js.map +1 -1
  21. package/dist/features/analytics-events/platform-events-teacher.js +6 -4
  22. package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
  23. package/dist/features/analytics-events/whitelist-events.js +10 -8
  24. package/dist/features/analytics-events/whitelist-events.js.map +1 -1
  25. package/dist/features/auth/account-selector/account-selector.js +26 -25
  26. package/dist/features/auth/account-selector/account-selector.js.map +1 -1
  27. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +15 -14
  28. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
  29. package/dist/features/auth/comps/user-list/user-item/user-item.js +30 -31
  30. package/dist/features/auth/comps/user-list/user-item/user-item.js.map +1 -1
  31. package/dist/features/auth/comps/user-list/user-list.js +35 -34
  32. package/dist/features/auth/comps/user-list/user-list.js.map +1 -1
  33. package/dist/features/auth/forgot-password/forgot-password-styled.js +14 -15
  34. package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
  35. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +6 -7
  36. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
  37. package/dist/features/auth/login/login-styled.js +8 -9
  38. package/dist/features/auth/login/login-styled.js.map +1 -1
  39. package/dist/features/chapters-v2/utils/node-card-utils.js +9 -9
  40. package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
  41. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +4 -4
  42. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
  43. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +85 -85
  44. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
  45. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +121 -98
  46. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
  47. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +29 -28
  48. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +1 -1
  49. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +43 -42
  50. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
  51. package/dist/features/circle-games/games/tutorial/tutorial.js +43 -35
  52. package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
  53. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js +2 -2
  54. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js.map +1 -1
  55. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js +1 -1
  56. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js.map +1 -1
  57. package/dist/features/circle-games/sign-up/comp/username-input/username-input.js +26 -24
  58. package/dist/features/circle-games/sign-up/comp/username-input/username-input.js.map +1 -1
  59. package/dist/features/circle-games/sign-up/constants.js +3 -1
  60. package/dist/features/circle-games/sign-up/constants.js.map +1 -1
  61. package/dist/features/communication/pub-sub/constants.js +7 -4
  62. package/dist/features/communication/pub-sub/constants.js.map +1 -1
  63. package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +42 -42
  64. package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
  65. package/dist/features/homework/homework-card-view.js +85 -97
  66. package/dist/features/homework/homework-card-view.js.map +1 -1
  67. package/dist/features/homework/homework-card.js +44 -42
  68. package/dist/features/homework/homework-card.js.map +1 -1
  69. package/dist/features/homework/hw-card-list/hw-card-list-view.js +31 -29
  70. package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
  71. package/dist/features/homework/hw-card-list/hw-card-list.js +54 -48
  72. package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
  73. package/dist/features/homework/utils.js +33 -27
  74. package/dist/features/homework/utils.js.map +1 -1
  75. package/dist/features/journey/comps/coachmark/coachmark.js +29 -27
  76. package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
  77. package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +17 -11
  78. package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
  79. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +72 -0
  80. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +1 -0
  81. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +59 -0
  82. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +1 -0
  83. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +63 -0
  84. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +1 -0
  85. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +67 -0
  86. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +1 -0
  87. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +70 -0
  88. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +1 -0
  89. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +59 -0
  90. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +1 -0
  91. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +59 -0
  92. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +1 -0
  93. package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +70 -0
  94. package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +1 -0
  95. package/dist/features/journey/journey-id/journey-id-student.js +2 -2
  96. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  97. package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
  98. package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
  99. package/dist/features/journey/use-journey/journey-context-provider.js +73 -72
  100. package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
  101. package/dist/features/journey/use-journey/journey-styled.js +6 -4
  102. package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
  103. package/dist/features/puzzles/api/puzzle-dashboard.js +10 -0
  104. package/dist/features/puzzles/api/puzzle-dashboard.js.map +1 -0
  105. package/dist/features/puzzles/app/puzzle-app-styled.js +85 -0
  106. package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -0
  107. package/dist/features/puzzles/app/puzzle-app-view.js +120 -0
  108. package/dist/features/puzzles/app/puzzle-app-view.js.map +1 -0
  109. package/dist/features/puzzles/app/puzzle-app.js +62 -0
  110. package/dist/features/puzzles/app/puzzle-app.js.map +1 -0
  111. package/dist/features/puzzles/comps/puzzle-card-styled.js +24 -69
  112. package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
  113. package/dist/features/puzzles/comps/puzzle-card.js +79 -30
  114. package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
  115. package/dist/features/puzzles/constants/puzzle-container.js +8 -0
  116. package/dist/features/puzzles/constants/puzzle-container.js.map +1 -0
  117. package/dist/features/puzzles/puzzle-analytics-events.js +11 -0
  118. package/dist/features/puzzles/puzzle-analytics-events.js.map +1 -0
  119. package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +55 -25
  120. package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
  121. package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +55 -0
  122. package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +1 -0
  123. package/dist/features/puzzles/puzzle-container/puzzle-container.js +100 -107
  124. package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
  125. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +37 -0
  126. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +1 -0
  127. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +110 -0
  128. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +1 -0
  129. package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js +1 -1
  130. package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map +1 -1
  131. package/dist/features/puzzles/utils/puzzle-pattern.js +28 -13
  132. package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
  133. package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +6 -0
  134. package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +1 -0
  135. package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +12 -60
  136. package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
  137. package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +72 -77
  138. package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
  139. package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +63 -0
  140. package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +1 -0
  141. package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +21 -0
  142. package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +1 -0
  143. package/dist/features/ui/error/error.js +65 -27
  144. package/dist/features/ui/error/error.js.map +1 -1
  145. package/dist/features/ui/lottie-animation/lottie-animation.js +25 -29
  146. package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
  147. package/dist/features/ui/modals/modal-styled.js +34 -58
  148. package/dist/features/ui/modals/modal-styled.js.map +1 -1
  149. package/dist/features/ui/modals/modal.js +40 -14
  150. package/dist/features/ui/modals/modal.js.map +1 -1
  151. package/dist/features/ui/nudge/nudge-styled.js +14 -7
  152. package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
  153. package/dist/features/ui/nudge/nudge.js +13 -12
  154. package/dist/features/ui/nudge/nudge.js.map +1 -1
  155. package/dist/features/{stickers/sticker-selector/sticker-selector-styles.js → ui/sticker-grid/sticker-grid-styles.js} +3 -4
  156. package/dist/features/ui/sticker-grid/sticker-grid-styles.js.map +1 -0
  157. package/dist/features/ui/sticker-grid/sticker-grid.js +24 -0
  158. package/dist/features/ui/sticker-grid/sticker-grid.js.map +1 -0
  159. package/dist/features/ui/sticker-grid/sticker.js +57 -0
  160. package/dist/features/ui/sticker-grid/sticker.js.map +1 -0
  161. package/dist/features/ui/stickers/constants.js +6 -0
  162. package/dist/features/ui/stickers/constants.js.map +1 -0
  163. package/dist/features/{stickers/stickers-effects/effects.js → ui/stickers/stickers-effects.js} +6 -6
  164. package/dist/features/ui/stickers/stickers-effects.js.map +1 -0
  165. package/dist/features/{stickers/stickers-effects/stickers-effects-styled.js → ui/stickers/stickers-styled.js} +2 -2
  166. package/dist/features/ui/stickers/stickers-styled.js.map +1 -0
  167. package/dist/features/{stickers/stickers-effects/stickers-effects-utils.js → ui/stickers/stickers-utils.js} +6 -6
  168. package/dist/features/ui/stickers/stickers-utils.js.map +1 -0
  169. package/dist/features/ui/stickers/stickers.js +40 -0
  170. package/dist/features/ui/stickers/stickers.js.map +1 -0
  171. package/dist/features/ui/streak-icon/streak-icon-styled.js +13 -13
  172. package/dist/features/ui/streak-icon/streak-icon-styled.js.map +1 -1
  173. package/dist/features/ui/streak-icon/streak-icon.js +17 -15
  174. package/dist/features/ui/streak-icon/streak-icon.js.map +1 -1
  175. package/dist/features/ui/text/text.js +40 -36
  176. package/dist/features/ui/text/text.js.map +1 -1
  177. package/dist/features/ui/theme/constants.js +4 -2
  178. package/dist/features/ui/theme/constants.js.map +1 -1
  179. package/dist/features/ui/theme/get-device.js +3 -3
  180. package/dist/features/ui/theme/get-device.js.map +1 -1
  181. package/dist/features/worksheet/worksheet/constants.js +12 -13
  182. package/dist/features/worksheet/worksheet/constants.js.map +1 -1
  183. package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +28 -0
  184. package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +1 -0
  185. package/dist/features/worksheet/worksheet/worksheet-helpers.js +20 -19
  186. package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
  187. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +29 -25
  188. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
  189. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +101 -47
  190. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
  191. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +244 -255
  192. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
  193. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +242 -207
  194. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
  195. package/dist/features/worksheet/worksheet/worksheet-styled.js +45 -36
  196. package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
  197. package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
  198. package/dist/features/worksheet/worksheet/worksheet.js +321 -325
  199. package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
  200. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
  201. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
  202. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +44 -35
  203. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
  204. package/dist/index.d.ts +152 -56
  205. package/dist/index.js +563 -539
  206. package/dist/index.js.map +1 -1
  207. package/dist/static/nudge-tap.0591aef4.json +1 -0
  208. package/dist/static/puzzle-blue-lottie.7017e2e8.json +1 -0
  209. package/dist/static/puzzle-blue-lottie.bf64ebc5.json +12760 -0
  210. package/dist/static/puzzle-dashboard-banner.b7956519.svg +1 -0
  211. package/dist/static/puzzle-green-lottie.1da90698.json +1 -0
  212. package/dist/static/puzzle-orange-lottie.cfcf3724.json +1 -0
  213. package/dist/static/puzzle-pattern-blue.abff0164.svg +1 -0
  214. package/dist/static/puzzle-pattern-green.b8ba1840.svg +1 -0
  215. package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +1 -0
  216. package/dist/static/puzzle-pattern-purple.14b09759.svg +1 -0
  217. package/dist/static/puzzle-pattern-yellow.50917fab.svg +1 -0
  218. package/dist/static/puzzle-purple-lottie.e70de110.json +9860 -0
  219. package/dist/static/puzzle-yellow-lottie.275b5cf4.json +1 -0
  220. package/package.json +1 -1
  221. package/dist/features/hooks/use-viewport/use-viewport.js +0 -22
  222. package/dist/features/hooks/use-viewport/use-viewport.js.map +0 -1
  223. package/dist/features/stickers/sticker-data.js +0 -234
  224. package/dist/features/stickers/sticker-data.js.map +0 -1
  225. package/dist/features/stickers/sticker-selector/sticker-selector-styles.js.map +0 -1
  226. package/dist/features/stickers/sticker-selector/sticker-selector.js +0 -25
  227. package/dist/features/stickers/sticker-selector/sticker-selector.js.map +0 -1
  228. package/dist/features/stickers/sticker-selector/sticker.js +0 -57
  229. package/dist/features/stickers/sticker-selector/sticker.js.map +0 -1
  230. package/dist/features/stickers/stickers-effects/effects.js.map +0 -1
  231. package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +0 -1
  232. package/dist/features/stickers/stickers-effects/stickers-effects-utils.js.map +0 -1
  233. package/dist/features/stickers/stickers-effects/stickers-effects.js +0 -39
  234. package/dist/features/stickers/stickers-effects/stickers-effects.js.map +0 -1
  235. package/dist/static/nudge-tap.5cb30093.json +0 -1057
  236. package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +0 -1
  237. package/dist/static/puzzle-pattern-green.c9f84bbc.svg +0 -1
  238. package/dist/static/puzzle-pattern-orange.3da09665.svg +0 -1
  239. package/dist/static/puzzle-pattern-purple.5fb5a319.svg +0 -1
  240. package/dist/static/puzzle-pattern-yellow.aadbf457.svg +0 -1
@@ -0,0 +1,120 @@
1
+ import { jsxs as y, jsx as a } from "react/jsx-runtime";
2
+ import { memo as A, useRef as S, useCallback as _, useEffect as l, useMemo as $ } from "react";
3
+ import H from "../../ui/image/image.js";
4
+ import M from "../../ui/layout/flex-view.js";
5
+ import x from "../../ui/separator/separator.js";
6
+ import d from "../../worksheet/constants/events.js";
7
+ import N from "../../worksheet/worksheet/hooks/use-learnosity.js";
8
+ import Q from "../../worksheet/worksheet/hooks/use-worksheet-data-helper.js";
9
+ import { getQuestionsFromItems as V } from "../../worksheet/worksheet/worksheet-helpers.js";
10
+ import { PuzzleQuestionWrapper as P, PuzzleContainer as R } from "./puzzle-app-styled.js";
11
+ const F = (u) => {
12
+ if (!u) return null;
13
+ const t = u.match(/<img[^>]+src="([^">]+)"/);
14
+ return t ? t[1] : null;
15
+ }, L = ({
16
+ worksheetData: u,
17
+ loggerRef: t,
18
+ onWorksheetErrored: n,
19
+ imageHue: I,
20
+ onLoaded: p
21
+ }) => {
22
+ const { signed_request: g, questions_signed_request: w } = u, z = S(null), {
23
+ loadingState: i,
24
+ data: o,
25
+ error: f
26
+ } = Q({
27
+ attemptId: void 0,
28
+ signedRequest: g,
29
+ loggerRef: t
30
+ }), E = _(
31
+ (s) => {
32
+ n({
33
+ code: s.code,
34
+ message: s.detail
35
+ });
36
+ },
37
+ [n]
38
+ ), { learnosity: r } = N(w, E, t);
39
+ l(() => {
40
+ i === "error" && n({
41
+ message: f ?? "Error loading worksheet"
42
+ });
43
+ }, [i, n, f]), l(() => {
44
+ r && t.current(d.WORKSHEET_V3_LEARNOSITY_INITIALIZED);
45
+ }, [r, t]), l(() => {
46
+ r && i === "success" && p && (t.current(d.WORKSHEET_V3_READY), p());
47
+ }, [r, i, t, p]);
48
+ const m = $(() => i === "success" && (o != null && o.learnosityItems) ? (t.current(d.WORKSHEET_V3_READY), V(o.learnosityItems, {
49
+ sectioned: !1,
50
+ adaptive: !1
51
+ }).map((e) => ({
52
+ response_id: e.response_id,
53
+ type: e.type,
54
+ stimulus: e.stimulus,
55
+ template: e.template,
56
+ stimulus_review: e.stimulus_review,
57
+ options: e.options,
58
+ metadata: e.metadata,
59
+ validation: e.validation
60
+ // Add other properties as needed
61
+ }))) : [], [i, o, t]);
62
+ l(() => {
63
+ if (r && m.length > 0) {
64
+ const c = requestAnimationFrame(() => {
65
+ try {
66
+ r.renderMath("mathjax");
67
+ } catch (e) {
68
+ n({
69
+ message: `MathJax rendering failed: ${e instanceof Error ? e.message : "Unknown error"}`
70
+ });
71
+ }
72
+ });
73
+ return () => {
74
+ cancelAnimationFrame(c);
75
+ };
76
+ }
77
+ }, [r, n, m]);
78
+ const T = _((s) => {
79
+ const { stimulus: c = "", template: e = "", response_id: v } = s, h = F(c);
80
+ return /* @__PURE__ */ y(
81
+ M,
82
+ {
83
+ $background: "TRANSPARENT",
84
+ $alignItems: "center",
85
+ className: "puzzle-app-view-question-card",
86
+ children: [
87
+ h && /* @__PURE__ */ a(
88
+ H,
89
+ {
90
+ src: h,
91
+ alt: "Puzzle illustration",
92
+ width: 183,
93
+ height: 183,
94
+ withLoader: !0
95
+ }
96
+ ),
97
+ /* @__PURE__ */ a(x, { heightX: 1 }),
98
+ e && /* @__PURE__ */ a(P, { children: /* @__PURE__ */ a("div", { dangerouslySetInnerHTML: { __html: e } }) })
99
+ ]
100
+ },
101
+ v
102
+ );
103
+ }, []);
104
+ return m.length ? /* @__PURE__ */ a(
105
+ R,
106
+ {
107
+ ref: z,
108
+ $gapX: 1,
109
+ $gutterX: 1,
110
+ $imageHue: I,
111
+ $background: "WHITE_1",
112
+ className: "puzzle-app-view-container",
113
+ children: m.map((s) => /* @__PURE__ */ a("div", { children: T(s) }, `question-${s.response_id}`))
114
+ }
115
+ ) : null;
116
+ }, U = A(L);
117
+ export {
118
+ U as default
119
+ };
120
+ //# sourceMappingURL=puzzle-app-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"puzzle-app-view.js","sources":["../../../../src/features/puzzles/app/puzzle-app-view.tsx"],"sourcesContent":["import type {\n ILearnosityError,\n ILearnosityQuestion,\n} from '../../worksheet/worksheet/worksheet-types';\nimport type { IPuzzleAppViewProps } from './puzzle-app-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport Image from '../../ui/image/image';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport EVENTS from '../../worksheet/constants/events';\nimport useLearnosity from '../../worksheet/worksheet/hooks/use-learnosity';\nimport useWorksheetDataHelper from '../../worksheet/worksheet/hooks/use-worksheet-data-helper';\nimport { getQuestionsFromItems } from '../../worksheet/worksheet/worksheet-helpers';\nimport * as Styled from './puzzle-app-styled';\n\nconst extractImageFromHTML = (htmlString: string) => {\n if (!htmlString) return null;\n\n const imgMatch = htmlString.match(/<img[^>]+src=\"([^\">]+)\"/);\n\n return imgMatch ? imgMatch[1] : null;\n};\n\nconst PuzzleAppView: FC<IPuzzleAppViewProps> = ({\n worksheetData,\n loggerRef,\n onWorksheetErrored,\n imageHue,\n onLoaded,\n}) => {\n const { signed_request: itemsSignedRequest, questions_signed_request: questionSignedRequest } =\n worksheetData;\n\n // Ref for the container to trigger MathJax rendering\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Get Learnosity items using the signed_request (not questions_signed_request)\n const {\n loadingState,\n data: learnosityData,\n error: worksheetError,\n } = useWorksheetDataHelper({\n attemptId: undefined,\n signedRequest: itemsSignedRequest,\n loggerRef,\n });\n\n const onLearnosityErrored = useCallback(\n (err: ILearnosityError) => {\n onWorksheetErrored({\n code: err.code,\n message: err.detail,\n });\n },\n [onWorksheetErrored],\n );\n\n // Initialize Learnosity using questions_signed_request (needed for interactive questions)\n const { learnosity } = useLearnosity(questionSignedRequest, onLearnosityErrored, loggerRef);\n\n useEffect(() => {\n if (loadingState === 'error') {\n onWorksheetErrored({\n message: worksheetError ?? 'Error loading worksheet',\n });\n }\n }, [loadingState, onWorksheetErrored, worksheetError]);\n\n // Log when learnosity is ready for future interactive features\n useEffect(() => {\n if (learnosity) {\n loggerRef.current(EVENTS.WORKSHEET_V3_LEARNOSITY_INITIALIZED);\n }\n }, [learnosity, loggerRef]);\n\n useEffect(() => {\n if (learnosity && loadingState === 'success' && onLoaded) {\n loggerRef.current(EVENTS.WORKSHEET_V3_READY);\n onLoaded();\n }\n }, [learnosity, loadingState, loggerRef, onLoaded]);\n\n // Memoize questions processing to prevent re-render loops\n const questions = useMemo(() => {\n // Extract questions from Learnosity items when data is loaded successfully\n if (loadingState === 'success' && learnosityData?.learnosityItems) {\n loggerRef.current(EVENTS.WORKSHEET_V3_READY);\n\n // Convert learnosityItems to questions using the worksheet helper\n const worksheetQuestions = getQuestionsFromItems(learnosityData.learnosityItems, {\n sectioned: false,\n adaptive: false,\n });\n\n // Extract just the Learnosity questions from worksheet questions\n const learnosityQuestions: ILearnosityQuestion[] = worksheetQuestions.map(q => ({\n response_id: q.response_id,\n type: q.type,\n stimulus: q.stimulus,\n template: q.template,\n stimulus_review: q.stimulus_review,\n options: q.options,\n metadata: q.metadata,\n validation: q.validation,\n // Add other properties as needed\n }));\n\n return learnosityQuestions;\n }\n\n return [];\n }, [loadingState, learnosityData, loggerRef]);\n\n // Force MathJax rendering after questions are loaded and rendered\n // Similar to how useLearnosityAppend does it\n useEffect(() => {\n if (learnosity && questions.length > 0) {\n // Use requestAnimationFrame to ensure DOM is updated before rendering math\n const renderMath = () => {\n try {\n learnosity.renderMath('mathjax');\n } catch (error) {\n onWorksheetErrored({\n message: `MathJax rendering failed: ${\n error instanceof Error ? error.message : 'Unknown error'\n }`,\n });\n }\n };\n\n const animationId = requestAnimationFrame(renderMath);\n\n return () => {\n cancelAnimationFrame(animationId);\n };\n }\n }, [learnosity, onWorksheetErrored, questions]);\n\n const renderQuestionContent = useCallback((question: ILearnosityQuestion) => {\n const { stimulus = '', template = '', response_id: responseId } = question;\n const imageUrl = extractImageFromHTML(stimulus);\n\n return (\n <FlexView\n $background=\"TRANSPARENT\"\n key={responseId}\n $alignItems=\"center\"\n className=\"puzzle-app-view-question-card\"\n >\n {/* Main Image or Interactive Content */}\n {imageUrl && (\n <Image\n src={imageUrl}\n alt=\"Puzzle illustration\"\n width={183}\n height={183}\n withLoader={true}\n />\n )}\n\n <Separator heightX={1} />\n\n {/* Question HTML Content */}\n {template && (\n <Styled.PuzzleQuestionWrapper>\n <div dangerouslySetInnerHTML={{ __html: template }} />\n </Styled.PuzzleQuestionWrapper>\n )}\n </FlexView>\n );\n }, []);\n\n if (!questions.length) return null;\n\n return (\n <Styled.PuzzleContainer\n ref={containerRef}\n $gapX={1}\n $gutterX={1}\n $imageHue={imageHue}\n $background=\"WHITE_1\"\n className=\"puzzle-app-view-container\"\n >\n {questions.map(question => (\n <div key={`question-${question.response_id}`}>{renderQuestionContent(question)}</div>\n ))}\n </Styled.PuzzleContainer>\n );\n};\n\nexport default memo(PuzzleAppView);\n"],"names":["extractImageFromHTML","htmlString","imgMatch","PuzzleAppView","worksheetData","loggerRef","onWorksheetErrored","imageHue","onLoaded","itemsSignedRequest","questionSignedRequest","containerRef","useRef","loadingState","learnosityData","worksheetError","useWorksheetDataHelper","onLearnosityErrored","useCallback","err","learnosity","useLearnosity","useEffect","EVENTS","questions","useMemo","getQuestionsFromItems","q","animationId","error","renderQuestionContent","question","stimulus","template","responseId","imageUrl","jsxs","FlexView","jsx","Image","Separator","Styled.PuzzleQuestionWrapper","Styled.PuzzleContainer","PuzzleAppView$1","memo"],"mappings":";;;;;;;;;;AAkBA,MAAMA,IAAuB,CAACC,MAAuB;AAC/C,MAAA,CAACA,EAAmB,QAAA;AAElB,QAAAC,IAAWD,EAAW,MAAM,yBAAyB;AAEpD,SAAAC,IAAWA,EAAS,CAAC,IAAI;AAClC,GAEMC,IAAyC,CAAC;AAAA,EAC9C,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AACF,MAAM;AACJ,QAAM,EAAE,gBAAgBC,GAAoB,0BAA0BC,MACpEN,GAGIO,IAAeC,EAAuB,IAAI,GAG1C;AAAA,IACJ,cAAAC;AAAA,IACA,MAAMC;AAAA,IACN,OAAOC;AAAA,MACLC,EAAuB;AAAA,IACzB,WAAW;AAAA,IACX,eAAeP;AAAA,IACf,WAAAJ;AAAA,EAAA,CACD,GAEKY,IAAsBC;AAAA,IAC1B,CAACC,MAA0B;AACN,MAAAb,EAAA;AAAA,QACjB,MAAMa,EAAI;AAAA,QACV,SAASA,EAAI;AAAA,MAAA,CACd;A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eY,IAAAC,EAAKzC,CAAa;"}
@@ -0,0 +1,62 @@
1
+ import { jsx as e, jsxs as o, Fragment as W } from "react/jsx-runtime";
2
+ import { memo as v, useState as h, useRef as P, useCallback as n, useEffect as R } from "react";
3
+ import y from "../../ui/error/error.js";
4
+ import d from "../../ui/layout/flex-view.js";
5
+ import F from "../../ui/loader/app-loader/app-loader.js";
6
+ import p from "../../ui/text/text.js";
7
+ import { usePreviewWorksheetGet as I } from "../../worksheet/worksheet-preview/api/get-preview-worksheet.js";
8
+ import { PuzzleAppWrapper as L, StyledFeedbackText as T, StyledHintFillIcon as D } from "./puzzle-app-styled.js";
9
+ import G from "./puzzle-app-view.js";
10
+ const S = ({ itemRef: s, title: m, imageHue: i, feedbackComments: l, tip: f }) => {
11
+ const [u, g] = h(), [r, $] = h(!1), { isProcessing: k, get: a, data: c, error: w } = I(), z = P(() => null), A = f || "Celebrate persistence more than correct answers - it's a life skill worth building.", t = n(() => {
12
+ a("test", {
13
+ action: "review",
14
+ node_type: "PUZZLE_CARD",
15
+ items: [s]
16
+ });
17
+ }, [a, s]);
18
+ R(() => {
19
+ t();
20
+ }, [t]);
21
+ const b = n((E) => {
22
+ g(E.message);
23
+ }, []), x = n(() => {
24
+ $(!0);
25
+ }, []);
26
+ return u || w ? /* @__PURE__ */ e(y, { height: "100vh", onTryAgain: t }) : k ? /* @__PURE__ */ e(F, { height: "100vh" }) : /* @__PURE__ */ o(
27
+ L,
28
+ {
29
+ className: "puzzle-app-container",
30
+ $background: `${i}_2`,
31
+ $alignItems: "center",
32
+ $flexGapX: 1,
33
+ $gutterX: 1,
34
+ $visible: r,
35
+ $height: "100vh",
36
+ children: [
37
+ r && /* @__PURE__ */ e(p, { $renderAs: "ab1-bold", children: m }),
38
+ c && /* @__PURE__ */ e(
39
+ G,
40
+ {
41
+ onWorksheetErrored: b,
42
+ worksheetData: c,
43
+ loggerRef: z,
44
+ imageHue: i,
45
+ onLoaded: x
46
+ }
47
+ ),
48
+ r && /* @__PURE__ */ e(W, { children: l ? /* @__PURE__ */ o(T, { $renderAs: "ab2", children: [
49
+ /* @__PURE__ */ e("span", { children: "Tutor Remark:" }),
50
+ l
51
+ ] }) : /* @__PURE__ */ o(d, { $flexDirection: "row", $alignItems: "center", $flexGap: 8, children: [
52
+ /* @__PURE__ */ e(d, { $width: 24, $height: 24, children: /* @__PURE__ */ e(D, {}) }),
53
+ /* @__PURE__ */ e(p, { $renderAs: "ab2", children: A })
54
+ ] }) })
55
+ ]
56
+ }
57
+ );
58
+ }, B = v(S);
59
+ export {
60
+ B as default
61
+ };
62
+ //# sourceMappingURL=puzzle-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"puzzle-app.js","sources":["../../../../src/features/puzzles/app/puzzle-app.tsx"],"sourcesContent":["import type { IPuzzleAppProps } from './puzzle-app-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useRef, useState } from 'react';\n\nimport Error from '../../ui/error/error';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { usePreviewWorksheetGet } from '../../worksheet/worksheet-preview/api/get-preview-worksheet';\nimport * as Styled from './puzzle-app-styled';\nimport PuzzleAppView from './puzzle-app-view';\n\nconst PuzzleApp: FC<IPuzzleAppProps> = ({ itemRef, title, imageHue, feedbackComments, tip }) => {\n const [error, setError] = useState<string>();\n const [worksheetRendered, setWorksheetRendered] = useState<boolean>(false);\n\n const { isProcessing, get, data: worksheetData, error: fetchError } = usePreviewWorksheetGet();\n const loggerRef = useRef(() => null);\n\n const tipInfo =\n tip || `Celebrate persistence more than correct answers - it's a life skill worth building.`;\n\n const fetchWorksheet = useCallback(() => {\n get('test', {\n action: 'review',\n node_type: 'PUZZLE_CARD',\n items: [itemRef],\n });\n }, [get, itemRef]);\n\n useEffect(() => {\n fetchWorksheet();\n }, [fetchWorksheet]);\n\n const handleWorksheetErrored = useCallback((err: { code?: number; message: string }) => {\n setError(err.message);\n }, []);\n\n const handleWorksheetLoaded = useCallback(() => {\n setWorksheetRendered(true);\n }, []);\n\n if (error || fetchError) {\n return <Error height=\"100vh\" onTryAgain={fetchWorksheet} />;\n }\n\n if (isProcessing) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.PuzzleAppWrapper\n className=\"puzzle-app-container\"\n $background={`${imageHue}_2`}\n $alignItems=\"center\"\n $flexGapX={1}\n $gutterX={1}\n $visible={worksheetRendered}\n $height=\"100vh\"\n >\n {worksheetRendered && <Text $renderAs=\"ab1-bold\">{title}</Text>}\n\n {worksheetData && (\n <PuzzleAppView\n onWorksheetErrored={handleWorksheetErrored}\n worksheetData={worksheetData}\n loggerRef={loggerRef}\n imageHue={imageHue}\n onLoaded={handleWorksheetLoaded}\n />\n )}\n\n {worksheetRendered && (\n <>\n {feedbackComments ? (\n <Styled.StyledFeedbackText $renderAs=\"ab2\">\n <span>Tutor Remark:</span>\n {feedbackComments}\n </Styled.StyledFeedbackText>\n ) : (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={8}>\n <FlexView $width={24} $height={24}>\n <Styled.StyledHintFillIcon />\n </FlexView>\n <Text $renderAs=\"ab2\">{tipInfo}</Text>\n </FlexView>\n )}\n </>\n )}\n </Styled.PuzzleAppWrapper>\n );\n};\n\nexport default memo(PuzzleApp);\n"],"names":["PuzzleApp","itemRef","title","imageHue","feedbackComments","tip","error","setError","useState","worksheetRendered","setWorksheetRendered","isProcessing","get","worksheetData","fetchError","usePreviewWorksheetGet","loggerRef","useRef","tipInfo","fetchWorksheet","useCallback","useEffect","handleWorksheetErrored","err","handleWorksheetLoaded","jsx","Error","AppLoader","jsxs","Styled.PuzzleAppWrapper","Text","PuzzleAppView","Styled.StyledFeedbackText","FlexView","Styled.StyledHintFillIcon","puzzleApp","memo"],"mappings":";;;;;;;;;AAaA,MAAMA,IAAiC,CAAC,EAAE,SAAAC,GAAS,OAAAC,GAAO,UAAAC,GAAU,kBAAAC,GAAk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AUqB;AAAA,UAAA;AAAA,QACZ;AAAA,QAGDf,4BAEI,UACCL,IAAA,gBAAAwB,EAACI,GAAA,EAA0B,WAAU,OACnC,UAAA;AAAA,UAAA,gBAAAP,EAAC,UAAK,UAAa,gBAAA,CAAA;AAAA,UAClBrB;AAAA,QACH,EAAA,CAAA,sBAEC6B,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,UAAU,GAC5D,UAAA;AAAA,UAAC,gBAAAR,EAAAQ,GAAA,EAAS,QAAQ,IAAI,SAAS,IAC7B,UAAC,gBAAAR,EAAAS,GAAA,CAAA,CAA0B,EAC7B,CAAA;AAAA,UACC,gBAAAT,EAAAK,GAAA,EAAK,WAAU,OAAO,UAAQZ,GAAA;AAAA,QAAA,EAAA,CACjC,EAEJ,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,GAEeiB,IAAAC,EAAKpC,CAAS;"}
@@ -1,79 +1,34 @@
1
- import e, { keyframes as a, css as r } from "styled-components";
2
- import n from "../../ui/layout/flex-view.js";
3
- import { getPuzzleCardPattern as l } from "../utils/puzzle-pattern.js";
4
- const m = a`
5
- from { transform: translateY(-100%); }
6
- to { transform: translateY(0); }
7
- `, o = a`
8
- from { transform: rotateY(0deg); }
9
- to { transform: rotateY(360deg); }
10
- `, c = a`
11
- from { transform: translateY(0); opacity: 1; }
12
- to { transform: translateY(-100%); opacity: 0; }
13
- `, d = e(n)`
1
+ import e from "styled-components";
2
+ import r from "../../ui/layout/flex-view.js";
3
+ import i from "../../ui/text/text.js";
4
+ import { getPuzzleCardPattern as p } from "../utils/puzzle-pattern.js";
5
+ const n = e(r)`
14
6
  position: relative;
7
+ cursor: pointer;
15
8
 
16
- box-shadow: inset 0px 0px 0px 4px ${({ theme: t, $imageHue: i }) => t.colors[`${i}_4`]};
9
+ box-shadow: inset 0px 0px 0px 4px ${({ theme: o, $imageHue: t }) => o.colors[`${t}_4`]};
17
10
 
18
- background-image: ${({ $imageHue: t }) => `url(${l(t)})`};
11
+ background-image: ${({ $imageHue: o }) => `url(${p(o)})`};
19
12
  background-size: cover;
20
13
 
21
- ${({ $animationPhase: t }) => t && r`
22
- transform-style: preserve-3d;
23
- opacity: 0;
24
- visibility: hidden;
25
- transform: translateY(-100%);
26
- `}
27
-
28
- ${({ $animationPhase: t, theme: i, $imageHue: s }) => {
29
- switch (t) {
30
- case "movingIn":
31
- return r`
32
- visibility: visible;
33
- opacity: 1;
34
- animation: ${m} 0.5s ease-out forwards;
35
- `;
36
- case "revealing":
37
- return r`
38
- visibility: visible;
39
- opacity: 1;
40
- transform: translateY(0); /* Position after moveIn */
41
- animation: ${o} 1s ease-in-out forwards;
42
- `;
43
- case "visible":
44
- return r`
45
- visibility: visible;
46
- opacity: 1;
47
- transform: translateY(0) rotateY(360deg);
48
- background-color: ${i.colors[`${s}_2`]};
49
- transition: background-color 0.2s ease-in;
50
- `;
51
- case "assigning":
52
- return r`
53
- visibility: visible;
54
- opacity: 1;
55
- transform: translateY(0); /* Reset rotation for this animation */
56
- animation: ${o} 1s ease-in-out forwards;
57
- `;
58
- case "assigned":
59
- return r`
60
- visibility: visible;
61
- opacity: 1;
62
- transform: translateY(0) rotateY(360deg);
63
- `;
64
- case "movingOut":
65
- return r`
66
- visibility: visible;
67
- opacity: 1;
68
- transform: translateY(0); /* Start from final position */
69
- animation: ${c} 0.5s ease-in forwards;
70
- `;
71
- default:
72
- return "";
14
+ &:hover {
15
+ outline: 1px solid ${({ theme: o }) => o.colors.BLACK_1};
73
16
  }
74
- }}
17
+ `, x = e(i)`
18
+ display: -webkit-box;
19
+ -webkit-line-clamp: 3;
20
+ -webkit-box-orient: vertical;
21
+ overflow: hidden;
22
+ text-overflow: ellipsis;
23
+ white-space: break-spaces;
24
+ `, b = e(r)`
25
+ position: absolute;
26
+ top: -16px;
27
+ right: -15px;
75
28
  `;
76
29
  export {
77
- d as PuzzleWrapper
30
+ n as PuzzleWrapper,
31
+ b as StickerWrapper,
32
+ x as Title
78
33
  };
79
34
  //# sourceMappingURL=puzzle-card-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"puzzle-card-styled.js","sources":["../../../../src/features/puzzles/comps/puzzle-card-styled.tsx"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport styled, { css, keyframes } from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport { getPuzzleCardPattern } from '../utils/puzzle-pattern';\n\n// --- Keyframes for each animation step ---\nconst moveInAnim = keyframes`\n from { transform: translateY(-100%); }\n to { transform: translateY(0); }\n`;\n\nconst rotateYAnim = keyframes`\n from { transform: rotateY(0deg); }\n to { transform: rotateY(360deg); }\n`;\n\nconst moveOutAnim = keyframes`\n from { transform: translateY(0); opacity: 1; }\n to { transform: translateY(-100%); opacity: 0; }\n`;\n\nconst PuzzleWrapper = styled(FlexView)<{ $animationPhase?: string; $imageHue: THueNames }>`\n position: relative;\n\n box-shadow: inset 0px 0px 0px 4px ${({ theme, $imageHue }) => theme.colors[`${$imageHue}_4`]};\n\n background-image: ${({ $imageHue }) => `url(${getPuzzleCardPattern($imageHue)})`};\n background-size: cover;\n\n ${({ $animationPhase }) =>\n $animationPhase &&\n css`\n transform-style: preserve-3d;\n opacity: 0;\n visibility: hidden;\n transform: translateY(-100%);\n `}\n\n ${({ $animationPhase, theme, $imageHue }) => {\n switch ($animationPhase) {\n case 'movingIn':\n return css`\n visibility: visible;\n opacity: 1;\n animation: ${moveInAnim} 0.5s ease-out forwards;\n `;\n case 'revealing':\n return css`\n visibility: visible;\n opacity: 1;\n transform: translateY(0); /* Position after moveIn */\n animation: ${rotateYAnim} 1s ease-in-out forwards;\n `;\n case 'visible':\n return css`\n visibility: visible;\n opacity: 1;\n transform: translateY(0) rotateY(360deg);\n background-color: ${theme.colors[`${$imageHue}_2`]};\n transition: background-color 0.2s ease-in;\n `;\n case 'assigning':\n return css`\n visibility: visible;\n opacity: 1;\n transform: translateY(0); /* Reset rotation for this animation */\n animation: ${rotateYAnim} 1s ease-in-out forwards;\n `;\n case 'assigned':\n return css`\n visibility: visible;\n opacity: 1;\n transform: translateY(0) rotateY(360deg);\n `;\n case 'movingOut':\n return css`\n visibility: visible;\n opacity: 1;\n transform: translateY(0); /* Start from final position */\n animation: ${moveOutAnim} 0.5s ease-in forwards;\n `;\n default:\n return '';\n }\n }}\n`;\n\nexport { PuzzleWrapper };\n"],"names":["moveInAnim","keyframes","rotateYAnim","moveOutAnim","PuzzleWrapper","styled","FlexView","theme","$imageHue","getPuzzleCardPattern","$animationPhase","css"],"mappings":";;;AAQA,MAAMA,IAAaC;AAAA;AAAA;AAAA,GAKbC,IAAcD;AAAA;AAAA;AAAA,GAKdE,IAAcF;AAAA;AAAA;AAAA,GAKdG,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA,sCAGC,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgBD,EAAM,OAAO,GAAGC,CAAS,IAAI,CAAC;AAAA;AAAA,sBAExE,CAAC,EAAE,WAAAA,EAAU,MAAM,OAAOC,EAAqBD,CAAS,CAAC,GAAG;AAAA;AAAA;AAAA,IAG9E,CAAC,EAAE,iBAAAE,QACHA,KACAC;AAAA;AAAA;AAAA;AAAA;AAAA,KAKC;AAAA;AAAA,IAED,CAAC,EAAE,iBAAAD,GAAiB,OAAAH,GAAO,WAAAC,QAAgB;AAC3C,UAAQE,GAAiB;AAAA,IACvB,KAAK;AACI,aAAAC;AAAA;AAAA;AAAA,uBAGQX,CAAU;AAAA;AAAA,IAE3B,KAAK;AACI,aAAAW;AAAA;AAAA;AAAA;AAAA,uBAIQT,CAAW;AAAA;AAAA,IAE5B,KAAK;AACI,aAAAS;AAAA;AAAA;AAAA;AAAA,8BAIeJ,EAAM,OAAO,GAAGC,CAAS,IAAI,CAAC;AAAA;AAAA;AAAA,IAGtD,KAAK;AACI,aAAAG;AAAA;AAAA;AAAA;AAAA,uBAIQT,CAAW;AAAA;AAAA,IAE5B,KAAK;AACI,aAAAS;AAAA;AAAA;AAAA;AAAA;AAAA,IAKT,KAAK;AACI,aAAAA;AAAA;AAAA;AAAA;AAAA,uBAIQR,CAAW;AAAA;AAAA,IAE5B;AACS,aAAA;AAAA,EACX;AACF,CAAC;AAAA;"}
1
+ {"version":3,"file":"puzzle-card-styled.js","sources":["../../../../src/features/puzzles/comps/puzzle-card-styled.tsx"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { getPuzzleCardPattern } from '../utils/puzzle-pattern';\n\nconst PuzzleWrapper = styled(FlexView)<{ $animationPhase?: string; $imageHue: THueNames }>`\n position: relative;\n cursor: pointer;\n\n box-shadow: inset 0px 0px 0px 4px ${({ theme, $imageHue }) => theme.colors[`${$imageHue}_4`]};\n\n background-image: ${({ $imageHue }) => `url(${getPuzzleCardPattern($imageHue)})`};\n background-size: cover;\n\n &:hover {\n outline: 1px solid ${({ theme }) => theme.colors.BLACK_1};\n }\n`;\n\nconst Title = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\nconst StickerWrapper = styled(FlexView)`\n position: absolute;\n top: -16px;\n right: -15px;\n`;\n\nexport { PuzzleWrapper, Title, StickerWrapper };\n"],"names":["PuzzleWrapper","styled","FlexView","theme","$imageHue","getPuzzleCardPattern","Title","Text","StickerWrapper"],"mappings":";;;;AAQM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,sCAIC,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgBD,EAAM,OAAO,GAAGC,CAAS,IAAI,CAAC;AAAA;AAAA,sBAExE,CAAC,EAAE,WAAAA,EAAU,MAAM,OAAOC,EAAqBD,CAAS,CAAC,GAAG;AAAA;AAAA;AAAA;AAAA,yBAIzD,CAAC,EAAE,OAAAD,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA,GAItDG,IAAQL,EAAOM,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASnBC,IAAiBP,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,35 +1,84 @@
1
- import { jsx as h } from "react/jsx-runtime";
2
- import { memo as p } from "react";
3
- import { PuzzleWrapper as s } from "./puzzle-card-styled.js";
4
- const c = p(
1
+ import { jsx as i, jsxs as f } from "react/jsx-runtime";
2
+ import { memo as P, useRef as _, useMemo as y, useCallback as s } from "react";
3
+ import S from "../../ui/buttons/clickable/clickable.js";
4
+ import b from "../../ui/image/image.js";
5
+ import A from "../../ui/layout/flex-view.js";
6
+ import Z from "../../ui/lottie-animation/lottie-animation.js";
7
+ import { PUZZLE_ANALYTICS_EVENTS as k } from "../puzzle-analytics-events.js";
8
+ import { getPuzzleStickerLottie as x } from "../utils/puzzle-feedback-celebration.js";
9
+ import { PuzzleWrapper as M, Title as j, StickerWrapper as v } from "./puzzle-card-styled.js";
10
+ const R = {
11
+ autoplay: !1,
12
+ loop: !0,
13
+ renderer: "canvas"
14
+ }, G = P(
5
15
  ({
6
- children: e,
7
- imageHue: t,
8
- onAnimationEnd: r,
9
- animationPhase: o,
10
- width: i,
11
- widthX: m,
12
- height: n,
13
- heightX: $,
14
- backgroundColor: a
15
- }) => /* @__PURE__ */ h(
16
- s,
17
- {
18
- $animationPhase: o,
19
- onAnimationEnd: r,
20
- $width: i,
21
- $height: n,
22
- $widthX: m,
23
- $heightX: $,
24
- $alignItems: "center",
25
- $justifyContent: "center",
26
- $imageHue: t,
27
- $background: a ?? `${t}_6`,
28
- children: e
29
- }
30
- )
16
+ imageHue: c,
17
+ imageUrl: u,
18
+ title: h,
19
+ height: $ = "100%",
20
+ width: z = "100%",
21
+ onCardClick: n,
22
+ userNodeId: o,
23
+ rewards: r,
24
+ studentId: a,
25
+ nodeId: m
26
+ }) => {
27
+ const { sticker: p } = (r == null ? void 0 : r[0]) || {}, l = _(null), L = y(
28
+ () => ({
29
+ node_id: m,
30
+ student_id: a,
31
+ node_type: "PUZZLE_CARD"
32
+ }),
33
+ [m, a]
34
+ ), e = p ? x(p) : void 0, g = s(() => {
35
+ o && (n == null || n(o));
36
+ }, [n, o]), E = s(() => {
37
+ var t;
38
+ e && ((t = l.current) == null || t.play());
39
+ }, [e]), d = s(() => {
40
+ var t;
41
+ e && ((t = l.current) == null || t.stop());
42
+ }, [e]);
43
+ return /* @__PURE__ */ i(
44
+ S,
45
+ {
46
+ label: "",
47
+ analyticsLabel: k.PUZZLE_VIEWED,
48
+ analyticsProps: L,
49
+ onClick: g,
50
+ children: /* @__PURE__ */ f(
51
+ M,
52
+ {
53
+ $width: z,
54
+ $height: $,
55
+ $justifyContent: "center",
56
+ $alignItems: "center",
57
+ $imageHue: c,
58
+ $background: `${c}_2`,
59
+ onMouseEnter: E,
60
+ onMouseLeave: d,
61
+ children: [
62
+ /* @__PURE__ */ f(A, { $justifyContent: "center", $alignItems: "center", $flexGap: 12, children: [
63
+ /* @__PURE__ */ i(b, { src: u ?? "", width: 68, height: 68, withLoader: !1, alt: "Puzzle" }),
64
+ /* @__PURE__ */ i(j, { $renderAs: "ab3", $align: "center", $width: "80%", children: h })
65
+ ] }),
66
+ e && /* @__PURE__ */ i(v, { $widthX: 2.5, $heightX: 2.5, children: /* @__PURE__ */ i(
67
+ Z,
68
+ {
69
+ src: e,
70
+ ref: l,
71
+ settings: R
72
+ }
73
+ ) })
74
+ ]
75
+ }
76
+ )
77
+ }
78
+ );
79
+ }
31
80
  );
32
81
  export {
33
- c as default
82
+ G as default
34
83
  };
35
84
  //# sourceMappingURL=puzzle-card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"puzzle-card.js","sources":["../../../../src/features/puzzles/comps/puzzle-card.tsx"],"sourcesContent":["import type { IPuzzleCardProps } from './puzzle-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport * as Styled from './puzzle-card-styled';\n\nconst PuzzleCard: FC<IPuzzleCardProps> = memo(\n ({\n children,\n imageHue,\n onAnimationEnd,\n animationPhase,\n width,\n widthX,\n height,\n heightX,\n backgroundColor,\n }) => {\n return (\n <Styled.PuzzleWrapper\n $animationPhase={animationPhase}\n onAnimationEnd={onAnimationEnd}\n $width={width}\n $height={height}\n $widthX={widthX}\n $heightX={heightX}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $imageHue={imageHue}\n $background={backgroundColor ?? `${imageHue}_6`}\n >\n {children}\n </Styled.PuzzleWrapper>\n );\n },\n);\n\nexport default PuzzleCard;\n"],"names":["PuzzleCard","memo","children","imageHue","onAnimationEnd","animationPhase","width","widthX","height","heightX","backgroundColor","jsx","Styled.PuzzleWrapper"],"mappings":";;;AAOA,MAAMA,IAAmCC;AAAA,EACvC,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,EAAA,MAGE,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,iBAAiBP;AAAA,MACjB,gBAAAD;AAAA,MACA,QAAQE;AAAA,MACR,SAASE;AAAA,MACT,SAASD;AAAA,MACT,UAAUE;AAAA,MACV,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,WAAWN;AAAA,MACX,aAAaO,KAAmB,GAAGP,CAAQ;AAAA,MAE1C,UAAAD;AAAA,IAAA;AAAA,EAAA;AAIT;"}
1
+ {"version":3,"file":"puzzle-card.js","sources":["../../../../src/features/puzzles/comps/puzzle-card.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../ui/lottie-animation/types';\nimport type { IPuzzleCardProps } from './puzzle-card-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useMemo, useRef } from 'react';\n\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport Image from '../../ui/image/image';\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { PUZZLE_ANALYTICS_EVENTS } from '../puzzle-analytics-events';\nimport { getPuzzleStickerLottie } from '../utils/puzzle-feedback-celebration';\nimport * as Styled from './puzzle-card-styled';\n\nconst puzzleStickerLottieSettings = {\n autoplay: false,\n loop: true,\n renderer: 'canvas',\n};\n\nconst PuzzleCard: FC<IPuzzleCardProps> = memo(\n ({\n imageHue,\n imageUrl,\n title,\n height = '100%',\n width = '100%',\n onCardClick,\n userNodeId,\n rewards,\n studentId,\n nodeId,\n }) => {\n const { sticker } = rewards?.[0] || {};\n\n const lottieAnimationRef = useRef<ILottieAnimationRef | null>(null);\n\n const analyticsProps = useMemo(\n () => ({\n node_id: nodeId,\n student_id: studentId,\n node_type: 'PUZZLE_CARD',\n }),\n [nodeId, studentId],\n );\n\n const puzzleStickerLottie = sticker ? getPuzzleStickerLottie(sticker) : undefined;\n\n const handleCardClick = useCallback(() => {\n if (userNodeId) {\n onCardClick?.(userNodeId);\n }\n }, [onCardClick, userNodeId]);\n\n const handleOnMouseEnter = useCallback(() => {\n if (puzzleStickerLottie) lottieAnimationRef.current?.play();\n }, [puzzleStickerLottie]);\n\n const handleOnMouseLeave = useCallback(() => {\n if (puzzleStickerLottie) lottieAnimationRef.current?.stop();\n }, [puzzleStickerLottie]);\n\n return (\n <Clickable\n label=\"\"\n analyticsLabel={PUZZLE_ANALYTICS_EVENTS.PUZZLE_VIEWED}\n analyticsProps={analyticsProps}\n onClick={handleCardClick}\n >\n <Styled.PuzzleWrapper\n $width={width}\n $height={height}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $imageHue={imageHue}\n $background={`${imageHue}_2`}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $flexGap={12}>\n <Image src={imageUrl ?? ''} width={68} height={68} withLoader={false} alt=\"Puzzle\" />\n\n <Styled.Title $renderAs=\"ab3\" $align=\"center\" $width=\"80%\">\n {title}\n </Styled.Title>\n </FlexView>\n\n {puzzleStickerLottie && (\n <Styled.StickerWrapper $widthX={2.5} $heightX={2.5}>\n <LottieAnimation\n src={puzzleStickerLottie}\n ref={lottieAnimationRef}\n settings={puzzleStickerLottieSettings}\n />\n </Styled.StickerWrapper>\n )}\n </Styled.PuzzleWrapper>\n </Clickable>\n );\n },\n);\n\nexport default PuzzleCard;\n"],"names":["puzzleStickerLottieSettings","PuzzleCard","memo","imageHue","imageUrl","title","height","width","onCardClick","userNodeId","rewards","studentId","nodeId","sticker","lottieAnimationRef","useRef","analyticsProps","useMemo","puzzleStickerLottie","getPuzzleStickerLottie","handleCardClick","useCallback","handleOnMouseEnter","_a","handleOnMouseLeave","jsx","Clickable","PUZZLE_ANALYTICS_EVENTS","jsxs","Styled.PuzzleWrapper","FlexView","Image","Styled.Title","Styled.StickerWrapper","LottieAnimation"],"mappings":";;;;;;;;;AAcA,MAAMA,IAA8B;AAAA,EAClC,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AACZ,GAEMC,IAAmCC;AAAA,EACvC,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ;AAAA,IACR,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,EAAA,MACI;AACJ,UAAM,EAAE,SAAAC,EAAQ,KAAIH,KAAA,gBAAAA,EAAU,OAAM,CAAA,GAE9BI,IAAqBC,EAAmC,IAAI,GAE5DC,IAAiBC;AAAA,MACrB,OAAO;AAAA,QACL,SAASL;AAAA,QACT,YAAYD;AAAA,QACZ,WAAW;AAAA,MAAA;AAAA,MAEb,CAACC,GAAQD,CAAS;AAAA,IAAA,GAGdO,IAAsBL,IAAUM,EAAuBN,CAAO,IAAI,QAElEO,IAAkBC,EAAY,MAAM;AACx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A,IAAA;AAAA,EAGN;AACF;"}
@@ -0,0 +1,8 @@
1
+ const A = {
2
+ REVEAL: [0, 50],
3
+ REVEAL_ASSIGNED: [58, 160]
4
+ };
5
+ export {
6
+ A as PUZZLE_ASSIGN_ANIMATION
7
+ };
8
+ //# sourceMappingURL=puzzle-container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"puzzle-container.js","sources":["../../../../src/features/puzzles/constants/puzzle-container.ts"],"sourcesContent":["import type { AnimationSegment } from 'lottie-web';\n\nexport const PUZZLE_ASSIGN_ANIMATION = {\n REVEAL: [0, 50] as AnimationSegment,\n REVEAL_ASSIGNED: [58, 160] as AnimationSegment,\n};\n"],"names":["PUZZLE_ASSIGN_ANIMATION"],"mappings":"AAEO,MAAMA,IAA0B;AAAA,EACrC,QAAQ,CAAC,GAAG,EAAE;AAAA,EACd,iBAAiB,CAAC,IAAI,GAAG;AAC3B;"}
@@ -0,0 +1,11 @@
1
+ import { PLUGINS as z } from "../../node_modules/@cuemath/analytics-v2/dist/constants.js";
2
+ var E = /* @__PURE__ */ ((e) => (e.PUZZLE_ASSIGNED = "puzzle_assigned", e.PUZZLE_VIEWED = "puzzle_viewed", e))(E || {});
3
+ const _ = {
4
+ puzzle_viewed: [z.MIXPANEL],
5
+ puzzle_assigned: [z.MIXPANEL]
6
+ };
7
+ export {
8
+ E as PUZZLE_ANALYTICS_EVENTS,
9
+ _ as PUZZLE_ANALYTICS_WHITELIST_EVENTS
10
+ };
11
+ //# sourceMappingURL=puzzle-analytics-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"puzzle-analytics-events.js","sources":["../../../src/features/puzzles/puzzle-analytics-events.ts"],"sourcesContent":["import { PLUGINS } from '@cuemath/analytics-v2/dist/constants';\n\nexport enum PUZZLE_ANALYTICS_EVENTS {\n PUZZLE_ASSIGNED = 'puzzle_assigned',\n PUZZLE_VIEWED = 'puzzle_viewed',\n}\n\nexport const PUZZLE_ANALYTICS_WHITELIST_EVENTS = {\n [PUZZLE_ANALYTICS_EVENTS.PUZZLE_VIEWED]: [PLUGINS.MIXPANEL],\n [PUZZLE_ANALYTICS_EVENTS.PUZZLE_ASSIGNED]: [PLUGINS.MIXPANEL],\n};\n"],"names":["PUZZLE_ANALYTICS_EVENTS","PUZZLE_ANALYTICS_WHITELIST_EVENTS","PLUGINS"],"mappings":";AAEY,IAAAA,sBAAAA,OACVA,EAAA,kBAAkB,mBAClBA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA;AAKL,MAAMC,IAAoC;AAAA,EAC9C,eAAwC,CAACC,EAAQ,QAAQ;AAAA,EACzD,iBAA0C,CAACA,EAAQ,QAAQ;AAC9D;"}
@@ -1,47 +1,77 @@
1
- import o from "styled-components";
2
- import t from "../../ui/layout/flex-view.js";
3
- const p = o(t)`
4
- cursor: pointer;
1
+ import e from "styled-components";
2
+ import r from "../../ui/layout/flex-view.js";
3
+ import { getPuzzleCardPattern as s } from "../utils/puzzle-pattern.js";
4
+ const c = e(r)(({ theme: t, $assigned: o }) => {
5
+ const { colors: i, layout: n } = t;
6
+ return `
7
+ cursor: pointer;
8
+ width: ${n.gutter * 15.9375}px;
9
+ height: ${n.gutter * 19.125}px;
10
+ position: relative;
11
+ left: ${o ? "0" : "50px"};
12
+ top: ${o ? "0" : "50px"};
5
13
 
6
- &:hover {
7
- outline: 2px solid ${({ theme: e }) => e.colors.BLACK_1};
8
- }
9
- `, l = o(t)(({ theme: e, $disabled: n }) => {
10
- const { colors: r } = e;
14
+ &:hover {
15
+ outline: 2px solid ${i.BLACK_1};
16
+ }
17
+ `;
18
+ }), x = e(r)(({ theme: t, $assigned: o, $assigning: i }) => {
19
+ const { colors: n, layout: p } = t;
11
20
  return `
12
- position: absolute;
13
- bottom: -48px;
14
21
  cursor: pointer;
15
- z-index: -1;
22
+ width: ${p.gutter * 15.9375}px;
23
+ position: absolute;
24
+ left: ${o ? "0" : "50px"};
25
+ bottom: ${o ? "-50px" : "11px"};
16
26
 
17
- ${n && `
18
- background: ${r.WHITE_4};
19
- border: 2px solid ${r.WHITE_5};
27
+ ${(o || i) && `
28
+ background: ${n.WHITE_4};
29
+ border: 2px solid ${n.WHITE_5};
20
30
  border-top: 0;
21
31
  pointer-events: none;
22
32
  `}
23
33
  `;
24
- }), c = o(t)`
34
+ });
35
+ e(r)`
25
36
  position: relative;
26
37
  top: -8px;
27
38
  height: 100%;
28
39
  width: 100%;
29
- `, u = o(t)`
40
+ `;
41
+ e(r)`
30
42
  border-radius: 50%;
31
- `, a = o(t)`
43
+ `;
44
+ const d = e(r)`
32
45
  position: relative;
33
46
  transition: height 0.3s ease-out;
34
- `, d = o(t)`
47
+ `, g = e(r)`
35
48
  position: absolute;
36
49
  top: 0;
37
50
  right: 0;
51
+ `, h = e(r)(({ $visible: t, theme: o }) => {
52
+ const { layout: i } = o;
53
+ return `
54
+ width: ${i.gutter * 22.1875}px;
55
+ height: ${i.gutter * 26}px;
56
+ left: 0;
57
+ opacity: ${t ? 1 : 0};
58
+ pointer-events: ${t ? "auto" : "none"};
59
+ transition: opacity 0.2s ease-out;
60
+ `;
61
+ }), $ = e(r)`
62
+ position: relative;
63
+
64
+ box-shadow: inset 0px 0px 0px 4px ${({ theme: t, $imageHue: o }) => t.colors[`${o}_4`]};
65
+
66
+ background-image: ${({ $imageHue: t }) => `url(${s(t)})`};
67
+ background-size: cover;
38
68
  `;
39
69
  export {
40
- d as AssignedTag,
41
- u as CheckMarkIcon,
42
- l as PuzzleButton,
43
- a as PuzzleContainer,
44
- p as PuzzleContent,
45
- c as PuzzleText
70
+ g as AssignedTag,
71
+ $ as PuzzleAssignedWrapper,
72
+ x as PuzzleButton,
73
+ d as PuzzleContainer,
74
+ c as PuzzleContent,
75
+ h as PuzzleContentWrapper
46
76
  };
47
77
  //# sourceMappingURL=puzzle-container-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"puzzle-container-styled.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\nconst PuzzleContent = styled(FlexView)`\n cursor: pointer;\n\n &:hover {\n outline: 2px solid ${({ theme }) => theme.colors.BLACK_1};\n }\n`;\n\ninterface IPuzzleButton {\n $disabled?: boolean;\n}\n\nconst PuzzleButton = styled(FlexView)<IPuzzleButton>(({ theme, $disabled }) => {\n const { colors } = theme;\n\n return `\n position: absolute;\n bottom: -48px;\n cursor: pointer;\n z-index: -1;\n \n ${\n $disabled &&\n `\n background: ${colors.WHITE_4};\n border: 2px solid ${colors.WHITE_5};\n border-top: 0;\n pointer-events: none;\n `\n }\n `;\n});\n\nconst PuzzleText = styled(FlexView)`\n position: relative;\n top: -8px;\n height: 100%;\n width: 100%;\n`;\n\nconst CheckMarkIcon = styled(FlexView)`\n border-radius: 50%;\n`;\n\nconst PuzzleContainer = styled(FlexView)`\n position: relative;\n transition: height 0.3s ease-out;\n`;\n\nconst AssignedTag = styled(FlexView)`\n position: absolute;\n top: 0;\n right: 0;\n`;\n\nexport { PuzzleContainer, PuzzleContent, PuzzleButton, PuzzleText, CheckMarkIcon, AssignedTag };\n"],"names":["PuzzleContent","styled","FlexView","theme","PuzzleButton","$disabled","colors","PuzzleText","CheckMarkIcon","PuzzleContainer","AssignedTag"],"mappings":";;AAIM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,yBAIZ,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA,GAQtDC,IAAeH,EAAOC,CAAQ,EAAiB,CAAC,EAAE,OAAAC,GAAO,WAAAE,QAAgB;AACvE,QAAA,EAAE,QAAAC,EAAW,IAAAH;AAEZ,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOHE,KACA;AAAA,oBACcC,EAAO,OAAO;AAAA,0BACRA,EAAO,OAAO;AAAA;AAAA;AAAA,KAIpC;AAAA;AAEJ,CAAC,GAEKC,IAAaN,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,GAO5BM,IAAgBP,EAAOC,CAAQ;AAAA;AAAA,GAI/BO,IAAkBR,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAKjCQ,IAAcT,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"puzzle-container-styled.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container-styled.tsx"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport { getPuzzleCardPattern } from '../utils/puzzle-pattern';\n\ninterface IPuzzleProps {\n $assigned?: boolean;\n $assigning?: boolean;\n}\n\nconst PuzzleContent = styled(FlexView)<IPuzzleProps>(({ theme, $assigned }) => {\n const { colors, layout } = theme;\n\n return `\n cursor: pointer;\n width: ${layout.gutter * 15.9375}px;\n height: ${layout.gutter * 19.125}px;\n position: relative;\n left: ${$assigned ? '0' : '50px'};\n top: ${$assigned ? '0' : '50px'};\n\n &:hover {\n outline: 2px solid ${colors.BLACK_1};\n }\n `;\n});\n\nconst PuzzleButton = styled(FlexView)<IPuzzleProps>(({ theme, $assigned, $assigning }) => {\n const { colors, layout } = theme;\n\n return `\n cursor: pointer;\n width: ${layout.gutter * 15.9375}px;\n position: absolute;\n left: ${$assigned ? '0' : '50px'};\n bottom: ${$assigned ? '-50px' : '11px'};\n \n ${\n ($assigned || $assigning) &&\n `\n background: ${colors.WHITE_4};\n border: 2px solid ${colors.WHITE_5};\n border-top: 0;\n pointer-events: none;\n `\n }\n `;\n});\n\nconst PuzzleText = styled(FlexView)`\n position: relative;\n top: -8px;\n height: 100%;\n width: 100%;\n`;\n\nconst CheckMarkIcon = styled(FlexView)`\n border-radius: 50%;\n`;\n\nconst PuzzleContainer = styled(FlexView)`\n position: relative;\n transition: height 0.3s ease-out;\n`;\n\nconst AssignedTag = styled(FlexView)`\n position: absolute;\n top: 0;\n right: 0;\n`;\n\ninterface IPuzzleContentWrapper {\n $visible?: boolean;\n}\n\nconst PuzzleContentWrapper = styled(FlexView)<IPuzzleContentWrapper>(({ $visible, theme }) => {\n const { layout } = theme;\n\n return `\n width: ${layout.gutter * 22.1875}px;\n height: ${layout.gutter * 26}px;\n left: 0;\n opacity: ${$visible ? 1 : 0};\n pointer-events: ${$visible ? 'auto' : 'none'};\n transition: opacity 0.2s ease-out;\n `;\n});\n\nconst PuzzleAssignedWrapper = styled(FlexView)<{ $imageHue: THueNames }>`\n position: relative;\n\n box-shadow: inset 0px 0px 0px 4px ${({ theme, $imageHue }) => theme.colors[`${$imageHue}_4`]};\n\n background-image: ${({ $imageHue }) => `url(${getPuzzleCardPattern($imageHue)})`};\n background-size: cover;\n`;\n\nexport {\n PuzzleContainer,\n PuzzleContentWrapper,\n PuzzleContent,\n PuzzleButton,\n PuzzleText,\n CheckMarkIcon,\n AssignedTag,\n PuzzleAssignedWrapper,\n};\n"],"names":["PuzzleContent","styled","FlexView","theme","$assigned","colors","layout","PuzzleButton","$assigning","PuzzleContainer","AssignedTag","PuzzleContentWrapper","$visible","PuzzleAssignedWrapper","$imageHue","getPuzzleCardPattern"],"mappings":";;;AAYM,MAAAA,IAAgBC,EAAOC,CAAQ,EAAgB,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgB;AACvE,QAAA,EAAE,QAAAC,GAAQ,QAAAC,EAAW,IAAAH;AAEpB,SAAA;AAAA;AAAA,aAEIG,EAAO,SAAS,OAAO;AAAA,cACtBA,EAAO,SAAS,MAAM;AAAA;AAAA,YAExBF,IAAY,MAAM,MAAM;AAAA,WACzBA,IAAY,MAAM,MAAM;AAAA;AAAA;AAAA,2BAGRC,EAAO,OAAO;AAAA;AAAA;AAGzC,CAAC,GAEKE,IAAeN,EAAOC,CAAQ,EAAgB,CAAC,EAAE,OAAAC,GAAO,WAAAC,GAAW,YAAAI,QAAiB;AAClF,QAAA,EAAE,QAAAH,GAAQ,QAAAC,EAAW,IAAAH;AAEpB,SAA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