@cuemath/leap 3.2.19-beta-0.1 → 3.2.19-link.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/assets/illustrations/illustrations.js +6 -6
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/line-icons/icons/star3.js +32 -0
  4. package/dist/assets/line-icons/icons/star3.js.map +1 -0
  5. package/dist/assets/lottie/lottie.js +0 -5
  6. package/dist/assets/lottie/lottie.js.map +1 -1
  7. package/dist/features/analytics-events/platform-events-student.js +1 -2
  8. package/dist/features/analytics-events/platform-events-student.js.map +1 -1
  9. package/dist/features/analytics-events/platform-events-teacher.js +4 -6
  10. package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
  11. package/dist/features/analytics-events/whitelist-events.js +8 -10
  12. package/dist/features/analytics-events/whitelist-events.js.map +1 -1
  13. package/dist/features/chapters-v2/utils/node-card-utils.js +2 -2
  14. package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
  15. package/dist/features/communication/pub-sub/constants.js +4 -7
  16. package/dist/features/communication/pub-sub/constants.js.map +1 -1
  17. package/dist/features/homework/homework-card-view.js +97 -85
  18. package/dist/features/homework/homework-card-view.js.map +1 -1
  19. package/dist/features/homework/homework-card.js +42 -44
  20. package/dist/features/homework/homework-card.js.map +1 -1
  21. package/dist/features/homework/hw-card-list/hw-card-list-view.js +29 -31
  22. package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
  23. package/dist/features/homework/hw-card-list/hw-card-list.js +48 -54
  24. package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
  25. package/dist/features/homework/utils.js +27 -33
  26. package/dist/features/homework/utils.js.map +1 -1
  27. package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +11 -17
  28. package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
  29. package/dist/features/journey/journey-id/journey-id-student.js +1 -1
  30. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  31. package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
  32. package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
  33. package/dist/features/puzzles/app/puzzle-app-styled.js +6 -10
  34. package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -1
  35. package/dist/features/puzzles/comps/puzzle-card-styled.js +69 -24
  36. package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
  37. package/dist/features/puzzles/comps/puzzle-card.js +30 -79
  38. package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
  39. package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +25 -55
  40. package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
  41. package/dist/features/puzzles/puzzle-container/puzzle-container.js +107 -100
  42. package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
  43. package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js +1 -1
  44. package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map +1 -1
  45. package/dist/features/puzzles/utils/puzzle-pattern.js +13 -28
  46. package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
  47. package/dist/features/trial-session/comps/student-profile/student-profile.js +1 -1
  48. package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js +7 -50
  49. package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js.map +1 -1
  50. package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js +15 -69
  51. package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js.map +1 -1
  52. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js +49 -0
  53. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js.map +1 -0
  54. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +64 -0
  55. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -0
  56. package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js +28 -0
  57. package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js.map +1 -0
  58. package/dist/features/ui/accordion/accordion-items/accordion-items.js +83 -0
  59. package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +1 -0
  60. package/dist/features/ui/accordion/accordion.js +62 -0
  61. package/dist/features/ui/accordion/accordion.js.map +1 -0
  62. package/dist/features/ui/inputs/base-input/base-input.js +11 -11
  63. package/dist/features/ui/inputs/base-input/base-input.js.map +1 -1
  64. package/dist/features/ui/inputs/text-input/text-input.js +19 -18
  65. package/dist/features/ui/inputs/text-input/text-input.js.map +1 -1
  66. package/dist/features/ui/modals/modal-styled.js +42 -8
  67. package/dist/features/ui/modals/modal-styled.js.map +1 -1
  68. package/dist/features/ui/modals/modal.js +37 -27
  69. package/dist/features/ui/modals/modal.js.map +1 -1
  70. package/dist/features/ui/text/text.js +31 -29
  71. package/dist/features/ui/text/text.js.map +1 -1
  72. package/dist/features/ui/theme/clrs.js +2 -0
  73. package/dist/features/ui/theme/clrs.js.map +1 -1
  74. package/dist/features/worksheet/worksheet/worksheet-helpers.js +19 -20
  75. package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
  76. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +12 -16
  77. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
  78. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +47 -101
  79. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
  80. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +146 -149
  81. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
  82. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +207 -242
  83. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
  84. package/dist/features/worksheet/worksheet/worksheet-styled.js +37 -37
  85. package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
  86. package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
  87. package/dist/features/worksheet/worksheet/worksheet.js +313 -307
  88. package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
  89. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
  90. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
  91. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +35 -44
  92. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
  93. package/dist/index.d.ts +71 -89
  94. package/dist/index.js +626 -626
  95. package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +1 -0
  96. package/dist/static/puzzle-pattern-green.c9f84bbc.svg +1 -0
  97. package/dist/static/puzzle-pattern-orange.3da09665.svg +1 -0
  98. package/dist/static/puzzle-pattern-purple.5fb5a319.svg +1 -0
  99. package/dist/static/puzzle-pattern-yellow.aadbf457.svg +1 -0
  100. package/dist/static/stripe-blurple.6abf422f.svg +1 -0
  101. package/package.json +1 -1
  102. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +0 -72
  103. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +0 -1
  104. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +0 -59
  105. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +0 -1
  106. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +0 -63
  107. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +0 -1
  108. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +0 -67
  109. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +0 -1
  110. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +0 -70
  111. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +0 -1
  112. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +0 -59
  113. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +0 -1
  114. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +0 -59
  115. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +0 -1
  116. package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +0 -70
  117. package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +0 -1
  118. package/dist/features/puzzles/api/puzzle-dashboard.js +0 -10
  119. package/dist/features/puzzles/api/puzzle-dashboard.js.map +0 -1
  120. package/dist/features/puzzles/constants/puzzle-container.js +0 -8
  121. package/dist/features/puzzles/constants/puzzle-container.js.map +0 -1
  122. package/dist/features/puzzles/puzzle-analytics-events.js +0 -11
  123. package/dist/features/puzzles/puzzle-analytics-events.js.map +0 -1
  124. package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +0 -55
  125. package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +0 -1
  126. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +0 -37
  127. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +0 -1
  128. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +0 -110
  129. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +0 -1
  130. package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +0 -28
  131. package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +0 -1
  132. package/dist/static/puzzle-blue-lottie.7017e2e8.json +0 -1
  133. package/dist/static/puzzle-blue-lottie.bf64ebc5.json +0 -12760
  134. package/dist/static/puzzle-dashboard-banner.b7956519.svg +0 -1
  135. package/dist/static/puzzle-green-lottie.1da90698.json +0 -1
  136. package/dist/static/puzzle-orange-lottie.cfcf3724.json +0 -1
  137. package/dist/static/puzzle-pattern-blue.abff0164.svg +0 -1
  138. package/dist/static/puzzle-pattern-green.b8ba1840.svg +0 -1
  139. package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +0 -1
  140. package/dist/static/puzzle-pattern-purple.14b09759.svg +0 -1
  141. package/dist/static/puzzle-pattern-yellow.50917fab.svg +0 -1
  142. package/dist/static/puzzle-purple-lottie.e70de110.json +0 -9860
  143. package/dist/static/puzzle-yellow-lottie.275b5cf4.json +0 -1
