@cuemath/leap 3.2.15-link.1 → 3.2.16-as1

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 (222) hide show
  1. package/dist/assets/illustrations/illustrations.js +0 -6
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/line-icons/icons/hint-fill.js +35 -0
  4. package/dist/assets/line-icons/icons/hint-fill.js.map +1 -0
  5. package/dist/assets/lottie/lottie.js +1 -11
  6. package/dist/assets/lottie/lottie.js.map +1 -1
  7. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +13 -18
  8. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
  9. package/dist/features/auth/comps/resend-otp/resend-otp.js +47 -54
  10. package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
  11. package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +17 -29
  12. package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
  13. package/dist/features/auth/comps/tabs/tabs-styled.js +10 -22
  14. package/dist/features/auth/comps/tabs/tabs-styled.js.map +1 -1
  15. package/dist/features/auth/comps/tabs/tabs.js +5 -5
  16. package/dist/features/auth/comps/tabs/tabs.js.map +1 -1
  17. package/dist/features/chapters-v2/utils/node-card-utils.js +7 -7
  18. package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
  19. package/dist/features/journey/comps/coachmark/coachmark.js +29 -28
  20. package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
  21. package/dist/features/journey/journey-id/journey-id-student.js +2 -2
  22. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  23. package/dist/features/journey/use-journey/journey-context-provider.js +73 -72
  24. package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
  25. package/dist/features/journey/use-journey/journey-styled.js +6 -4
  26. package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
  27. package/dist/features/puzzles/app/puzzle-app-styled.js +81 -0
  28. package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -0
  29. package/dist/features/puzzles/app/puzzle-app-view.js +120 -0
  30. package/dist/features/puzzles/app/puzzle-app-view.js.map +1 -0
  31. package/dist/features/puzzles/app/puzzle-app.js +82 -0
  32. package/dist/features/puzzles/app/puzzle-app.js.map +1 -0
  33. package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js +50 -7
  34. package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js.map +1 -1
  35. package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js +69 -15
  36. package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js.map +1 -1
  37. package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +6 -0
  38. package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +1 -0
  39. package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +12 -60
  40. package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
  41. package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +72 -77
  42. package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
  43. package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +63 -0
  44. package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +1 -0
  45. package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +21 -0
  46. package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +1 -0
  47. package/dist/features/ui/image/image.js +1 -1
  48. package/dist/features/ui/image/image.js.map +1 -1
  49. package/dist/features/ui/inputs/base-input/base-input.js +11 -11
  50. package/dist/features/ui/inputs/base-input/base-input.js.map +1 -1
  51. package/dist/features/ui/inputs/base-select-input/base-select-input.js +57 -55
  52. package/dist/features/ui/inputs/base-select-input/base-select-input.js.map +1 -1
  53. package/dist/features/ui/inputs/checkbox-input/checkbox-input.js +21 -21
  54. package/dist/features/ui/inputs/checkbox-input/checkbox-input.js.map +1 -1
  55. package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js +5 -5
  56. package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js.map +1 -1
  57. package/dist/features/ui/inputs/text-input/text-input.js +18 -19
  58. package/dist/features/ui/inputs/text-input/text-input.js.map +1 -1
  59. package/dist/features/ui/modals/modal-styled.js +8 -43
  60. package/dist/features/ui/modals/modal-styled.js.map +1 -1
  61. package/dist/features/ui/modals/modal.js +27 -37
  62. package/dist/features/ui/modals/modal.js.map +1 -1
  63. package/dist/features/ui/nudge/nudge-styled.js +14 -7
  64. package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
  65. package/dist/features/ui/nudge/nudge.js +13 -12
  66. package/dist/features/ui/nudge/nudge.js.map +1 -1
  67. package/dist/features/ui/text/text.js +29 -31
  68. package/dist/features/ui/text/text.js.map +1 -1
  69. package/dist/features/ui/theme/button.js +78 -78
  70. package/dist/features/ui/theme/button.js.map +1 -1
  71. package/dist/features/worksheet/worksheet/mocks/activity.js +6 -0
  72. package/dist/features/worksheet/worksheet/mocks/activity.js.map +1 -0
  73. package/dist/features/worksheet/worksheet/mocks/behaviors/assessment.js +38 -0
  74. package/dist/features/worksheet/worksheet/mocks/behaviors/assessment.js.map +1 -0
  75. package/dist/features/worksheet/worksheet/mocks/behaviors/chapter_assessment.js +38 -0
  76. package/dist/features/worksheet/worksheet/mocks/behaviors/chapter_assessment.js.map +1 -0
  77. package/dist/features/worksheet/worksheet/mocks/behaviors/diagnostic.js +38 -0
  78. package/dist/features/worksheet/worksheet/mocks/behaviors/diagnostic.js.map +1 -0
  79. package/dist/features/worksheet/worksheet/mocks/behaviors/dynamic.js +38 -0
  80. package/dist/features/worksheet/worksheet/mocks/behaviors/dynamic.js.map +1 -0
  81. package/dist/features/worksheet/worksheet/mocks/behaviors/extra_practice.js +38 -0
  82. package/dist/features/worksheet/worksheet/mocks/behaviors/extra_practice.js.map +1 -0
  83. package/dist/features/worksheet/worksheet/mocks/behaviors/index.js +95 -0
  84. package/dist/features/worksheet/worksheet/mocks/behaviors/index.js.map +1 -0
  85. package/dist/features/worksheet/worksheet/mocks/behaviors/learning-v3.js +38 -0
  86. package/dist/features/worksheet/worksheet/mocks/behaviors/learning-v3.js.map +1 -0
  87. package/dist/features/worksheet/worksheet/mocks/behaviors/learning.js +38 -0
  88. package/dist/features/worksheet/worksheet/mocks/behaviors/learning.js.map +1 -0
  89. package/dist/features/worksheet/worksheet/mocks/behaviors/legacy.js +38 -0
  90. package/dist/features/worksheet/worksheet/mocks/behaviors/legacy.js.map +1 -0
  91. package/dist/features/worksheet/worksheet/mocks/behaviors/level2.js +38 -0
  92. package/dist/features/worksheet/worksheet/mocks/behaviors/level2.js.map +1 -0
  93. package/dist/features/worksheet/worksheet/mocks/behaviors/level3.js +38 -0
  94. package/dist/features/worksheet/worksheet/mocks/behaviors/level3.js.map +1 -0
  95. package/dist/features/worksheet/worksheet/mocks/behaviors/mastery.js +41 -0
  96. package/dist/features/worksheet/worksheet/mocks/behaviors/mastery.js.map +1 -0
  97. package/dist/features/worksheet/worksheet/mocks/behaviors/practice.js +38 -0
  98. package/dist/features/worksheet/worksheet/mocks/behaviors/practice.js.map +1 -0
  99. package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle-card.js +39 -0
  100. package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle-card.js.map +1 -0
  101. package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_easy.js +39 -0
  102. package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_easy.js.map +1 -0
  103. package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_hard.js +39 -0
  104. package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_hard.js.map +1 -0
  105. package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_medium.js +39 -0
  106. package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_medium.js.map +1 -0
  107. package/dist/features/worksheet/worksheet/mocks/behaviors/recap.js +39 -0
  108. package/dist/features/worksheet/worksheet/mocks/behaviors/recap.js.map +1 -0
  109. package/dist/features/worksheet/worksheet/mocks/behaviors/remedial.js +39 -0
  110. package/dist/features/worksheet/worksheet/mocks/behaviors/remedial.js.map +1 -0
  111. package/dist/features/worksheet/worksheet/mocks/behaviors/revision.js +38 -0
  112. package/dist/features/worksheet/worksheet/mocks/behaviors/revision.js.map +1 -0
  113. package/dist/features/worksheet/worksheet/mocks/behaviors/sat-math-assessment.js +38 -0
  114. package/dist/features/worksheet/worksheet/mocks/behaviors/sat-math-assessment.js.map +1 -0
  115. package/dist/features/worksheet/worksheet/mocks/behaviors/sat_english_learning.js +38 -0
  116. package/dist/features/worksheet/worksheet/mocks/behaviors/sat_english_learning.js.map +1 -0
  117. package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_learning.js +38 -0
  118. package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_learning.js.map +1 -0
  119. package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_recap.js +39 -0
  120. package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_recap.js.map +1 -0
  121. package/dist/features/worksheet/worksheet/mocks/behaviors/target_practice.js +38 -0
  122. package/dist/features/worksheet/worksheet/mocks/behaviors/target_practice.js.map +1 -0
  123. package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic-v2.js +38 -0
  124. package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic-v2.js.map +1 -0
  125. package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic.js +38 -0
  126. package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic.js.map +1 -0
  127. package/dist/features/worksheet/worksheet/mocks/behaviors/turing_assessment.js +38 -0
  128. package/dist/features/worksheet/worksheet/mocks/behaviors/turing_assessment.js.map +1 -0
  129. package/dist/features/worksheet/worksheet/mocks/behaviors/turing_practice.js +38 -0
  130. package/dist/features/worksheet/worksheet/mocks/behaviors/turing_practice.js.map +1 -0
  131. package/dist/features/worksheet/worksheet/mocks/signed-requests.js +5 -0
  132. package/dist/features/worksheet/worksheet/mocks/signed-requests.js.map +1 -0
  133. package/dist/features/worksheet/worksheet/stories/use-canvas-sync-broker-story.js +57 -0
  134. package/dist/features/worksheet/worksheet/stories/use-canvas-sync-broker-story.js.map +1 -0
  135. package/dist/features/worksheet/worksheet/stories/worksheet-story-container.js +231 -0
  136. package/dist/features/worksheet/worksheet/stories/worksheet-story-container.js.map +1 -0
  137. package/dist/features/worksheet/worksheet/stories/worksheet-student.js +174 -0
  138. package/dist/features/worksheet/worksheet/stories/worksheet-student.js.map +1 -0
  139. package/dist/features/worksheet/worksheet/stories/worksheet-teacher.js +255 -0
  140. package/dist/features/worksheet/worksheet/stories/worksheet-teacher.js.map +1 -0
  141. package/dist/features/worksheet/worksheet/worksheet-helpers.js +32 -31
  142. package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
  143. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +24 -24
  144. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
  145. package/dist/index.d.ts +18 -152
  146. package/dist/index.js +496 -522
  147. package/dist/index.js.map +1 -1
  148. package/dist/static/nudge-tap.0591aef4.json +1 -0
  149. package/dist/types/models/worksheet.js +5 -0
  150. package/dist/types/models/worksheet.js.map +1 -0
  151. package/package.json +3 -2
  152. package/dist/assets/line-icons/icons/after-noon.js +0 -34
  153. package/dist/assets/line-icons/icons/after-noon.js.map +0 -1
  154. package/dist/assets/line-icons/icons/apple-icon-white.js +0 -42
  155. package/dist/assets/line-icons/icons/apple-icon-white.js.map +0 -1
  156. package/dist/assets/line-icons/icons/evening.js +0 -35
  157. package/dist/assets/line-icons/icons/evening.js.map +0 -1
  158. package/dist/assets/line-icons/icons/morning.js +0 -35
  159. package/dist/assets/line-icons/icons/morning.js.map +0 -1
  160. package/dist/assets/line-icons/icons/star3.js +0 -32
  161. package/dist/assets/line-icons/icons/star3.js.map +0 -1
  162. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js +0 -9
  163. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js.map +0 -1
  164. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js +0 -65
  165. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js.map +0 -1
  166. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +0 -92
  167. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +0 -1
  168. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js +0 -12
  169. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js.map +0 -1
  170. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js +0 -34
  171. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +0 -1
  172. package/dist/features/auth/comps/otp-input/otp-input-styled.js +0 -22
  173. package/dist/features/auth/comps/otp-input/otp-input-styled.js.map +0 -1
  174. package/dist/features/auth/comps/otp-input/otp-input.js +0 -51
  175. package/dist/features/auth/comps/otp-input/otp-input.js.map +0 -1
  176. package/dist/features/auth/comps/pill-button/pill-button-styled.js +0 -44
  177. package/dist/features/auth/comps/pill-button/pill-button-styled.js.map +0 -1
  178. package/dist/features/auth/comps/pill-button/pill-button.js +0 -75
  179. package/dist/features/auth/comps/pill-button/pill-button.js.map +0 -1
  180. package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js +0 -17
  181. package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js.map +0 -1
  182. package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js +0 -67
  183. package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js.map +0 -1
  184. package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-constants.js +0 -19
  185. package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-constants.js.map +0 -1
  186. package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-styled.js +0 -32
  187. package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-styled.js.map +0 -1
  188. package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide.js +0 -44
  189. package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide.js.map +0 -1
  190. package/dist/features/auth/signup-v2/signup-header/signup-header.js +0 -54
  191. package/dist/features/auth/signup-v2/signup-header/signup-header.js.map +0 -1
  192. package/dist/features/auth/signup-v2/signup-options/signup-options.js +0 -83
  193. package/dist/features/auth/signup-v2/signup-options/signup-options.js.map +0 -1
  194. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js +0 -49
  195. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js.map +0 -1
  196. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +0 -64
  197. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +0 -1
  198. package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js +0 -28
  199. package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js.map +0 -1
  200. package/dist/features/ui/accordion/accordion-items/accordion-items.js +0 -83
  201. package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +0 -1
  202. package/dist/features/ui/accordion/accordion.js +0 -62
  203. package/dist/features/ui/accordion/accordion.js.map +0 -1
  204. package/dist/static/animated-avatar.1ad58b1d.json +0 -1
  205. package/dist/static/animated-avatar.69b07505.json +0 -1
  206. package/dist/static/animated-avatar.9c560b46.json +0 -1
  207. package/dist/static/calendar-purple.1a840b41.svg +0 -1
  208. package/dist/static/flying-disk.c7f6ed39.json +0 -1
  209. package/dist/static/graduation-cap.3be3340a.json +0 -1
  210. package/dist/static/handshake.287e7dfb.svg +0 -1
  211. package/dist/static/light-bulb.c6db0b23.json +0 -1
  212. package/dist/static/money.332aacf1.svg +0 -1
  213. package/dist/static/muscle.9bcfb8a7.json +0 -1
  214. package/dist/static/nudge-tap.5cb30093.json +0 -1057
  215. package/dist/static/parent-avatar.822c7b9b.svg +0 -1
  216. package/dist/static/pencil.23df9da0.json +0 -1
  217. package/dist/static/plus-sign.de6af957.json +0 -1
  218. package/dist/static/racing-car.2cbf864e.json +0 -1
  219. package/dist/static/rocket.0a3ccab0.json +0 -1
  220. package/dist/static/shovel.abeec04c.json +0 -1
  221. package/dist/static/stripe-blurple.6abf422f.svg +0 -1
  222. package/dist/static/trustpilot.bd3d79e1.svg +0 -1
