@cuemath/leap 3.2.18 → 3.2.19-beta-0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/illustrations/illustrations.js +6 -5
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lottie/lottie.js +5 -0
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +2 -1
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +6 -4
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +10 -8
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +2 -2
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +7 -4
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +85 -97
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +44 -42
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +31 -29
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +54 -48
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +33 -27
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +17 -11
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +72 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +63 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +67 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +70 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +70 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +1 -0
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +10 -0
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +1 -0
- package/dist/features/puzzles/app/puzzle-app-styled.js +10 -6
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +24 -69
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +79 -30
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/constants/puzzle-container.js +8 -0
- package/dist/features/puzzles/constants/puzzle-container.js.map +1 -0
- package/dist/features/puzzles/puzzle-analytics-events.js +11 -0
- package/dist/features/puzzles/puzzle-analytics-events.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +55 -25
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +55 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +100 -107
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +37 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +1 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +110 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +1 -0
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map +1 -1
- package/dist/features/puzzles/utils/puzzle-pattern.js +28 -13
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +28 -0
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +20 -19
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +16 -12
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +101 -47
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +149 -146
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +242 -207
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +37 -37
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +307 -313
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +44 -35
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +87 -4
- package/dist/index.js +326 -316
- package/dist/index.js.map +1 -1
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +1 -0
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +12760 -0
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +1 -0
- package/dist/static/puzzle-green-lottie.1da90698.json +1 -0
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +1 -0
- package/dist/static/puzzle-pattern-blue.abff0164.svg +1 -0
- package/dist/static/puzzle-pattern-green.b8ba1840.svg +1 -0
- package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +1 -0
- package/dist/static/puzzle-pattern-purple.14b09759.svg +1 -0
- package/dist/static/puzzle-pattern-yellow.50917fab.svg +1 -0
- package/dist/static/puzzle-purple-lottie.e70de110.json +9860 -0
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +1 -0
- package/package.json +1 -1
- package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +0 -1
- package/dist/static/puzzle-pattern-green.c9f84bbc.svg +0 -1
- package/dist/static/puzzle-pattern-orange.3da09665.svg +0 -1
- package/dist/static/puzzle-pattern-purple.5fb5a319.svg +0 -1
- package/dist/static/puzzle-pattern-yellow.aadbf457.svg +0 -1
@@ -3,14 +3,14 @@ import n from "../../../assets/line-icons/icons/hint-fill.js";
|
|
3
3
|
import l from "../../ui/layout/flex-view.js";
|
4
4
|
import r from "../../ui/text/text.js";
|
5
5
|
import { getPuzzleCardPattern as p } from "../utils/puzzle-pattern.js";
|
6
|
-
const
|
6
|
+
const f = 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
|
-
}),
|
13
|
+
}), d = 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`]};
|
@@ -27,7 +27,7 @@ const d = o(l)(({ theme: t, $visible: i }) => {
|
|
27
27
|
bottom: 0;
|
28
28
|
background-image: ${({ $imageHue: t }) => `url(${p(t)})`};
|
29
29
|
background-size: cover;
|
30
|
-
opacity: 0.
|
30
|
+
opacity: 0.4;
|
31
31
|
}
|
32
32
|
`, x = o(n)`
|
33
33
|
color: ${({ theme: t }) => t.colors.BLACK_1};
|
@@ -44,7 +44,7 @@ const d = 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';
|
47
|
+
font-family: 'Athletics-Regular';
|
48
48
|
|
49
49
|
font-weight: 400;
|
50
50
|
font-style: normal;
|
@@ -70,10 +70,14 @@ const d = o(l)(({ theme: t, $visible: i }) => {
|
|
70
70
|
li {
|
71
71
|
margin: 4px 0;
|
72
72
|
}
|
73
|
+
|
74
|
+
strong {
|
75
|
+
font-weight: 700;
|
76
|
+
}
|
73
77
|
`;
|
74
78
|
export {
|
75
|
-
|
76
|
-
|
79
|
+
f as PuzzleAppWrapper,
|
80
|
+
d as PuzzleContainer,
|
77
81
|
h as PuzzleQuestionWrapper,
|
78
82
|
u as StyledFeedbackText,
|
79
83
|
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: 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.
|
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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from { transform: translateY(0); opacity: 1; }
|
12
|
-
to { transform: translateY(-100%); opacity: 0; }
|
13
|
-
`, d = e(n)`
|
1
|
+
import e from "styled-components";
|
2
|
+
import r from "../../ui/layout/flex-view.js";
|
3
|
+
import i from "../../ui/text/text.js";
|
4
|
+
import { getPuzzleCardPattern as p } from "../utils/puzzle-pattern.js";
|
5
|
+
const n = e(r)`
|
14
6
|
position: relative;
|
7
|
+
cursor: pointer;
|
15
8
|
|
16
|
-
box-shadow: inset 0px 0px 0px 4px ${({ theme:
|
9
|
+
box-shadow: inset 0px 0px 0px 4px ${({ theme: o, $imageHue: t }) => o.colors[`${t}_4`]};
|
17
10
|
|
18
|
-
background-image: ${({ $imageHue:
|
11
|
+
background-image: ${({ $imageHue: o }) => `url(${p(o)})`};
|
19
12
|
background-size: cover;
|
20
13
|
|
21
|
-
|
22
|
-
|
23
|
-
opacity: 0;
|
24
|
-
visibility: hidden;
|
25
|
-
transform: translateY(-100%);
|
26
|
-
`}
|
27
|
-
|
28
|
-
${({ $animationPhase: t, theme: i, $imageHue: s }) => {
|
29
|
-
switch (t) {
|
30
|
-
case "movingIn":
|
31
|
-
return r`
|
32
|
-
visibility: visible;
|
33
|
-
opacity: 1;
|
34
|
-
animation: ${m} 0.5s ease-out forwards;
|
35
|
-
`;
|
36
|
-
case "revealing":
|
37
|
-
return r`
|
38
|
-
visibility: visible;
|
39
|
-
opacity: 1;
|
40
|
-
transform: translateY(0); /* Position after moveIn */
|
41
|
-
animation: ${o} 1s ease-in-out forwards;
|
42
|
-
`;
|
43
|
-
case "visible":
|
44
|
-
return r`
|
45
|
-
visibility: visible;
|
46
|
-
opacity: 1;
|
47
|
-
transform: translateY(0) rotateY(360deg);
|
48
|
-
background-color: ${i.colors[`${s}_2`]};
|
49
|
-
transition: background-color 0.2s ease-in;
|
50
|
-
`;
|
51
|
-
case "assigning":
|
52
|
-
return r`
|
53
|
-
visibility: visible;
|
54
|
-
opacity: 1;
|
55
|
-
transform: translateY(0); /* Reset rotation for this animation */
|
56
|
-
animation: ${o} 1s ease-in-out forwards;
|
57
|
-
`;
|
58
|
-
case "assigned":
|
59
|
-
return r`
|
60
|
-
visibility: visible;
|
61
|
-
opacity: 1;
|
62
|
-
transform: translateY(0) rotateY(360deg);
|
63
|
-
`;
|
64
|
-
case "movingOut":
|
65
|
-
return r`
|
66
|
-
visibility: visible;
|
67
|
-
opacity: 1;
|
68
|
-
transform: translateY(0); /* Start from final position */
|
69
|
-
animation: ${c} 0.5s ease-in forwards;
|
70
|
-
`;
|
71
|
-
default:
|
72
|
-
return "";
|
14
|
+
&:hover {
|
15
|
+
outline: 1px solid ${({ theme: o }) => o.colors.BLACK_1};
|
73
16
|
}
|
74
|
-
|
17
|
+
`, x = e(i)`
|
18
|
+
display: -webkit-box;
|
19
|
+
-webkit-line-clamp: 3;
|
20
|
+
-webkit-box-orient: vertical;
|
21
|
+
overflow: hidden;
|
22
|
+
text-overflow: ellipsis;
|
23
|
+
white-space: break-spaces;
|
24
|
+
`, b = e(r)`
|
25
|
+
position: absolute;
|
26
|
+
top: -16px;
|
27
|
+
right: -15px;
|
75
28
|
`;
|
76
29
|
export {
|
77
|
-
|
30
|
+
n as PuzzleWrapper,
|
31
|
+
b as StickerWrapper,
|
32
|
+
x as Title
|
78
33
|
};
|
79
34
|
//# sourceMappingURL=puzzle-card-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-card-styled.js","sources":["../../../../src/features/puzzles/comps/puzzle-card-styled.tsx"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport styled
|
1
|
+
{"version":3,"file":"puzzle-card-styled.js","sources":["../../../../src/features/puzzles/comps/puzzle-card-styled.tsx"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { getPuzzleCardPattern } from '../utils/puzzle-pattern';\n\nconst PuzzleWrapper = styled(FlexView)<{ $animationPhase?: string; $imageHue: THueNames }>`\n position: relative;\n cursor: pointer;\n\n box-shadow: inset 0px 0px 0px 4px ${({ theme, $imageHue }) => theme.colors[`${$imageHue}_4`]};\n\n background-image: ${({ $imageHue }) => `url(${getPuzzleCardPattern($imageHue)})`};\n background-size: cover;\n\n &:hover {\n outline: 1px solid ${({ theme }) => theme.colors.BLACK_1};\n }\n`;\n\nconst Title = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\nconst StickerWrapper = styled(FlexView)`\n position: absolute;\n top: -16px;\n right: -15px;\n`;\n\nexport { PuzzleWrapper, Title, StickerWrapper };\n"],"names":["PuzzleWrapper","styled","FlexView","theme","$imageHue","getPuzzleCardPattern","Title","Text","StickerWrapper"],"mappings":";;;;AAQM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,sCAIC,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgBD,EAAM,OAAO,GAAGC,CAAS,IAAI,CAAC;AAAA;AAAA,sBAExE,CAAC,EAAE,WAAAA,EAAU,MAAM,OAAOC,EAAqBD,CAAS,CAAC,GAAG;AAAA;AAAA;AAAA;AAAA,yBAIzD,CAAC,EAAE,OAAAD,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA,GAItDG,IAAQL,EAAOM,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASnBC,IAAiBP,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1,35 +1,84 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
|
1
|
+
import { jsx as i, jsxs as f } from "react/jsx-runtime";
|
2
|
+
import { memo as P, useRef as _, useMemo as y, useCallback as s } from "react";
|
3
|
+
import S from "../../ui/buttons/clickable/clickable.js";
|
4
|
+
import b from "../../ui/image/image.js";
|
5
|
+
import A from "../../ui/layout/flex-view.js";
|
6
|
+
import Z from "../../ui/lottie-animation/lottie-animation.js";
|
7
|
+
import { PUZZLE_ANALYTICS_EVENTS as k } from "../puzzle-analytics-events.js";
|
8
|
+
import { getPuzzleStickerLottie as x } from "../utils/puzzle-feedback-celebration.js";
|
9
|
+
import { PuzzleWrapper as M, Title as j, StickerWrapper as v } from "./puzzle-card-styled.js";
|
10
|
+
const R = {
|
11
|
+
autoplay: !1,
|
12
|
+
loop: !0,
|
13
|
+
renderer: "canvas"
|
14
|
+
}, G = P(
|
5
15
|
({
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
width:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
{
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
}
|
30
|
-
|
16
|
+
imageHue: c,
|
17
|
+
imageUrl: u,
|
18
|
+
title: h,
|
19
|
+
height: $ = "100%",
|
20
|
+
width: z = "100%",
|
21
|
+
onCardClick: n,
|
22
|
+
userNodeId: o,
|
23
|
+
rewards: r,
|
24
|
+
studentId: a,
|
25
|
+
nodeId: m
|
26
|
+
}) => {
|
27
|
+
const { sticker: p } = (r == null ? void 0 : r[0]) || {}, l = _(null), L = y(
|
28
|
+
() => ({
|
29
|
+
node_id: m,
|
30
|
+
student_id: a,
|
31
|
+
node_type: "PUZZLE_CARD"
|
32
|
+
}),
|
33
|
+
[m, a]
|
34
|
+
), e = p ? x(p) : void 0, g = s(() => {
|
35
|
+
o && (n == null || n(o));
|
36
|
+
}, [n, o]), E = s(() => {
|
37
|
+
var t;
|
38
|
+
e && ((t = l.current) == null || t.play());
|
39
|
+
}, [e]), d = s(() => {
|
40
|
+
var t;
|
41
|
+
e && ((t = l.current) == null || t.stop());
|
42
|
+
}, [e]);
|
43
|
+
return /* @__PURE__ */ i(
|
44
|
+
S,
|
45
|
+
{
|
46
|
+
label: "",
|
47
|
+
analyticsLabel: k.PUZZLE_VIEWED,
|
48
|
+
analyticsProps: L,
|
49
|
+
onClick: g,
|
50
|
+
children: /* @__PURE__ */ f(
|
51
|
+
M,
|
52
|
+
{
|
53
|
+
$width: z,
|
54
|
+
$height: $,
|
55
|
+
$justifyContent: "center",
|
56
|
+
$alignItems: "center",
|
57
|
+
$imageHue: c,
|
58
|
+
$background: `${c}_2`,
|
59
|
+
onMouseEnter: E,
|
60
|
+
onMouseLeave: d,
|
61
|
+
children: [
|
62
|
+
/* @__PURE__ */ f(A, { $justifyContent: "center", $alignItems: "center", $flexGap: 12, children: [
|
63
|
+
/* @__PURE__ */ i(b, { src: u ?? "", width: 68, height: 68, withLoader: !1, alt: "Puzzle" }),
|
64
|
+
/* @__PURE__ */ i(j, { $renderAs: "ab3", $align: "center", $width: "80%", children: h })
|
65
|
+
] }),
|
66
|
+
e && /* @__PURE__ */ i(v, { $widthX: 2.5, $heightX: 2.5, children: /* @__PURE__ */ i(
|
67
|
+
Z,
|
68
|
+
{
|
69
|
+
src: e,
|
70
|
+
ref: l,
|
71
|
+
settings: R
|
72
|
+
}
|
73
|
+
) })
|
74
|
+
]
|
75
|
+
}
|
76
|
+
)
|
77
|
+
}
|
78
|
+
);
|
79
|
+
}
|
31
80
|
);
|
32
81
|
export {
|
33
|
-
|
82
|
+
G as default
|
34
83
|
};
|
35
84
|
//# sourceMappingURL=puzzle-card.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-card.js","sources":["../../../../src/features/puzzles/comps/puzzle-card.tsx"],"sourcesContent":["import type { IPuzzleCardProps } from './puzzle-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport * as Styled from './puzzle-card-styled';\n\nconst PuzzleCard: FC<IPuzzleCardProps> = memo(\n ({\n
|
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,GAE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sB,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;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"puzzle-container.js","sources":["../../../../src/features/puzzles/constants/puzzle-container.ts"],"sourcesContent":["import type { AnimationSegment } from 'lottie-web';\n\nexport const PUZZLE_ASSIGN_ANIMATION = {\n REVEAL: [0, 50] as AnimationSegment,\n REVEAL_ASSIGNED: [58, 160] as AnimationSegment,\n};\n"],"names":["PUZZLE_ASSIGN_ANIMATION"],"mappings":"AAEO,MAAMA,IAA0B;AAAA,EACrC,QAAQ,CAAC,GAAG,EAAE;AAAA,EACd,iBAAiB,CAAC,IAAI,GAAG;AAC3B;"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { PLUGINS as z } from "../../node_modules/@cuemath/analytics-v2/dist/constants.js";
|
2
|
+
var E = /* @__PURE__ */ ((e) => (e.PUZZLE_ASSIGNED = "puzzle_assigned", e.PUZZLE_VIEWED = "puzzle_viewed", e))(E || {});
|
3
|
+
const _ = {
|
4
|
+
puzzle_viewed: [z.MIXPANEL],
|
5
|
+
puzzle_assigned: [z.MIXPANEL]
|
6
|
+
};
|
7
|
+
export {
|
8
|
+
E as PUZZLE_ANALYTICS_EVENTS,
|
9
|
+
_ as PUZZLE_ANALYTICS_WHITELIST_EVENTS
|
10
|
+
};
|
11
|
+
//# sourceMappingURL=puzzle-analytics-events.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"puzzle-analytics-events.js","sources":["../../../src/features/puzzles/puzzle-analytics-events.ts"],"sourcesContent":["import { PLUGINS } from '@cuemath/analytics-v2/dist/constants';\n\nexport enum PUZZLE_ANALYTICS_EVENTS {\n PUZZLE_ASSIGNED = 'puzzle_assigned',\n PUZZLE_VIEWED = 'puzzle_viewed',\n}\n\nexport const PUZZLE_ANALYTICS_WHITELIST_EVENTS = {\n [PUZZLE_ANALYTICS_EVENTS.PUZZLE_VIEWED]: [PLUGINS.MIXPANEL],\n [PUZZLE_ANALYTICS_EVENTS.PUZZLE_ASSIGNED]: [PLUGINS.MIXPANEL],\n};\n"],"names":["PUZZLE_ANALYTICS_EVENTS","PUZZLE_ANALYTICS_WHITELIST_EVENTS","PLUGINS"],"mappings":";AAEY,IAAAA,sBAAAA,OACVA,EAAA,kBAAkB,mBAClBA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA;AAKL,MAAMC,IAAoC;AAAA,EAC9C,eAAwC,CAACC,EAAQ,QAAQ;AAAA,EACzD,iBAA0C,CAACA,EAAQ,QAAQ;AAC9D;"}
|
@@ -1,47 +1,77 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
|
4
|
-
|
1
|
+
import e from "styled-components";
|
2
|
+
import r from "../../ui/layout/flex-view.js";
|
3
|
+
import { getPuzzleCardPattern as s } from "../utils/puzzle-pattern.js";
|
4
|
+
const c = e(r)(({ theme: t, $assigned: o }) => {
|
5
|
+
const { colors: i, layout: n } = t;
|
6
|
+
return `
|
7
|
+
cursor: pointer;
|
8
|
+
width: ${n.gutter * 15.9375}px;
|
9
|
+
height: ${n.gutter * 19.125}px;
|
10
|
+
position: relative;
|
11
|
+
left: ${o ? "0" : "50px"};
|
12
|
+
top: ${o ? "0" : "50px"};
|
5
13
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
14
|
+
&:hover {
|
15
|
+
outline: 2px solid ${i.BLACK_1};
|
16
|
+
}
|
17
|
+
`;
|
18
|
+
}), x = e(r)(({ theme: t, $assigned: o, $assigning: i }) => {
|
19
|
+
const { colors: n, layout: p } = t;
|
11
20
|
return `
|
12
|
-
position: absolute;
|
13
|
-
bottom: -48px;
|
14
21
|
cursor: pointer;
|
15
|
-
|
22
|
+
width: ${p.gutter * 15.9375}px;
|
23
|
+
position: absolute;
|
24
|
+
left: ${o ? "0" : "50px"};
|
25
|
+
bottom: ${o ? "-50px" : "11px"};
|
16
26
|
|
17
|
-
${
|
18
|
-
background: ${
|
19
|
-
border: 2px solid ${
|
27
|
+
${(o || i) && `
|
28
|
+
background: ${n.WHITE_4};
|
29
|
+
border: 2px solid ${n.WHITE_5};
|
20
30
|
border-top: 0;
|
21
31
|
pointer-events: none;
|
22
32
|
`}
|
23
33
|
`;
|
24
|
-
})
|
34
|
+
});
|
35
|
+
e(r)`
|
25
36
|
position: relative;
|
26
37
|
top: -8px;
|
27
38
|
height: 100%;
|
28
39
|
width: 100%;
|
29
|
-
|
40
|
+
`;
|
41
|
+
e(r)`
|
30
42
|
border-radius: 50%;
|
31
|
-
|
43
|
+
`;
|
44
|
+
const d = e(r)`
|
32
45
|
position: relative;
|
33
46
|
transition: height 0.3s ease-out;
|
34
|
-
`,
|
47
|
+
`, g = e(r)`
|
35
48
|
position: absolute;
|
36
49
|
top: 0;
|
37
50
|
right: 0;
|
51
|
+
`, h = e(r)(({ $visible: t, theme: o }) => {
|
52
|
+
const { layout: i } = o;
|
53
|
+
return `
|
54
|
+
width: ${i.gutter * 22.1875}px;
|
55
|
+
height: ${i.gutter * 26}px;
|
56
|
+
left: 0;
|
57
|
+
opacity: ${t ? 1 : 0};
|
58
|
+
pointer-events: ${t ? "auto" : "none"};
|
59
|
+
transition: opacity 0.2s ease-out;
|
60
|
+
`;
|
61
|
+
}), $ = e(r)`
|
62
|
+
position: relative;
|
63
|
+
|
64
|
+
box-shadow: inset 0px 0px 0px 4px ${({ theme: t, $imageHue: o }) => t.colors[`${o}_4`]};
|
65
|
+
|
66
|
+
background-image: ${({ $imageHue: t }) => `url(${s(t)})`};
|
67
|
+
background-size: cover;
|
38
68
|
`;
|
39
69
|
export {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
70
|
+
g as AssignedTag,
|
71
|
+
$ as PuzzleAssignedWrapper,
|
72
|
+
x as PuzzleButton,
|
73
|
+
d as PuzzleContainer,
|
74
|
+
c as PuzzleContent,
|
75
|
+
h as PuzzleContentWrapper
|
46
76
|
};
|
47
77
|
//# sourceMappingURL=puzzle-container-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-container-styled.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\nconst PuzzleContent = styled(FlexView)
|
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;AA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/jsx-runtime";
|
2
|
+
import { memo as d } from "react";
|
3
|
+
import m from "../../ui/buttons/clickable/clickable.js";
|
4
|
+
import u from "../../ui/image/image.js";
|
5
|
+
import t from "../../ui/text/text.js";
|
6
|
+
import { PuzzleContent as g, AssignedTag as h, PuzzleButton as p } from "./puzzle-container-styled.js";
|
7
|
+
const k = d(
|
8
|
+
({ handleOnPuzzleClick: l, imageUrl: o, title: c, handleAssign: a, assigned: r, assigning: n, analyticsProps: s }) => /* @__PURE__ */ i($, { children: [
|
9
|
+
/* @__PURE__ */ i(
|
10
|
+
g,
|
11
|
+
{
|
12
|
+
$justifyContent: "center",
|
13
|
+
$alignItems: "center",
|
14
|
+
onClick: l,
|
15
|
+
title: "Click to preview",
|
16
|
+
$flexGapX: 1.5,
|
17
|
+
$assigned: r,
|
18
|
+
$gutterX: 1,
|
19
|
+
children: [
|
20
|
+
/* @__PURE__ */ e(u, { width: 136, height: 136, src: o, withLoader: !1, alt: "Puzzle" }),
|
21
|
+
/* @__PURE__ */ e(t, { $renderAs: "h4", $align: "center", children: c }),
|
22
|
+
r && /* @__PURE__ */ e(h, { $gap: 4, $gutter: 8, $background: "BLACK_1", children: /* @__PURE__ */ e(t, { $renderAs: "ac4", $color: "WHITE_1", children: "Assigned" }) })
|
23
|
+
]
|
24
|
+
}
|
25
|
+
),
|
26
|
+
/* @__PURE__ */ e(
|
27
|
+
m,
|
28
|
+
{
|
29
|
+
onClick: a,
|
30
|
+
label: "",
|
31
|
+
analyticsLabel: "puzzle_assigned",
|
32
|
+
disabled: r || n,
|
33
|
+
analyticsProps: s,
|
34
|
+
children: /* @__PURE__ */ e(
|
35
|
+
p,
|
36
|
+
{
|
37
|
+
$background: "BLACK_1",
|
38
|
+
$widthX: 15.75,
|
39
|
+
$alignItems: "center",
|
40
|
+
$justifyContent: "center",
|
41
|
+
$gapX: 0.75,
|
42
|
+
$gutterX: 1,
|
43
|
+
$assigned: r,
|
44
|
+
$assigning: n,
|
45
|
+
children: /* @__PURE__ */ e(t, { $renderAs: "ub1-bold", $color: r ? "BLACK_T_38" : "WHITE_1", children: r ? "Discuss in next class" : "Assign" })
|
46
|
+
}
|
47
|
+
)
|
48
|
+
}
|
49
|
+
)
|
50
|
+
] })
|
51
|
+
);
|
52
|
+
export {
|
53
|
+
k as default
|
54
|
+
};
|
55
|
+
//# sourceMappingURL=puzzle-container-view.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"puzzle-container-view.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container-view.tsx"],"sourcesContent":["import type { IPuzzleContainerViewProps } from './puzzle-container-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport Image from '../../ui/image/image';\nimport Text from '../../ui/text/text';\nimport * as Styled from './puzzle-container-styled';\n\nconst PuzzleContainerView: FC<IPuzzleContainerViewProps> = memo(\n ({ handleOnPuzzleClick, imageUrl, title, handleAssign, assigned, assigning, analyticsProps }) => {\n return (\n <>\n <Styled.PuzzleContent\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleOnPuzzleClick}\n title=\"Click to preview\"\n $flexGapX={1.5}\n $assigned={assigned}\n $gutterX={1}\n >\n <Image width={136} height={136} src={imageUrl} withLoader={false} alt=\"Puzzle\" />\n <Text $renderAs=\"h4\" $align=\"center\">\n {title}\n </Text>\n\n {assigned && (\n <Styled.AssignedTag $gap={4} $gutter={8} $background=\"BLACK_1\">\n <Text $renderAs=\"ac4\" $color=\"WHITE_1\">\n Assigned\n </Text>\n </Styled.AssignedTag>\n )}\n </Styled.PuzzleContent>\n\n <Clickable\n onClick={handleAssign}\n label=\"\"\n analyticsLabel=\"puzzle_assigned\"\n disabled={assigned || assigning}\n analyticsProps={analyticsProps}\n >\n <Styled.PuzzleButton\n $background=\"BLACK_1\"\n $widthX={15.75}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $gapX={0.75}\n $gutterX={1}\n $assigned={assigned}\n $assigning={assigning}\n >\n <Text $renderAs=\"ub1-bold\" $color={assigned ? 'BLACK_T_38' : 'WHITE_1'}>\n {assigned ? 'Discuss in next class' : 'Assign'}\n </Text>\n </Styled.PuzzleButton>\n </Clickable>\n </>\n );\n },\n);\n\nexport default PuzzleContainerView;\n"],"names":["PuzzleContainerView","memo","handleOnPuzzleClick","imageUrl","title","handleAssign","assigned","assigning","analyticsProps","jsxs","Fragment","Styled.PuzzleContent","jsx","Image","Text","Styled.AssignedTag","Clickable","Styled.PuzzleButton"],"mappings":";;;;;;AAUA,MAAMA,IAAqDC;AAAA,EACzD,CAAC,EAAE,qBAAAC,GAAqB,UAAAC,GAAU,OAAAC,GAAO,cAAAC,GAAc,UAAAC,GAAU,WAAAC,GAAW,gBAAAC,QAGtE,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAAA,MAAA;AAAA,QACC,iBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,SAAST;AAAA,QACT,OAAM;AAAA,QACN,WAAW;AAAA,QACX,WAAWI;AAAA,QACX,UAAU;AAAA,QAEV,UAAA;AAAA,UAAC,gBAAAM,EAAAC,GAAA,EAAM,OAAO,KAAK,QAAQ,KAAK,KAAKV,GAAU,YAAY,IAAO,KAAI,SAAS,CAAA;AAAA,4BAC9EW,GAAK,EAAA,WAAU,MAAK,QAAO,UACzB,UACHV,GAAA;AAAA,UAECE,KACE,gBAAAM,EAAAG,GAAA,EAAmB,MAAM,GAAG,SAAS,GAAG,aAAY,WACnD,4BAACD,GAAK,EAAA,WAAU,OAAM,QAAO,WAAU,qBAEvC,CAAA,GACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,IAEA,gBAAAF;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,SAASX;AAAA,QACT,OAAM;AAAA,QACN,gBAAe;AAAA,QACf,UAAUC,KAAYC;AAAA,QACtB,gBAAAC;AAAA,QAEA,UAAA,gBAAAI;AAAA,UA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