@cuemath/leap 3.2.30 → 3.2.31-m

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 (202) hide show
  1. package/dist/assets/illustrations/illustrations.js +5 -6
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/lottie/lottie.js +1 -6
  4. package/dist/assets/lottie/lottie.js.map +1 -1
  5. package/dist/features/analytics-events/platform-events-student.js +1 -2
  6. package/dist/features/analytics-events/platform-events-student.js.map +1 -1
  7. package/dist/features/analytics-events/platform-events-teacher.js +4 -6
  8. package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
  9. package/dist/features/analytics-events/whitelist-events.js +16 -20
  10. package/dist/features/analytics-events/whitelist-events.js.map +1 -1
  11. package/dist/features/auth/account-selector/account-selector.js +52 -54
  12. package/dist/features/auth/account-selector/account-selector.js.map +1 -1
  13. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js +1 -2
  14. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js.map +1 -1
  15. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js +8 -8
  16. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js.map +1 -1
  17. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +60 -82
  18. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +1 -1
  19. package/dist/features/auth/comps/pill-button/pill-button.js +38 -41
  20. package/dist/features/auth/comps/pill-button/pill-button.js.map +1 -1
  21. package/dist/features/auth/comps/resend-otp/resend-otp.js +14 -18
  22. package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
  23. package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js +26 -32
  24. package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js.map +1 -1
  25. package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +10 -2
  26. package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
  27. package/dist/features/auth/comps/user-list/user-item/user-item-styled.js +3 -9
  28. package/dist/features/auth/comps/user-list/user-item/user-item-styled.js.map +1 -1
  29. package/dist/features/auth/comps/user-list/user-item/user-item.js +15 -14
  30. package/dist/features/auth/comps/user-list/user-item/user-item.js.map +1 -1
  31. package/dist/features/auth/pla-signup/signup-options/signup-options.js +35 -42
  32. package/dist/features/auth/pla-signup/signup-options/signup-options.js.map +1 -1
  33. package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.js +43 -43
  34. package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.js.map +1 -1
  35. package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-utils.js +1 -1
  36. package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-utils.js.map +1 -1
  37. package/dist/features/chapters-v2/utils/node-card-utils.js +2 -2
  38. package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
  39. package/dist/features/communication/pub-sub/constants.js +4 -7
  40. package/dist/features/communication/pub-sub/constants.js.map +1 -1
  41. package/dist/features/homework/homework-card-view.js +97 -85
  42. package/dist/features/homework/homework-card-view.js.map +1 -1
  43. package/dist/features/homework/homework-card.js +42 -44
  44. package/dist/features/homework/homework-card.js.map +1 -1
  45. package/dist/features/homework/hw-card-list/hw-card-list-view.js +29 -31
  46. package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
  47. package/dist/features/homework/hw-card-list/hw-card-list.js +48 -54
  48. package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
  49. package/dist/features/homework/utils.js +27 -33
  50. package/dist/features/homework/utils.js.map +1 -1
  51. package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +11 -17
  52. package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
  53. package/dist/features/journey/journey-id/journey-id-student.js +1 -1
  54. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  55. package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
  56. package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
  57. package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapters-list.js +53 -68
  58. package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapters-list.js.map +1 -1
  59. package/dist/features/puzzles/app/puzzle-app-styled.js +6 -10
  60. package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -1
  61. package/dist/features/puzzles/comps/puzzle-card-styled.js +69 -24
  62. package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
  63. package/dist/features/puzzles/comps/puzzle-card.js +30 -79
  64. package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
  65. package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +25 -55
  66. package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
  67. package/dist/features/puzzles/puzzle-container/puzzle-container.js +107 -100
  68. package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
  69. package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js +1 -1
  70. package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map +1 -1
  71. package/dist/features/puzzles/utils/puzzle-pattern.js +13 -28
  72. package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
  73. package/dist/features/stickers/sticker-data.js +234 -0
  74. package/dist/features/stickers/sticker-data.js.map +1 -0
  75. package/dist/features/{ui/sticker-grid/sticker-grid-styles.js → stickers/sticker-selector/sticker-selector-styles.js} +23 -31
  76. package/dist/features/stickers/sticker-selector/sticker-selector-styles.js.map +1 -0
  77. package/dist/features/stickers/sticker-selector/sticker-selector.js +39 -0
  78. package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -0
  79. package/dist/features/stickers/sticker-selector/sticker.js +56 -0
  80. package/dist/features/stickers/sticker-selector/sticker.js.map +1 -0
  81. package/dist/features/stickers/stickers-effects/effects.js +82 -0
  82. package/dist/features/stickers/stickers-effects/effects.js.map +1 -0
  83. package/dist/features/stickers/stickers-effects/stickers-cache.js +19 -0
  84. package/dist/features/stickers/stickers-effects/stickers-cache.js.map +1 -0
  85. package/dist/features/stickers/stickers-effects/stickers-effects-helper.js +105 -0
  86. package/dist/features/stickers/stickers-effects/stickers-effects-helper.js.map +1 -0
  87. package/dist/features/stickers/stickers-effects/stickers-effects-styled.js +36 -0
  88. package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +1 -0
  89. package/dist/features/stickers/stickers-effects/stickers-effects.js +55 -0
  90. package/dist/features/stickers/stickers-effects/stickers-effects.js.map +1 -0
  91. package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +8 -3
  92. package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
  93. package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +40 -40
  94. package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
  95. package/dist/features/ui/dot-lottie-animations/dot-lottie-animation.js +88 -75
  96. package/dist/features/ui/dot-lottie-animations/dot-lottie-animation.js.map +1 -1
  97. package/dist/features/ui/lottie-animation/lottie-animation.js +45 -43
  98. package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
  99. package/dist/features/ui/modals/modal-styled.js +48 -15
  100. package/dist/features/ui/modals/modal-styled.js.map +1 -1
  101. package/dist/features/ui/modals/modal.js +43 -35
  102. package/dist/features/ui/modals/modal.js.map +1 -1
  103. package/dist/features/ui/theme/layout.js +3 -3
  104. package/dist/features/ui/theme/layout.js.map +1 -1
  105. package/dist/features/worksheet/worksheet/worksheet-helpers.js +19 -20
  106. package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
  107. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +12 -16
  108. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
  109. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +47 -101
  110. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
  111. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +163 -166
  112. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
  113. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +207 -242
  114. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
  115. package/dist/features/worksheet/worksheet/worksheet-styled.js +34 -34
  116. package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
  117. package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
  118. package/dist/features/worksheet/worksheet/worksheet.js +430 -375
  119. package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
  120. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
  121. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
  122. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +35 -44
  123. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
  124. package/dist/index.d.ts +86 -149
  125. package/dist/index.js +418 -430
  126. package/dist/index.js.map +1 -1
  127. package/dist/static/animated-avatar.1ad58b1d.json +1 -0
  128. package/dist/static/animated-avatar.69b07505.json +1 -0
  129. package/dist/static/animated-avatar.9c560b46.json +1 -0
  130. package/dist/static/cuemath-app-qr-code.4beefe48.svg +1 -0
  131. package/dist/static/cuemath-app-qr-code.ba6cc09b.svg +1 -0
  132. package/dist/static/cuemath-app-qr-code.d0912fc7.png +0 -0
  133. package/dist/static/otp.2d08f874.json +1 -0
  134. package/dist/static/phone-number.84f55562.json +1 -0
  135. package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +1 -0
  136. package/dist/static/puzzle-pattern-green.c9f84bbc.svg +1 -0
  137. package/dist/static/puzzle-pattern-orange.3da09665.svg +1 -0
  138. package/dist/static/puzzle-pattern-purple.5fb5a319.svg +1 -0
  139. package/dist/static/puzzle-pattern-yellow.aadbf457.svg +1 -0
  140. package/dist/static/target-achieved-text.053bd142.json +2830 -0
  141. package/dist/static/user-type-selector-grid-bg.3c9c8ad6.svg +1 -0
  142. package/dist/static/user-type-selector-grid-bg.3ce8142d.svg +1 -0
  143. package/package.json +1 -1
  144. package/dist/features/auth/pla-signup/pla-analytics-events.js +0 -23
  145. package/dist/features/auth/pla-signup/pla-analytics-events.js.map +0 -1
  146. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +0 -72
  147. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +0 -1
  148. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +0 -59
  149. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +0 -1
  150. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +0 -63
  151. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +0 -1
  152. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +0 -67
  153. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +0 -1
  154. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +0 -70
  155. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +0 -1
  156. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +0 -59
  157. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +0 -1
  158. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +0 -59
  159. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +0 -1
  160. package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +0 -70
  161. package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +0 -1
  162. package/dist/features/puzzles/api/puzzle-dashboard.js +0 -10
  163. package/dist/features/puzzles/api/puzzle-dashboard.js.map +0 -1
  164. package/dist/features/puzzles/constants/puzzle-container.js +0 -8
  165. package/dist/features/puzzles/constants/puzzle-container.js.map +0 -1
  166. package/dist/features/puzzles/puzzle-analytics-events.js +0 -11
  167. package/dist/features/puzzles/puzzle-analytics-events.js.map +0 -1
  168. package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +0 -55
  169. package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +0 -1
  170. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +0 -37
  171. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +0 -1
  172. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +0 -107
  173. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +0 -1
  174. package/dist/features/ui/sticker-grid/sticker-grid-styles.js.map +0 -1
  175. package/dist/features/ui/sticker-grid/sticker-grid.js +0 -24
  176. package/dist/features/ui/sticker-grid/sticker-grid.js.map +0 -1
  177. package/dist/features/ui/sticker-grid/sticker.js +0 -57
  178. package/dist/features/ui/sticker-grid/sticker.js.map +0 -1
  179. package/dist/features/ui/stickers/constants.js +0 -6
  180. package/dist/features/ui/stickers/constants.js.map +0 -1
  181. package/dist/features/ui/stickers/stickers-effects.js +0 -64
  182. package/dist/features/ui/stickers/stickers-effects.js.map +0 -1
  183. package/dist/features/ui/stickers/stickers-styled.js +0 -29
  184. package/dist/features/ui/stickers/stickers-styled.js.map +0 -1
  185. package/dist/features/ui/stickers/stickers-utils.js +0 -91
  186. package/dist/features/ui/stickers/stickers-utils.js.map +0 -1
  187. package/dist/features/ui/stickers/stickers.js +0 -40
  188. package/dist/features/ui/stickers/stickers.js.map +0 -1
  189. package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +0 -28
  190. package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +0 -1
  191. package/dist/static/animated-avatar.c3a0fa98.json +0 -1
  192. package/dist/static/puzzle-blue-lottie.bf64ebc5.json +0 -12760
  193. package/dist/static/puzzle-dashboard-banner.b7956519.svg +0 -1
  194. package/dist/static/puzzle-green-lottie.1da90698.json +0 -1
  195. package/dist/static/puzzle-orange-lottie.0a105c42.json +0 -21206
  196. package/dist/static/puzzle-pattern-blue.abff0164.svg +0 -1
  197. package/dist/static/puzzle-pattern-green.b8ba1840.svg +0 -1
  198. package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +0 -1
  199. package/dist/static/puzzle-pattern-purple.14b09759.svg +0 -1
  200. package/dist/static/puzzle-pattern-yellow.50917fab.svg +0 -1
  201. package/dist/static/puzzle-purple-lottie.e70de110.json +0 -9860
  202. package/dist/static/puzzle-yellow-lottie.275b5cf4.json +0 -1