@@ -0,0 +1,81 @@
1
+ import o from "styled-components";
2
+ import n from "../../../assets/line-icons/icons/hint-fill.js";
3
+ import l from "../../ui/layout/flex-view.js";
4
+ import r from "../../ui/text/text.js";
5
+ import { getPuzzleCardPattern as p } from "../utils/puzzle-pattern.js";
6
+ const d = o(l)(({ theme: t, $visible: i }) => {
7
+ const { gutter: e } = t.layout;
8
+ return i ? `
9
+ overflow: scroll;
10
+ padding-top: ${e * 1.5}px;
11
+ padding-bottom: ${e * 2}px;
12
+ ` : "";
13
+ }), g = o(l)`
14
+ position: relative;
15
+ margin: 0 auto;
16
+ box-shadow: inset 0px 0px 0px 4px ${({ theme: t, $imageHue: i }) => t.colors[`${i}_4`]};
17
+ max-width: 343px;
18
+ width: 100%;
19
+ min-height: max-content;
20
+
21
+ &::before {
22
+ content: '';
23
+ position: absolute;
24
+ top: 0;
25
+ left: 0;
26
+ right: 0;
27
+ bottom: 0;
28
+ background-image: ${({ $imageHue: t }) => `url(${p(t)})`};
29
+ background-size: cover;
30
+ opacity: 0.2;
31
+ }
32
+ `, x = o(n)`
33
+ color: ${({ theme: t }) => t.colors.BLACK_1};
34
+
35
+ & .hint-fill-icon-path {
36
+ fill: ${({ theme: t }) => t.colors.WHITE_1};
37
+ }
38
+ `, u = o(r)`
39
+ & span {
40
+ font-weight: 700;
41
+ margin-right: 4px;
42
+ }
43
+ `, h = o.div`
44
+ color: ${({ theme: t }) => t.colors.BLACK};
45
+ font-size: 14px;
46
+ line-height: 1.2;
47
+ font-family: 'Athletics';
48
+
49
+ font-weight: 400;
50
+ font-style: normal;
51
+
52
+ em {
53
+ font-style: italic;
54
+ }
55
+
56
+ ul,
57
+ ol {
58
+ list-style-type: initial;
59
+ padding-left: 32px;
60
+ }
61
+
62
+ ol {
63
+ list-style-type: decimal;
64
+ }
65
+
66
+ p {
67
+ margin: 0;
68
+ }
69
+
70
+ li {
71
+ margin: 4px 0;
72
+ }
73
+ `;
74
+ export {
75
+ d as PuzzleAppWrapper,
76
+ g as PuzzleContainer,
77
+ h as PuzzleQuestionWrapper,
78
+ u as StyledFeedbackText,
79
+ x as StyledHintFillIcon
80
+ };
81
+ //# sourceMappingURL=puzzle-app-styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"puzzle-app-styled.js","sources":["../../../../src/features/puzzles/app/puzzle-app-styled.tsx"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport styled from 'styled-components';\n\nimport HintFillIcon from '../../../assets/line-icons/icons/hint-fill';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { getPuzzleCardPattern } from '../utils/puzzle-pattern';\n\nconst PuzzleAppWrapper = styled(FlexView)<{ $visible: boolean }>(({ theme, $visible }) => {\n const { gutter } = theme.layout;\n\n if (!$visible) {\n return ``;\n }\n\n return `\n overflow: scroll;\n padding-top: ${gutter * 1.5}px;\n padding-bottom: ${gutter * 2}px;\n `;\n});\n\nconst PuzzleContainer = styled(FlexView)<{ $imageHue: THueNames; $backgroundOpacity?: number }>`\n position: relative;\n margin: 0 auto;\n box-shadow: inset 0px 0px 0px 4px ${({ theme, $imageHue }) => theme.colors[`${$imageHue}_4`]};\n max-width: 343px;\n width: 100%;\n min-height: max-content;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-image: ${({ $imageHue }) => `url(${getPuzzleCardPattern($imageHue)})`};\n background-size: cover;\n opacity: 0.2;\n }\n`;\n\nconst StyledHintFillIcon = styled(HintFillIcon)`\n color: ${({ theme }) => theme.colors.BLACK_1};\n\n & .hint-fill-icon-path {\n fill: ${({ theme }) => theme.colors.WHITE_1};\n }\n`;\n\nconst StyledFeedbackText = styled(Text)`\n & span {\n font-weight: 700;\n margin-right: 4px;\n }\n`;\n\nconst PuzzleQuestionWrapper = styled.div`\n color: ${({ theme }) => theme.colors.BLACK};\n font-size: 14px;\n line-height: 1.2;\n font-family: 'Athletics';\n\n font-weight: 400;\n font-style: normal;\n\n em {\n font-style: italic;\n }\n\n ul,\n ol {\n list-style-type: initial;\n padding-left: 32px;\n }\n\n ol {\n list-style-type: decimal;\n }\n\n p {\n margin: 0;\n }\n\n li {\n margin: 4px 0;\n }\n`;\n\nexport {\n PuzzleAppWrapper,\n PuzzleContainer,\n StyledFeedbackText,\n StyledHintFillIcon,\n PuzzleQuestionWrapper,\n};\n"],"names":["PuzzleAppWrapper","styled","FlexView","theme","$visible","gutter","PuzzleContainer","$imageHue","getPuzzleCardPattern","StyledHintFillIcon","HintFillIcon","StyledFeedbackText","Text","PuzzleQuestionWrapper"],"mappings":";;;;;AASM,MAAAA,IAAmBC,EAAOC,CAAQ,EAAyB,CAAC,EAAE,OAAAC,GAAO,UAAAC,QAAe;AAClF,QAAA,EAAE,QAAAC,EAAO,IAAIF,EAAM;AAEzB,SAAKC,IAIE;AAAA;AAAA,mBAEUC,IAAS,GAAG;AAAA,sBACTA,IAAS,CAAC;AAAA,MANrB;AAQX,CAAC,GAEKC,IAAkBL,EAAOC,CAAQ;AAAA;AAAA;AAAA,sCAGD,CAAC,EAAE,OAAAC,GAAO,WAAAI,QAAgBJ,EAAM,OAAO,GAAGI,CAAS,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAYtE,CAAC,EAAE,WAAAA,EAAU,MAAM,OAAOC,EAAqBD,CAAS,CAAC,GAAG;AAAA;AAAA;AAAA;AAAA,GAM9EE,IAAqBR,EAAOS,CAAY;AAAA,WACnC,CAAC,EAAE,OAAAP,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,YAGlC,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA,GAIzCQ,IAAqBV,EAAOW,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA,GAOhCC,IAAwBZ,EAAO;AAAA,WAC1B,CAAC,EAAE,OAAAE,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -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;AAAA,IACH;AAAA,IACA,CAACb,CAAkB;AAAA,EAAA,GAIf,EAAE,YAAAc,EAAW,IAAIC,EAAcX,GAAuBO,GAAqBZ,CAAS;AAE1F,EAAAiB,EAAU,MAAM;AACd,IAAIT,MAAiB,WACAP,EAAA;AAAA,MACjB,SAASS,KAAkB;AAAA,IAAA,CAC5B;AAAA,EAEF,GAAA,CAACF,GAAcP,GAAoBS,CAAc,CAAC,GAGrDO,EAAU,MAAM;AACd,IAAIF,KACQf,EAAA,QAAQkB,EAAO,mCAAmC;AAAA,EAC9D,GACC,CAACH,GAAYf,CAAS,CAAC,GAE1BiB,EAAU,MAAM;AACV,IAAAF,KAAcP,MAAiB,aAAaL,MACpCH,EAAA,QAAQkB,EAAO,kBAAkB,GAClCf;KAEV,CAACY,GA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,YAACC;AAAA,YAAA;AAAA,cACC,KAAKJ;AAAA,cACL,KAAI;AAAA,cACJ,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,YAAY;AAAA,YAAA;AAAA,UACd;AAAA,UAGF,gBAAAG,EAACE,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,UAGtBP,KACC,gBAAAK,EAACG,GAAA,EACC,UAAA,gBAAAH,EAAC,OAAI,EAAA,yBAAyB,EAAE,QAAQL,EAAS,EAAA,CAAG,EACtD,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MArBGC;AAAA,IAAA;AAAA,EAyBX,GAAG,CAAE,CAAA;AAED,SAACV,EAAU,SAGb,gBAAAc;AAAA,IAACI;AAAAA,IAAA;AAAA,MACC,KAAK/B;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAWJ;AAAA,MACX,aAAY;AAAA,MACZ,WAAU;AAAA,MAET,UAAUiB,EAAA,IAAI,CACbO,MAAA,gBAAAO,EAAC,OAA8C,EAAA,UAAAR,EAAsBC,CAAQ,EAAA,GAAnE,YAAYA,EAAS,WAAW,EAAqC,CAChF;AAAA,IAAA;AAAA,EAAA,IAbyB;AAgBhC,GAEeY,IAAAC,EAAKzC,CAAa;"}
@@ -0,0 +1,82 @@
1
+ import { jsx as e, jsxs as s, Fragment as z } from "react/jsx-runtime";
2
+ import { memo as S, useState as p, useRef as v, useCallback as a, useEffect as x } from "react";
3
+ import { ErrorBoundary as T } from "react-error-boundary";
4
+ import f from "../../ui/error/error.js";
5
+ import g from "../../ui/layout/flex-view.js";
6
+ import W from "../../ui/loader/app-loader/app-loader.js";
7
+ import u from "../../ui/text/text.js";
8
+ import _ from "../../worksheet/learnosity-preloader/learnosity-preloader.js";
9
+ import { usePreviewWorksheetGet as U } from "../../worksheet/worksheet-preview/api/get-preview-worksheet.js";
10
+ import { LEARNOSITY_QUESTIONS_API as y, LEARNOSITY_QUESTIONS_API_FALLBACK as C } from "../../worksheet/worksheet/stories/worksheet-story-container.js";
11
+ import { PuzzleAppWrapper as F, StyledFeedbackText as N, StyledHintFillIcon as O } from "./puzzle-app-styled.js";
12
+ import B from "./puzzle-app-view.js";
13
+ const D = (r) => {
14
+ console.log("Worksheet Logger:", r);
15
+ }, G = () => {
16
+ const r = new URLSearchParams(window.location.search), t = r.get("itemRef") || "", k = r.get("title") || "", l = r.get("imageHue") || "BLUE", c = r.get("feedbackComments") || void 0, A = r.get("tip") || void 0, [$, m] = p(), [o, b] = p(!1), { isProcessing: E, get: d, data: h, error: L } = U(), w = v(() => null), R = A || "Celebrate persistence more than correct answers - it's a life skill worth building.", n = a(() => {
17
+ d("test", {
18
+ action: "review",
19
+ node_type: "PUZZLE_CARD",
20
+ items: [t]
21
+ });
22
+ }, [d, t]);
23
+ x(() => {
24
+ n();
25
+ }, [n]);
26
+ const P = a((i) => {
27
+ m(i.message);
28
+ }, []), I = a(() => {
29
+ b(!0);
30
+ }, []);
31
+ return t ? $ || L ? /* @__PURE__ */ e(f, { height: "100vh", onTryAgain: n }) : E ? /* @__PURE__ */ e(W, { height: "100vh" }) : /* @__PURE__ */ e(
32
+ T,
33
+ {
34
+ fallback: /* @__PURE__ */ e(f, { height: "100vh" }),
35
+ onError: (i) => m(i.message),
36
+ children: /* @__PURE__ */ e(
37
+ _,
38
+ {
39
+ apiURL: y,
40
+ fallbackAPIURL: C,
41
+ logger: D,
42
+ children: /* @__PURE__ */ s(
43
+ F,
44
+ {
45
+ className: "puzzle-app-container",
46
+ $background: `${l}_2`,
47
+ $alignItems: "center",
48
+ $flexGapX: 1,
49
+ $gutterX: 1,
50
+ $visible: o,
51
+ $height: "100vh",
52
+ children: [
53
+ o && /* @__PURE__ */ e(u, { $renderAs: "ab1-bold", children: k }),
54
+ h && /* @__PURE__ */ e(
55
+ B,
56
+ {
57
+ onWorksheetErrored: P,
58
+ worksheetData: h,
59
+ loggerRef: w,
60
+ imageHue: l,
61
+ onLoaded: I
62
+ }
63
+ ),
64
+ o && /* @__PURE__ */ e(z, { children: c ? /* @__PURE__ */ s(N, { $renderAs: "ab2", children: [
65
+ /* @__PURE__ */ e("span", { children: "Tutor Remark:" }),
66
+ c
67
+ ] }) : /* @__PURE__ */ s(g, { $flexDirection: "row", $alignItems: "center", $flexGap: 8, children: [
68
+ /* @__PURE__ */ e(g, { $width: 24, $height: 24, children: /* @__PURE__ */ e(O, {}) }),
69
+ /* @__PURE__ */ e(u, { $renderAs: "ab2", children: R })
70
+ ] }) })
71
+ ]
72
+ }
73
+ )
74
+ }
75
+ )
76
+ }
77
+ ) : null;
78
+ }, re = S(G);
79
+ export {
80
+ re as default
81
+ };
82
+ //# 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 { THueNames } from '../../ui/types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useRef, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\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 LearnosityPreloader from '../../worksheet/learnosity-preloader/learnosity-preloader';\nimport { usePreviewWorksheetGet } from '../../worksheet/worksheet-preview/api/get-preview-worksheet';\nimport {\n LEARNOSITY_QUESTIONS_API,\n LEARNOSITY_QUESTIONS_API_FALLBACK,\n} from '../../worksheet/worksheet/stories/worksheet-story-container';\nimport * as Styled from './puzzle-app-styled';\nimport PuzzleAppView from './puzzle-app-view';\n\nconst logger = (eventName: string) => {\n // eslint-disable-next-line no-console\n console.log('Worksheet Logger:', eventName);\n};\n\nconst PuzzleApp: FC = () => {\n // Extract props from URL search parameters\n const urlParams = new URLSearchParams(window.location.search);\n const itemRef = urlParams.get('itemRef') || '';\n const title = urlParams.get('title') || '';\n const imageHue = (urlParams.get('imageHue') || 'BLUE') as THueNames;\n const feedbackComments = urlParams.get('feedbackComments') || undefined;\n const tip = urlParams.get('tip') || undefined;\n\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 (!itemRef) return null;\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 <ErrorBoundary\n fallback={<Error height=\"100vh\" />}\n onError={errorInfo => setError(errorInfo.message)}\n >\n <LearnosityPreloader\n apiURL={LEARNOSITY_QUESTIONS_API}\n fallbackAPIURL={LEARNOSITY_QUESTIONS_API_FALLBACK}\n logger={logger}\n >\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 </LearnosityPreloader>\n </ErrorBoundary>\n );\n};\n\nexport default memo(PuzzleApp);\n"],"names":["logger","eventName","PuzzleApp","urlParams","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","ErrorBoundary","errorInfo","LearnosityPreloader","LEARNOSITY_QUESTIONS_API","LEARNOSITY_QUESTIONS_API_FALLBACK","jsxs","Styled.PuzzleAppWrapper","Text","PuzzleAppView","Styled.StyledFeedbackText","FlexView","Styled.StyledHintFillIcon","puzzleApp","memo"],"mappings":";;;;;;;;;;;;AAmBA,MAAMA,IAAS,CAACC,MAAsB;AAE5B,UAAA,IAAI,qBAAqBA,CAAS;AAC5C,GAEMC,IAAgB,MAAM;AAE1B,QAAMC,IAAY,IAAI,gBAAgB,OAAO,SAAS,MAAM,GACtDC,IAAUD,EAAU,IAAI,SAAS,KAAK,IACtCE,IAAQF,EAAU,IAAI,OAAO,KAAK,IAClCG,IAAYH,EAAU,IAAI,UAAU,KAAK,QACzCI,IAAmBJ,EAAU,IAAI,kBAAkB,KAAK,QACxDK,IAAML,EAAU,IAAI,KAAK,KAAK,QAE9B,CAACM,GAAOC,CAAQ,IAAIC,EAAiB,GACrC,CAACC,GAAmBC,CAAoB,IAAIF,EAAkB,EAAK,GAEnE,EAAE,cAAAG,GAAc,KAAAC,GAAK,MAAMC,GAAe,OAAOC,MAAeC,KAChEC,IAAYC,EAAO,MAAM,IAAI,GAE7BC,IACJb,KAAO,uFAEHc,IAAiBC,EA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WAAAG;AAAA,oBACA,UAAAb;AAAA,oBACA,UAAUqB;AAAA,kBAAA;AAAA,gBACZ;AAAA,gBAGDf,4BAEI,UACCL,IAAA,gBAAA6B,EAACI,GAAA,EAA0B,WAAU,OACnC,UAAA;AAAA,kBAAA,gBAAAZ,EAAC,UAAK,UAAa,gBAAA,CAAA;AAAA,kBAClBrB;AAAA,gBACH,EAAA,CAAA,sBAECkC,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,UAAU,GAC5D,UAAA;AAAA,kBAAC,gBAAAb,EAAAa,GAAA,EAAS,QAAQ,IAAI,SAAS,IAC7B,UAAC,gBAAAb,EAAAc,GAAA,CAAA,CAA0B,EAC7B,CAAA;AAAA,kBACC,gBAAAd,EAAAU,GAAA,EAAK,WAAU,OAAO,UAAQjB,GAAA;AAAA,gBAAA,EAAA,CACjC,EAEJ,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA,IA3DiB;AA8DvB,GAEesB,KAAAC,EAAK1C,CAAS;"}
@@ -1,13 +1,56 @@
1
- import t from "styled-components";
2
- import o from "../../../ui/layout/flex-view.js";
3
- const i = t.div`
1
+ import o from "styled-components";
2
+ import e from "../../../ui/image/image.js";
3
+ import t from "../../../ui/layout/flex-view.js";
4
+ const l = o.div`
4
5
  width: 100%;
