@cuemath/leap 3.2.16-pzd-beta-0.5 → 3.2.17-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 (122) hide show
  1. package/dist/assets/illustrations/illustrations.js +5 -6
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/lottie/lottie.js +0 -5
  4. package/dist/assets/lottie/lottie.js.map +1 -1
  5. package/dist/features/analytics-events/platform-events-student.js +1 -2
  6. package/dist/features/analytics-events/platform-events-student.js.map +1 -1
  7. package/dist/features/analytics-events/platform-events-teacher.js +4 -6
  8. package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
  9. package/dist/features/analytics-events/whitelist-events.js +8 -10
  10. package/dist/features/analytics-events/whitelist-events.js.map +1 -1
  11. package/dist/features/chapters-v2/utils/node-card-utils.js +2 -2
  12. package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
  13. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +4 -4
  14. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
  15. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +85 -85
  16. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
  17. package/dist/features/communication/pub-sub/constants.js +4 -7
  18. package/dist/features/communication/pub-sub/constants.js.map +1 -1
  19. package/dist/features/homework/homework-card-view.js +97 -85
  20. package/dist/features/homework/homework-card-view.js.map +1 -1
  21. package/dist/features/homework/homework-card.js +42 -44
  22. package/dist/features/homework/homework-card.js.map +1 -1
  23. package/dist/features/homework/hw-card-list/hw-card-list-view.js +29 -31
  24. package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
  25. package/dist/features/homework/hw-card-list/hw-card-list.js +48 -54
  26. package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
  27. package/dist/features/homework/utils.js +27 -33
  28. package/dist/features/homework/utils.js.map +1 -1
  29. package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +11 -17
  30. package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
  31. package/dist/features/journey/journey-id/journey-id-student.js +1 -1
  32. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  33. package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
  34. package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
  35. package/dist/features/puzzles/app/puzzle-app-styled.js +10 -14
  36. package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -1
  37. package/dist/features/puzzles/app/puzzle-app-view.js +20 -21
  38. package/dist/features/puzzles/app/puzzle-app-view.js.map +1 -1
  39. package/dist/features/puzzles/comps/puzzle-card-styled.js +69 -24
  40. package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
  41. package/dist/features/puzzles/comps/puzzle-card.js +30 -79
  42. package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
  43. package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +25 -55
  44. package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
  45. package/dist/features/puzzles/puzzle-container/puzzle-container.js +107 -100
  46. package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
  47. package/dist/features/puzzles/utils/puzzle-pattern.js +13 -28
  48. package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
  49. package/dist/features/ui/carousal/carousal-styles.js +45 -0
  50. package/dist/features/ui/carousal/carousal-styles.js.map +1 -0
  51. package/dist/features/ui/carousal/carousal.js +76 -0
  52. package/dist/features/ui/carousal/carousal.js.map +1 -0
  53. package/dist/features/worksheet/worksheet/worksheet-helpers.js +19 -20
  54. package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
  55. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +12 -16
  56. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
  57. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +47 -101
  58. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
  59. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +146 -149
  60. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
  61. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +207 -242
  62. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
  63. package/dist/features/worksheet/worksheet/worksheet-styled.js +37 -37
  64. package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
  65. package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
  66. package/dist/features/worksheet/worksheet/worksheet.js +313 -307
  67. package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
  68. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
  69. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
  70. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +35 -44
  71. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
  72. package/dist/index.d.ts +34 -87
  73. package/dist/index.js +407 -415
  74. package/dist/index.js.map +1 -1
  75. package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +1 -0
  76. package/dist/static/puzzle-pattern-green.c9f84bbc.svg +1 -0
  77. package/dist/static/puzzle-pattern-orange.3da09665.svg +1 -0
  78. package/dist/static/puzzle-pattern-purple.5fb5a319.svg +1 -0
  79. package/dist/static/puzzle-pattern-yellow.aadbf457.svg +1 -0
  80. package/package.json +1 -1
  81. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +0 -72
  82. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +0 -1
  83. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +0 -59
  84. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +0 -1
  85. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +0 -63
  86. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +0 -1
  87. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +0 -67
  88. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +0 -1
  89. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +0 -70
  90. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +0 -1
  91. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +0 -59
  92. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +0 -1
  93. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +0 -59
  94. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +0 -1
  95. package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +0 -70
  96. package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +0 -1
  97. package/dist/features/puzzles/api/puzzle-dashboard.js +0 -10
  98. package/dist/features/puzzles/api/puzzle-dashboard.js.map +0 -1
  99. package/dist/features/puzzles/constants/puzzle-container.js +0 -8
  100. package/dist/features/puzzles/constants/puzzle-container.js.map +0 -1
  101. package/dist/features/puzzles/puzzle-analytics-events.js +0 -11
  102. package/dist/features/puzzles/puzzle-analytics-events.js.map +0 -1
  103. package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +0 -55
  104. package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +0 -1
  105. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +0 -37
  106. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +0 -1
  107. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +0 -110
  108. package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +0 -1
  109. package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +0 -28
  110. package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +0 -1
  111. package/dist/static/puzzle-blue-lottie.7017e2e8.json +0 -1
  112. package/dist/static/puzzle-blue-lottie.bf64ebc5.json +0 -12760
  113. package/dist/static/puzzle-dashboard-banner.b7956519.svg +0 -1
  114. package/dist/static/puzzle-green-lottie.1da90698.json +0 -1
  115. package/dist/static/puzzle-orange-lottie.cfcf3724.json +0 -1
  116. package/dist/static/puzzle-pattern-blue.abff0164.svg +0 -1
  117. package/dist/static/puzzle-pattern-green.b8ba1840.svg +0 -1
  118. package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +0 -1
  119. package/dist/static/puzzle-pattern-purple.14b09759.svg +0 -1
  120. package/dist/static/puzzle-pattern-yellow.50917fab.svg +0 -1
  121. package/dist/static/puzzle-purple-lottie.e70de110.json +0 -9860
  122. package/dist/static/puzzle-yellow-lottie.275b5cf4.json +0 -1