@@ -1,91 +0,0 @@
1
- const f = (n, s) => {
2
- const t = Math.ceil(s / 4), r = Math.floor(n / t), d = n % t, M = ["top", "right", "bottom", "left"][r] ?? "left", h = (d + 0.5) / t * 100, i = (Math.random() - 0.5) * 25, o = Math.min(Math.max(h + i, 0), 100), a = 45 + Math.random() * 10, e = 45 + Math.random() * 10;
3
- let l = 0, m = 0;
4
- switch (M) {
5
- case "top":
6
- l = o - a, m = -e + i;
7
- break;
8
- case "right":
9
- l = 100 - a + i, m = o - e;
10
- break;
11
- case "bottom":
12
- l = o - a, m = 100 - e + i;
13
- break;
14
- case "left":
15
- l = -a + i, m = o - e;
16
- break;
17
- }
18
- return {
19
- fromX: `${l}vw`,
20
- fromY: `${m}vh`,
21
- x: a,
22
- y: e
23
- };
24
- }, g = (n, s = 10) => {
25
- const t = [];
26
- let r = 0;
27
- const d = n;
28
- for (; t.length < n && r < d; ) {
29
- const c = Math.floor(Math.random() * (100 - 2 * s) + s);
30
- t.every((M) => Math.abs(M - c) >= s) && t.push(c), r++;
31
- }
32
- for (; t.length < n; )
33
- t.push(Math.floor(Math.random() * (100 - 2 * s) + s));
34
- return t;
35
- };
36
- function x({
37
- count: n,
38
- effect: s,
39
- stickers: t,
40
- minSize: r,
41
- maxSize: d
42
- }) {
43
- const c = 100 / n * 2, M = () => Math.random() * (d - r) + r, h = [], i = ["float_up", "fall_down"].includes(s) ? g(n, c) : [];
44
- for (let o = 0; o < n; o++) {
45
- const a = t[o % t.length] ?? "", e = M();
46
- if (s === "float_up")
47
- h.push({
48
- id: o,
49
- sticker: a,
50
- x: i[o],
51
- y: 110 + (Math.random() - 0.5) * e,
52
- size: e
53
- });
54
- else if (s === "fall_down")
55
- h.push({
56
- id: o,
57
- sticker: a,
58
- x: i[o],
59
- y: -10 + (Math.random() - 0.5) * e,
60
- size: e
61
- });
62
- else if (s === "burst_from_edges") {
63
- const { x: l, y: m, fromX: p, fromY: u } = f(o, n);
64
- h.push({ id: o, sticker: a, x: l, y: m, fromX: p, fromY: u, size: e });
65
- } else s === "pop_expand" ? h.push({
66
- id: o,
67
- sticker: a,
68
- x: 50,
69
- y: 100,
70
- fromX: `${(Math.random() - 0.5) * 27.5}vw`,
71
- fromY: `${-50 - Math.random() * 27.5}vh`,
72
- size: e
73
- }) : h.push({
74
- id: o,
75
- sticker: a,
76
- x: Math.random() * 100,
77
- y: Math.random() * 100,
78
- size: e
79
- });
80
- }
81
- return h;
82
- }
83
- const v = (n, s = 0.2) => {
84
- const t = n * s, r = n - t, d = n + t;
85
- return Math.floor(Math.random() * (d - r + 1)) + r;
86
- };
87
- export {
88
- x as generateStickerData,
89
- v as randomizeDuration
90
- };
91
- //# sourceMappingURL=stickers-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stickers-utils.js","sources":["../../../../src/features/ui/stickers/stickers-utils.ts"],"sourcesContent":["import type { StickerDatum, StickersProps } from './stickers-types';\n\nconst getBurstPosition = (\n index: number,\n total: number,\n): {\n fromX: string;\n fromY: string;\n x: number;\n y: number;\n} => {\n const countPerSide = Math.ceil(total / 4);\n const sideIndex = Math.floor(index / countPerSide);\n const pos = index % countPerSide;\n\n const sides = ['top', 'right', 'bottom', 'left'] as const;\n const side = sides[sideIndex] ?? 'left';\n\n const basePercent = ((pos + 0.5) / countPerSide) * 100;\n const jitter = (Math.random() - 0.5) * 25;\n const edgePercent = Math.min(Math.max(basePercent + jitter, 0), 100);\n\n const centerX = 45 + Math.random() * 10;\n const centerY = 45 + Math.random() * 10;\n\n let fromX = 0;\n let fromY = 0;\n\n switch (side) {\n case 'top':\n fromX = edgePercent - centerX;\n fromY = -centerY + jitter;\n break;\n case 'right':\n fromX = 100 - centerX + jitter;\n fromY = edgePercent - centerY;\n break;\n case 'bottom':\n fromX = edgePercent - centerX;\n fromY = 100 - centerY + jitter;\n break;\n case 'left':\n fromX = -centerX + jitter;\n fromY = edgePercent - centerY;\n break;\n }\n\n return {\n fromX: `${fromX}vw`,\n fromY: `${fromY}vh`,\n x: centerX,\n y: centerY,\n };\n};\n\nconst getRandomNonOverlappingPositions = (count: number, buffer = 10): number[] => {\n const used: number[] = [];\n let attempts = 0;\n const maxAttempts = count;\n\n while (used.length < count && attempts < maxAttempts) {\n const value = Math.floor(Math.random() * (100 - 2 * buffer) + buffer);\n\n if (used.every(v => Math.abs(v - value) >= buffer)) {\n used.push(value);\n }\n attempts++;\n }\n\n while (used.length < count) {\n used.push(Math.floor(Math.random() * (100 - 2 * buffer) + buffer));\n }\n\n return used;\n};\n\nexport function generateStickerData({\n count,\n effect,\n stickers,\n minSize,\n maxSize,\n}: {\n count: number;\n effect: StickersProps['effect'];\n stickers: string[];\n minSize: number;\n maxSize: number;\n}): StickerDatum[] {\n const buffer = (100 / count) * 2;\n const getSize = () => Math.random() * (maxSize - minSize) + minSize;\n const result: StickerDatum[] = [];\n const xPositions = ['float_up', 'fall_down'].includes(effect)\n ? getRandomNonOverlappingPositions(count, buffer)\n : [];\n\n for (let i = 0; i < count; i++) {\n const sticker = stickers[i % stickers.length] ?? '';\n const size = getSize();\n\n if (effect === 'float_up') {\n result.push({\n id: i,\n sticker,\n x: xPositions[i]!,\n y: 110 + (Math.random() - 0.5) * size,\n size,\n });\n } else if (effect === 'fall_down') {\n result.push({\n id: i,\n sticker,\n x: xPositions[i]!,\n y: -10 + (Math.random() - 0.5) * size,\n size,\n });\n } else if (effect === 'burst_from_edges') {\n const { x, y, fromX, fromY } = getBurstPosition(i, count);\n\n result.push({ id: i, sticker, x, y, fromX, fromY, size });\n } else if (effect === 'pop_expand') {\n result.push({\n id: i,\n sticker,\n x: 50,\n y: 100,\n fromX: `${(Math.random() - 0.5) * 27.5}vw`,\n fromY: `${-50 - Math.random() * 27.5}vh`,\n size,\n });\n } else {\n result.push({\n id: i,\n sticker,\n x: Math.random() * 100,\n y: Math.random() * 100,\n size,\n });\n }\n }\n\n return result;\n}\n\nexport const randomizeDuration = (base: number, variancePercent = 0.2): number => {\n const delta = base * variancePercent;\n const min = base - delta;\n const max = base + delta;\n\n return Math.floor(Math.random() * (max - min + 1)) + min;\n};\n"],"names":["getBurstPosition","index","total","countPerSide","sideIndex","pos","side","basePercent","jitter","edgePercent","centerX","centerY","fromX","fromY","getRandomNonOverlappingPositions","count","buffer","used","attempts","maxAttempts","value","v","generateStickerData","effect","stickers","minSize","maxSize","getSize","result","xPositions","i","sticker","size","x","y","randomizeDuration","base","variancePercent","delta","min","max"],"mappings":"AAEA,MAAMA,IAAmB,CACvBC,GACAC,MAMG;AACH,QAAMC,IAAe,KAAK,KAAKD,IAAQ,CAAC,GAClCE,IAAY,KAAK,MAAMH,IAAQE,CAAY,GAC3CE,IAAMJ,IAAQE,GAGdG,IADQ,CAAC,OAAO,SAAS,UAAU,MAAM,EAC5BF,CAAS,KAAK,QAE3BG,KAAgBF,IAAM,OAAOF,IAAgB,KAC7CK,KAAU,KAAK,OAAO,IAAI,OAAO,IACjCC,IAAc,KAAK,IAAI,KAAK,IAAIF,IAAcC,GAAQ,CAAC,GAAG,GAAG,GAE7DE,IAAU,KAAK,KAAK,OAAA,IAAW,IAC/BC,IAAU,KAAK,KAAK,OAAA,IAAW;AAErC,MAAIC,IAAQ,GACRC,IAAQ;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L;AAEO,SAAAJ;AACT;AAEO,MAAMO,IAAoB,CAACC,GAAcC,IAAkB,QAAgB;AAChF,QAAMC,IAAQF,IAAOC,GACfE,IAAMH,IAAOE,GACbE,IAAMJ,IAAOE;AAEZ,SAAA,KAAK,MAAM,KAAK,OAAA,KAAYE,IAAMD,IAAM,EAAE,IAAIA;AACvD;"}
@@ -1,40 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { memo as E, useState as I, useLayoutEffect as l } from "react";
3
- import { STICKER_MIN_SIZE as x, STICKER_MAX_SIZE as D } from "./constants.js";
4
- import { Container as T, Sticker as _ } from "./stickers-styled.js";
5
- import { generateStickerData as z } from "./stickers-utils.js";
6
- const C = ({ stickers: i, effect: t, count: m, duration: r }) => {
7
- const [c, s] = I([]);
8
- return l(() => {
9
- const e = z({
10
- count: m,
11
- effect: t,
12
- stickers: i,
13
- minSize: x,
14
- maxSize: D
15
- });
16
- s(e);
17
- const o = setTimeout(() => s([]), r);
18
- return () => clearTimeout(o);
19
- }, [i, t, m, r]), /* @__PURE__ */ a(T, { children: c.map((e) => {
20
- const { id: o, sticker: n, x: S, y: k, size: p, fromX: u, fromY: f } = e;
21
- return /* @__PURE__ */ a(
22
- _,
23
- {
24
- effect: t,
25
- duration: r,
26
- fromX: u,
27
- fromY: f,
28
- x: S,
29
- y: k,
30
- size: p,
31
- children: n
32
- },
33
- o
34
- );
35
- }) });
36
- }, R = E(C);
37
- export {
38
- R as default
39
- };
40
- //# sourceMappingURL=stickers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stickers.js","sources":["../../../../src/features/ui/stickers/stickers.tsx"],"sourcesContent":["import type { StickerDatum, StickersProps } from './stickers-types';\n\nimport React, { memo, useLayoutEffect, useState } from 'react';\n\nimport { STICKER_MAX_SIZE, STICKER_MIN_SIZE } from './constants';\nimport { Container, Sticker } from './stickers-styled';\nimport { generateStickerData } from './stickers-utils';\n\nconst Stickers: React.FC<StickersProps> = ({ stickers, effect, count, duration }) => {\n const [stickersData, setStickersData] = useState<ReturnType<typeof generateStickerData>>([]);\n\n useLayoutEffect(() => {\n const stickerData = generateStickerData({\n count,\n effect,\n stickers,\n minSize: STICKER_MIN_SIZE,\n maxSize: STICKER_MAX_SIZE,\n });\n\n setStickersData(stickerData);\n\n const timeout = setTimeout(() => setStickersData([]), duration);\n\n return () => clearTimeout(timeout);\n }, [stickers, effect, count, duration]);\n\n return (\n <Container>\n {stickersData.map((data: StickerDatum) => {\n const { id, sticker, x, y, size, fromX, fromY } = data;\n\n return (\n <Sticker\n key={id}\n effect={effect}\n duration={duration}\n fromX={fromX}\n fromY={fromY}\n x={x}\n y={y}\n size={size}\n >\n {sticker}\n </Sticker>\n );\n })}\n </Container>\n );\n};\n\nexport default memo(Stickers);\n"],"names":["Stickers","stickers","effect","count","duration","stickersData","setStickersData","useState","useLayoutEffect","stickerData","generateStickerData","STICKER_MIN_SIZE","STICKER_MAX_SIZE","timeout","jsx","Container","data","id","sticker","x","y","size","fromX","fromY","Sticker","memo"],"mappings":";;;;;AAQA,MAAMA,IAAoC,CAAC,EAAE,UAAAC,GAAU,QAAAC,GAAQ,OAAAC,GAAO,UAAAC,QAAe;AACnF,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAiD,CAAE,CAAA;AAE3F,SAAAC,EAAgB,MAAM;AACpB,UAAMC,IAAcC,EAAoB;AAAA,MACtC,OAAAP;AAAA,MACA,QAAAD;AAAA,MACA,UAAAD;AAAA,MACA,SAASU;AAAA,MACT,SAASC;AAAA,IAAA,CACV;AAED,IAAAN,EAAgBG,CAAW;AAE3B,UAAMI,IAAU,WAAW,MAAMP,EAAgB,CAAE,CAAA,GAAGF,CAAQ;AAEvD,WAAA,MAAM,aAAaS,CAAO;AAAA,KAChC,CAACZ,GAAUC,GAAQC,GAAOC,CAAQ,CAAC,GAGnC,gBAAAU,EAAAC,GAAA,EACE,UAAaV,EAAA,IAAI,CAACW,MAAuB;AAClC,UAAA,EAAE,IAAAC,GAAI,SAAAC,GAAS,GAAAC,GAAG,GAAAC,GAAG,MAAAC,GAAM,OAAAC,GAAO,OAAAC,EAAU,IAAAP;AAGhD,WAAA,gBAAAF;AAAA,MAACU;AAAA,MAAA;AAAA,QAEC,QAAAtB;AAAA,QACA,UAAAE;AAAA,QACA,OAAAkB;AAAA,QACA,OAAAC;AAAA,QACA,GAAAJ;AAAA,QACA,GAAAC;AAAA,QACA,MAAAC;AAAA,QAEC,UAAAH;AAAA,MAAA;AAAA,MATID;AAAA,IAAA;AAAA,EAYV,CAAA,EACH,CAAA;AAEJ,GAEehB,IAAAwB,EAAKzB,CAAQ;"}
@@ -1,28 +0,0 @@
1
- import { useMemo as p, useEffect as m } from "react";
2
- import { usePuzzleAttemptJourney as c } from "../../../journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js";
3
- import { usePuzzleReviewJourney as f } from "../../../journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js";
4
- import { usePuzzleUnassignJourney as l } from "../../../journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js";
5
- import { useJourney as P } from "../../../journey/use-journey/use-journey.js";
6
- const C = ({ behavior: a }) => {
7
- const { maximumAttempts: e, canStartJourney: t } = a, { isJourneyActive: r, clearJourney: o } = P(), { puzzleAttemptCtaRef: i, startJourney: u } = c(), { puzzleReviewCtaRef: y, startJourney: n } = f(), { puzzleUnassignRef: J, startJourney: s } = l(), z = p(() => e === -2, [e]);
8
- return m(() => {
9
- z && t && !r && (u(), n(), s());
10
- }, [
11
- t,
12
- r,
13
- z,
14
- u,
15
- n,
16
- s
17
- ]), m(() => () => {
18
- o();
19
- }, [o]), {
20
- puzzleAttemptCtaRef: i,
21
- puzzleReviewCtaRef: y,
22
- puzzleUnassignRef: J
23
- };
24
- };
25
- export {
26
- C as useWorksheetJourney
27
- };
28
- //# sourceMappingURL=use-worksheet-journey.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-worksheet-journey.js","sources":["../../../../../src/features/worksheet/worksheet/hooks/use-worksheet-journey.ts"],"sourcesContent":["import type { IWorksheetBehavior } from '../worksheet-types';\n\nimport { useEffect, useMemo } from 'react';\n\nimport { usePuzzleAttemptJourney } from '../../../journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey';\nimport { usePuzzleReviewJourney } from '../../../journey/hooks/use-puzzles-journey/use-puzzle-review-journey';\nimport { usePuzzleUnassignJourney } from '../../../journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey';\nimport { useJourney } from '../../../journey/use-journey/use-journey';\n\ninterface IUseWorksheetJourney {\n behavior: IWorksheetBehavior;\n}\n\nconst useWorksheetJourney = ({ behavior }: IUseWorksheetJourney) => {\n const { maximumAttempts, canStartJourney } = behavior;\n\n const { isJourneyActive, clearJourney } = useJourney();\n\n const { puzzleAttemptCtaRef, startJourney: startPuzzleAttemptJourney } =\n usePuzzleAttemptJourney();\n\n const { puzzleReviewCtaRef, startJourney: startPuzzleReviewJourney } = usePuzzleReviewJourney();\n const { puzzleUnassignRef, startJourney: startPuzzleUnassignJourney } =\n usePuzzleUnassignJourney();\n\n const isPuzzleCard = useMemo(() => maximumAttempts === -2, [maximumAttempts]);\n\n useEffect(() => {\n if (isPuzzleCard && canStartJourney && !isJourneyActive) {\n //* This will be triggered by STUDENT during resume sheet.\n startPuzzleAttemptJourney();\n //* This will be triggered by TEACHER during review sheet\n startPuzzleReviewJourney();\n //* This will be trigger by TEACHER during preview sheet.\n startPuzzleUnassignJourney();\n }\n }, [\n canStartJourney,\n isJourneyActive,\n isPuzzleCard,\n startPuzzleAttemptJourney,\n startPuzzleReviewJourney,\n startPuzzleUnassignJourney,\n ]);\n\n useEffect(() => {\n return () => {\n clearJourney();\n };\n }, [clearJourney]);\n\n return {\n puzzleAttemptCtaRef,\n puzzleReviewCtaRef,\n puzzleUnassignRef,\n };\n};\n\nexport { useWorksheetJourney };\n"],"names":["useWorksheetJourney","behavior","maximumAttempts","canStartJourney","isJourneyActive","clearJourney","useJourney","puzzleAttemptCtaRef","startPuzzleAttemptJourney","usePuzzleAttemptJourney","puzzleReviewCtaRef","startPuzzleReviewJourney","usePuzzleReviewJourney","puzzleUnassignRef","startPuzzleUnassignJourney","usePuzzleUnassignJourney","isPuzzleCard","useMemo","useEffect"],"mappings":";;;;;AAaA,MAAMA,IAAsB,CAAC,EAAE,UAAAC,QAAqC;AAC5D,QAAA,EAAE,iBAAAC,GAAiB,iBAAAC,EAAoB,IAAAF,GAEvC,EAAE,iBAAAG,GAAiB,cAAAC,EAAa,IAAIC,EAAW,GAE/C,EAAE,qBAAAC,GAAqB,cAAcC,MACzCC,EAAwB,GAEpB,EAAE,oBAAAC,GAAoB,cAAcC,MAA6BC,EAAuB,GACxF,EAAE,mBAAAC,GAAmB,cAAcC,MACvCC,EAAyB,GAErBC,IAAeC,EAAQ,MAAMf,MAAoB,IAAI,CAACA,CAAe,CAAC;AAE5E,SAAAgB,EAAU,MAAM;AACV,IAAAF,KAAgBb,KAAmB,CAACC,MAEZI,KAEDG,KAEEG;EAC7B,GACC;AAAA,IACDX;AAAA,IACAC;AAAA,IACAY;AAAA,IACAR;AAAA,IACAG;AAAA,IACAG;AAAA,EAAA,CACD,GAEDI,EAAU,MACD,MAAM;AACE,IAAAb;EAAA,GAEd,CAACA,CAAY,CAAC,GAEV;AAAA,IACL,qBAAAE;AAAA,IACA,oBAAAG;AAAA,IACA,mBAAAG;AAAA,EAAA;AAEJ;"}