5
6
  height: 100%;
6
- `, n = t(o)`
7
+ `, c = o(t)`
7
8
  margin: auto;
8
- `;
9
+ `, h = o(e)`
10
+ object-fit: cover;
11
+ `, s = o.div(
12
+ ({ theme: r }) => `
13
+ flex: 1;
14
+ display: grid;
15
+ border-left: 1px solid ${r.colors.BLACK_T_87};
16
+ grid-template-columns: repeat(2, 1fr);
17
+ grid-template-rows: auto auto auto;
18
+ `
19
+ ), p = o(t)(
20
+ ({ theme: r }) => `
21
+ border: 0.5px solid ${r.colors.WHITE_5};
22
+ &:first-child,
23
+ &:nth-child(2) {
24
+ grid-column: span 1;
25
+ }
26
+ &:nth-child(3),
27
+ &:nth-child(4) {
28
+ grid-column: span 2;
29
+ }
30
+ &:first-child {
31
+ border-left: none;
32
+ border-top: none;
33
+ }
34
+ &:nth-child(2) {
35
+ border-right: none;
36
+ border-top: none;
37
+ }
38
+ &:nth-child(3) {
39
+ border-left: none;
40
+ border-right: none;
41
+ }
42
+ &:nth-child(4) {
43
+ border-left: none;
44
+ border-right: none;
45
+ border-bottom: none;
46
+ }
47
+ `
48
+ );
9
49
  export {
10
- i as Container,
11
- n as ContentWrapper
50
+ l as Container,
51
+ c as ContentWrapper,
52
+ s as GridContainer,
53
+ p as GridItem,
54
+ h as ProfilePicture
12
55
  };