@@ -1 +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.4;\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-Regular';\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 strong {\n font-weight: 700;\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;AAAA;AAAA;AAAA;AAAA;"}
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;"}
@@ -1,34 +1,79 @@
1
- import e from "styled-components";
2
- import r from "../../ui/layout/flex-view.js";
3
- import i from "../../ui/text/text.js";
4
- import { getPuzzleCardPattern as p } from "../utils/puzzle-pattern.js";
5
- const n = e(r)`
1
+ import e, { keyframes as a, css as r } from "styled-components";
2
+ import n from "../../ui/layout/flex-view.js";
3
+ import { getPuzzleCardPattern as l } from "../utils/puzzle-pattern.js";
4
+ const m = a`
5
+ from { transform: translateY(-100%); }
6
+ to { transform: translateY(0); }
7
+ `, o = a`
8
+ from { transform: rotateY(0deg); }
9
+ to { transform: rotateY(360deg); }
10
+ `, c = a`
11
+ from { transform: translateY(0); opacity: 1; }
12
+ to { transform: translateY(-100%); opacity: 0; }
13
+ `, d = e(n)`
6
14
  position: relative;
7
- cursor: pointer;
8
15
 
9
- box-shadow: inset 0px 0px 0px 4px ${({ theme: o, $imageHue: t }) => o.colors[`${t}_4`]};
16
+ box-shadow: inset 0px 0px 0px 4px ${({ theme: t, $imageHue: i }) => t.colors[`${i}_4`]};
10
17
 
11
- background-image: ${({ $imageHue: o }) => `url(${p(o)})`};
18
+ background-image: ${({ $imageHue: t }) => `url(${l(t)})`};
12
19
  background-size: cover;
13
20
 
