@cuemath/leap 3.2.17-pzd-0.1 → 3.2.17
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 +10 -6
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/after-noon.js +34 -0
- package/dist/assets/line-icons/icons/after-noon.js.map +1 -0
- package/dist/assets/line-icons/icons/apple-icon-white.js +42 -0
- package/dist/assets/line-icons/icons/apple-icon-white.js.map +1 -0
- package/dist/assets/line-icons/icons/evening.js +35 -0
- package/dist/assets/line-icons/icons/evening.js.map +1 -0
- package/dist/assets/line-icons/icons/morning.js +35 -0
- package/dist/assets/line-icons/icons/morning.js.map +1 -0
- package/dist/assets/lottie/lottie.js +10 -5
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +1 -2
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +4 -6
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +8 -10
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js +9 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js.map +1 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js +52 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js.map +1 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +93 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +1 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text-styled.js +10 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text-styled.js.map +1 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text.js +17 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text.js.map +1 -0
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +18 -13
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js +12 -0
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js.map +1 -0
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js +34 -0
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +1 -0
- package/dist/features/auth/comps/otp-input/otp-input-styled.js +26 -0
- package/dist/features/auth/comps/otp-input/otp-input-styled.js.map +1 -0
- package/dist/features/auth/comps/otp-input/otp-input.js +50 -0
- package/dist/features/auth/comps/otp-input/otp-input.js.map +1 -0
- package/dist/features/auth/comps/pill-button/pill-button-styled.js +44 -0
- package/dist/features/auth/comps/pill-button/pill-button-styled.js.map +1 -0
- package/dist/features/auth/comps/pill-button/pill-button.js +74 -0
- package/dist/features/auth/comps/pill-button/pill-button.js.map +1 -0
- package/dist/features/auth/comps/resend-otp/resend-otp.js +54 -47
- package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js +17 -0
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js.map +1 -0
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js +67 -0
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js.map +1 -0
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +29 -17
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs-styled.js +22 -10
- package/dist/features/auth/comps/tabs/tabs-styled.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs.js +5 -5
- package/dist/features/auth/comps/tabs/tabs.js.map +1 -1
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-constants.js +19 -0
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-constants.js.map +1 -0
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js +32 -0
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js.map +1 -0
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js +44 -0
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js.map +1 -0
- package/dist/features/auth/pla-signup/signup-header/signup-header.js +54 -0
- package/dist/features/auth/pla-signup/signup-header/signup-header.js.map +1 -0
- package/dist/features/auth/pla-signup/signup-options/signup-options.js +83 -0
- package/dist/features/auth/pla-signup/signup-options/signup-options.js.map +1 -0
- 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 +4 -7
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +97 -85
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +42 -44
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +29 -31
- 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 +48 -54
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +27 -33
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +11 -17
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- 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/app/puzzle-app-styled.js +6 -10
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +69 -24
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +30 -79
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +25 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +107 -100
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- 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 +13 -28
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/ui/drawer/drawer-styled.js +34 -0
- package/dist/features/ui/drawer/drawer-styled.js.map +1 -0
- package/dist/features/ui/drawer/drawer.js +42 -0
- package/dist/features/ui/drawer/drawer.js.map +1 -0
- package/dist/features/ui/image/image.js +1 -1
- package/dist/features/ui/image/image.js.map +1 -1
- package/dist/features/ui/theme/button.js +78 -78
- package/dist/features/ui/theme/button.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +19 -20
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +12 -16
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +47 -101
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +146 -149
- 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 +207 -242
- 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 +313 -307
- 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 +35 -44
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +123 -90
- package/dist/index.js +518 -504
- package/dist/index.js.map +1 -1
- package/dist/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +3 -2
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +6 -10
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +12 -9
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/static/animated-avatar.1ad58b1d.json +1 -0
- package/dist/static/animated-avatar.69b07505.json +1 -0
- package/dist/static/animated-avatar.9c560b46.json +1 -0
- package/dist/static/calendar-purple.1a840b41.svg +1 -0
- package/dist/static/flying-disk.c7f6ed39.json +1 -0
- package/dist/static/graduation-cap.3be3340a.json +1 -0
- package/dist/static/handshake.287e7dfb.svg +1 -0
- package/dist/static/light-bulb.c6db0b23.json +1 -0
- package/dist/static/money.332aacf1.svg +1 -0
- package/dist/static/muscle.9bcfb8a7.json +1 -0
- package/dist/static/parent-avatar.822c7b9b.svg +1 -0
- package/dist/static/pencil.23df9da0.json +1 -0
- package/dist/static/plus-sign.de6af957.json +1 -0
- package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +1 -0
- package/dist/static/puzzle-pattern-green.c9f84bbc.svg +1 -0
- package/dist/static/puzzle-pattern-orange.3da09665.svg +1 -0
- package/dist/static/puzzle-pattern-purple.5fb5a319.svg +1 -0
- package/dist/static/puzzle-pattern-yellow.aadbf457.svg +1 -0
- package/dist/static/racing-car.2cbf864e.json +1 -0
- package/dist/static/rocket.0a3ccab0.json +1 -0
- package/dist/static/shovel.abeec04c.json +1 -0
- package/dist/static/trustpilot.bd3d79e1.svg +1 -0
- package/package.json +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +0 -72
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +0 -63
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +0 -67
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +0 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +0 -10
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +0 -1
- package/dist/features/puzzles/constants/puzzle-container.js +0 -8
- package/dist/features/puzzles/constants/puzzle-container.js.map +0 -1
- package/dist/features/puzzles/puzzle-analytics-events.js +0 -11
- package/dist/features/puzzles/puzzle-analytics-events.js.map +0 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +0 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +0 -37
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +0 -110
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +0 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +0 -28
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +0 -1
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +0 -5
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +0 -8
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +0 -1
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +0 -12760
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +0 -1
- package/dist/static/puzzle-green-lottie.1da90698.json +0 -1
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +0 -1
- package/dist/static/puzzle-pattern-blue.abff0164.svg +0 -1
- package/dist/static/puzzle-pattern-green.b8ba1840.svg +0 -1
- package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +0 -1
- package/dist/static/puzzle-pattern-purple.14b09759.svg +0 -1
- package/dist/static/puzzle-pattern-yellow.50917fab.svg +0 -1
- package/dist/static/puzzle-purple-lottie.e70de110.json +0 -9860
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +0 -1
- /package/dist/node_modules/{query-string/node_modules/decode-uri-component → decode-uri-component}/index.js +0 -0
@@ -1,77 +1,47 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
|
4
|
-
|
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
|
25
|
-
|
13
|
+
bottom: -48px;
|
14
|
+
cursor: pointer;
|
15
|
+
z-index: -1;
|
26
16
|
|
27
|
-
${
|
28
|
-
background: ${
|
29
|
-
border: 2px solid ${
|
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
|
-
`,
|
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
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
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
|
1
|
+
{"version":3,"file":"puzzle-container-styled.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\nconst PuzzleContent = styled(FlexView)`\n cursor: pointer;\n\n &:hover {\n outline: 2px solid ${({ theme }) => theme.colors.BLACK_1};\n }\n`;\n\ninterface IPuzzleButton {\n $disabled?: boolean;\n}\n\nconst PuzzleButton = styled(FlexView)<IPuzzleButton>(({ theme, $disabled }) => {\n const { colors } = theme;\n\n return `\n position: absolute;\n bottom: -48px;\n cursor: pointer;\n z-index: -1;\n \n ${\n $disabled &&\n `\n background: ${colors.WHITE_4};\n border: 2px solid ${colors.WHITE_5};\n border-top: 0;\n pointer-events: none;\n `\n }\n `;\n});\n\nconst PuzzleText = styled(FlexView)`\n position: relative;\n top: -8px;\n height: 100%;\n width: 100%;\n`;\n\nconst CheckMarkIcon = styled(FlexView)`\n border-radius: 50%;\n`;\n\nconst PuzzleContainer = styled(FlexView)`\n position: relative;\n transition: height 0.3s ease-out;\n`;\n\nconst AssignedTag = styled(FlexView)`\n position: absolute;\n top: 0;\n right: 0;\n`;\n\nexport { PuzzleContainer, PuzzleContent, PuzzleButton, PuzzleText, CheckMarkIcon, AssignedTag };\n"],"names":["PuzzleContent","styled","FlexView","theme","PuzzleButton","$disabled","colors","PuzzleText","CheckMarkIcon","PuzzleContainer","AssignedTag"],"mappings":";;AAIM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,yBAIZ,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA,GAQtDC,IAAeH,EAAOC,CAAQ,EAAiB,CAAC,EAAE,OAAAC,GAAO,WAAAE,QAAgB;AACvE,QAAA,EAAE,QAAAC,EAAW,IAAAH;AAEZ,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOHE,KACA;AAAA,oBACcC,EAAO,OAAO;AAAA,0BACRA,EAAO,OAAO;AAAA;AAAA;AAAA,KAIpC;AAAA;AAEJ,CAAC,GAEKC,IAAaN,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,GAO5BM,IAAgBP,EAAOC,CAAQ;AAAA;AAAA,GAI/BO,IAAkBR,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAKjCQ,IAAcT,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1,120 +1,127 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import {
|
7
|
-
import
|
8
|
-
import { PuzzleContainer as
|
9
|
-
|
10
|
-
const W = {
|
11
|
-
loop: !1,
|
12
|
-
renderer: "svg",
|
13
|
-
autoPlay: !1
|
14
|
-
}, X = Z(
|
1
|
+
import { jsx as i, jsxs as l, Fragment as w } from "react/jsx-runtime";
|
2
|
+
import { memo as X, useState as z, useRef as j, useEffect as C, useCallback as c } from "react";
|
3
|
+
import L from "../../../assets/line-icons/icons/check2.js";
|
4
|
+
import O from "../../ui/image/image.js";
|
5
|
+
import r from "../../ui/text/text.js";
|
6
|
+
import { usePostPuzzleToAssign as B } from "../api/puzzle-assign.js";
|
7
|
+
import D from "../comps/puzzle-card.js";
|
8
|
+
import { PuzzleContainer as W, PuzzleContent as G, AssignedTag as K, PuzzleButton as S, PuzzleText as U, CheckMarkIcon as H } from "./puzzle-container-styled.js";
|
9
|
+
const N = 1500, M = X(
|
15
10
|
({
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
11
|
+
userType: A,
|
12
|
+
triggerReveal: o = !1,
|
13
|
+
onFullyHidden: s,
|
14
|
+
onPuzzleClick: d,
|
15
|
+
puzzleData: p,
|
16
|
+
courseStream: g,
|
17
|
+
studentId: u
|
22
18
|
}) => {
|
23
19
|
const {
|
24
|
-
image_hue:
|
25
|
-
image_url:
|
26
|
-
assigned:
|
27
|
-
title:
|
28
|
-
id:
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
} = $, [I, a] = j(s), r = k(null), w = u(() => D(i), [i]), R = u(
|
33
|
-
() => ({
|
34
|
-
node_id: A,
|
35
|
-
node_type: "PUZZLE_CARD",
|
36
|
-
student_elo_rating: h,
|
37
|
-
current_elo_rating: _
|
38
|
-
}),
|
39
|
-
[A, h, _]
|
40
|
-
), { post: C, isProcessing: b } = y({
|
41
|
-
onComplete: (e) => {
|
42
|
-
var t;
|
43
|
-
e ? a(!0) : ((t = r.current) == null || t.playSegments(c.REVEAL_ASSIGNED, !1), a(!1));
|
20
|
+
image_hue: m,
|
21
|
+
image_url: b,
|
22
|
+
assigned: e,
|
23
|
+
title: I,
|
24
|
+
id: h
|
25
|
+
} = p, [n, t] = z("hidden"), [f, P] = z(!1), a = j(null), { post: $, isProcessing: k } = B({
|
26
|
+
onComplete: (x) => {
|
27
|
+
x ? t("visible") : n === "visible" && t("assigning");
|
44
28
|
}
|
45
29
|
});
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
30
|
+
C(() => {
|
31
|
+
e || (o ? f ? t("assigned") : n === "hidden" && t("movingIn") : n !== "hidden" && n !== "movingOut" && t("movingOut"));
|
32
|
+
}, [o, f, e]), C(() => (n === "assigned" && !e && (a.current = setTimeout(() => {
|
33
|
+
t("movingOut");
|
34
|
+
}, N)), () => {
|
35
|
+
a.current && clearTimeout(a.current);
|
36
|
+
}), [n, e]);
|
37
|
+
const T = c(() => {
|
38
|
+
switch (n) {
|
39
|
+
case "movingIn":
|
40
|
+
t("revealing");
|
41
|
+
break;
|
42
|
+
case "revealing":
|
43
|
+
t("visible");
|
44
|
+
break;
|
45
|
+
case "assigning":
|
46
|
+
t("assigned"), P(!0);
|
47
|
+
break;
|
48
|
+
case "movingOut":
|
49
|
+
t("hidden"), s == null || s();
|
50
|
+
break;
|
51
|
+
}
|
52
|
+
}, [n, s]), v = c(() => {
|
53
|
+
e || $(
|
52
54
|
{
|
53
|
-
puzzle_id:
|
55
|
+
puzzle_id: h
|
54
56
|
},
|
55
57
|
{
|
56
|
-
studentId:
|
57
|
-
courseStream:
|
58
|
+
studentId: u,
|
59
|
+
courseStream: g
|
58
60
|
}
|
59
61
|
);
|
60
|
-
}, [
|
61
|
-
|
62
|
-
}, [
|
63
|
-
|
64
|
-
|
65
|
-
}, []), N = u(
|
66
|
-
() => ({
|
67
|
-
name: "enterFrame",
|
68
|
-
callback: (e) => {
|
69
|
-
const { currentTime: t } = e;
|
70
|
-
t === 49 && a(!0), t === 101 && (o == null || o());
|
71
|
-
}
|
72
|
-
}),
|
73
|
-
[o]
|
74
|
-
);
|
75
|
-
return l ? s ? /* @__PURE__ */ n(E, { $justifyContent: "center", children: /* @__PURE__ */ n(
|
76
|
-
G,
|
77
|
-
{
|
78
|
-
$imageHue: i,
|
79
|
-
$background: `${i}_2`,
|
80
|
-
$widthX: 15.9375,
|
81
|
-
children: /* @__PURE__ */ n(
|
82
|
-
S,
|
83
|
-
{
|
84
|
-
imageUrl: g,
|
85
|
-
handleOnPuzzleClick: L,
|
86
|
-
title: d,
|
87
|
-
assigned: !0
|
88
|
-
}
|
89
|
-
)
|
90
|
-
}
|
91
|
-
) }) : /* @__PURE__ */ n(E, { children: /* @__PURE__ */ T(U, { $heightX: 26, children: [
|
92
|
-
/* @__PURE__ */ n(
|
93
|
-
v,
|
62
|
+
}, [g, e, $, h, u]), _ = c(() => {
|
63
|
+
d();
|
64
|
+
}, [d]), E = () => n === "visible" || e ? /* @__PURE__ */ l(w, { children: [
|
65
|
+
/* @__PURE__ */ l(
|
66
|
+
G,
|
94
67
|
{
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
68
|
+
$justifyContent: "center",
|
69
|
+
$alignItems: "center",
|
70
|
+
$width: "100%",
|
71
|
+
$height: "100%",
|
72
|
+
onClick: _,
|
73
|
+
title: "Click to preview",
|
74
|
+
$flexGapX: 1.5,
|
75
|
+
children: [
|
76
|
+
/* @__PURE__ */ i(O, { width: 136, height: 136, src: b, withLoader: !1, alt: "Puzzle" }),
|
77
|
+
/* @__PURE__ */ i(r, { $renderAs: "h4", children: I }),
|
78
|
+
e && /* @__PURE__ */ i(K, { $gap: 4, $gutter: 8, $background: "BLACK_1", children: /* @__PURE__ */ i(r, { $renderAs: "ac4", $color: "WHITE_1", children: "Assigned" }) })
|
79
|
+
]
|
101
80
|
}
|
102
81
|
),
|
103
|
-
|
82
|
+
A === "TEACHER" && /* @__PURE__ */ i(
|
104
83
|
S,
|
105
84
|
{
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
85
|
+
$background: "BLACK_1",
|
86
|
+
$widthX: 15.75,
|
87
|
+
$alignItems: "center",
|
88
|
+
$justifyContent: "center",
|
89
|
+
$gapX: 0.75,
|
90
|
+
$gutterX: 1,
|
91
|
+
onClick: v,
|
92
|
+
$disabled: e || k,
|
93
|
+
children: /* @__PURE__ */ i(r, { $renderAs: "ub1-bold", $color: e ? "BLACK_T_38" : "WHITE_1", children: e ? "Discuss in next class" : "Assign" })
|
112
94
|
}
|
113
|
-
)
|
114
|
-
] })
|
95
|
+
)
|
96
|
+
] }) : n === "assigned" ? /* @__PURE__ */ l(U, { $alignItems: "center", $justifyContent: "center", $flexGap: 8, children: [
|
97
|
+
/* @__PURE__ */ i(
|
98
|
+
H,
|
99
|
+
{
|
100
|
+
$widthX: 2.5,
|
101
|
+
$heightX: 2.5,
|
102
|
+
$background: "WHITE",
|
103
|
+
$alignItems: "center",
|
104
|
+
$justifyContent: "center",
|
105
|
+
children: /* @__PURE__ */ i(L, {})
|
106
|
+
}
|
107
|
+
),
|
108
|
+
/* @__PURE__ */ i(r, { $renderAs: "ab1-bold", $align: "center", $color: "WHITE", children: "Puzzle assigned" })
|
109
|
+
] }) : null;
|
110
|
+
return n === "hidden" && !o ? null : /* @__PURE__ */ i(W, { children: /* @__PURE__ */ i(
|
111
|
+
D,
|
112
|
+
{
|
113
|
+
animationPhase: e ? void 0 : n,
|
114
|
+
onAnimationEnd: T,
|
115
|
+
imageHue: m ?? "BLUE",
|
116
|
+
heightX: 19,
|
117
|
+
widthX: 15.75,
|
118
|
+
backgroundColor: e ? `${m}_2` : void 0,
|
119
|
+
children: E()
|
120
|
+
}
|
121
|
+
) });
|
115
122
|
}
|
116
|
-
),
|
123
|
+
), F = M;
|
117
124
|
export {
|
118
|
-
|
125
|
+
F as default
|
119
126
|
};
|
120
127
|
//# sourceMappingURL=puzzle-container.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-container.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../ui/lottie-animation/types';\nimport type { IPuzzleCardContainerProps } from './puzzle-container-types';\nimport type { AnimationEventName, BMEnterFrameEvent } from 'lottie-web';\nimport type { FC } from 'react';\n\nimport { useState, useCallback, useEffect, useRef, memo, useMemo } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { usePostPuzzleToAssign } from '../api/puzzle-assign';\nimport { PUZZLE_ASSIGN_ANIMATION } from '../constants/puzzle-container';\nimport { getPuzzleCardLottie } from '../utils/puzzle-pattern';\nimport * as Styled from './puzzle-container-styled';\nimport PuzzleAssigned from './puzzle-container-view';\n\nconst modeRevealAnimationSettings = {\n loop: false,\n renderer: 'svg',\n autoPlay: false,\n};\n\nconst PuzzleCardContainer: FC<IPuzzleCardContainerProps> = memo(\n ({\n triggerReveal = false,\n onFullyHidden,\n onPuzzleClick,\n puzzleData,\n courseStream,\n studentId,\n }) => {\n const {\n image_hue: imageHue,\n image_url: imageUrl,\n assigned: externalAssigned,\n title,\n id: puzzleId,\n node_id: nodeId,\n student_elo_rating,\n current_elo_rating,\n } = puzzleData;\n\n const [showPuzzleInfo, setShowPuzzleInfo] = useState(externalAssigned);\n\n const assignLottieRef = useRef<ILottieAnimationRef | null>(null);\n const puzzleLottieSrc = useMemo(() => getPuzzleCardLottie(imageHue), [imageHue]);\n\n const analyticsProps = useMemo(\n () => ({\n node_id: nodeId,\n node_type: 'PUZZLE_CARD',\n student_elo_rating,\n current_elo_rating,\n }),\n [nodeId, student_elo_rating, current_elo_rating],\n );\n\n const { post: postPuzzleToAssign, isProcessing } = usePostPuzzleToAssign({\n onComplete: (error: string | null) => {\n if (error) {\n // Handle error (e.g., show a notification)\n setShowPuzzleInfo(true);\n } else {\n assignLottieRef.current?.playSegments(PUZZLE_ASSIGN_ANIMATION.REVEAL_ASSIGNED, false);\n\n setShowPuzzleInfo(false);\n }\n },\n });\n\n useEffect(() => {\n if (!externalAssigned) {\n if (triggerReveal) {\n assignLottieRef.current?.playSegments(PUZZLE_ASSIGN_ANIMATION.REVEAL, true);\n } else {\n assignLottieRef.current?.stop();\n setShowPuzzleInfo(false);\n }\n }\n }, [externalAssigned, triggerReveal]);\n\n const handleAssign = useCallback(() => {\n if (externalAssigned) return;\n\n postPuzzleToAssign(\n {\n puzzle_id: puzzleId,\n },\n {\n studentId,\n courseStream,\n },\n );\n }, [courseStream, externalAssigned, postPuzzleToAssign, puzzleId, studentId]);\n\n const handleOnPuzzleClick = useCallback(() => {\n onPuzzleClick();\n }, [onPuzzleClick]);\n\n const showPuzzleLottie = useCallback(() => {\n assignLottieRef.current?.playSegments(PUZZLE_ASSIGN_ANIMATION.REVEAL, true);\n }, []);\n\n const onAnimationFinish = useMemo(\n () => ({\n name: 'enterFrame' as AnimationEventName,\n callback: (event: BMEnterFrameEvent) => {\n const { currentTime } = event;\n\n if (currentTime === 49) {\n setShowPuzzleInfo(true);\n }\n\n if (currentTime === 101) {\n onFullyHidden?.();\n }\n },\n }),\n [onFullyHidden],\n );\n\n if (!triggerReveal) {\n return null;\n }\n\n if (externalAssigned) {\n return (\n <Styled.PuzzleContainer $justifyContent=\"center\">\n <Styled.PuzzleAssignedWrapper\n $imageHue={imageHue}\n $background={`${imageHue}_2`}\n $widthX={15.9375}\n >\n <PuzzleAssigned\n imageUrl={imageUrl}\n handleOnPuzzleClick={handleOnPuzzleClick}\n title={title}\n assigned\n />\n </Styled.PuzzleAssignedWrapper>\n </Styled.PuzzleContainer>\n );\n }\n\n return (\n <Styled.PuzzleContainer>\n <FlexView $heightX={26}>\n <LottieAnimation\n src={puzzleLottieSrc}\n ref={assignLottieRef}\n settings={modeRevealAnimationSettings}\n onRender={showPuzzleLottie}\n eventListener={onAnimationFinish}\n animateOnIntersect\n />\n\n <Styled.PuzzleContentWrapper $visible={showPuzzleInfo} $position=\"absolute\">\n <PuzzleAssigned\n imageUrl={imageUrl}\n title={title}\n handleOnPuzzleClick={handleOnPuzzleClick}\n handleAssign={handleAssign}\n assigning={isProcessing}\n analyticsProps={analyticsProps}\n />\n </Styled.PuzzleContentWrapper>\n </FlexView>\n </Styled.PuzzleContainer>\n );\n },\n);\n\nexport default PuzzleCardContainer;\n"],"names":["modeRevealAnimationSettings","PuzzleCardContainer","memo","triggerReveal","onFullyHidden","onPuzzleClick","puzzleData","courseStream","studentId","imageHue","imageUrl","externalAssigned","title","puzzleId","nodeId","student_elo_rating","current_elo_rating","showPuzzleInfo","setShowPuzzleInfo","useState","assignLottieRef","useRef","puzzleLottieSrc","useMemo","getPuzzleCardLottie","analyticsProps","postPuzzleToAssign","isProcessing","usePostPuzzleToAssign","error","_a","PUZZLE_ASSIGN_ANIMATION","useEffect","_b","handleAssign","useCallback","handleOnPuzzleClick","showPuzzleLottie","onAnimationFinish","event","currentTime","jsx","Styled.PuzzleContainer","Styled.PuzzleAssignedWrapper","PuzzleAssigned","jsxs","FlexView","LottieAnimation","Styled.PuzzleContentWrapper","PuzzleCardContainer$1"],"mappings":";;;;;;;;;AAeA,MAAMA,IAA8B;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AACZ,GAEMC,IAAqDC;AAAA,EACzD,CAAC;AAAA,IACC,eAAAC,IAAgB;AAAA,IAChB,eAAAC;AAAA,IACA,eA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ACC,UAAAlC;AAAA,UACA,OAAAE;AAAA,UACA,qBAAAwB;AAAA,UACA,cAAAF;AAAA,UACA,WAAWP;AAAA,UACX,gBAAAF;AAAA,QAAA;AAAA,MAAA,GAEJ;AAAA,IAAA,EACF,CAAA,EACF,CAAA,IA7CO;AAAA,EA+CX;AACF,GAEAwB,KAAehD;"}
|
1
|
+
{"version":3,"file":"puzzle-container.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container.tsx"],"sourcesContent":["import type { TPuzzleCardAnimationPhases } from '../comps/puzzle-card-types';\nimport type { IPuzzleCardContainerProps } from './puzzle-container-types';\nimport type { FC } from 'react';\n\nimport { useState, useCallback, useEffect, useRef, memo } from 'react';\n\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport Image from '../../ui/image/image';\nimport Text from '../../ui/text/text';\nimport { usePostPuzzleToAssign } from '../api/puzzle-assign';\nimport PuzzleCard from '../comps/puzzle-card';\nimport * as Styled from './puzzle-container-styled';\n\nconst ASSIGNED_DISPLAY_DURATION = 1500; // ms\n\nconst PuzzleCardContainer: FC<IPuzzleCardContainerProps> = memo(\n ({\n userType,\n triggerReveal = false,\n onFullyHidden,\n onPuzzleClick,\n puzzleData,\n courseStream,\n studentId,\n }) => {\n const {\n image_hue: imageHue,\n image_url: imageUrl,\n assigned: externalAssigned,\n title,\n id: puzzleId,\n } = puzzleData;\n\n const [animationPhase, setAnimationPhase] = useState<TPuzzleCardAnimationPhases>('hidden');\n const [isAssigned, setIsAssigned] = useState(false);\n\n const assignedTimer = useRef<NodeJS.Timeout | null>(null);\n\n const { post: postPuzzleToAssign, isProcessing } = usePostPuzzleToAssign({\n onComplete: (error: string | null) => {\n if (error) {\n // Handle error (e.g., show a notification)\n setAnimationPhase('visible'); // Reset to visible if assignment fails\n } else {\n if (animationPhase === 'visible') {\n setAnimationPhase('assigning');\n }\n }\n },\n });\n\n // Main trigger to start or hide the card\n useEffect(() => {\n if (!externalAssigned) {\n if (triggerReveal) {\n if (isAssigned) {\n setAnimationPhase('assigned'); // Already assigned, show statically\n } else if (animationPhase === 'hidden') {\n setAnimationPhase('movingIn'); // Start the animation sequence\n }\n } else {\n // If trigger is removed, start hiding (unless already hidden/hiding)\n if (animationPhase !== 'hidden' && animationPhase !== 'movingOut') {\n setAnimationPhase('movingOut');\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [triggerReveal, isAssigned, externalAssigned]);\n\n // Timer to auto-hide after the 'assigned' phase\n useEffect(() => {\n if (animationPhase === 'assigned' && !externalAssigned) {\n assignedTimer.current = setTimeout(() => {\n setAnimationPhase('movingOut');\n }, ASSIGNED_DISPLAY_DURATION);\n }\n\n return () => {\n if (assignedTimer.current) clearTimeout(assignedTimer.current);\n };\n }, [animationPhase, externalAssigned]);\n\n // State machine for animations\n const handleAnimationEnd = useCallback(() => {\n switch (animationPhase) {\n case 'movingIn':\n setAnimationPhase('revealing');\n break;\n case 'revealing':\n setAnimationPhase('visible');\n break;\n case 'assigning':\n setAnimationPhase('assigned');\n setIsAssigned(true);\n break;\n case 'movingOut':\n setAnimationPhase('hidden');\n onFullyHidden?.();\n break;\n default:\n break;\n }\n }, [animationPhase, onFullyHidden]);\n\n const handleAssign = useCallback(() => {\n if (externalAssigned) return; // Do nothing if already assigned\n\n postPuzzleToAssign(\n {\n puzzle_id: puzzleId,\n },\n {\n studentId,\n courseStream,\n },\n );\n }, [courseStream, externalAssigned, postPuzzleToAssign, puzzleId, studentId]);\n\n const handleOnPuzzleClick = useCallback(() => {\n onPuzzleClick();\n }, [onPuzzleClick]);\n\n // Render content only during specific phases\n const renderContent = () => {\n if (animationPhase === 'visible' || externalAssigned) {\n return (\n <>\n <Styled.PuzzleContent\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $width=\"100%\"\n $height=\"100%\"\n onClick={handleOnPuzzleClick}\n title=\"Click to preview\"\n $flexGapX={1.5}\n >\n <Image width={136} height={136} src={imageUrl} withLoader={false} alt=\"Puzzle\" />\n <Text $renderAs=\"h4\">{title}</Text>\n\n {externalAssigned && (\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 {userType === 'TEACHER' && (\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 onClick={handleAssign}\n $disabled={externalAssigned || isProcessing}\n >\n <Text $renderAs=\"ub1-bold\" $color={externalAssigned ? 'BLACK_T_38' : 'WHITE_1'}>\n {externalAssigned ? 'Discuss in next class' : 'Assign'}\n </Text>\n </Styled.PuzzleButton>\n )}\n </>\n );\n }\n\n if (animationPhase === 'assigned') {\n return (\n <Styled.PuzzleText $alignItems=\"center\" $justifyContent=\"center\" $flexGap={8}>\n <Styled.CheckMarkIcon\n $widthX={2.5}\n $heightX={2.5}\n $background=\"WHITE\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <Check2Icon />\n </Styled.CheckMarkIcon>\n\n <Text $renderAs=\"ab1-bold\" $align=\"center\" $color=\"WHITE\">\n Puzzle assigned\n </Text>\n </Styled.PuzzleText>\n );\n }\n\n // No content during animations\n return null;\n };\n\n if (animationPhase === 'hidden' && !triggerReveal) {\n return null;\n }\n\n return (\n <Styled.PuzzleContainer>\n <PuzzleCard\n animationPhase={!externalAssigned ? animationPhase : undefined}\n onAnimationEnd={handleAnimationEnd}\n imageHue={imageHue ?? 'BLUE'}\n heightX={19}\n widthX={15.75}\n backgroundColor={externalAssigned ? `${imageHue}_2` : undefined}\n >\n {renderContent()}\n </PuzzleCard>\n </Styled.PuzzleContainer>\n );\n },\n);\n\nexport default PuzzleCardContainer;\n"],"names":["ASSIGNED_DISPLAY_DURATION","PuzzleCardContainer","memo","userType","triggerReveal","onFullyHidden","onPuzzleClick","puzzleData","courseStream","studentId","imageHue","imageUrl","externalAssigned","title","puzzleId","animationPhase","setAnimationPhase","useState","isAssigned","setIsAssigned","assignedTimer","useRef","postPuzzleToAssign","isProcessing","usePostPuzzleToAssign","error","useEffect","handleAnimationEnd","useCallback","handleAssign","handleOnPuzzleClick","renderContent","jsxs","Fragment","Styled.PuzzleContent","jsx","Image","Text","Styled.AssignedTag","Styled.PuzzleButton","Styled.PuzzleText","Styled.CheckMarkIcon","Check2Icon","Styled.PuzzleContainer","PuzzleCard","PuzzleCardContainer$1"],"mappings":";;;;;;;;AAaA,MAAMA,IAA4B,MAE5BC,IAAqDC;AAAA,EACzD,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,EAAA,MACI;AACE,UAAA;AAAA,MACJ,WAAWC;AAAA,MACX,WAAWC;AAAA,MACX,UAAUC;AAAA,MACV,OAAAC;AAAA,MACA,IAAIC;AAAA,IACF,IAAAP,GAEE,CAACQ,GAAgBC,CAAiB,IAAIC,EAAqC,QAAQ,GACnF,CAACC,GAAYC,CAAa,IAAIF,EAAS,EAAK,GAE5CG,IAAgBC,EAA8B,IAAI,GAElD,EAAE,MAAMC,GAAoB,cAAAC,EAAA,IAAiBC,EAAsB;AAAA,MACvE,YAAY,CAACC,MAAyB;AACpC,QAAIA,IAEFT,EAAkB,SAAS,IAEvBD,MAAmB,aACrBC,EAAkB,WAAW;AAAA,MAGnC;AAAA,IAAA,CACD;AAGD,IAAAU,EAAU,MAAM;AACd,MAAKd,MACCR,IACEc,IACFF,EAAkB,UAAU,IACnBD,MAAmB,YAC5BC,EAAkB,UAAU,IAI1BD,MAAmB,YAAYA,MAAmB,eACpDC,EAAkB,WAAW;AAAA,IAKlC,GAAA,CAACZ,GAAec,GAAYN,CAAgB,CAAC,GAGhDc,EAAU,OACJX,MAAmB,cAAc,CAACH,MACtBQ,EAAA,UAAU,WAAW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;AAAA,QACR,iBAAiBE,IAAmB,GAAGF,CAAQ,OAAO;AAAA,QAErD,UAAcqB,EAAA;AAAA,MAAA;AAAA,IAEnB,EAAA,CAAA;AAAA,EAEJ;AACF,GAEAc,IAAe5C;"}
|
package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-feedback-celebration.js","sources":["../../../../src/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.tsx"],"sourcesContent":["import type { IPuzzleFeedbackCelebration } from './puzzle-feedback-celebration-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport useModalActions from '../../ui/modals/use-modal-actions';\nimport useModalParams from '../../ui/modals/use-modal-params';\nimport { getPuzzleStickerLottie } from '../utils/puzzle-feedback-celebration';\nimport * as Styled from './puzzle-feedback-celebration-styled';\n\nconst puzzleStickerLottieSettings = {\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n};\n\nconst PuzzleFeedbackCelebration: FC = () => {\n const { closeModal } = useModalActions();\n const { feedbackComments, rewards, onCloseModal } = useModalParams<IPuzzleFeedbackCelebration>();\n\n const [showHeader, setShowHeader] = useState(false);\n const [showLottie, setShowLottie] = useState(false);\n const [showText, setShowText] = useState(false);\n const [showButton, setShowButton] = useState(false);\n\n const { sticker } = rewards[0] || {};\n\n const stickerLottie = sticker ? getPuzzleStickerLottie(sticker) : undefined;\n\n const handleCloseModal = useCallback(() => {\n onCloseModal?.();\n closeModal();\n }, [closeModal, onCloseModal]);\n\n useEffect(() => {\n // Sequence: Header -> Lottie -> Text -> Button\n const headerTimer = setTimeout(() => {\n setShowHeader(true);\n }, 100);\n\n const lottieTimer = setTimeout(() => {\n setShowLottie(true);\n }, 400);\n\n const textTimer = setTimeout(() => {\n setShowText(true);\n }, 1000);\n\n const buttonTimer = setTimeout(() => {\n setShowButton(true);\n }, 1500);\n\n // Close modal after 4000ms\n const closeModalTimer = setTimeout(() => {\n handleCloseModal();\n }, 5500);\n\n return () => {\n clearTimeout(headerTimer);\n clearTimeout(lottieTimer);\n clearTimeout(textTimer);\n clearTimeout(buttonTimer);\n clearTimeout(closeModalTimer);\n };\n }, [handleCloseModal]);\n\n return (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $width=\"100%\">\n <Styled.PuzzleFeedbackModalWrapper $flexGapX={2.5} $widthX={33.5} $alignItems=\"center\">\n <Styled.ShimmerText $renderAs=\"ac2-black\" $show={showHeader}>\n Puzzle Reviewed\n </Styled.ShimmerText>\n\n <Styled.LottieContainer $widthX={12.5} $heightX={12.5} $show={showLottie}>\n {stickerLottie && (\n <LottieAnimation\n width={200}\n height={200}\n src={stickerLottie}\n settings={puzzleStickerLottieSettings}\n />\n )}\n </Styled.LottieContainer>\n\n <Styled.FeedbackText\n $width=\"80%\"\n $renderAs=\"
|
1
|
+
{"version":3,"file":"puzzle-feedback-celebration.js","sources":["../../../../src/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.tsx"],"sourcesContent":["import type { IPuzzleFeedbackCelebration } from './puzzle-feedback-celebration-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport useModalActions from '../../ui/modals/use-modal-actions';\nimport useModalParams from '../../ui/modals/use-modal-params';\nimport { getPuzzleStickerLottie } from '../utils/puzzle-feedback-celebration';\nimport * as Styled from './puzzle-feedback-celebration-styled';\n\nconst puzzleStickerLottieSettings = {\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n};\n\nconst PuzzleFeedbackCelebration: FC = () => {\n const { closeModal } = useModalActions();\n const { feedbackComments, rewards, onCloseModal } = useModalParams<IPuzzleFeedbackCelebration>();\n\n const [showHeader, setShowHeader] = useState(false);\n const [showLottie, setShowLottie] = useState(false);\n const [showText, setShowText] = useState(false);\n const [showButton, setShowButton] = useState(false);\n\n const { sticker } = rewards[0] || {};\n\n const stickerLottie = sticker ? getPuzzleStickerLottie(sticker) : undefined;\n\n const handleCloseModal = useCallback(() => {\n onCloseModal?.();\n closeModal();\n }, [closeModal, onCloseModal]);\n\n useEffect(() => {\n // Sequence: Header -> Lottie -> Text -> Button\n const headerTimer = setTimeout(() => {\n setShowHeader(true);\n }, 100);\n\n const lottieTimer = setTimeout(() => {\n setShowLottie(true);\n }, 400);\n\n const textTimer = setTimeout(() => {\n setShowText(true);\n }, 1000);\n\n const buttonTimer = setTimeout(() => {\n setShowButton(true);\n }, 1500);\n\n // Close modal after 4000ms\n const closeModalTimer = setTimeout(() => {\n handleCloseModal();\n }, 5500);\n\n return () => {\n clearTimeout(headerTimer);\n clearTimeout(lottieTimer);\n clearTimeout(textTimer);\n clearTimeout(buttonTimer);\n clearTimeout(closeModalTimer);\n };\n }, [handleCloseModal]);\n\n return (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $width=\"100%\">\n <Styled.PuzzleFeedbackModalWrapper $flexGapX={2.5} $widthX={33.5} $alignItems=\"center\">\n <Styled.ShimmerText $renderAs=\"ac2-black\" $show={showHeader}>\n Puzzle Reviewed\n </Styled.ShimmerText>\n\n <Styled.LottieContainer $widthX={12.5} $heightX={12.5} $show={showLottie}>\n {stickerLottie && (\n <LottieAnimation\n width={200}\n height={200}\n src={stickerLottie}\n settings={puzzleStickerLottieSettings}\n />\n )}\n </Styled.LottieContainer>\n\n <Styled.FeedbackText\n $width=\"80%\"\n $renderAs=\"ah3\"\n $color=\"WHITE_1\"\n $align=\"center\"\n $show={showText}\n >\n {feedbackComments}\n </Styled.FeedbackText>\n\n <Styled.CloseButtonWrapper $show={showButton}>\n <IconButton\n renderAs=\"secondary\"\n Icon={CrossIcon}\n size=\"small\"\n analyticsLabel=\"close_puzzle_feedback_modal\"\n onClick={handleCloseModal}\n />\n </Styled.CloseButtonWrapper>\n </Styled.PuzzleFeedbackModalWrapper>\n </FlexView>\n );\n};\n\nexport default PuzzleFeedbackCelebration;\n"],"names":["puzzleStickerLottieSettings","PuzzleFeedbackCelebration","closeModal","useModalActions","feedbackComments","rewards","onCloseModal","useModalParams","showHeader","setShowHeader","useState","showLottie","setShowLottie","showText","setShowText","showButton","setShowButton","sticker","stickerLottie","getPuzzleStickerLottie","handleCloseModal","useCallback","useEffect","headerTimer","lottieTimer","textTimer","buttonTimer","closeModalTimer","FlexView","jsxs","Styled.PuzzleFeedbackModalWrapper","jsx","Styled.ShimmerText","Styled.LottieContainer","LottieAnimation","Styled.FeedbackText","Styled.CloseButtonWrapper","IconButton","CrossIcon","PuzzleFeedbackCelebration$1"],"mappings":";;;;;;;;;;AAcA,MAAMA,IAA8B;AAAA,EAClC,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AACZ,GAEMC,IAAgC,MAAM;AACpC,QAAA,EAAE,YAAAC,MAAeC,KACjB,EAAE,kBAAAC,GAAkB,SAAAC,GAAS,cAAAC,MAAiBC,EAA2C,GAEzF,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5C,CAACC,GAAYC,CAAa,IAAIF,EAAS,EAAK,GAC5C,CAACG,GAAUC,CAAW,IAAIJ,EAAS,EAAK,GACxC,CAACK,GAAYC,CAAa,IAAIN,EAAS,EAAK,GAE5C,EAAE,SAAAO,EAAQ,IAAIZ,EAAQ,CAAC,KAAK,CAAA,GAE5Ba,IAAgBD,IAAUE,EAAuBF,CAAO,IAAI,QAE5DG,IAAmBC,EAAY,MAAM;AAC1B,IAAAf,KAAA,QAAAA,KACJJ;EAAA,GACV,CAACA,GAAYI,CAAY,CAAC;AAE7B,SAAAgB,EAAU,MAAM;AAER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AAA,QACT,MAAMC;AAAA,QACN,MAAK;AAAA,QACL,gBAAe;AAAA,QACf,SAASlB;AAAA,MAAA;AAAA,IAAA,GAEb;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ,GAEAmB,IAAetC;"}
|
@@ -1,40 +1,25 @@
|
|
1
|
-
import { ILLUSTRATIONS as
|
2
|
-
import { LOTTIE as E } from "../../../assets/lottie/lottie.js";
|
1
|
+
import { ILLUSTRATIONS as P } from "../../../assets/illustrations/illustrations.js";
|
3
2
|
const {
|
4
|
-
PUZZLE_PATTERN_BLUE:
|
5
|
-
PUZZLE_PATTERN_GREEN:
|
6
|
-
PUZZLE_PATTERN_ORANGE:
|
7
|
-
PUZZLE_PATTERN_PURPLE:
|
8
|
-
PUZZLE_PATTERN_YELLOW:
|
9
|
-
} =
|
10
|
-
switch (
|
3
|
+
PUZZLE_PATTERN_BLUE: r,
|
4
|
+
PUZZLE_PATTERN_GREEN: e,
|
5
|
+
PUZZLE_PATTERN_ORANGE: t,
|
6
|
+
PUZZLE_PATTERN_PURPLE: L,
|
7
|
+
PUZZLE_PATTERN_YELLOW: R
|
8
|
+
} = P, N = (E) => {
|
9
|
+
switch (E) {
|
11
10
|
case "YELLOW":
|
12
|
-
return
|
11
|
+
return R;
|
13
12
|
case "GREEN":
|
14
|
-
return t;
|
15
|
-
case "ORANGE":
|
16
|
-
return P;
|
17
|
-
case "PURPLE":
|
18
|
-
return T;
|
19
|
-
default:
|
20
13
|
return e;
|
21
|
-
}
|
22
|
-
}, O = (L) => {
|
23
|
-
switch (L) {
|
24
|
-
case "YELLOW":
|
25
|
-
return E.PUZZLE_YELLOW_LOTTIE;
|
26
|
-
case "GREEN":
|
27
|
-
return E.PUZZLE_GREEN_LOTTIE;
|
28
14
|
case "ORANGE":
|
29
|
-
return
|
15
|
+
return t;
|
30
16
|
case "PURPLE":
|
31
|
-
return
|
17
|
+
return L;
|
32
18
|
default:
|
33
|
-
return
|
19
|
+
return r;
|
34
20
|
}
|
35
21
|
};
|
36
22
|
export {
|
37
|
-
|
38
|
-
U as getPuzzleCardPattern
|
23
|
+
N as getPuzzleCardPattern
|
39
24
|
};
|
40
25
|
//# sourceMappingURL=puzzle-pattern.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-pattern.js","sources":["../../../../src/features/puzzles/utils/puzzle-pattern.ts"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\
|
1
|
+
{"version":3,"file":"puzzle-pattern.js","sources":["../../../../src/features/puzzles/utils/puzzle-pattern.ts"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst {\n PUZZLE_PATTERN_BLUE,\n PUZZLE_PATTERN_GREEN,\n PUZZLE_PATTERN_ORANGE,\n PUZZLE_PATTERN_PURPLE,\n PUZZLE_PATTERN_YELLOW,\n} = ILLUSTRATIONS;\n\nconst getPuzzleCardPattern = (imageHue: THueNames) => {\n switch (imageHue) {\n case 'YELLOW':\n return PUZZLE_PATTERN_YELLOW;\n case 'GREEN':\n return PUZZLE_PATTERN_GREEN;\n case 'ORANGE':\n return PUZZLE_PATTERN_ORANGE;\n case 'PURPLE':\n return PUZZLE_PATTERN_PURPLE;\n\n default:\n return PUZZLE_PATTERN_BLUE;\n }\n};\n\nexport { getPuzzleCardPattern };\n"],"names":["PUZZLE_PATTERN_BLUE","PUZZLE_PATTERN_GREEN","PUZZLE_PATTERN_ORANGE","PUZZLE_PATTERN_PURPLE","PUZZLE_PATTERN_YELLOW","ILLUSTRATIONS","getPuzzleCardPattern","imageHue"],"mappings":";AAIA,MAAM;AAAA,EACJ,qBAAAA;AAAA,EACA,sBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,uBAAAC;AACF,IAAIC,GAEEC,IAAuB,CAACC,MAAwB;AACpD,UAAQA,GAAU;AAAA,IAChB,KAAK;AACI,aAAAH;AAAA,IACT,KAAK;AACI,aAAAH;AAAA,IACT,KAAK;AACI,aAAAC;AAAA,IACT,KAAK;AACI,aAAAC;AAAA,IAET;AACS,aAAAH;AAAA,EACX;AACF;"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import o from "styled-components";
|
2
|
+
import e from "../layout/flex-view.js";
|
3
|
+
const a = o.div`
|
4
|
+
position: fixed;
|
5
|
+
top: 0;
|
6
|
+
bottom: 0;
|
7
|
+
left: ${({ $position: t }) => t === "left" ? 0 : "auto"};
|
8
|
+
right: ${({ $position: t }) => t === "right" ? 0 : "auto"};
|
9
|
+
width: 100%;
|
10
|
+
height: 100%;
|
11
|
+
z-index: ${({ $zIndex: t }) => t ?? 999};
|
12
|
+
pointer-events: ${({ $isOpen: t }) => t ? "auto" : "none"};
|
13
|
+
`, s = o(e)`
|
14
|
+
position: absolute;
|
15
|
+
top: 0;
|
16
|
+
bottom: 0;
|
17
|
+
${({ $position: t }) => t === "left" ? "left: 0;" : "right: 0;"}
|
18
|
+
width: ${({ $drawerWidth: t }) => typeof t == "number" ? `${t}px` : t};
|
19
|
+
transform: ${({ $isOpen: t, $position: i }) => t ? "translateX(0)" : i === "left" ? "translateX(-100%)" : "translateX(100%)"};
|
20
|
+
transition: transform 0.3s ease-in-out;
|
21
|
+
height: 100%;
|
22
|
+
`, p = o(e)`
|
23
|
+
position: absolute;
|
24
|
+
inset: 0;
|
25
|
+
backdrop-filter: blur(40px);
|
26
|
+
opacity: ${({ $isOpen: t }) => t ? 1 : 0};
|
27
|
+
transition: opacity 0.3s ease-in-out;
|
28
|
+
`;
|
29
|
+
export {
|
30
|
+
p as DrawerBackdrop,
|
31
|
+
a as DrawerContainer,
|
32
|
+
s as DrawerPanel
|
33
|
+
};
|
34
|
+
//# sourceMappingURL=drawer-styled.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"drawer-styled.js","sources":["../../../../src/features/ui/drawer/drawer-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../layout/flex-view';\n\ninterface DrawerContainerProps {\n $isOpen: boolean;\n $position: 'left' | 'right';\n $zIndex?: number;\n}\n\ninterface DrawerPanelProps extends DrawerContainerProps {\n $drawerWidth: number | string;\n}\n\nexport const DrawerContainer = styled.div<DrawerContainerProps>`\n position: fixed;\n top: 0;\n bottom: 0;\n left: ${({ $position }) => ($position === 'left' ? 0 : 'auto')};\n right: ${({ $position }) => ($position === 'right' ? 0 : 'auto')};\n width: 100%;\n height: 100%;\n z-index: ${({ $zIndex }) => $zIndex ?? 999};\n pointer-events: ${({ $isOpen }) => ($isOpen ? 'auto' : 'none')};\n`;\n\nexport const DrawerPanel = styled(FlexView)<DrawerPanelProps>`\n position: absolute;\n top: 0;\n bottom: 0;\n ${({ $position }) => ($position === 'left' ? 'left: 0;' : 'right: 0;')}\n width: ${({ $drawerWidth }) =>\n typeof $drawerWidth === 'number' ? `${$drawerWidth}px` : $drawerWidth};\n transform: ${({ $isOpen, $position }) =>\n $isOpen ? 'translateX(0)' : $position === 'left' ? 'translateX(-100%)' : 'translateX(100%)'};\n transition: transform 0.3s ease-in-out;\n height: 100%;\n`;\n\nexport const DrawerBackdrop = styled(FlexView)<{ $isOpen: boolean }>`\n position: absolute;\n inset: 0;\n backdrop-filter: blur(40px);\n opacity: ${({ $isOpen }) => ($isOpen ? 1 : 0)};\n transition: opacity 0.3s ease-in-out;\n`;\n"],"names":["DrawerContainer","styled","$position","$zIndex","$isOpen","DrawerPanel","FlexView","$drawerWidth","DrawerBackdrop"],"mappings":";;AAcO,MAAMA,IAAkBC,EAAO;AAAA;AAAA;AAAA;AAAA,UAI5B,CAAC,EAAE,WAAAC,QAAiBA,MAAc,SAAS,IAAI,MAAO;AAAA,WACrD,CAAC,EAAE,WAAAA,QAAiBA,MAAc,UAAU,IAAI,MAAO;AAAA;AAAA;AAAA,aAGrD,CAAC,EAAE,SAAAC,QAAcA,KAAW,GAAG;AAAA,oBACxB,CAAC,EAAE,SAAAC,EAAA,MAAeA,IAAU,SAAS,MAAO;AAAA,GAGnDC,IAAcJ,EAAOK,CAAQ;AAAA;AAAA;AAAA;AAAA,IAItC,CAAC,EAAE,WAAAJ,QAAiBA,MAAc,SAAS,aAAa,WAAY;AAAA,WAC7D,CAAC,EAAE,cAAAK,EACV,MAAA,OAAOA,KAAiB,WAAW,GAAGA,CAAY,OAAOA,CAAY;AAAA,eAC1D,CAAC,EAAE,SAAAH,GAAS,WAAAF,QACvBE,IAAU,kBAAkBF,MAAc,SAAS,sBAAsB,kBAAkB;AAAA;AAAA;AAAA,GAKlFM,IAAiBP,EAAOK,CAAQ;AAAA;AAAA;AAAA;AAAA,aAIhC,CAAC,EAAE,SAAAF,EAAA,MAAeA,IAAU,IAAI,CAAE;AAAA;AAAA;"}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { jsxs as s, jsx as c } from "react/jsx-runtime";
|
2
|
+
import { memo as $, useRef as w, useEffect as k } from "react";
|
3
|
+
import { DrawerContainer as D, DrawerBackdrop as _, DrawerPanel as p } from "./drawer-styled.js";
|
4
|
+
const E = $(
|
5
|
+
({ isOpen: r, onClose: e, children: i, drawerWidth: o = 300, position: n = "left", zIndex: u, theme: m = "dark" }) => {
|
6
|
+
const t = w(null);
|
7
|
+
k(() => {
|
8
|
+
const d = (f) => {
|
9
|
+
t.current && !t.current.contains(f.target) && (e == null || e());
|
10
|
+
};
|
11
|
+
return r && document.addEventListener("mousedown", d), () => {
|
12
|
+
document.removeEventListener("mousedown", d);
|
13
|
+
};
|
14
|
+
}, [r, e]);
|
15
|
+
const a = m === "dark";
|
16
|
+
return /* @__PURE__ */ s(D, { $isOpen: r, $position: n, $zIndex: u, children: [
|
17
|
+
/* @__PURE__ */ c(
|
18
|
+
_,
|
19
|
+
{
|
20
|
+
$isOpen: r,
|
21
|
+
onClick: e,
|
22
|
+
$background: a ? "WHITE_T_10" : "BLACK_T_38"
|
23
|
+
}
|
24
|
+
),
|
25
|
+
/* @__PURE__ */ c(
|
26
|
+
p,
|
27
|
+
{
|
28
|
+
ref: t,
|
29
|
+
$isOpen: r,
|
30
|
+
$position: n,
|
31
|
+
$drawerWidth: o,
|
32
|
+
$background: a ? "BLACK_3" : "WHITE_3",
|
33
|
+
children: i
|
34
|
+
}
|
35
|
+
)
|
36
|
+
] });
|
37
|
+
}
|
38
|
+
), L = E;
|
39
|
+
export {
|
40
|
+
L as default
|
41
|
+
};
|
42
|
+
//# sourceMappingURL=drawer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"drawer.js","sources":["../../../../src/features/ui/drawer/drawer.tsx"],"sourcesContent":["import type { IDrawerProps } from './drawer-types';\nimport type { FC } from 'react';\n\nimport { memo, useEffect, useRef } from 'react';\n\nimport * as Styled from './drawer-styled';\n\nconst Drawer: FC<IDrawerProps> = memo(\n ({ isOpen, onClose, children, drawerWidth = 300, position = 'left', zIndex, theme = 'dark' }) => {\n const drawerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n if (drawerRef.current && !drawerRef.current.contains(e.target as Node)) {\n onClose?.();\n }\n };\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, [isOpen, onClose]);\n\n const isDarkTheme = theme === 'dark';\n\n return (\n <Styled.DrawerContainer $isOpen={isOpen} $position={position} $zIndex={zIndex}>\n <Styled.DrawerBackdrop\n $isOpen={isOpen}\n onClick={onClose}\n $background={isDarkTheme ? 'WHITE_T_10' : 'BLACK_T_38'}\n />\n <Styled.DrawerPanel\n ref={drawerRef}\n $isOpen={isOpen}\n $position={position}\n $drawerWidth={drawerWidth}\n $background={isDarkTheme ? 'BLACK_3' : 'WHITE_3'}\n >\n {children}\n </Styled.DrawerPanel>\n </Styled.DrawerContainer>\n );\n },\n);\n\nexport default Drawer;\n"],"names":["Drawer","memo","isOpen","onClose","children","drawerWidth","position","zIndex","theme","drawerRef","useRef","useEffect","handleClickOutside","e","isDarkTheme","jsxs","Styled.DrawerContainer","jsx","Styled.DrawerBackdrop","Styled.DrawerPanel","Drawer$1"],"mappings":";;;AAOA,MAAMA,IAA2BC;AAAA,EAC/B,CAAC,EAAE,QAAAC,GAAQ,SAAAC,GAAS,UAAAC,GAAU,aAAAC,IAAc,KAAK,UAAAC,IAAW,QAAQ,QAAAC,GAAQ,OAAAC,IAAQ,OAAA,MAAa;AACzF,UAAAC,IAAYC,EAAuB,IAAI;AAE7C,IAAAC,EAAU,MAAM;AACR,YAAAC,IAAqB,CAACC,MAAkB;AACxC,QAAAJ,EAAU,WAAW,CAACA,EAAU,QAAQ,SAASI,EAAE,MAAc,MACzDV,KAAA,QAAAA;AAAA,MACZ;AAGF,aAAID,KACO,SAAA,iBAAiB,aAAaU,CAAkB,GAGpD,MAAM;AACF,iBAAA,oBAAoB,aAAaA,CAAkB;AAAA,MAAA;AAAA,IAC9D,GACC,CAACV,GAAQC,CAAO,CAAC;AAEpB,UAAMW,IAAcN,MAAU;AAG5B,WAAA,gBAAAO,EAACC,GAAA,EAAuB,SAASd,GAAQ,WAAWI,GAAU,SAASC,GACrE,UAAA;AAAA,MAAA,gBAAAU;AAAA,QAACC;AAAAA,QAAA;AAAA,UACC,SAAShB;AAAA,UACT,SAASC;AAAA,UACT,aAAaW,IAAc,eAAe;AAAA,QAAA;AAAA,MAC5C;AAAA,MACA,gBAAAG;AAAA,QAACE;AAAAA,QAAA;AAAA,UACC,KAAKV;AAAA,UACL,SAASP;AAAA,UACT,WAAWI;AAAA,UACX,cAAcD;AAAA,UACd,aAAaS,IAAc,YAAY;AAAA,UAEtC,UAAAV;AAAA,QAAA;AAAA,MACH;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF,GAEAgB,IAAepB;"}
|
@@ -14,7 +14,7 @@ const p = t(i)`
|
|
14
14
|
overflow: hidden;
|
15
15
|
position: relative;
|
16
16
|
`, u = g(
|
17
|
-
({ borderRadius: n = 0, borderColor: r, withLoader: a, ...o }) => {
|
17
|
+
({ borderRadius: n = 0, borderColor: r, withLoader: a = !1, ...o }) => {
|
18
18
|
const { width: s, height: d } = o, [m, l] = f(!0);
|
19
19
|
return /* @__PURE__ */ h(
|
20
20
|
L,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"image.js","sources":["../../../../src/features/ui/image/image.tsx"],"sourcesContent":["import type { IImageProps } from './image-types';\n\nimport { useState, memo } from 'react';\nimport styled from 'styled-components';\n\nimport { skeletonLoadingAnimation } from '../constants/style';\nimport FlexView from '../layout/flex-view';\n\nconst LoadingFlexView = styled(FlexView)`\n animation: ${skeletonLoadingAnimation} 2s linear infinite;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n`;\n\nconst ImageWrapper = styled(FlexView)`\n overflow: hidden;\n position: relative;\n`;\n\nconst Image: React.FC<IImageProps> = memo(\n ({ borderRadius = 0, borderColor, withLoader, ...props }) => {\n const { width, height } = props;\n const [isLoading, setIsLoading] = useState(true);\n const handleImgLoaded = () => {\n setIsLoading(false);\n };\n const showLoader = isLoading && withLoader;\n\n return (\n <ImageWrapper\n $width={width}\n $height={height}\n $borderColor={borderColor}\n $borderRadius={borderRadius}\n >\n {showLoader && <LoadingFlexView $inherit={true} />}\n <img onLoad={handleImgLoaded} {...props} />\n </ImageWrapper>\n );\n },\n);\n\nexport default Image;\n"],"names":["LoadingFlexView","styled","FlexView","skeletonLoadingAnimation","ImageWrapper","Image","memo","borderRadius","borderColor","withLoader","props","width","height","isLoading","setIsLoading","useState","jsxs","jsx","Image$1"],"mappings":";;;;;AAQA,MAAMA,IAAkBC,EAAOC,CAAQ;AAAA,eACxBC,CAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQjCC,IAAeH,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAK9BG,IAA+BC;AAAA,EACnC,CAAC,EAAE,cAAAC,IAAe,GAAG,aAAAC,GAAa,YAAAC,
|
1
|
+
{"version":3,"file":"image.js","sources":["../../../../src/features/ui/image/image.tsx"],"sourcesContent":["import type { IImageProps } from './image-types';\n\nimport { useState, memo } from 'react';\nimport styled from 'styled-components';\n\nimport { skeletonLoadingAnimation } from '../constants/style';\nimport FlexView from '../layout/flex-view';\n\nconst LoadingFlexView = styled(FlexView)`\n animation: ${skeletonLoadingAnimation} 2s linear infinite;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n`;\n\nconst ImageWrapper = styled(FlexView)`\n overflow: hidden;\n position: relative;\n`;\n\nconst Image: React.FC<IImageProps> = memo(\n ({ borderRadius = 0, borderColor, withLoader = false, ...props }) => {\n const { width, height } = props;\n const [isLoading, setIsLoading] = useState(true);\n const handleImgLoaded = () => {\n setIsLoading(false);\n };\n const showLoader = isLoading && withLoader;\n\n return (\n <ImageWrapper\n $width={width}\n $height={height}\n $borderColor={borderColor}\n $borderRadius={borderRadius}\n >\n {showLoader && <LoadingFlexView $inherit={true} />}\n <img onLoad={handleImgLoaded} {...props} />\n </ImageWrapper>\n );\n },\n);\n\nexport default Image;\n"],"names":["LoadingFlexView","styled","FlexView","skeletonLoadingAnimation","ImageWrapper","Image","memo","borderRadius","borderColor","withLoader","props","width","height","isLoading","setIsLoading","useState","jsxs","jsx","Image$1"],"mappings":";;;;;AAQA,MAAMA,IAAkBC,EAAOC,CAAQ;AAAA,eACxBC,CAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQjCC,IAAeH,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAK9BG,IAA+BC;AAAA,EACnC,CAAC,EAAE,cAAAC,IAAe,GAAG,aAAAC,GAAa,YAAAC,IAAa,IAAO,GAAGC,QAAY;AAC7D,UAAA,EAAE,OAAAC,GAAO,QAAAC,EAAW,IAAAF,GACpB,CAACG,GAAWC,CAAY,IAAIC,EAAS,EAAI;AAO7C,WAAA,gBAAAC;AAAA,MAACZ;AAAA,MAAA;AAAA,QACC,QAAQO;AAAA,QACR,SAASC;AAAA,QACT,cAAcJ;AAAA,QACd,eAAeD;AAAA,QAEd,UAAA;AAAA,UATcM,KAAaJ,KASb,gBAAAQ,EAACjB,GAAgB,EAAA,UAAU,GAAM,CAAA;AAAA,UAC/C,gBAAAiB,EAAA,OAAA,EAAI,QAbe,MAAM;AAC5B,YAAAH,EAAa,EAAK;AAAA,UAAA,GAYe,GAAGJ,EAAO,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG/C;AACF,GAEAQ,IAAeb;"}
|