13
56
  //# sourceMappingURL=teacher-intro-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"teacher-intro-styled.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n`;\n\nconst ContentWrapper = styled(FlexView)`\n margin: auto;\n`;\n\nexport { Container, ContentWrapper };\n"],"names":["Container","styled","ContentWrapper","FlexView"],"mappings":";;AAIA,MAAMA,IAAYC,EAAO;AAAA;AAAA;AAAA,GAKnBC,IAAiBD,EAAOE,CAAQ;AAAA;AAAA;"}
1
+ {"version":3,"file":"teacher-intro-styled.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n`;\n\nconst ContentWrapper = styled(FlexView)`\n margin: auto;\n`;\n\nconst ProfilePicture = styled(Image)`\n object-fit: cover;\n`;\n\nconst GridContainer = styled.div(\n ({ theme }) => `\n flex: 1;\n display: grid;\n border-left: 1px solid ${theme.colors.BLACK_T_87};\n grid-template-columns: repeat(2, 1fr);\n grid-template-rows: auto auto auto;\n`,\n);\n\nconst GridItem = styled(FlexView)(\n ({ theme }) => `\n border: 0.5px solid ${theme.colors.WHITE_5};\n &:first-child,\n &:nth-child(2) {\n grid-column: span 1;\n }\n &:nth-child(3),\n &:nth-child(4) {\n grid-column: span 2;\n }\n &:first-child {\n border-left: none;\n border-top: none;\n }\n &:nth-child(2) {\n border-right: none;\n border-top: none;\n }\n &:nth-child(3) {\n border-left: none;\n border-right: none;\n }\n &:nth-child(4) {\n border-left: none;\n border-right: none;\n border-bottom: none;\n }\n`,\n);\n\nexport { Container, ContentWrapper, ProfilePicture, GridContainer, GridItem };\n"],"names":["Container","styled","ContentWrapper","FlexView","ProfilePicture","Image","GridContainer","theme","GridItem"],"mappings":";;;AAKA,MAAMA,IAAYC,EAAO;AAAA;AAAA;AAAA,GAKnBC,IAAiBD,EAAOE,CAAQ;AAAA;AAAA,GAIhCC,IAAiBH,EAAOI,CAAK;AAAA;AAAA,GAI7BC,IAAgBL,EAAO;AAAA,EAC3B,CAAC,EAAE,OAAAM,EAAA,MAAY;AAAA;AAAA;AAAA,2BAGUA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAIlD,GAEMC,IAAWP,EAAOE,CAAQ;AAAA,EAC9B,CAAC,EAAE,OAAAI,EAAA,MAAY;AAAA,wBACOA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2B5C;"}
@@ -1,20 +1,74 @@
1
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
- import { memo as m } from "react";
3
- import n from "../../../ui/separator/separator.js";
4
- import { useTrialSessionContext as f } from "../../context/use-trial-session-context.js";
5
- import a from "../communication-slide/index.js";
6
- import p from "../slide-header/index.js";
7
- import { Container as s, ContentWrapper as c } from "./teacher-intro-styled.js";
8
- import h from "./teacher-profile/teacher-profile.js";
9
- const j = m(() => {
10
- const { slideConfig: e } = f(), { renderAVIn: o, teacher_profile: t } = e || {};
11
- return o === "right" ? /* @__PURE__ */ r(a, {}) : /* @__PURE__ */ i(s, { children: [
12
- /* @__PURE__ */ r(n, { height: 60 }),
13
- /* @__PURE__ */ r(p, {}),
14
- /* @__PURE__ */ r(c, { $width: 750, children: /* @__PURE__ */ r(h, { teacherProfile: t }) })
1
+ import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
+ import { memo as T, useMemo as I } from "react";
3
+ import j from "../../../ui/image/image.js";
4
+ import h from "../../../ui/layout/flex-view.js";
5
+ import s from "../../../ui/separator/separator.js";
6
+ import t from "../../../ui/text/text.js";
7
+ import { useTrialSessionContext as k } from "../../context/use-trial-session-context.js";
8
+ import O from "../communication-slide/index.js";
9
+ import F from "../slide-header/index.js";
10
+ import { COUNTRY_FLAGS as H } from "./teacher-intro-constants.js";
11
+ import { Container as L, ContentWrapper as D, ProfilePicture as E, GridContainer as P, GridItem as i } from "./teacher-intro-styled.js";
12
+ const z = T(() => {
13
+ const { slideConfig: f } = k(), { renderAVIn: m, teacher_profile: u } = f || {}, {
14
+ degree: g,
15
+ countries: o,
16
+ lower_grade: a,
17
+ higher_grade: n,
18
+ header_image: $,
19
+ years_of_experience: p,
20
+ number_of_students_taught: b
21
+ } = u || {}, { degree_name: c, field_of_study: d } = g || {}, _ = Object.values(H), l = n && parseInt(n, 10) > 8, x = I(() => l ? "High School" : ` ${a === "K" ? "" : "G"}${a} - G${n}`, [l, n, a]);
22
+ return m === "right" ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ r(L, { children: [
23
+ /* @__PURE__ */ e(s, { height: 60 }),
24
+ /* @__PURE__ */ e(F, {}),
25
+ /* @__PURE__ */ r(
26
+ D,
27
+ {
28
+ $flexDirection: "row",
29
+ $width: 750,
30
+ $borderColor: "BLACK_T_87",
31
+ $background: "WHITE_3",
32
+ children: [
33
+ /* @__PURE__ */ e(E, { withLoader: !0, src: $, width: 350, height: 350 }),
34
+ /* @__PURE__ */ r(P, { children: [
35
+ /* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
36
+ /* @__PURE__ */ e(t, { $renderAs: "ah3-black", children: p }),
37
+ /* @__PURE__ */ e(t, { $renderAs: "ub3", children: "Yrs of Teaching Experience" })
38
+ ] }),
39
+ /* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
40
+ /* @__PURE__ */ e(t, { $renderAs: "ah3-black", children: b }),
41
+ /* @__PURE__ */ e(t, { $renderAs: "ub3", children: "Students Taught" })
42
+ ] }),
43
+ c && d && /* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
44
+ /* @__PURE__ */ e(t, { $renderAs: "ab1-black", children: c }),
45
+ /* @__PURE__ */ r(t, { $renderAs: "ub3", children: [
46
+ "In ",
47
+ d
48
+ ] })
49
+ ] }),
50
+ /* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
51
+ /* @__PURE__ */ r(t, { $renderAs: "ab1-black", children: [
52
+ "Teaching ",
53
+ x,
54
+ " kids in"
55
+ ] }),
56
+ /* @__PURE__ */ e(s, { height: 12 }),
57
+ /* @__PURE__ */ e(h, { $flexDirection: "row", $flexGap: 16, $flexWrap: !0, children: o && o.length > 0 && o.map((C) => {
58
+ const y = _.find((S) => S.name === C), { flag_icon: A = "", label: w, name: G } = y || {};
59
+ return /* @__PURE__ */ r(h, { $flexDirection: "row", $flexGap: 4, children: [
60
+ /* @__PURE__ */ e(j, { src: A, width: 30, height: 20, withLoader: !1 }),
61
+ /* @__PURE__ */ e(t, { $renderAs: "ab3-black", children: w })
62
+ ] }, G);
63
+ }) })
64
+ ] })
65
+ ] })
66
+ ]
67
+ }
68
+ )
15
69
  ] });