14
- &:hover {
15
- outline: 1px solid ${({ theme: o }) => o.colors.BLACK_1};
21
+ ${({ $animationPhase: t }) => t && r`
22
+ transform-style: preserve-3d;
23
+ opacity: 0;
24
+ visibility: hidden;
25
+ transform: translateY(-100%);
26
+ `}
27
+
28
+ ${({ $animationPhase: t, theme: i, $imageHue: s }) => {
29
+ switch (t) {
30
+ case "movingIn":
31
+ return r`
32
+ visibility: visible;
33
+ opacity: 1;
34
+ animation: ${m} 0.5s ease-out forwards;
35
+ `;
36
+ case "revealing":
37
+ return r`
38
+ visibility: visible;
39
+ opacity: 1;
40
+ transform: translateY(0); /* Position after moveIn */
41
+ animation: ${o} 1s ease-in-out forwards;
42
+ `;
43
+ case "visible":
44
+ return r`
45
+ visibility: visible;
46
+ opacity: 1;
47
+ transform: translateY(0) rotateY(360deg);
48
+ background-color: ${i.colors[`${s}_2`]};
49
+ transition: background-color 0.2s ease-in;
50
+ `;
51
+ case "assigning":
52
+ return r`
53
+ visibility: visible;
54
+ opacity: 1;
55
+ transform: translateY(0); /* Reset rotation for this animation */
56
+ animation: ${o} 1s ease-in-out forwards;
57
+ `;
58
+ case "assigned":
59
+ return r`
60
+ visibility: visible;
61
+ opacity: 1;
62
+ transform: translateY(0) rotateY(360deg);
63
+ `;
64
+ case "movingOut":
65
+ return r`
66
+ visibility: visible;
67
+ opacity: 1;
68
+ transform: translateY(0); /* Start from final position */
69
+ animation: ${c} 0.5s ease-in forwards;
70
+ `;
71
+ default:
72
+ return "";
16
73
  }
17
- `, x = e(i)`
18
- display: -webkit-box;
19
- -webkit-line-clamp: 3;
20
- -webkit-box-orient: vertical;
21
- overflow: hidden;
22
- text-overflow: ellipsis;
23
- white-space: break-spaces;
24
- `, b = e(r)`
25
- position: absolute;
26
- top: -16px;
27
- right: -15px;
74
+ }}
28
75
  `;
29
76
  export {
30
- n as PuzzleWrapper,
31
- b as StickerWrapper,
32
- x as Title
77
+ d as PuzzleWrapper
33
78
  };
34
79
  //# sourceMappingURL=puzzle-card-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"puzzle-card-styled.js","sources":["../../../../src/features/puzzles/comps/puzzle-card-styled.tsx"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { getPuzzleCardPattern } from '../utils/puzzle-pattern';\n\nconst PuzzleWrapper = styled(FlexView)<{ $animationPhase?: string; $imageHue: THueNames }>`\n position: relative;\n cursor: pointer;\n\n box-shadow: inset 0px 0px 0px 4px ${({ theme, $imageHue }) => theme.colors[`${$imageHue}_4`]};\n\n background-image: ${({ $imageHue }) => `url(${getPuzzleCardPattern($imageHue)})`};\n background-size: cover;\n\n &:hover {\n outline: 1px solid ${({ theme }) => theme.colors.BLACK_1};\n }\n`;\n\nconst Title = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\nconst StickerWrapper = styled(FlexView)`\n position: absolute;\n top: -16px;\n right: -15px;\n`;\n\nexport { PuzzleWrapper, Title, StickerWrapper };\n"],"names":["PuzzleWrapper","styled","FlexView","theme","$imageHue","getPuzzleCardPattern","Title","Text","StickerWrapper"],"mappings":";;;;AAQM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,sCAIC,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgBD,EAAM,OAAO,GAAGC,CAAS,IAAI,CAAC;AAAA;AAAA,sBAExE,CAAC,EAAE,WAAAA,EAAU,MAAM,OAAOC,EAAqBD,CAAS,CAAC,GAAG;AAAA;AAAA;AAAA;AAAA,yBAIzD,CAAC,EAAE,OAAAD,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA,GAItDG,IAAQL,EAAOM,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASnBC,IAAiBP,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"puzzle-card-styled.js","sources":["../../../../src/features/puzzles/comps/puzzle-card-styled.tsx"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport styled, { css, keyframes } from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport { getPuzzleCardPattern } from '../utils/puzzle-pattern';\n\n// --- Keyframes for each animation step ---\nconst moveInAnim = keyframes`\n from { transform: translateY(-100%); }\n to { transform: translateY(0); }\n`;\n\nconst rotateYAnim = keyframes`\n from { transform: rotateY(0deg); }\n to { transform: rotateY(360deg); }\n`;\n\nconst moveOutAnim = keyframes`\n from { transform: translateY(0); opacity: 1; }\n to { transform: translateY(-100%); opacity: 0; }\n`;\n\nconst PuzzleWrapper = styled(FlexView)<{ $animationPhase?: string; $imageHue: THueNames }>`\n position: relative;\n\n box-shadow: inset 0px 0px 0px 4px ${({ theme, $imageHue }) => theme.colors[`${$imageHue}_4`]};\n\n background-image: ${({ $imageHue }) => `url(${getPuzzleCardPattern($imageHue)})`};\n background-size: cover;\n\n ${({ $animationPhase }) =>\n $animationPhase &&\n css`\n transform-style: preserve-3d;\n opacity: 0;\n visibility: hidden;\n transform: translateY(-100%);\n `}\n\n ${({ $animationPhase, theme, $imageHue }) => {\n switch ($animationPhase) {\n case 'movingIn':\n return css`\n visibility: visible;\n opacity: 1;\n animation: ${moveInAnim} 0.5s ease-out forwards;\n `;\n case 'revealing':\n return css`\n visibility: visible;\n opacity: 1;\n transform: translateY(0); /* Position after moveIn */\n animation: ${rotateYAnim} 1s ease-in-out forwards;\n `;\n case 'visible':\n return css`\n visibility: visible;\n opacity: 1;\n transform: translateY(0) rotateY(360deg);\n background-color: ${theme.colors[`${$imageHue}_2`]};\n transition: background-color 0.2s ease-in;\n `;\n case 'assigning':\n return css`\n visibility: visible;\n opacity: 1;\n transform: translateY(0); /* Reset rotation for this animation */\n animation: ${rotateYAnim} 1s ease-in-out forwards;\n `;\n case 'assigned':\n return css`\n visibility: visible;\n opacity: 1;\n transform: translateY(0) rotateY(360deg);\n `;\n case 'movingOut':\n return css`\n visibility: visible;\n opacity: 1;\n transform: translateY(0); /* Start from final position */\n animation: ${moveOutAnim} 0.5s ease-in forwards;\n `;\n default:\n return '';\n }\n }}\n`;\n\nexport { PuzzleWrapper };\n"],"names":["moveInAnim","keyframes","rotateYAnim","moveOutAnim","PuzzleWrapper","styled","FlexView","theme","$imageHue","getPuzzleCardPattern","$animationPhase","css"],"mappings":";;;AAQA,MAAMA,IAAaC;AAAA;AAAA;AAAA,GAKbC,IAAcD;AAAA;AAAA;AAAA,GAKdE,IAAcF;AAAA;AAAA;AAAA,GAKdG,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA,sCAGC,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgBD,EAAM,OAAO,GAAGC,CAAS,IAAI,CAAC;AAAA;AAAA,sBAExE,CAAC,EAAE,WAAAA,EAAU,MAAM,OAAOC,EAAqBD,CAAS,CAAC,GAAG;AAAA;AAAA;AAAA,IAG9E,CAAC,EAAE,iBAAAE,QACHA,KACAC;AAAA;AAAA;AAAA;AAAA;AAAA,KAKC;AAAA;AAAA,IAED,CAAC,EAAE,iBAAAD,GAAiB,OAAAH,GAAO,WAAAC,QAAgB;AAC3C,UAAQE,GAAiB;AAAA,IACvB,KAAK;AACI,aAAAC;AAAA;AAAA;AAAA,uBAGQX,CAAU;AAAA;AAAA,IAE3B,KAAK;AACI,aAAAW;AAAA;AAAA;AAAA;AAAA,uBAIQT,CAAW;AAAA;AAAA,IAE5B,KAAK;AACI,aAAAS;AAAA;AAAA;AAAA;AAAA,8BAIeJ,EAAM,OAAO,GAAGC,CAAS,IAAI,CAAC;AAAA;AAAA;AAAA,IAGtD,KAAK;AACI,aAAAG;AAAA;AAAA;AAAA;AAAA,uBAIQT,CAAW;AAAA;AAAA,IAE5B,KAAK;AACI,aAAAS;AAAA;AAAA;AAAA;AAAA;AAAA,IAKT,KAAK;AACI,aAAAA;AAAA;AAAA;AAAA;AAAA,uBAIQR,CAAW;AAAA;AAAA,IAE5B;AACS,aAAA;AAAA,EACX;AACF,CAAC;AAAA;"}
@@ -1,84 +1,35 @@
1
- import { jsx as i, jsxs as f } from "react/jsx-runtime";
2
- import { memo as P, useRef as _, useMemo as y, useCallback as s } from "react";
3
- import S from "../../ui/buttons/clickable/clickable.js";
4
- import b from "../../ui/image/image.js";
5
- import A from "../../ui/layout/flex-view.js";
6
- import Z from "../../ui/lottie-animation/lottie-animation.js";
7
- import { PUZZLE_ANALYTICS_EVENTS as k } from "../puzzle-analytics-events.js";
8
- import { getPuzzleStickerLottie as x } from "../utils/puzzle-feedback-celebration.js";
9
- import { PuzzleWrapper as M, Title as j, StickerWrapper as v } from "./puzzle-card-styled.js";
10
- const R = {
11
- autoplay: !1,
12
- loop: !0,
13
- renderer: "canvas"
14
- }, G = P(
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import { memo as p } from "react";
3
+ import { PuzzleWrapper as s } from "./puzzle-card-styled.js";
4
+ const c = p(
15
5
  ({
16
- imageHue: c,
17
- imageUrl: u,
18
- title: h,
19
- height: $ = "100%",
20
- width: z = "100%",
21
- onCardClick: n,
22
- userNodeId: o,
23
- rewards: r,
24
- studentId: a,
25
- nodeId: m
26
- }) => {
27
- const { sticker: p } = (r == null ? void 0 : r[0]) || {}, l = _(null), L = y(
28
- () => ({
29
- node_id: m,
30
- student_id: a,
31
- node_type: "PUZZLE_CARD"
32
- }),
33
- [m, a]
34
- ), e = p ? x(p) : void 0, g = s(() => {
35
- o && (n == null || n(o));
36
- }, [n, o]), E = s(() => {
37
- var t;
38
- e && ((t = l.current) == null || t.play());
39
- }, [e]), d = s(() => {
40
- var t;
41
- e && ((t = l.current) == null || t.stop());
42
- }, [e]);
43
- return /* @__PURE__ */ i(
44
- S,
45
- {
46
- label: "",
47
- analyticsLabel: k.PUZZLE_VIEWED,
48
- analyticsProps: L,
49
- onClick: g,
50
- children: /* @__PURE__ */ f(
51
- M,
52
- {
53
- $width: z,
54
- $height: $,
55
- $justifyContent: "center",
56
- $alignItems: "center",
57
- $imageHue: c,
58
- $background: `${c}_2`,
59
- onMouseEnter: E,
60
- onMouseLeave: d,
61
- children: [
62
- /* @__PURE__ */ f(A, { $justifyContent: "center", $alignItems: "center", $flexGap: 12, children: [
63
- /* @__PURE__ */ i(b, { src: u ?? "", width: 68, height: 68, withLoader: !1, alt: "Puzzle" }),
64
- /* @__PURE__ */ i(j, { $renderAs: "ab3", $align: "center", $width: "80%", children: h })
65
- ] }),
66
- e && /* @__PURE__ */ i(v, { $widthX: 2.5, $heightX: 2.5, children: /* @__PURE__ */ i(
67
- Z,
68
- {
69
- src: e,
70
- ref: l,
71
- settings: R
72
- }
73
- ) })
74
- ]
75
- }
76
- )
77
- }
78
- );
79
- }
6
+ children: e,
7
+ imageHue: t,
8
+ onAnimationEnd: r,
9
+ animationPhase: o,
10
+ width: i,
11
+ widthX: m,
12
+ height: n,
13
+ heightX: $,
14
+ backgroundColor: a
15
+ }) => /* @__PURE__ */ h(
16
+ s,
17
+ {
18
+ $animationPhase: o,
19
+ onAnimationEnd: r,
20
+ $width: i,
21
+ $height: n,
22
+ $widthX: m,
23
+ $heightX: $,
24
+ $alignItems: "center",
25
+ $justifyContent: "center",
26
+ $imageHue: t,
27
+ $background: a ?? `${t}_6`,
28
+ children: e
29
+ }
30
+ )
80
31
  );
81
32
  export {
82
- G as default
33
+ c as default
83
34
  };
84
35
  //# sourceMappingURL=puzzle-card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"puzzle-card.js","sources":["../../../../src/features/puzzles/comps/puzzle-card.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../ui/lottie-animation/types';\nimport type { IPuzzleCardProps } from './puzzle-card-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useMemo, useRef } from 'react';\n\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport Image from '../../ui/image/image';\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { PUZZLE_ANALYTICS_EVENTS } from '../puzzle-analytics-events';\nimport { getPuzzleStickerLottie } from '../utils/puzzle-feedback-celebration';\nimport * as Styled from './puzzle-card-styled';\n\nconst puzzleStickerLottieSettings = {\n autoplay: false,\n loop: true,\n renderer: 'canvas',\n};\n\nconst PuzzleCard: FC<IPuzzleCardProps> = memo(\n ({\n imageHue,\n imageUrl,\n title,\n height = '100%',\n width = '100%',\n onCardClick,\n userNodeId,\n rewards,\n studentId,\n nodeId,\n }) => {\n const { sticker } = rewards?.[0] || {};\n\n const lottieAnimationRef = useRef<ILottieAnimationRef | null>(null);\n\n const analyticsProps = useMemo(\n () => ({\n node_id: nodeId,\n student_id: studentId,\n node_type: 'PUZZLE_CARD',\n }),\n [nodeId, studentId],\n );\n\n const puzzleStickerLottie = sticker ? getPuzzleStickerLottie(sticker) : undefined;\n\n const handleCardClick = useCallback(() => {\n if (userNodeId) {\n onCardClick?.(userNodeId);\n }\n }, [onCardClick, userNodeId]);\n\n const handleOnMouseEnter = useCallback(() => {\n if (puzzleStickerLottie) lottieAnimationRef.current?.play();\n }, [puzzleStickerLottie]);\n\n const handleOnMouseLeave = useCallback(() => {\n if (puzzleStickerLottie) lottieAnimationRef.current?.stop();\n }, [puzzleStickerLottie]);\n\n return (\n <Clickable\n label=\"\"\n analyticsLabel={PUZZLE_ANALYTICS_EVENTS.PUZZLE_VIEWED}\n analyticsProps={analyticsProps}\n onClick={handleCardClick}\n >\n <Styled.PuzzleWrapper\n $width={width}\n $height={height}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $imageHue={imageHue}\n $background={`${imageHue}_2`}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $flexGap={12}>\n <Image src={imageUrl ?? ''} width={68} height={68} withLoader={false} alt=\"Puzzle\" />\n\n <Styled.Title $renderAs=\"ab3\" $align=\"center\" $width=\"80%\">\n {title}\n </Styled.Title>\n </FlexView>\n\n {puzzleStickerLottie && (\n <Styled.StickerWrapper $widthX={2.5} $heightX={2.5}>\n <LottieAnimation\n src={puzzleStickerLottie}\n ref={lottieAnimationRef}\n settings={puzzleStickerLottieSettings}\n />\n </Styled.StickerWrapper>\n )}\n </Styled.PuzzleWrapper>\n </Clickable>\n );\n },\n);\n\nexport default PuzzleCard;\n"],"names":["puzzleStickerLottieSettings","PuzzleCard","memo","imageHue","imageUrl","title","height","width","onCardClick","userNodeId","rewards","studentId","nodeId","sticker","lottieAnimationRef","useRef","analyticsProps","useMemo","puzzleStickerLottie","getPuzzleStickerLottie","handleCardClick","useCallback","handleOnMouseEnter","_a","handleOnMouseLeave","jsx","Clickable","PUZZLE_ANALYTICS_EVENTS","jsxs","Styled.PuzzleWrapper","FlexView","Image","Styled.Title","Styled.StickerWrapper","LottieAnimation"],"mappings":";;;;;;;;;AAcA,MAAMA,IAA8B;AAAA,EAClC,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AACZ,GAEMC,IAAmCC;AAAA,EACvC,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ;AAAA,IACR,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,EAAA,MACI;AACJ,UAAM,EAAE,SAAAC,EAAQ,KAAIH,KAAA,gBAAAA,EAAU,OAAM,CAAA,GAE9BI,IAAqBC,EAAmC,IAAI,GAE5DC,IAAiBC;AAAA,MACrB,OAAO;AAAA,QACL,SAASL;AAAA,QACT,YAAYD;AAAA,QACZ,WAAW;AAAA,MAAA;AAAA,MAEb,CAACC,GAAQD,CAAS;AAAA,IAAA,GAGdO,IAAsBL,IAAUM,EAAuBN,CAAO,IAAI,QAElEO,IAAkBC,EAAY,MAAM;AACxC,MAAIZ,MACFD,KAAA,QAAAA,EAAcC;AAAA,IAChB,GACC,CAACD,GAAaC,CAAU,CAAC,GAEtBa,IAAqBD,EAAY,MAAM;;AACvC,MAAAH,OAAwCK,IAAAT,EAAA,YAAA,QAAAS,EAAS;AAAA,IAAK,GACzD,CAACL,CAAmB,CAAC,GAElBM,IAAqBH,EAAY,MAAM;;AACvC,MAAAH,OAAwCK,IAAAT,EAAA,YAAA,QAAAS,EAAS;AAAA,IAAK,GACzD,CAACL,CAAmB,CAAC;AAGtB,WAAA,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,gBAAgBC,EAAwB;AAAA,QACxC,gBAAAX;AAAA,QACA,SAASI;AAAA,QAET,UAAA,gBAAAQ;AAAA,UAACC;AAAAA,UAAA;AAAA,YACC,QAAQtB;AAAA,YACR,SAASD;AAAA,YACT,iBAAgB;AAAA,YAChB,aAAY;AAAA,YACZ,WAAWH;AAAA,YACX,aAAa,GAAGA,CAAQ;AAAA,YACxB,cAAcmB;AAAA,YACd,cAAcE;AAAA,YAEd,UAAA;AAAA,cAAA,gBAAAI,EAACE,KAAS,iBAAgB,UAAS,aAAY,UAAS,UAAU,IAChE,UAAA;AAAA,gBAAC,gBAAAL,EAAAM,GAAA,EAAM,KAAK3B,KAAY,IAAI,OAAO,IAAI,QAAQ,IAAI,YAAY,IAAO,KAAI,SAAS,CAAA;AAAA,gBAEnF,gBAAAqB,EAACO,GAAA,EAAa,WAAU,OAAM,QAAO,UAAS,QAAO,OAClD,UACH3B,EAAA,CAAA;AAAA,cAAA,GACF;AAAA,cAECa,uBACEe,GAAA,EAAsB,SAAS,KAAK,UAAU,KAC7C,UAAA,gBAAAR;AAAA,gBAACS;AAAA,gBAAA;AAAA,kBACC,KAAKhB;AAAA,kBACL,KAAKJ;AAAA,kBACL,UAAUd;AAAA,gBAAA;AAAA,cAAA,GAEd;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"puzzle-card.js","sources":["../../../../src/features/puzzles/comps/puzzle-card.tsx"],"sourcesContent":["import type { IPuzzleCardProps } from './puzzle-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport * as Styled from './puzzle-card-styled';\n\nconst PuzzleCard: FC<IPuzzleCardProps> = memo(\n ({\n children,\n imageHue,\n onAnimationEnd,\n animationPhase,\n width,\n widthX,\n height,\n heightX,\n backgroundColor,\n }) => {\n return (\n <Styled.PuzzleWrapper\n $animationPhase={animationPhase}\n onAnimationEnd={onAnimationEnd}\n $width={width}\n $height={height}\n $widthX={widthX}\n $heightX={heightX}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $imageHue={imageHue}\n $background={backgroundColor ?? `${imageHue}_6`}\n >\n {children}\n </Styled.PuzzleWrapper>\n );\n },\n);\n\nexport default PuzzleCard;\n"],"names":["PuzzleCard","memo","children","imageHue","onAnimationEnd","animationPhase","width","widthX","height","heightX","backgroundColor","jsx","Styled.PuzzleWrapper"],"mappings":";;;AAOA,MAAMA,IAAmCC;AAAA,EACvC,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,EAAA,MAGE,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,iBAAiBP;AAAA,MACjB,gBAAAD;AAAA,MACA,QAAQE;AAAA,MACR,SAASE;AAAA,MACT,SAASD;AAAA,MACT,UAAUE;AAAA,MACV,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,WAAWN;AAAA,MACX,aAAaO,KAAmB,GAAGP,CAAQ;AAAA,MAE1C,UAAAD;AAAA,IAAA;AAAA,EAAA;AAIT;"}
@@ -1,77 +1,47 @@
1
- import e from "styled-components";
2
- import r from "../../ui/layout/flex-view.js";
3
- import { getPuzzleCardPattern as s } from "../utils/puzzle-pattern.js";
4
- const c = e(r)(({ theme: t, $assigned: o }) => {
5
- const { colors: i, layout: n } = t;
6
- return `
7
- cursor: pointer;
8
- width: ${n.gutter * 15.9375}px;
9
- height: ${n.gutter * 19.125}px;
10
- position: relative;
11
- left: ${o ? "0" : "50px"};
12
- top: ${o ? "0" : "50px"};
1
+ import o from "styled-components";
2
+ import t from "../../ui/layout/flex-view.js";
3
+ const p = o(t)`
4
+ cursor: pointer;
13
5
 
14
- &:hover {
15
- outline: 2px solid ${i.BLACK_1};
16
- }
17
- `;
18
- }), x = e(r)(({ theme: t, $assigned: o, $assigning: i }) => {
19
- const { colors: n, layout: p } = t;
6
+ &:hover {
7
+ outline: 2px solid ${({ theme: e }) => e.colors.BLACK_1};
8
+ }
9
+ `, l = o(t)(({ theme: e, $disabled: n }) => {
10
+ const { colors: r } = e;
20
11
  return `
21
- cursor: pointer;
22
- width: ${p.gutter * 15.9375}px;
23
12
  position: absolute;
24
- left: ${o ? "0" : "50px"};
25
- bottom: ${o ? "-50px" : "11px"};
13
+ bottom: -48px;
14
+ cursor: pointer;
15
+ z-index: -1;
26
16
 
27
- ${(o || i) && `
28
- background: ${n.WHITE_4};
29
- border: 2px solid ${n.WHITE_5};
17
+ ${n && `
18
+ background: ${r.WHITE_4};
19
+ border: 2px solid ${r.WHITE_5};
30
20
  border-top: 0;
31
21
  pointer-events: none;
32
22
  `}
33
23
  `;
34
- });
35
- e(r)`
24
+ }), c = o(t)`
36
25
  position: relative;
37
26
  top: -8px;
38
27
  height: 100%;
39
28
  width: 100%;
40
- `;
41
- e(r)`
29
+ `, u = o(t)`
42
30
  border-radius: 50%;
43
- `;
44
- const d = e(r)`
31
+ `, a = o(t)`
45
32
  position: relative;
46
33
  transition: height 0.3s ease-out;
47
- `, g = e(r)`
34
+ `, d = o(t)`
48
35
  position: absolute;
49
36
  top: 0;
50
37
  right: 0;
51
- `, h = e(r)(({ $visible: t, theme: o }) => {
52
- const { layout: i } = o;
53
- return `
54
- width: ${i.gutter * 22.1875}px;
55
- height: ${i.gutter * 26}px;
56
- left: 0;
57
- opacity: ${t ? 1 : 0};
58
- pointer-events: ${t ? "auto" : "none"};
59
- transition: opacity 0.2s ease-out;
60
- `;
61
- }), $ = e(r)`
62
- position: relative;
63
-
64
- box-shadow: inset 0px 0px 0px 4px ${({ theme: t, $imageHue: o }) => t.colors[`${o}_4`]};
65
-
66
- background-image: ${({ $imageHue: t }) => `url(${s(t)})`};
67
- background-size: cover;
68
38
  `;
69
39
  export {
70
- g as AssignedTag,
71
- $ as PuzzleAssignedWrapper,
72
- x as PuzzleButton,
73
- d as PuzzleContainer,
74
- c as PuzzleContent,
75
- h as PuzzleContentWrapper
40
+ d as AssignedTag,
41
+ u as CheckMarkIcon,
42
+ l as PuzzleButton,
43
+ a as PuzzleContainer,
44
+ p as PuzzleContent,
45
+ c as PuzzleText
76
46
  };
77
47
  //# sourceMappingURL=puzzle-container-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"puzzle-container-styled.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container-styled.tsx"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport { getPuzzleCardPattern } from '../utils/puzzle-pattern';\n\ninterface IPuzzleProps {\n $assigned?: boolean;\n $assigning?: boolean;\n}\n\nconst PuzzleContent = styled(FlexView)<IPuzzleProps>(({ theme, $assigned }) => {\n const { colors, layout } = theme;\n\n return `\n cursor: pointer;\n width: ${layout.gutter * 15.9375}px;\n height: ${layout.gutter * 19.125}px;\n position: relative;\n left: ${$assigned ? '0' : '50px'};\n top: ${$assigned ? '0' : '50px'};\n\n &:hover {\n outline: 2px solid ${colors.BLACK_1};\n }\n `;\n});\n\nconst PuzzleButton = styled(FlexView)<IPuzzleProps>(({ theme, $assigned, $assigning }) => {\n const { colors, layout } = theme;\n\n return `\n cursor: pointer;\n width: ${layout.gutter * 15.9375}px;\n position: absolute;\n left: ${$assigned ? '0' : '50px'};\n bottom: ${$assigned ? '-50px' : '11px'};\n \n ${\n ($assigned || $assigning) &&\n `\n background: ${colors.WHITE_4};\n border: 2px solid ${colors.WHITE_5};\n border-top: 0;\n pointer-events: none;\n `\n }\n `;\n});\n\nconst PuzzleText = styled(FlexView)`\n position: relative;\n top: -8px;\n height: 100%;\n width: 100%;\n`;\n\nconst CheckMarkIcon = styled(FlexView)`\n border-radius: 50%;\n`;\n\nconst PuzzleContainer = styled(FlexView)`\n position: relative;\n transition: height 0.3s ease-out;\n`;\n\nconst AssignedTag = styled(FlexView)`\n position: absolute;\n top: 0;\n right: 0;\n`;\n\ninterface IPuzzleContentWrapper {\n $visible?: boolean;\n}\n\nconst PuzzleContentWrapper = styled(FlexView)<IPuzzleContentWrapper>(({ $visible, theme }) => {\n const { layout } = theme;\n\n return `\n width: ${layout.gutter * 22.1875}px;\n height: ${layout.gutter * 26}px;\n left: 0;\n opacity: ${$visible ? 1 : 0};\n pointer-events: ${$visible ? 'auto' : 'none'};\n transition: opacity 0.2s ease-out;\n `;\n});\n\nconst PuzzleAssignedWrapper = styled(FlexView)<{ $imageHue: THueNames }>`\n position: relative;\n\n box-shadow: inset 0px 0px 0px 4px ${({ theme, $imageHue }) => theme.colors[`${$imageHue}_4`]};\n\n background-image: ${({ $imageHue }) => `url(${getPuzzleCardPattern($imageHue)})`};\n background-size: cover;\n`;\n\nexport {\n PuzzleContainer,\n PuzzleContentWrapper,\n PuzzleContent,\n PuzzleButton,\n PuzzleText,\n CheckMarkIcon,\n AssignedTag,\n PuzzleAssignedWrapper,\n};\n"],"names":["PuzzleContent","styled","FlexView","theme","$assigned","colors","layout","PuzzleButton","$assigning","PuzzleContainer","AssignedTag","PuzzleContentWrapper","$visible","PuzzleAssignedWrapper","$imageHue","getPuzzleCardPattern"],"mappings":";;;AAYM,MAAAA,IAAgBC,EAAOC,CAAQ,EAAgB,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgB;AACvE,QAAA,EAAE,QAAAC,GAAQ,QAAAC,EAAW,IAAAH;AAEpB,SAAA;AAAA;AAAA,aAEIG,EAAO,SAAS,OAAO;AAAA,cACtBA,EAAO,SAAS,MAAM;AAAA;AAAA,YAExBF,IAAY,MAAM,MAAM;AAAA,WACzBA,IAAY,MAAM,MAAM;AAAA;AAAA;AAAA,2BAGRC,EAAO,OAAO;AAAA;AAAA;AAGzC,CAAC,GAEKE,IAAeN,EAAOC,CAAQ,EAAgB,CAAC,EAAE,OAAAC,GAAO,WAAAC,GAAW,YAAAI,QAAiB;AAClF,QAAA,EAAE,QAAAH,GAAQ,QAAAC,EAAW,IAAAH;AAEpB,SAAA;AAAA;AAAA,aAEIG,EAAO,SAAS,OAAO;AAAA;AAAA,YAExBF,IAAY,MAAM,MAAM;AAAA,cACtBA,IAAY,UAAU,MAAM;AAAA;AAAA,OAGnCA,KAAaI,MACd;AAAA,oBACcH,EAAO,OAAO;AAAA,0BACRA,EAAO,OAAO;AAAA;AAAA;AAAA,KAIpC;AAAA;AAEJ,CAAC;AAEkBJ,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAOZD,EAAOC,CAAQ;AAAA;AAAA;AAI/B,MAAAO,IAAkBR,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAKjCQ,IAAcT,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAU7BS,IAAuBV,EAAOC,CAAQ,EAAyB,CAAC,EAAE,UAAAU,GAAU,OAAAT,QAAY;AACtF,QAAA,EAAE,QAAAG,EAAW,IAAAH;AAEZ,SAAA;AAAA,aACIG,EAAO,SAAS,OAAO;AAAA,cACtBA,EAAO,SAAS,EAAE;AAAA;AAAA,eAEjBM,IAAW,IAAI,CAAC;AAAA,sBACTA,IAAW,SAAS,MAAM;AAAA;AAAA;AAGhD,CAAC,GAEKC,IAAwBZ,EAAOC,CAAQ;AAAA;AAAA;AAAA,sCAGP,CAAC,EAAE,OAAAC,GAAO,WAAAW,QAAgBX,EAAM,OAAO,GAAGW,CAAS,IAAI,CAAC;AAAA;AAAA,sBAExE,CAAC,EAAE,WAAAA,EAAU,MAAM,OAAOC,EAAqBD,CAAS,CAAC,GAAG;AAAA;AAAA;"}
1
+ {"version":3,"file":"puzzle-container-styled.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\nconst PuzzleContent = styled(FlexView)`\n cursor: pointer;\n\n &:hover {\n outline: 2px solid ${({ theme }) => theme.colors.BLACK_1};\n }\n`;\n\ninterface IPuzzleButton {\n $disabled?: boolean;\n}\n\nconst PuzzleButton = styled(FlexView)<IPuzzleButton>(({ theme, $disabled }) => {\n const { colors } = theme;\n\n return `\n position: absolute;\n bottom: -48px;\n cursor: pointer;\n z-index: -1;\n \n ${\n $disabled &&\n `\n background: ${colors.WHITE_4};\n border: 2px solid ${colors.WHITE_5};\n border-top: 0;\n pointer-events: none;\n `\n }\n `;\n});\n\nconst PuzzleText = styled(FlexView)`\n position: relative;\n top: -8px;\n height: 100%;\n width: 100%;\n`;\n\nconst CheckMarkIcon = styled(FlexView)`\n border-radius: 50%;\n`;\n\nconst PuzzleContainer = styled(FlexView)`\n position: relative;\n transition: height 0.3s ease-out;\n`;\n\nconst AssignedTag = styled(FlexView)`\n position: absolute;\n top: 0;\n right: 0;\n`;\n\nexport { PuzzleContainer, PuzzleContent, PuzzleButton, PuzzleText, CheckMarkIcon, AssignedTag };\n"],"names":["PuzzleContent","styled","FlexView","theme","PuzzleButton","$disabled","colors","PuzzleText","CheckMarkIcon","PuzzleContainer","AssignedTag"],"mappings":";;AAIM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,yBAIZ,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA,GAQtDC,IAAeH,EAAOC,CAAQ,EAAiB,CAAC,EAAE,OAAAC,GAAO,WAAAE,QAAgB;AACvE,QAAA,EAAE,QAAAC,EAAW,IAAAH;AAEZ,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOHE,KACA;AAAA,oBACcC,EAAO,OAAO;AAAA,0BACRA,EAAO,OAAO;AAAA;AAAA;AAAA,KAIpC;AAAA;AAEJ,CAAC,GAEKC,IAAaN,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,GAO5BM,IAAgBP,EAAOC,CAAQ;AAAA;AAAA,GAI/BO,IAAkBR,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAKjCQ,IAAcT,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,120 +1,127 @@
1
- import { jsx as n, jsxs as T } from "react/jsx-runtime";
2
- import { memo as Z, useState as j, useRef as k, useMemo as u, useEffect as O, useCallback as m } from "react";
3
- import U from "../../ui/layout/flex-view.js";
4
- import v from "../../ui/lottie-animation/lottie-animation.js";
5
- import { usePostPuzzleToAssign as y } from "../api/puzzle-assign.js";
6
- import { PUZZLE_ASSIGN_ANIMATION as c } from "../constants/puzzle-container.js";
7
- import { getPuzzleCardLottie as D } from "../utils/puzzle-pattern.js";
8
- import { PuzzleContainer as E, PuzzleAssignedWrapper as G, PuzzleContentWrapper as M } from "./puzzle-container-styled.js";
9
- import S from "./puzzle-container-view.js";
10
- const W = {
11
- loop: !1,
12
- renderer: "svg",
13
- autoPlay: !1
14
- }, X = Z(
1
+ import { jsx as i, jsxs as l, Fragment as w } from "react/jsx-runtime";
2
+ import { memo as X, useState as z, useRef as j, useEffect as C, useCallback as c } from "react";
3
+ import L from "../../../assets/line-icons/icons/check2.js";
4
+ import O from "../../ui/image/image.js";
5
+ import r from "../../ui/text/text.js";
6
+ import { usePostPuzzleToAssign as B } from "../api/puzzle-assign.js";
7
+ import D from "../comps/puzzle-card.js";
8
+ import { PuzzleContainer as W, PuzzleContent as G, AssignedTag as K, PuzzleButton as S, PuzzleText as U, CheckMarkIcon as H } from "./puzzle-container-styled.js";
9
+ const N = 1500, M = X(
15
10
  ({
16
- triggerReveal: l = !1,
17
- onFullyHidden: o,
18
- onPuzzleClick: f,
19
- puzzleData: $,
20
- courseStream: z,
21
- studentId: p
11
+ userType: A,
12
+ triggerReveal: o = !1,
13
+ onFullyHidden: s,
14
+ onPuzzleClick: d,
15
+ puzzleData: p,
16
+ courseStream: g,
17
+ studentId: u
22
18
  }) => {
23
19
  const {
24
- image_hue: i,
25
- image_url: g,
26
- assigned: s,
27
- title: d,
28
- id: P,
29
- node_id: A,
30
- student_elo_rating: h,
31
- current_elo_rating: _
32
- } = $, [I, a] = j(s), r = k(null), w = u(() => D(i), [i]), R = u(
33
- () => ({
34
- node_id: A,
35
- node_type: "PUZZLE_CARD",
36
- student_elo_rating: h,
37
- current_elo_rating: _
38
- }),
39
- [A, h, _]
40
- ), { post: C, isProcessing: b } = y({
41
- onComplete: (e) => {
42
- var t;
43
- e ? a(!0) : ((t = r.current) == null || t.playSegments(c.REVEAL_ASSIGNED, !1), a(!1));
20
+ image_hue: m,
21
+ image_url: b,
22
+ assigned: e,
23
+ title: I,
24
+ id: h
25
+ } = p, [n, t] = z("hidden"), [f, P] = z(!1), a = j(null), { post: $, isProcessing: k } = B({
26
+ onComplete: (x) => {
27
+ x ? t("visible") : n === "visible" && t("assigning");
44
28
  }
45
29
  });
46
- O(() => {
47
- var e, t;
48
- s || (l ? (e = r.current) == null || e.playSegments(c.REVEAL, !0) : ((t = r.current) == null || t.stop(), a(!1)));
49
- }, [s, l]);
50
- const x = m(() => {
51
- s || C(
30
+ C(() => {
31
+ e || (o ? f ? t("assigned") : n === "hidden" && t("movingIn") : n !== "hidden" && n !== "movingOut" && t("movingOut"));
32
+ }, [o, f, e]), C(() => (n === "assigned" && !e && (a.current = setTimeout(() => {
33
+ t("movingOut");
34
+ }, N)), () => {
35
+ a.current && clearTimeout(a.current);
36
+ }), [n, e]);
37
+ const T = c(() => {
38
+ switch (n) {
39
+ case "movingIn":
40
+ t("revealing");
41
+ break;
42
+ case "revealing":
43
+ t("visible");
44
+ break;
45
+ case "assigning":
46
+ t("assigned"), P(!0);
47
+ break;
48
+ case "movingOut":
49
+ t("hidden"), s == null || s();
50
+ break;
51
+ }
52
+ }, [n, s]), v = c(() => {
53
+ e || $(
52
54
  {
53
- puzzle_id: P
55
+ puzzle_id: h
54
56
  },
55
57
  {
56
- studentId: p,
57
- courseStream: z
58
+ studentId: u,
59
+ courseStream: g
58
60
  }
59
61
  );
60
- }, [z, s, C, P, p]), L = m(() => {
61
- f();
62
- }, [f]), V = m(() => {
63
- var e;
64
- (e = r.current) == null || e.playSegments(c.REVEAL, !0);
65
- }, []), N = u(
66
- () => ({
67
- name: "enterFrame",
68
- callback: (e) => {
69
- const { currentTime: t } = e;
70
- t === 49 && a(!0), t === 101 && (o == null || o());
71
- }
72
- }),
73
- [o]
74
- );
75
- return l ? s ? /* @__PURE__ */ n(E, { $justifyContent: "center", children: /* @__PURE__ */ n(
76
- G,
77
- {
78
- $imageHue: i,
79
- $background: `${i}_2`,
80
- $widthX: 15.9375,
81
- children: /* @__PURE__ */ n(
82
- S,
83
- {
84
- imageUrl: g,
85
- handleOnPuzzleClick: L,
86
- title: d,
87
- assigned: !0
88
- }
89
- )
90
- }
91
- ) }) : /* @__PURE__ */ n(E, { children: /* @__PURE__ */ T(U, { $heightX: 26, children: [
92
- /* @__PURE__ */ n(
93
- v,
62
+ }, [g, e, $, h, u]), _ = c(() => {
63
+ d();
64
+ }, [d]), E = () => n === "visible" || e ? /* @__PURE__ */ l(w, { children: [
65
+ /* @__PURE__ */ l(
66
+ G,
94
67
  {
95
- src: w,
96
- ref: r,
97
- settings: W,
98
- onRender: V,
99
- eventListener: N,
100
- animateOnIntersect: !0
68
+ $justifyContent: "center",
69
+ $alignItems: "center",
70
+ $width: "100%",
71
+ $height: "100%",
72
+ onClick: _,
73
+ title: "Click to preview",
74
+ $flexGapX: 1.5,
75
+ children: [
76
+ /* @__PURE__ */ i(O, { width: 136, height: 136, src: b, withLoader: !1, alt: "Puzzle" }),
77
+ /* @__PURE__ */ i(r, { $renderAs: "h4", children: I }),
78
+ e && /* @__PURE__ */ i(K, { $gap: 4, $gutter: 8, $background: "BLACK_1", children: /* @__PURE__ */ i(r, { $renderAs: "ac4", $color: "WHITE_1", children: "Assigned" }) })
79
+ ]
101
80
  }
102
81
  ),
103
- /* @__PURE__ */ n(M, { $visible: I, $position: "absolute", children: /* @__PURE__ */ n(
82
+ A === "TEACHER" && /* @__PURE__ */ i(
104
83
  S,
105
84
  {
106
- imageUrl: g,
107
- title: d,
108
- handleOnPuzzleClick: L,
109
- handleAssign: x,
110
- assigning: b,
111
- analyticsProps: R
85
+ $background: "BLACK_1",
86
+ $widthX: 15.75,
87
+ $alignItems: "center",
88
+ $justifyContent: "center",
89
+ $gapX: 0.75,
90
+ $gutterX: 1,
91
+ onClick: v,
92
+ $disabled: e || k,
93
+ children: /* @__PURE__ */ i(r, { $renderAs: "ub1-bold", $color: e ? "BLACK_T_38" : "WHITE_1", children: e ? "Discuss in next class" : "Assign" })
112
94
  }
113
- ) })
114
- ] }) }) : null;
95
+ )
96
+ ] }) : n === "assigned" ? /* @__PURE__ */ l(U, { $alignItems: "center", $justifyContent: "center", $flexGap: 8, children: [
97
+ /* @__PURE__ */ i(
98
+ H,
99
+ {
100
+ $widthX: 2.5,
101
+ $heightX: 2.5,
102
+ $background: "WHITE",
103
+ $alignItems: "center",
104
+ $justifyContent: "center",
105
+ children: /* @__PURE__ */ i(L, {})
106
+ }
107
+ ),
108
+ /* @__PURE__ */ i(r, { $renderAs: "ab1-bold", $align: "center", $color: "WHITE", children: "Puzzle assigned" })
109
+ ] }) : null;
110
+ return n === "hidden" && !o ? null : /* @__PURE__ */ i(W, { children: /* @__PURE__ */ i(
111
+ D,
112
+ {
113
+ animationPhase: e ? void 0 : n,
114
+ onAnimationEnd: T,
115
+ imageHue: m ?? "BLUE",
116
+ heightX: 19,
117
+ widthX: 15.75,
118
+ backgroundColor: e ? `${m}_2` : void 0,
119
+ children: E()
120
+ }
121
+ ) });
115
122
  }
116
- ), te = X;
123
+ ), F = M;
117
124
  export {
118
- te as default
125
+ F as default
119
126
  };
120
127
  //# sourceMappingURL=puzzle-container.js.map