@@ -1,22 +1,22 @@
1
1
  import o from "styled-components";
2
- import r from "../../../assets/line-icons/icons/hint-fill.js";
2
+ import n from "../../../assets/line-icons/icons/hint-fill.js";
3
3
  import l from "../../ui/layout/flex-view.js";
4
- import n from "../../ui/text/text.js";
4
+ import r from "../../ui/text/text.js";
5
5
  import { getPuzzleCardPattern as p } from "../utils/puzzle-pattern.js";
6
- const f = o(l)(({ theme: t, $visible: i }) => {
6
+ const d = o(l)(({ theme: t, $visible: i }) => {
7
7
  const { gutter: e } = t.layout;
8
8
  return i ? `
9
9
  overflow: scroll;
10
10
  padding-top: ${e * 1.5}px;
11
11
  padding-bottom: ${e * 2}px;
12
12
  ` : "";
13
- }), d = o(l)`
13
+ }), g = o(l)`
14
14
  position: relative;
15
15
  margin: 0 auto;
16
16
  box-shadow: inset 0px 0px 0px 4px ${({ theme: t, $imageHue: i }) => t.colors[`${i}_4`]};
17
17
  max-width: 343px;
18
18
  width: 100%;
19
- min-height: 402px;
19
+ min-height: max-content;
20
20
 
21
21
  &::before {
22
22
  content: '';
@@ -29,13 +29,13 @@ const f = o(l)(({ theme: t, $visible: i }) => {
29
29
  background-size: cover;
30
30
  opacity: 0.2;
31
31
  }
32
- `, x = o(r)`
32
+ `, x = o(n)`
33
33
  color: ${({ theme: t }) => t.colors.BLACK_1};
34
34
 
35
35
  & .hint-fill-icon-path {
36
36
  fill: ${({ theme: t }) => t.colors.WHITE_1};
37
37
  }
38
- `, u = o(n)`
38
+ `, u = o(r)`
39
39
  & span {
40
40
  font-weight: 700;
41
41
  margin-right: 4px;
@@ -44,7 +44,7 @@ const f = o(l)(({ theme: t, $visible: i }) => {
44
44
  color: ${({ theme: t }) => t.colors.BLACK};
45
45
  font-size: 14px;
46
46
  line-height: 1.2;
47
- font-family: 'Athletics-Regular';
47
+ font-family: 'Athletics';
48
48
 
49
49
  font-weight: 400;
50
50
  font-style: normal;
@@ -70,14 +70,10 @@ const f = o(l)(({ theme: t, $visible: i }) => {
70
70
  li {
71
71
  margin: 4px 0;
72
72
  }
73
-
74
- strong {
75
- font-weight: 700;
76
- }
77
73
  `;
78
74
  export {
79
- f as PuzzleAppWrapper,
80
- d as PuzzleContainer,
75
+ d as PuzzleAppWrapper,
76
+ g as PuzzleContainer,
81
77
  h as PuzzleQuestionWrapper,
82
78
  u as StyledFeedbackText,
83
79
  x as StyledHintFillIcon
@@ -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: 402px;\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-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,4 +1,4 @@
1
- import { jsxs as v, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as y, jsx as a } from "react/jsx-runtime";
2
2
  import { memo as A, useRef as S, useCallback as _, useEffect as l, useMemo as $ } from "react";
3
3
  import H from "../../ui/image/image.js";
4
4
  import M from "../../ui/layout/flex-view.js";
@@ -15,7 +15,7 @@ const F = (u) => {
15
15
  }, L = ({
16
16
  worksheetData: u,
17
17
  loggerRef: t,
18
- onWorksheetErrored: r,
18
+ onWorksheetErrored: n,
19
19
  imageHue: I,
20
20
  onLoaded: p
21
21
  }) => {
@@ -29,22 +29,22 @@ const F = (u) => {
29
29
  loggerRef: t
30
30
  }), E = _(
31
31
  (s) => {
32
- r({
32
+ n({
33
33
  code: s.code,
34
34
  message: s.detail
35
35
  });
36
36
  },
37
- [r]
38
- ), { learnosity: n } = N(w, E, t);
37
+ [n]
38
+ ), { learnosity: r } = N(w, E, t);
39
39
  l(() => {
40
- i === "error" && r({
40
+ i === "error" && n({
41
41
  message: f ?? "Error loading worksheet"
42
42
  });
43
- }, [i, r, f]), l(() => {
44
- n && t.current(d.WORKSHEET_V3_LEARNOSITY_INITIALIZED);
45
- }, [n, t]), l(() => {
46
- n && i === "success" && p && (t.current(d.WORKSHEET_V3_READY), p());
47
- }, [n, i, t, p]);
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
48
  const m = $(() => i === "success" && (o != null && o.learnosityItems) ? (t.current(d.WORKSHEET_V3_READY), V(o.learnosityItems, {
49
49
  sectioned: !1,
50
50
  adaptive: !1
@@ -60,12 +60,12 @@ const F = (u) => {
60
60
  // Add other properties as needed
61
61
  }))) : [], [i, o, t]);
62
62
  l(() => {
63
- if (n && m.length > 0) {
63
+ if (r && m.length > 0) {
64
64
  const c = requestAnimationFrame(() => {
65
65
  try {
66
- n.renderMath("mathjax");
66
+ r.renderMath("mathjax");
67
67
  } catch (e) {
68
- r({
68
+ n({
69
69
  message: `MathJax rendering failed: ${e instanceof Error ? e.message : "Unknown error"}`
70
70
  });
71
71
  }
@@ -74,10 +74,10 @@ const F = (u) => {
74
74
  cancelAnimationFrame(c);
75
75
  };
76
76
  }
77
- }, [n, r, m]);
78
- const y = _((s) => {
79
- const { stimulus: c = "", template: e = "", response_id: T } = s, h = F(c);
80
- return /* @__PURE__ */ v(
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
81
  M,
82
82
  {
83
83
  $background: "TRANSPARENT",
@@ -98,7 +98,7 @@ const F = (u) => {
98
98
  e && /* @__PURE__ */ a(P, { children: /* @__PURE__ */ a("div", { dangerouslySetInnerHTML: { __html: e } }) })
99
99
  ]
100
100
  },
101
- T
101
+ v
102
102
  );
103
103
  }, []);
104
104
  return m.length ? /* @__PURE__ */ a(
@@ -110,8 +110,7 @@ const F = (u) => {
110
110
  $imageHue: I,
111
111
  $background: "WHITE_1",
112
112
  className: "puzzle-app-view-container",
113
- $justifyContent: "center",
114
- children: m.map((s) => /* @__PURE__ */ a("div", { children: y(s) }, `question-${s.response_id}`))
113
+ children: m.map((s) => /* @__PURE__ */ a("div", { children: T(s) }, `question-${s.response_id}`))
115
114
  }
116
115
  ) : null;
117
116
  }, U = A(L);
@@ -1 +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 $justifyContent=\"center\"\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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../../../../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,MAA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AG,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;"}
@@ -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;AAA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AAA,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;"}