16
70
  });
17
71
  export {
18
- j as default
72
+ z as default
19
73
  };
20
74
  //# sourceMappingURL=teacher-intro.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"teacher-intro.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport Separator from '../../../ui/separator/separator';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport CommunicationSlide from '../communication-slide';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './teacher-intro-styled';\nimport TeacherProfile from './teacher-profile/teacher-profile';\n\nconst TeacherIntro = memo(() => {\n const { slideConfig } = useTrialSessionContext();\n const { renderAVIn, teacher_profile: teacherProfile } = slideConfig || {};\n\n if (renderAVIn === 'right') return <CommunicationSlide />;\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $width={750}>\n <TeacherProfile teacherProfile={teacherProfile} />\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n});\n\nexport default TeacherIntro;\n"],"names":["TeacherIntro","memo","slideConfig","useTrialSessionContext","renderAVIn","teacherProfile","jsx","CommunicationSlide","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","TeacherProfile"],"mappings":";;;;;;;;AASM,MAAAA,IAAeC,EAAK,MAAM;AACxB,QAAA,EAAE,aAAAC,MAAgBC,KAClB,EAAE,YAAAC,GAAY,iBAAiBC,EAAe,IAAIH,KAAe,CAAA;AAEvE,SAAIE,MAAe,UAAgB,gBAAAE,EAACC,GAAmB,CAAA,CAAA,IAGrD,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,IAAC,gBAAAH,EAAAI,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,sBACtBC,GAAY,EAAA;AAAA,IACb,gBAAAL,EAACM,GAAA,EAAsB,QAAQ,KAC7B,UAAA,gBAAAN,EAACO,GAAe,EAAA,gBAAAR,EAAgC,CAAA,GAClD;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"teacher-intro.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro.tsx"],"sourcesContent":["import { memo, useMemo } from 'react';\n\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport CommunicationSlide from '../communication-slide';\nimport SlideHeader from '../slide-header';\nimport { COUNTRY_FLAGS } from './teacher-intro-constants';\nimport * as Styled from './teacher-intro-styled';\n\nconst TeacherIntro = memo(() => {\n const { slideConfig } = useTrialSessionContext();\n const { renderAVIn, teacher_profile: teacherProfile } = slideConfig || {};\n\n const {\n degree,\n countries,\n lower_grade: lowerGrade,\n higher_grade: higherGrade,\n header_image: headerImage,\n years_of_experience: yearsOfExperience,\n number_of_students_taught: numberOfStudentsTaught,\n } = teacherProfile || {};\n const { degree_name: degreeName, field_of_study: fieldOfStudy } = degree || {};\n\n const countryFlagArray = Object.values(COUNTRY_FLAGS);\n const isHighSchool = higherGrade && parseInt(higherGrade, 10) > 8;\n\n const displayGrade = useMemo(() => {\n return isHighSchool\n ? 'High School'\n : ` ${lowerGrade === 'K' ? '' : 'G'}${lowerGrade} - G${higherGrade}`;\n }, [isHighSchool, higherGrade, lowerGrade]);\n\n if (renderAVIn === 'right') return <CommunicationSlide />;\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper\n $flexDirection=\"row\"\n $width={750}\n $borderColor=\"BLACK_T_87\"\n $background=\"WHITE_3\"\n >\n <Styled.ProfilePicture withLoader src={headerImage} width={350} height={350} />\n <Styled.GridContainer>\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ah3-black\">{yearsOfExperience}</Text>\n <Text $renderAs=\"ub3\">Yrs of Teaching Experience</Text>\n </Styled.GridItem>\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ah3-black\">{numberOfStudentsTaught}</Text>\n <Text $renderAs=\"ub3\">Students Taught</Text>\n </Styled.GridItem>\n {degreeName && fieldOfStudy && (\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ab1-black\">{degreeName}</Text>\n <Text $renderAs=\"ub3\">In {fieldOfStudy}</Text>\n </Styled.GridItem>\n )}\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ab1-black\">Teaching {displayGrade} kids in</Text>\n <Separator height={12} />\n <FlexView $flexDirection=\"row\" $flexGap={16} $flexWrap>\n {countries &&\n countries.length > 0 &&\n countries.map(country => {\n const countryFlag = countryFlagArray.find(item => item.name === country);\n const { flag_icon: flagIcon = '', label, name } = countryFlag || {};\n\n return (\n <FlexView key={name} $flexDirection=\"row\" $flexGap={4}>\n <Image src={flagIcon} width={30} height={20} withLoader={false} />\n <Text $renderAs=\"ab3-black\">{label}</Text>\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.GridItem>\n </Styled.GridContainer>\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n});\n\nexport default TeacherIntro;\n"],"names":["TeacherIntro","memo","slideConfig","useTrialSessionContext","renderAVIn","teacherProfile","degree","countries","lowerGrade","higherGrade","headerImage","yearsOfExperience","numberOfStudentsTaught","degreeName","fieldOfStudy","countryFlagArray","COUNTRY_FLAGS","isHighSchool","displayGrade","useMemo","jsx","CommunicationSlide","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","Styled.ProfilePicture","Styled.GridContainer","Styled.GridItem","Text","FlexView","country","countryFlag","item","flagIcon","label","name","Image"],"mappings":";;;;;;;;;;;AAYM,MAAAA,IAAeC,EAAK,MAAM;AACxB,QAAA,EAAE,aAAAC,MAAgBC,KAClB,EAAE,YAAAC,GAAY,iBAAiBC,EAAe,IAAIH,KAAe,CAAA,GAEjE;AAAA,IACJ,QAAAI;AAAA,IACA,WAAAC;AAAA,IACA,aAAaC;AAAA,IACb,cAAcC;AAAA,IACd,cAAcC;AAAA,IACd,qBAAqBC;AAAA,IACrB,2BAA2BC;AAAA,EAAA,IACzBP,KAAkB,CA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TLE_DURATION
5
+ };
6
+ //# sourceMappingURL=arrow-tooltip-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow-tooltip-constants.js","sources":["../../../../src/features/ui/arrow-tooltip/arrow-tooltip-constants.ts"],"sourcesContent":["export const DEFAULT_ARROW_SIZE = 8;\nexport const THROTTLE_DURATION = 100;\n"],"names":["DEFAULT_ARROW_SIZE","THROTTLE_DURATION"],"mappings":"AAAO,MAAMA,IAAqB,GACrBC,IAAoB;"}
@@ -1,63 +1,15 @@
1
- import w from "styled-components";
2
- import y from "../layout/flex-view.js";
3
- import { arrowPosition as T, tooltipPosition as k, animateToolTip as m } from "./arrow-tooltip-util.js";
4
- const P = w(y)(({
5
- theme: o,
6
- $arrowColor: r,
7
- $arrowSize: t,
8
- $arrowXCoOrdinates: c,
9
- $arrowYCoOrdinates: d,
10
- $borderColor: p,
11
- $isAnimated: x,
12
- $position: n,
13
- $renderAs: s,
14
- $tooltipCoOrdinates: e,
15
- $tooltipOffset: f,
16
- $tooltipXCoOrdinates: g,
17
- $tooltipYCoOrdinates: u,
18
- $zIndex: C,
19
- $backgroundColor: O
20
- }) => {
21
- const { gutter: l } = o.layout, { REAL_BLACK_15: $ } = o.colors, { tooltipVariants: a } = o.arrowTooltip;
22
- let { backgroundColorName: i } = a[s];
23
- const { textColorName: b } = a[s];
24
- return i = O || i, `
25
- position: fixed;
26
- z-index: ${C || 1};
27
- padding: ${l * 0.25}px ${l * 0.5}px;
28
- color: ${b};
29
- box-shadow: 0px 2px 15px 0px ${$};
30
- background-color: ${o.colors[i]};
31
- border: 1px solid ${p ? o.colors[p] : "transparent"};
32
-
33
- &::after {
34
- content: '';
35
- position: absolute;
36
- height: ${t}px;
37
- width: ${t}px;
38
- clip-path: polygon(0% 0%, 100% 100%, 0% 100%);
39
- background-color: ${r ? o.colors[r] : o.colors[i]};
40
- ${T({
41
- position: n,
42
- arrowXCoOrdinates: c,
43
- arrowYCoOrdinates: d,
44
- arrowSize: t
45
- })};
46
- }
47
-
48
- ${k({
49
- position: n,
50
- arrowSize: t,
51
- tooltipCoOrdinates: e,
52
- tooltipOffset: f,
53
- tooltipXCoOrdinates: g,
54
- tooltipYCoOrdinates: u
55
- })};
56
-
57
- ${m(x)};
58
- `;
59
- });
1
+ import o from "styled-components";
2
+ const i = o.div`
3
+ position: absolute;
4
+ top: 0;
5
+ left: 0;
6
+ right: 0;
7
+ bottom: 0;
8
+ width: 100%;
9
+ height: 100%;
10
+ z-index: ${({ theme: t }) => t.zIndex.JOURNEY_OVERLAY};
11
+ `;
60
12
  export {
61
- P as TooltipBody
13
+ i as BackgroundOverlay
62
14
  };
63
15
  //# sourceMappingURL=arrow-tooltip-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"arrow-tooltip-styled.js","sources":["../../../../src/features/ui/arrow-tooltip/arrow-tooltip-styled.tsx"],"sourcesContent":["import type { TArrowTooltipVariants, TColorNames } from '../types';\nimport type { TPositionProps, TTooltipCoOrdinatesProps } from './arrow-tooltip-types';\n\nimport styled from 'styled-components';\n\nimport FlexView from '../layout/flex-view';\nimport { animateToolTip, arrowPosition, tooltipPosition } from './arrow-tooltip-util';\n\ninterface ITooltipBodyProps {\n $arrowSize: number;\n $arrowColor?: TColorNames;\n $arrowXCoOrdinates?: number;\n $arrowYCoOrdinates?: number;\n $backgroundColor?: TColorNames;\n $borderColor?: TColorNames;\n $position: TPositionProps;\n $renderAs: TArrowTooltipVariants;\n $tooltipCoOrdinates: TTooltipCoOrdinatesProps | null;\n $tooltipOffset?: number;\n $tooltipXCoOrdinates?: number | string;\n $tooltipYCoOrdinates?: number | string;\n $zIndex?: number;\n $isAnimated?: boolean;\n}\n\nconst TooltipBody = styled(FlexView)<ITooltipBodyProps>(({\n theme,\n $arrowColor,\n $arrowSize,\n $arrowXCoOrdinates,\n $arrowYCoOrdinates,\n $borderColor,\n $isAnimated,\n $position,\n $renderAs,\n $tooltipCoOrdinates,\n $tooltipOffset,\n $tooltipXCoOrdinates,\n $tooltipYCoOrdinates,\n $zIndex,\n $backgroundColor,\n}) => {\n const { gutter } = theme.layout;\n const { REAL_BLACK_15 } = theme.colors;\n const { tooltipVariants } = theme.arrowTooltip;\n let { backgroundColorName } = tooltipVariants[$renderAs];\n const { textColorName } = tooltipVariants[$renderAs];\n\n backgroundColorName = $backgroundColor || backgroundColorName;\n\n return `\n position: fixed;\n z-index: ${$zIndex || 1};\n padding: ${gutter * 0.25}px ${gutter * 0.5}px;\n color: ${textColorName};\n box-shadow: 0px 2px 15px 0px ${REAL_BLACK_15};\n background-color: ${theme.colors[backgroundColorName]};\n border: 1px solid ${$borderColor ? theme.colors[$borderColor] : 'transparent'};\n\n &::after {\n content: '';\n position: absolute;\n height: ${$arrowSize}px;\n width: ${$arrowSize}px;\n clip-path: polygon(0% 0%, 100% 100%, 0% 100%);\n background-color: ${\n $arrowColor ? theme.colors[$arrowColor] : theme.colors[backgroundColorName]\n };\n ${arrowPosition({\n position: $position,\n arrowXCoOrdinates: $arrowXCoOrdinates,\n arrowYCoOrdinates: $arrowYCoOrdinates,\n arrowSize: $arrowSize,\n })};\n }\n\n ${tooltipPosition({\n position: $position,\n arrowSize: $arrowSize,\n tooltipCoOrdinates: $tooltipCoOrdinates,\n tooltipOffset: $tooltipOffset,\n tooltipXCoOrdinates: $tooltipXCoOrdinates,\n tooltipYCoOrdinates: $tooltipYCoOrdinates,\n })};\n\n ${animateToolTip($isAnimated)};\n `;\n});\n\nexport { TooltipBody };\n"],"names":["TooltipBody","styled","FlexView","theme","$arrowColor","$arrowSize","$arrowXCoOrdinates","$arrowYCoOrdinates","$borderColor","$isAnimated","$position","$renderAs","$tooltipCoOrdinates","$tooltipOffset","$tooltipXCoOrdinates","$tooltipYCoOrdinates","$zIndex","$backgroundColor","gutter","REAL_BLACK_15","tooltipVariants","backgroundColorName","textColorName","arrowPosition","tooltipPosition","animateToolTip"],"mappings":";;;AAyBA,MAAMA,IAAcC,EAAOC,CAAQ,EAAqB,CAAC;AAAA,EACvD,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EAAehB,CAAW,CAAC;AAAA;AAEjC,CAAC;"}
1
+ {"version":3,"file":"arrow-tooltip-styled.js","sources":["../../../../src/features/ui/arrow-tooltip/arrow-tooltip-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const BackgroundOverlay = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n z-index: ${({ theme }) => theme.zIndex.JOURNEY_OVERLAY};\n`;\n"],"names":["BackgroundOverlay","styled","theme"],"mappings":";AAEO,MAAMA,IAAoBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAQ3B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,eAAe;AAAA;"}