@cuemath/leap 3.5.32-as3 → 3.5.32-as5
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/features/timeline/comps/new-progress-intro-modal/new-progress-intro-modal-constants.js +7 -7
- package/dist/features/timeline/comps/new-progress-intro-modal/new-progress-intro-modal-constants.js.map +1 -1
- package/dist/features/timeline/comps/new-progress-intro-modal/new-progress-intro-modal.js +13 -13
- package/dist/features/timeline/comps/new-progress-intro-modal/new-progress-intro-modal.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js +43 -43
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card/activities-card.js +32 -32
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card/activities-card.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js +39 -88
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activity-puzzle-card.js +64 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activity-puzzle-card.js.map +1 -0
- package/package.json +1 -1
package/dist/features/timeline/comps/new-progress-intro-modal/new-progress-intro-modal-constants.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ILLUSTRATIONS as
|
|
2
|
-
const
|
|
1
|
+
import { ILLUSTRATIONS as i } from "../../../../assets/illustrations/illustrations.js";
|
|
2
|
+
const o = [
|
|
3
3
|
{
|
|
4
4
|
title: "Daily Progress",
|
|
5
|
-
description: "
|
|
6
|
-
icon:
|
|
5
|
+
description: "Track both in-class and at-home activities in real-time",
|
|
6
|
+
icon: i.CLOCK_PURPLE
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
title: "Monthly Reports",
|
|
10
|
-
description: "Get
|
|
11
|
-
icon:
|
|
10
|
+
description: "Get insights into your child's monthly progress and achievements",
|
|
11
|
+
icon: i.CALENDAR_PURPLE_2
|
|
12
12
|
}
|
|
13
13
|
];
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
o as PROGRESS_INFO
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=new-progress-intro-modal-constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-progress-intro-modal-constants.js","sources":["../../../../../src/features/timeline/comps/new-progress-intro-modal/new-progress-intro-modal-constants.ts"],"sourcesContent":["import { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\n\nexport const PROGRESS_INFO: {\n title: string;\n description: string;\n icon: string;\n}[] = [\n {\n title: 'Daily Progress',\n description: '
|
|
1
|
+
{"version":3,"file":"new-progress-intro-modal-constants.js","sources":["../../../../../src/features/timeline/comps/new-progress-intro-modal/new-progress-intro-modal-constants.ts"],"sourcesContent":["import { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\n\nexport const PROGRESS_INFO: {\n title: string;\n description: string;\n icon: string;\n}[] = [\n {\n title: 'Daily Progress',\n description: 'Track both in-class and at-home activities in real-time',\n icon: ILLUSTRATIONS.CLOCK_PURPLE,\n },\n {\n title: 'Monthly Reports',\n description: `Get insights into your child's monthly progress and achievements`,\n icon: ILLUSTRATIONS.CALENDAR_PURPLE_2,\n },\n];\n"],"names":["PROGRESS_INFO","ILLUSTRATIONS"],"mappings":";AAEO,MAAMA,IAIP;AAAA,EACJ;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAMC,EAAc;AAAA,EACtB;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAMA,EAAc;AAAA,EACtB;AACF;"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
2
|
+
import { memo as d } from "react";
|
|
3
3
|
import r from "../../../ui/layout/flex-view.js";
|
|
4
4
|
import n from "../../../ui/separator/separator.js";
|
|
5
5
|
import l from "../../../ui/image/image.js";
|
|
6
6
|
import { ILLUSTRATIONS as a } from "../../../../assets/illustrations/illustrations.js";
|
|
7
|
-
import
|
|
8
|
-
import { PROGRESS_INFO as
|
|
9
|
-
import
|
|
10
|
-
const
|
|
7
|
+
import i from "../../../ui/text/text.js";
|
|
8
|
+
import { PROGRESS_INFO as h } from "./new-progress-intro-modal-constants.js";
|
|
9
|
+
import g from "../../../ui/buttons/button/button.js";
|
|
10
|
+
const m = ({ onClose: s }) => /* @__PURE__ */ t(r, { children: [
|
|
11
11
|
/* @__PURE__ */ t(r, { $background: "PURPLE_4", $alignItems: "center", $justifyContent: "center", children: [
|
|
12
12
|
/* @__PURE__ */ e(n, { heightX: 1.5 }),
|
|
13
13
|
/* @__PURE__ */ e(r, { $gutterX: 1.5, $alignItems: "center", $justifyContent: "center", $gap: 50, children: /* @__PURE__ */ e(l, { src: a.PROGRESS_BAR_PURPLE }) })
|
|
14
14
|
] }),
|
|
15
15
|
/* @__PURE__ */ t(r, { $gutterX: 2, $gapX: 1.5, children: [
|
|
16
16
|
/* @__PURE__ */ t(r, { children: [
|
|
17
|
-
/* @__PURE__ */ e(
|
|
17
|
+
/* @__PURE__ */ e(i, { $renderAs: "ab1-bold", children: "Introducing: Enhanced Progress Tracking" }),
|
|
18
18
|
/* @__PURE__ */ e(n, { height: 4 }),
|
|
19
|
-
/* @__PURE__ */ e(
|
|
19
|
+
/* @__PURE__ */ e(i, { $renderAs: "ub1", children: "View your child's complete learning journey all in one place. Here’s what’s new:" })
|
|
20
20
|
] }),
|
|
21
21
|
/* @__PURE__ */ e(n, { heightX: 1.5 }),
|
|
22
|
-
|
|
22
|
+
h.map((o, c) => /* @__PURE__ */ t(
|
|
23
23
|
r,
|
|
24
24
|
{
|
|
25
25
|
$flexDirection: "row",
|
|
26
26
|
$alignItems: "flex-start",
|
|
27
27
|
$flexGapX: 0.5,
|
|
28
28
|
children: [
|
|
29
|
-
/* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(l, { src:
|
|
29
|
+
/* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(l, { src: o.icon, width: 32, height: 32 }) }),
|
|
30
30
|
/* @__PURE__ */ t(r, { $gutter: 4, $flex: 1, children: [
|
|
31
|
-
/* @__PURE__ */ e(
|
|
32
|
-
/* @__PURE__ */ e(
|
|
31
|
+
/* @__PURE__ */ e(i, { $renderAs: "ub1-bold", children: o.title }),
|
|
32
|
+
/* @__PURE__ */ e(i, { $renderAs: "ub1", children: o.description }),
|
|
33
33
|
/* @__PURE__ */ e(n, { heightX: 1.5 })
|
|
34
34
|
] })
|
|
35
35
|
]
|
|
@@ -37,7 +37,7 @@ const g = ({ onClose: s }) => /* @__PURE__ */ t(r, { children: [
|
|
|
37
37
|
`progress-info-${c}`
|
|
38
38
|
)),
|
|
39
39
|
/* @__PURE__ */ e(r, { $alignItems: "center", $justifyContent: "center", $gapX: 0.5, children: /* @__PURE__ */ e(
|
|
40
|
-
|
|
40
|
+
g,
|
|
41
41
|
{
|
|
42
42
|
width: 240,
|
|
43
43
|
label: "View progress",
|
|
@@ -47,7 +47,7 @@ const g = ({ onClose: s }) => /* @__PURE__ */ t(r, { children: [
|
|
|
47
47
|
}
|
|
48
48
|
) })
|
|
49
49
|
] })
|
|
50
|
-
] }), R =
|
|
50
|
+
] }), R = d(m);
|
|
51
51
|
export {
|
|
52
52
|
R as default
|
|
53
53
|
};
|
package/dist/features/timeline/comps/new-progress-intro-modal/new-progress-intro-modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-progress-intro-modal.js","sources":["../../../../../src/features/timeline/comps/new-progress-intro-modal/new-progress-intro-modal.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Image from '../../../ui/image/image';\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Text from '../../../ui/text/text';\nimport { PROGRESS_INFO } from './new-progress-intro-modal-constants';\nimport Button from '../../../ui/buttons/button/button';\n\nconst NewProgressIntroModal = ({ onClose }: { onClose: () => void }) => {\n return (\n <FlexView>\n <FlexView $background=\"PURPLE_4\" $alignItems=\"center\" $justifyContent=\"center\">\n <Separator heightX={1.5} />\n <FlexView $gutterX={1.5} $alignItems=\"center\" $justifyContent=\"center\" $gap={50}>\n <Image src={ILLUSTRATIONS.PROGRESS_BAR_PURPLE} />\n </FlexView>\n </FlexView>\n <FlexView $gutterX={2} $gapX={1.5}>\n <FlexView>\n <Text $renderAs=\"ab1-bold\">
|
|
1
|
+
{"version":3,"file":"new-progress-intro-modal.js","sources":["../../../../../src/features/timeline/comps/new-progress-intro-modal/new-progress-intro-modal.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Image from '../../../ui/image/image';\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Text from '../../../ui/text/text';\nimport { PROGRESS_INFO } from './new-progress-intro-modal-constants';\nimport Button from '../../../ui/buttons/button/button';\n\nconst NewProgressIntroModal = ({ onClose }: { onClose: () => void }) => {\n return (\n <FlexView>\n <FlexView $background=\"PURPLE_4\" $alignItems=\"center\" $justifyContent=\"center\">\n <Separator heightX={1.5} />\n <FlexView $gutterX={1.5} $alignItems=\"center\" $justifyContent=\"center\" $gap={50}>\n <Image src={ILLUSTRATIONS.PROGRESS_BAR_PURPLE} />\n </FlexView>\n </FlexView>\n <FlexView $gutterX={2} $gapX={1.5}>\n <FlexView>\n <Text $renderAs=\"ab1-bold\">Introducing: Enhanced Progress Tracking</Text>\n <Separator height={4} />\n <Text $renderAs=\"ub1\">\n View your child's complete learning journey all in one place. Here’s what’s new:\n </Text>\n </FlexView>\n <Separator heightX={1.5} />\n {PROGRESS_INFO.map((item, index) => (\n <FlexView\n key={`progress-info-${index}`}\n $flexDirection=\"row\"\n $alignItems=\"flex-start\"\n $flexGapX={0.5}\n >\n <FlexView>\n <Image src={item.icon} width={32} height={32} />\n </FlexView>\n <FlexView $gutter={4} $flex={1}>\n <Text $renderAs=\"ub1-bold\">{item.title}</Text>\n <Text $renderAs=\"ub1\">{item.description}</Text>\n <Separator heightX={1.5} />\n </FlexView>\n </FlexView>\n ))}\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" $gapX={0.5}>\n <Button\n width={240}\n label=\"View progress\"\n renderAs=\"black\"\n shape=\"square\"\n onClick={onClose}\n />\n </FlexView>\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(NewProgressIntroModal);\n"],"names":["NewProgressIntroModal","onClose","FlexView","jsxs","jsx","Separator","Image","ILLUSTRATIONS","Text","PROGRESS_INFO","item","index","Button","newProgressIntroModal","memo"],"mappings":";;;;;;;;;AAUA,MAAMA,IAAwB,CAAC,EAAE,SAAAC,0BAE5BC,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACD,KAAS,aAAY,YAAW,aAAY,UAAS,iBAAgB,UACpE,UAAA;AAAA,IAAC,gBAAAE,EAAAC,GAAA,EAAU,SAAS,IAAK,CAAA;AAAA,IACxB,gBAAAD,EAAAF,GAAA,EAAS,UAAU,KAAK,aAAY,UAAS,iBAAgB,UAAS,MAAM,IAC3E,UAAC,gBAAAE,EAAAE,GAAA,EAAM,KAAKC,EAAc,oBAAqB,CAAA,GACjD;AAAA,EAAA,GACF;AAAA,EACC,gBAAAJ,EAAAD,GAAA,EAAS,UAAU,GAAG,OAAO,KAC5B,UAAA;AAAA,IAAA,gBAAAC,EAACD,GACC,EAAA,UAAA;AAAA,MAAC,gBAAAE,EAAAI,GAAA,EAAK,WAAU,YAAW,UAAuC,2CAAA;AAAA,MAClE,gBAAAJ,EAACC,GAAU,EAAA,QAAQ,EAAG,CAAA;AAAA,MACrB,gBAAAD,EAAAI,GAAA,EAAK,WAAU,OAAM,UAEtB,oFAAA;AAAA,IAAA,GACF;AAAA,IACA,gBAAAJ,EAACC,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,IACxBI,EAAc,IAAI,CAACC,GAAMC,MACxB,gBAAAR;AAAA,MAACD;AAAA,MAAA;AAAA,QAEC,gBAAe;AAAA,QACf,aAAY;AAAA,QACZ,WAAW;AAAA,QAEX,UAAA;AAAA,UAAC,gBAAAE,EAAAF,GAAA,EACC,UAAC,gBAAAE,EAAAE,GAAA,EAAM,KAAKI,EAAK,MAAM,OAAO,IAAI,QAAQ,GAAA,CAAI,EAChD,CAAA;AAAA,UACC,gBAAAP,EAAAD,GAAA,EAAS,SAAS,GAAG,OAAO,GAC3B,UAAA;AAAA,YAAA,gBAAAE,EAACI,GAAK,EAAA,WAAU,YAAY,UAAAE,EAAK,OAAM;AAAA,YACtC,gBAAAN,EAAAI,GAAA,EAAK,WAAU,OAAO,YAAK,aAAY;AAAA,YACxC,gBAAAJ,EAACC,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,UAAA,GAC3B;AAAA,QAAA;AAAA,MAAA;AAAA,MAZK,iBAAiBM,CAAK;AAAA,IAAA,CAc9B;AAAA,sBACAT,GAAS,EAAA,aAAY,UAAS,iBAAgB,UAAS,OAAO,KAC7D,UAAA,gBAAAE;AAAA,MAACQ;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,QACP,OAAM;AAAA,QACN,UAAS;AAAA,QACT,OAAM;AAAA,QACN,SAASX;AAAA,MAAA;AAAA,IAAA,GAEb;AAAA,EAAA,GACF;AACF,EAAA,CAAA,GAIWY,IAAAC,EAAKd,CAAqB;"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as x } from "react";
|
|
3
|
-
import { GoalsSection as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as t, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { memo as x, useCallback as P } from "react";
|
|
3
|
+
import { GoalsSection as I } from "./monthly-card.styled.js";
|
|
4
|
+
import M from "../../monthly-report/comps/goals/goals-card/goals-card.js";
|
|
5
5
|
import n from "../../../../ui/layout/flex-view.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
6
|
+
import w from "../../../../ui/buttons/clickable/clickable.js";
|
|
7
|
+
import E from "../../../../../assets/line-icons/icons/carat-right.js";
|
|
8
|
+
import _ from "../../../../ui/text/text.js";
|
|
9
|
+
import u from "../../../../ui/image/image.js";
|
|
10
|
+
import { monthNames as L, REPORT_CONFIG as d } from "../../constants.js";
|
|
11
11
|
import { REPORT_TYPE as o } from "../../monthly-timeline-types.js";
|
|
12
|
-
import { ILLUSTRATIONS as
|
|
13
|
-
const
|
|
14
|
-
report:
|
|
15
|
-
year:
|
|
16
|
-
month:
|
|
17
|
-
onReportClick:
|
|
18
|
-
reportType:
|
|
19
|
-
courseStream:
|
|
12
|
+
import { ILLUSTRATIONS as X } from "../../../../../assets/illustrations/illustrations.js";
|
|
13
|
+
const G = ({
|
|
14
|
+
report: i,
|
|
15
|
+
year: r,
|
|
16
|
+
month: m,
|
|
17
|
+
onReportClick: c,
|
|
18
|
+
reportType: e,
|
|
19
|
+
courseStream: R
|
|
20
20
|
}) => {
|
|
21
|
-
var
|
|
22
|
-
const b = () => {
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
let
|
|
26
|
-
|
|
21
|
+
var f, $, g;
|
|
22
|
+
const b = P(() => {
|
|
23
|
+
c && c((i == null ? void 0 : i.id) || "", e, r, L[m - 1] || "");
|
|
24
|
+
}, [m, c, i == null ? void 0 : i.id, e, r]);
|
|
25
|
+
let a = { label: "", icon: "" };
|
|
26
|
+
e === o.PTM ? a = d.PTM ?? { label: "Report", icon: "full" } : e === o.MPR_V1 ? a = d.MPR_V1 ?? { label: "Report", icon: "full" } : e === o.MPR_V2 && (a = d["MPR_V2_" + (R || "").toLowerCase()] ?? {
|
|
27
27
|
label: "Report",
|
|
28
28
|
icon: "full"
|
|
29
29
|
});
|
|
30
|
-
const
|
|
31
|
-
return
|
|
30
|
+
const h = e === o.PTM ? [] : ((f = i == null ? void 0 : i.progress_data) == null ? void 0 : f.user_milestones) || [];
|
|
31
|
+
return e === o.MPR_V2 && !((g = ($ = i == null ? void 0 : i.progress_data) == null ? void 0 : $.user_milestones) != null && g.length) ? /* @__PURE__ */ t(
|
|
32
32
|
n,
|
|
33
33
|
{
|
|
34
34
|
$flexDirection: "row",
|
|
@@ -40,27 +40,27 @@ const T = ({
|
|
|
40
40
|
$background: "WHITE_3",
|
|
41
41
|
$heightX: 4.5,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ l(u, { src: X.NO_REPORT, alt: "report icon", withLoader: !0, width: 32, height: 32 }),
|
|
44
|
+
/* @__PURE__ */ l(_, { $renderAs: "ub2", $color: "BLACK_1", children: "Report unavailable - no activity this month." })
|
|
45
45
|
]
|
|
46
46
|
}
|
|
47
|
-
) : /* @__PURE__ */
|
|
48
|
-
|
|
47
|
+
) : /* @__PURE__ */ l(
|
|
48
|
+
w,
|
|
49
49
|
{
|
|
50
50
|
onClick: b,
|
|
51
|
-
disabled: !(
|
|
51
|
+
disabled: !(i != null && i.id) && e !== o.MPR_V1,
|
|
52
52
|
label: "Report Card click",
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
-
!!
|
|
55
|
-
|
|
53
|
+
children: /* @__PURE__ */ t(n, { $flexGap: 1, $borderColor: "BLACK_1", children: [
|
|
54
|
+
!!h.length && /* @__PURE__ */ l(I, { $flexGap: 1, children: h.map((s, C) => /* @__PURE__ */ l(
|
|
55
|
+
M,
|
|
56
56
|
{
|
|
57
|
-
category:
|
|
58
|
-
milestone:
|
|
57
|
+
category: s.goal_category,
|
|
58
|
+
milestone: s,
|
|
59
59
|
isExpended: !1
|
|
60
60
|
},
|
|
61
|
-
|
|
61
|
+
s.user_milestone_id || C
|
|
62
62
|
)) }),
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ t(
|
|
64
64
|
n,
|
|
65
65
|
{
|
|
66
66
|
$flexDirection: "row",
|
|
@@ -69,19 +69,19 @@ const T = ({
|
|
|
69
69
|
$background: "BLACK_1",
|
|
70
70
|
$heightX: 3,
|
|
71
71
|
children: [
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ t(n, { $flexDirection: "row", $alignItems: "center", $flexGapX: 0.5, $gutterX: 1, children: [
|
|
73
|
+
/* @__PURE__ */ l(u, { src: a.icon, alt: "report icon", withLoader: !0, width: 32, height: 32 }),
|
|
74
|
+
/* @__PURE__ */ l(_, { $renderAs: "ub2-bold", $color: "WHITE", children: a.label })
|
|
75
75
|
] }),
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ l(n, { $gutterX: 0.75, children: /* @__PURE__ */ l(E, { width: 24, height: 24, color: "WHITE" }) })
|
|
77
77
|
]
|
|
78
78
|
}
|
|
79
79
|
)
|
|
80
80
|
] })
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
|
-
},
|
|
83
|
+
}, S = x(G);
|
|
84
84
|
export {
|
|
85
|
-
|
|
85
|
+
S as default
|
|
86
86
|
};
|
|
87
87
|
//# sourceMappingURL=monthly-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-card.js","sources":["../../../../../../src/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport { type IMonthlyReportCardProps } from './monthly-card-types';\nimport * as Styled from './monthly-card.styled';\nimport GoalsCard from '../../monthly-report/comps/goals/goals-card/goals-card';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport Text from '../../../../ui/text/text';\nimport Image from '../../../../ui/image/image';\nimport { monthNames, REPORT_CONFIG } from '../../constants';\nimport { REPORT_TYPE } from '../../monthly-timeline-types';\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\n\nconst MonthlyReportCard: FC<IMonthlyReportCardProps> = ({\n report,\n year,\n month,\n onReportClick,\n reportType,\n courseStream,\n}) => {\n const handleReportClick = () => {\n if (onReportClick) {\n onReportClick(report?.id || '', reportType, year, monthNames[month - 1] || '');\n }\n };\n\n let config = { label: '', icon: '' };\n\n if (reportType === REPORT_TYPE.PTM) {\n config = REPORT_CONFIG.PTM ?? { label: 'Report', icon: 'full' };\n } else if (reportType === REPORT_TYPE.MPR_V1) {\n config = REPORT_CONFIG.MPR_V1 ?? { label: 'Report', icon: 'full' };\n } else if (reportType === REPORT_TYPE.MPR_V2) {\n config = REPORT_CONFIG['MPR_V2_' + (courseStream || '').toLowerCase()] ?? {\n label: 'Report',\n icon: 'full',\n };\n }\n\n const reportMilestones =\n reportType === REPORT_TYPE.PTM ? [] : report?.progress_data?.user_milestones || [];\n\n if (reportType === REPORT_TYPE.MPR_V2 && !report?.progress_data?.user_milestones?.length) {\n return (\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGapX={0.5}\n $gutterX={1}\n $gapX={1}\n $borderColor=\"WHITE_5\"\n $background=\"WHITE_3\"\n $heightX={4.5}\n >\n <Image src={ILLUSTRATIONS.NO_REPORT} alt=\"report icon\" withLoader width={32} height={32} />\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n Report unavailable - no activity this month.\n </Text>\n </FlexView>\n );\n }\n\n return (\n <Clickable\n onClick={handleReportClick}\n disabled={!report?.id && reportType !== REPORT_TYPE.MPR_V1}\n label=\"Report Card click\"\n >\n <FlexView $flexGap={1} $borderColor=\"BLACK_1\">\n {!!reportMilestones.length && (\n <Styled.GoalsSection $flexGap={1}>\n {reportMilestones.map((milestone, milestoneIndex) => (\n <GoalsCard\n key={milestone.user_milestone_id || milestoneIndex}\n category={milestone.goal_category}\n milestone={milestone}\n isExpended={false}\n />\n ))}\n </Styled.GoalsSection>\n )}\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $background=\"BLACK_1\"\n $heightX={3}\n >\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={0.5} $gutterX={1}>\n <Image src={config.icon} alt=\"report icon\" withLoader width={32} height={32} />\n <Text $renderAs=\"ub2-bold\" $color=\"WHITE\">\n {config.label}\n </Text>\n </FlexView>\n <FlexView $gutterX={0.75}>\n <CaratRightIcon width={24} height={24} color=\"WHITE\" />\n </FlexView>\n </FlexView>\n </FlexView>\n </Clickable>\n );\n};\n\nexport default memo(MonthlyReportCard);\n"],"names":["MonthlyReportCard","report","year","month","onReportClick","reportType","courseStream","handleReportClick","monthNames","config","REPORT_TYPE","REPORT_CONFIG","reportMilestones","_a","_c","_b","jsxs","FlexView","jsx","Image","ILLUSTRATIONS","Text","Clickable","Styled.GoalsSection","milestone","milestoneIndex","GoalsCard","CaratRightIcon","MonthlyReportCard$1","memo"],"mappings":";;;;;;;;;;;;AAcA,MAAMA,IAAiD,CAAC;AAAA,EACtD,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AACF,MAAM;;
|
|
1
|
+
{"version":3,"file":"monthly-card.js","sources":["../../../../../../src/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\n\nimport { type IMonthlyReportCardProps } from './monthly-card-types';\nimport * as Styled from './monthly-card.styled';\nimport GoalsCard from '../../monthly-report/comps/goals/goals-card/goals-card';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport Text from '../../../../ui/text/text';\nimport Image from '../../../../ui/image/image';\nimport { monthNames, REPORT_CONFIG } from '../../constants';\nimport { REPORT_TYPE } from '../../monthly-timeline-types';\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\n\nconst MonthlyReportCard: FC<IMonthlyReportCardProps> = ({\n report,\n year,\n month,\n onReportClick,\n reportType,\n courseStream,\n}) => {\n const handleReportClick = useCallback(() => {\n if (onReportClick) {\n onReportClick(report?.id || '', reportType, year, monthNames[month - 1] || '');\n }\n }, [month, onReportClick, report?.id, reportType, year]);\n\n let config = { label: '', icon: '' };\n\n if (reportType === REPORT_TYPE.PTM) {\n config = REPORT_CONFIG.PTM ?? { label: 'Report', icon: 'full' };\n } else if (reportType === REPORT_TYPE.MPR_V1) {\n config = REPORT_CONFIG.MPR_V1 ?? { label: 'Report', icon: 'full' };\n } else if (reportType === REPORT_TYPE.MPR_V2) {\n config = REPORT_CONFIG['MPR_V2_' + (courseStream || '').toLowerCase()] ?? {\n label: 'Report',\n icon: 'full',\n };\n }\n\n const reportMilestones =\n reportType === REPORT_TYPE.PTM ? [] : report?.progress_data?.user_milestones || [];\n\n if (reportType === REPORT_TYPE.MPR_V2 && !report?.progress_data?.user_milestones?.length) {\n return (\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGapX={0.5}\n $gutterX={1}\n $gapX={1}\n $borderColor=\"WHITE_5\"\n $background=\"WHITE_3\"\n $heightX={4.5}\n >\n <Image src={ILLUSTRATIONS.NO_REPORT} alt=\"report icon\" withLoader width={32} height={32} />\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n Report unavailable - no activity this month.\n </Text>\n </FlexView>\n );\n }\n\n return (\n <Clickable\n onClick={handleReportClick}\n disabled={!report?.id && reportType !== REPORT_TYPE.MPR_V1}\n label=\"Report Card click\"\n >\n <FlexView $flexGap={1} $borderColor=\"BLACK_1\">\n {!!reportMilestones.length && (\n <Styled.GoalsSection $flexGap={1}>\n {reportMilestones.map((milestone, milestoneIndex) => (\n <GoalsCard\n key={milestone.user_milestone_id || milestoneIndex}\n category={milestone.goal_category}\n milestone={milestone}\n isExpended={false}\n />\n ))}\n </Styled.GoalsSection>\n )}\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $background=\"BLACK_1\"\n $heightX={3}\n >\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={0.5} $gutterX={1}>\n <Image src={config.icon} alt=\"report icon\" withLoader width={32} height={32} />\n <Text $renderAs=\"ub2-bold\" $color=\"WHITE\">\n {config.label}\n </Text>\n </FlexView>\n <FlexView $gutterX={0.75}>\n <CaratRightIcon width={24} height={24} color=\"WHITE\" />\n </FlexView>\n </FlexView>\n </FlexView>\n </Clickable>\n );\n};\n\nexport default memo(MonthlyReportCard);\n"],"names":["MonthlyReportCard","report","year","month","onReportClick","reportType","courseStream","handleReportClick","useCallback","monthNames","config","REPORT_TYPE","REPORT_CONFIG","reportMilestones","_a","_c","_b","jsxs","FlexView","jsx","Image","ILLUSTRATIONS","Text","Clickable","Styled.GoalsSection","milestone","milestoneIndex","GoalsCard","CaratRightIcon","MonthlyReportCard$1","memo"],"mappings":";;;;;;;;;;;;AAcA,MAAMA,IAAiD,CAAC;AAAA,EACtD,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AACF,MAAM;;AACE,QAAAC,IAAoBC,EAAY,MAAM;AAC1C,IAAIJ,KACYA,GAAAH,KAAA,gBAAAA,EAAQ,OAAM,IAAII,GAAYH,GAAMO,EAAWN,IAAQ,CAAC,KAAK,EAAE;AAAA,EAC/E,GACC,CAACA,GAAOC,GAAeH,KAAA,gBAAAA,EAAQ,IAAII,GAAYH,CAAI,CAAC;AAEvD,MAAIQ,IAAS,EAAE,OA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B,UAAAX,EAAiB,IAAI,CAACY,GAAWC,MAChC,gBAAAP;AAAA,UAACQ;AAAA,UAAA;AAAA,YAEC,UAAUF,EAAU;AAAA,YACpB,WAAAA;AAAA,YACA,YAAY;AAAA,UAAA;AAAA,UAHPA,EAAU,qBAAqBC;AAAA,QAKvC,CAAA,GACH;AAAA,QAEF,gBAAAT;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,gBAAe;AAAA,YACf,aAAY;AAAA,YACZ,iBAAgB;AAAA,YAChB,aAAY;AAAA,YACZ,UAAU;AAAA,YAEV,UAAA;AAAA,cAAC,gBAAAD,EAAAC,GAAA,EAAS,gBAAe,OAAM,aAAY,UAAS,WAAW,KAAK,UAAU,GAC5E,UAAA;AAAA,gBAAC,gBAAAC,EAAAC,GAAA,EAAM,KAAKV,EAAO,MAAM,KAAI,eAAc,YAAU,IAAC,OAAO,IAAI,QAAQ,GAAI,CAAA;AAAA,kCAC5EY,GAAK,EAAA,WAAU,YAAW,QAAO,SAC/B,YAAO,OACV;AAAA,cAAA,GACF;AAAA,cACC,gBAAAH,EAAAD,GAAA,EAAS,UAAU,MAClB,UAAC,gBAAAC,EAAAS,GAAA,EAAe,OAAO,IAAI,QAAQ,IAAI,OAAM,QAAQ,CAAA,GACvD;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeC,IAAAC,EAAK9B,CAAiB;"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { memo as z, useRef as
|
|
3
|
-
import { getCardTypeIconMap as $, stateIcon as
|
|
4
|
-
import { CARD_TYPE as
|
|
5
|
-
import { ActivityCardContainerWrapper as
|
|
2
|
+
import { memo as z, useRef as D, useState as I, useMemo as d, useCallback as u } from "react";
|
|
3
|
+
import { getCardTypeIconMap as $, stateIcon as B } from "../constants.js";
|
|
4
|
+
import { CARD_TYPE as g } from "../../../monthly-report-types.js";
|
|
5
|
+
import { ActivityCardContainerWrapper as S, ActivityCardContainer as M } from "./activities-card.styled.js";
|
|
6
6
|
import n from "../../../../../../ui/layout/flex-view.js";
|
|
7
|
-
import
|
|
7
|
+
import j from "../../../../../../ui/lottie-animation/lottie-animation.js";
|
|
8
8
|
import m from "../../../../../../ui/text/text.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { NODE_STATE as
|
|
12
|
-
import
|
|
9
|
+
import k from "../../../../../../homework/card-title.js";
|
|
10
|
+
import G from "../activities-card-puzzles/activities-card-puzzles.js";
|
|
11
|
+
import { NODE_STATE as p } from "../../../../../daily-timeline/daily-timeline-types.js";
|
|
12
|
+
import T from "../../../../../../ui/buttons/text-button/text-button.js";
|
|
13
13
|
import { countActivitiesByState as K } from "../utils.js";
|
|
14
|
-
const
|
|
14
|
+
const y = {
|
|
15
15
|
autoplay: !1,
|
|
16
16
|
loop: !0,
|
|
17
17
|
renderer: "canvas"
|
|
18
|
-
},
|
|
18
|
+
}, N = ({
|
|
19
19
|
cardType: t,
|
|
20
|
-
nodeType:
|
|
20
|
+
nodeType: f,
|
|
21
21
|
activitiesList: o = [],
|
|
22
|
-
onPuzzleClick:
|
|
22
|
+
onPuzzleClick: A
|
|
23
23
|
}) => {
|
|
24
|
-
const a =
|
|
24
|
+
const a = D(null), [s, C] = I(!1), x = d(() => {
|
|
25
25
|
const { totalDone: e, totalPending: i, totalOverdue: c } = K(o);
|
|
26
26
|
return [
|
|
27
27
|
e > 0 && `${e} Done`,
|
|
28
28
|
i > 0 && `${i} In-progress`,
|
|
29
29
|
c > 0 && `${c} Overdue`
|
|
30
30
|
].filter(Boolean).join(", ");
|
|
31
|
-
}, [o]),
|
|
32
|
-
if (t ===
|
|
31
|
+
}, [o]), b = d(() => t ? t.split("_").join(" ") : "", [t]), { displayedActivities: X, remainingCount: h } = d(() => {
|
|
32
|
+
if (t === g.puzzle)
|
|
33
33
|
return { displayedActivities: o, remainingCount: 0 };
|
|
34
34
|
const e = 3, i = o.length > e;
|
|
35
35
|
return s || !i ? { displayedActivities: o, remainingCount: 0 } : {
|
|
@@ -43,15 +43,15 @@ const O = {
|
|
|
43
43
|
var e;
|
|
44
44
|
(e = a.current) == null || e.stop();
|
|
45
45
|
}, []), v = u(() => {
|
|
46
|
-
|
|
46
|
+
C((e) => !e);
|
|
47
47
|
}, []);
|
|
48
48
|
return /* @__PURE__ */ l(n, { onMouseEnter: _, onMouseLeave: w, children: [
|
|
49
49
|
/* @__PURE__ */ r(
|
|
50
|
-
|
|
50
|
+
S,
|
|
51
51
|
{
|
|
52
52
|
$background: $(t).color,
|
|
53
53
|
children: /* @__PURE__ */ l(
|
|
54
|
-
|
|
54
|
+
M,
|
|
55
55
|
{
|
|
56
56
|
$flexDirection: "row",
|
|
57
57
|
$alignItems: "center",
|
|
@@ -71,49 +71,49 @@ const O = {
|
|
|
71
71
|
$alignItems: "center",
|
|
72
72
|
$justifyContent: "center",
|
|
73
73
|
children: /* @__PURE__ */ r(
|
|
74
|
-
|
|
74
|
+
j,
|
|
75
75
|
{
|
|
76
76
|
ref: a,
|
|
77
77
|
src: $(t).lottie,
|
|
78
78
|
width: 32,
|
|
79
79
|
height: 32,
|
|
80
|
-
settings:
|
|
80
|
+
settings: y
|
|
81
81
|
}
|
|
82
82
|
)
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
85
|
/* @__PURE__ */ l(n, { children: [
|
|
86
|
-
/* @__PURE__ */ r(
|
|
87
|
-
/* @__PURE__ */ r(m, { $renderAs: "ub3", $color: "BLACK_1", children:
|
|
86
|
+
/* @__PURE__ */ r(k, { cardHeader: b, nodeType: f }),
|
|
87
|
+
/* @__PURE__ */ r(m, { $renderAs: "ub3", $color: "BLACK_1", children: x })
|
|
88
88
|
] })
|
|
89
89
|
]
|
|
90
90
|
}
|
|
91
91
|
)
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
|
-
o.length > 0 && (t ===
|
|
95
|
-
|
|
94
|
+
o.length > 0 && (t === g.puzzle ? /* @__PURE__ */ r(G, { puzzles: o, onPuzzleClick: A }) : /* @__PURE__ */ l(n, { $flexRowGapX: 1.25, $gutterX: 1, $gapX: 1, $borderColor: "GREY_2", children: [
|
|
95
|
+
X.map(({ state: e, title: i, subtext: c, id: E }, R) => /* @__PURE__ */ l(n, { $flexDirection: "row", $flexGapX: 1.05, children: [
|
|
96
96
|
/* @__PURE__ */ r(n, { $gapX: 0.25, children: /* @__PURE__ */ r(
|
|
97
97
|
n,
|
|
98
98
|
{
|
|
99
99
|
$borderRadiusX: 1,
|
|
100
|
-
$background: e ===
|
|
100
|
+
$background: e === p.PENDING || e === p.NOT_STARTED ? "RED" : "BLACK_1",
|
|
101
101
|
$widthX: 1,
|
|
102
102
|
$heightX: 1,
|
|
103
103
|
$alignItems: "center",
|
|
104
104
|
$justifyContent: "center",
|
|
105
|
-
children: !!e &&
|
|
105
|
+
children: !!e && B[e]
|
|
106
106
|
}
|
|
107
107
|
) }),
|
|
108
108
|
/* @__PURE__ */ l(n, { $flexRowGap: 4, children: [
|
|
109
109
|
/* @__PURE__ */ r(m, { $renderAs: "ub2", $color: "BLACK_1", children: i || "" }),
|
|
110
110
|
/* @__PURE__ */ r(m, { $renderAs: "ub3", $color: "BLACK_T_60", children: c || "" })
|
|
111
111
|
] })
|
|
112
|
-
] }, `${
|
|
113
|
-
(
|
|
114
|
-
|
|
112
|
+
] }, `${E}-${R}`)),
|
|
113
|
+
(h > 0 || s) && o.length > 3 && /* @__PURE__ */ r(n, { $gutterX: 2, children: /* @__PURE__ */ r(
|
|
114
|
+
T,
|
|
115
115
|
{
|
|
116
|
-
label: s ? "Show less" : `+${
|
|
116
|
+
label: s ? "Show less" : `+${h} activities`,
|
|
117
117
|
size: "regular",
|
|
118
118
|
color: "BLACK_1",
|
|
119
119
|
onClick: v
|
|
@@ -121,7 +121,7 @@ const O = {
|
|
|
121
121
|
) })
|
|
122
122
|
] }))
|
|
123
123
|
] });
|
|
124
|
-
}, ee = z(
|
|
124
|
+
}, ee = z(N);
|
|
125
125
|
export {
|
|
126
126
|
ee as default
|
|
127
127
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activities-card.js","sources":["../../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card/activities-card.tsx"],"sourcesContent":["import { memo, type FC, useRef, useCallback, useMemo, useState } from 'react';\n\nimport { type IActivitiesCardProps } from './activities-card-types';\nimport { getCardTypeIconMap, stateIcon } from '../constants';\nimport { CARD_TYPE } from '../../../monthly-report-types';\nimport * as Styled from './activities-card.styled';\nimport FlexView from '../../../../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../../../../ui/lottie-animation/lottie-animation';\nimport { type ILottieAnimationRef } from '../../../../../../ui/lottie-animation/types';\nimport Text from '../../../../../../ui/text/text';\nimport CardTitle from '../../../../../../homework/card-title';\nimport { type TColorNames } from '../../../../../../ui/types';\nimport ActivitiesCardPuzzles from '../activities-card-puzzles/activities-card-puzzles';\nimport { NODE_STATE } from '../../../../../daily-timeline/daily-timeline-types';\nimport TextButton from '../../../../../../ui/buttons/text-button/text-button';\nimport { countActivitiesByState } from '../utils';\n\nconst lottieSettings = {\n autoplay: false,\n loop: true,\n renderer: 'canvas',\n};\n\nconst ActivitiesCard: FC<IActivitiesCardProps> = ({\n cardType,\n nodeType,\n activitiesList = [],\n onPuzzleClick,\n}) => {\n const lottieRef = useRef<ILottieAnimationRef>(null);\n const [showAllActivities, setShowAllActivities] = useState(false);\n\n const progressStatus = useMemo(() => {\n const { totalDone, totalPending, totalOverdue } = countActivitiesByState(activitiesList);\n\n return [\n totalDone > 0 && `${totalDone} Done`,\n totalPending > 0 && `${totalPending} In-progress`,\n totalOverdue > 0 && `${totalOverdue} Overdue`,\n ]\n .filter(Boolean)\n .join(', ');\n }, [activitiesList]);\n const cardHeaderText = useMemo(() => (cardType ? cardType.split('_').join(' ') : ''), [cardType]);\n const { displayedActivities, remainingCount } = useMemo(() => {\n if (cardType === CARD_TYPE.puzzle) {\n return { displayedActivities: activitiesList, remainingCount: 0 };\n }\n\n const maxVisible = 3;\n const hasMore = activitiesList.length > maxVisible;\n\n if (showAllActivities || !hasMore) {\n return { displayedActivities: activitiesList, remainingCount: 0 };\n }\n\n return {\n displayedActivities: activitiesList.slice(0, maxVisible),\n remainingCount: activitiesList.length - maxVisible,\n };\n }, [activitiesList, showAllActivities, cardType]);\n\n const handleMouseEnter = useCallback(() => {\n lottieRef.current?.play();\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n lottieRef.current?.stop();\n }, []);\n\n const handleToggleActivities = useCallback(() => {\n setShowAllActivities(prev => !prev);\n }, []);\n\n return (\n <FlexView onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n <Styled.ActivityCardContainerWrapper\n $background={getCardTypeIconMap(cardType).color as TColorNames}\n >\n <Styled.ActivityCardContainer\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $height=\"56px\"\n $bgImage={getCardTypeIconMap(cardType).background}\n $gutterX={0.78125}\n $flexGap={8.5}\n >\n <FlexView\n $widthX={2}\n $heightX={2}\n $borderRadiusX={2}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <LottieAnimation\n ref={lottieRef}\n src={getCardTypeIconMap(cardType).lottie}\n width={32}\n height={32}\n settings={lottieSettings}\n />\n </FlexView>\n <FlexView>\n <CardTitle cardHeader={cardHeaderText} nodeType={nodeType} />\n <Text $renderAs=\"ub3\" $color=\"BLACK_1\">\n {progressStatus}\n </Text>\n </FlexView>\n </Styled.ActivityCardContainer>\n </Styled.ActivityCardContainerWrapper>\n {activitiesList.length > 0 &&\n (cardType === CARD_TYPE.puzzle ? (\n <ActivitiesCardPuzzles puzzles={activitiesList} onPuzzleClick={onPuzzleClick} />\n ) : (\n <FlexView $flexRowGapX={1.25} $gutterX={1} $gapX={1} $borderColor=\"GREY_2\">\n {displayedActivities.map(({ state, title, subtext, id }, index) => (\n <FlexView $flexDirection=\"row\" $flexGapX={1.05} key={`${id}-${index}`}>\n <FlexView $gapX={0.25}>\n <FlexView\n $borderRadiusX={1}\n $background={\n state === NODE_STATE.PENDING || state === NODE_STATE.NOT_STARTED\n ? 'RED'\n : 'BLACK_1'\n }\n $widthX={1}\n $heightX={1}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {!!state && (stateIcon[state as NODE_STATE] || stateIcon[NODE_STATE.COMPLETED])}\n </FlexView>\n </FlexView>\n <FlexView $flexRowGap={4}>\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n {title || ''}\n </Text>\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext || ''}\n </Text>\n </FlexView>\n </FlexView>\n ))}\n {(remainingCount > 0 || showAllActivities) && activitiesList.length > 3 && (\n <FlexView $gutterX={2}>\n <TextButton\n label={showAllActivities ? 'Show less' : `+${remainingCount} activities`}\n size=\"regular\"\n color=\"BLACK_1\"\n onClick={handleToggleActivities}\n />\n </FlexView>\n )}\n </FlexView>\n ))}\n </FlexView>\n );\n};\n\nexport default memo(ActivitiesCard);\n"],"names":["lottieSettings","ActivitiesCard","cardType","nodeType","activitiesList","onPuzzleClick","lottieRef","useRef","showAllActivities","setShowAllActivities","useState","progressStatus","useMemo","totalDone","totalPending","totalOverdue","countActivitiesByState","cardHeaderText","displayedActivities","remainingCount","CARD_TYPE","maxVisible","hasMore","handleMouseEnter","useCallback","_a","handleMouseLeave","handleToggleActivities","prev","jsxs","FlexView","jsx","Styled.ActivityCardContainerWrapper","getCardTypeIconMap","Styled.ActivityCardContainer","LottieAnimation","CardTitle","Text","ActivitiesCardPuzzles","state","title","subtext","id","index","NODE_STATE","stateIcon","TextButton","ActivitiesCard$1","memo"],"mappings":";;;;;;;;;;;;;AAiBA,MAAMA,IAAiB;AAAA,EACrB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AACZ,GAEMC,IAA2C,CAAC;AAAA,EAChD,UAA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":3,"file":"activities-card.js","sources":["../../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card/activities-card.tsx"],"sourcesContent":["import { memo, type FC, useRef, useCallback, useMemo, useState } from 'react';\n\nimport { type IActivitiesCardProps } from './activities-card-types';\nimport { getCardTypeIconMap, stateIcon } from '../constants';\nimport { CARD_TYPE } from '../../../monthly-report-types';\nimport * as Styled from './activities-card.styled';\nimport FlexView from '../../../../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../../../../ui/lottie-animation/lottie-animation';\nimport { type ILottieAnimationRef } from '../../../../../../ui/lottie-animation/types';\nimport Text from '../../../../../../ui/text/text';\nimport CardTitle from '../../../../../../homework/card-title';\nimport { type TColorNames } from '../../../../../../ui/types';\nimport ActivitiesCardPuzzles from '../activities-card-puzzles/activities-card-puzzles';\nimport { NODE_STATE } from '../../../../../daily-timeline/daily-timeline-types';\nimport TextButton from '../../../../../../ui/buttons/text-button/text-button';\nimport { countActivitiesByState } from '../utils';\n\nconst lottieSettings = {\n autoplay: false,\n loop: true,\n renderer: 'canvas',\n};\n\nconst ActivitiesCard: FC<IActivitiesCardProps> = ({\n cardType,\n nodeType,\n activitiesList = [],\n onPuzzleClick,\n}) => {\n const lottieRef = useRef<ILottieAnimationRef>(null);\n const [showAllActivities, setShowAllActivities] = useState(false);\n\n const progressStatus = useMemo(() => {\n const { totalDone, totalPending, totalOverdue } = countActivitiesByState(activitiesList);\n\n return [\n totalDone > 0 && `${totalDone} Done`,\n totalPending > 0 && `${totalPending} In-progress`,\n totalOverdue > 0 && `${totalOverdue} Overdue`,\n ]\n .filter(Boolean)\n .join(', ');\n }, [activitiesList]);\n const cardHeaderText = useMemo(() => (cardType ? cardType.split('_').join(' ') : ''), [cardType]);\n const { displayedActivities, remainingCount } = useMemo(() => {\n if (cardType === CARD_TYPE.puzzle) {\n return { displayedActivities: activitiesList, remainingCount: 0 };\n }\n\n const maxVisible = 3;\n const hasMore = activitiesList.length > maxVisible;\n\n if (showAllActivities || !hasMore) {\n return { displayedActivities: activitiesList, remainingCount: 0 };\n }\n\n return {\n displayedActivities: activitiesList.slice(0, maxVisible),\n remainingCount: activitiesList.length - maxVisible,\n };\n }, [activitiesList, showAllActivities, cardType]);\n\n const handleMouseEnter = useCallback(() => {\n lottieRef.current?.play();\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n lottieRef.current?.stop();\n }, []);\n\n const handleToggleActivities = useCallback(() => {\n setShowAllActivities(prev => !prev);\n }, []);\n\n return (\n <FlexView onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n <Styled.ActivityCardContainerWrapper\n $background={getCardTypeIconMap(cardType).color as TColorNames}\n >\n <Styled.ActivityCardContainer\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $height=\"56px\"\n $bgImage={getCardTypeIconMap(cardType).background}\n $gutterX={0.78125}\n $flexGap={8.5}\n >\n <FlexView\n $widthX={2}\n $heightX={2}\n $borderRadiusX={2}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <LottieAnimation\n ref={lottieRef}\n src={getCardTypeIconMap(cardType).lottie}\n width={32}\n height={32}\n settings={lottieSettings}\n />\n </FlexView>\n <FlexView>\n <CardTitle cardHeader={cardHeaderText} nodeType={nodeType} />\n <Text $renderAs=\"ub3\" $color=\"BLACK_1\">\n {progressStatus}\n </Text>\n </FlexView>\n </Styled.ActivityCardContainer>\n </Styled.ActivityCardContainerWrapper>\n {activitiesList.length > 0 &&\n (cardType === CARD_TYPE.puzzle ? (\n <ActivitiesCardPuzzles puzzles={activitiesList} onPuzzleClick={onPuzzleClick} />\n ) : (\n <FlexView $flexRowGapX={1.25} $gutterX={1} $gapX={1} $borderColor=\"GREY_2\">\n {displayedActivities.map(({ state, title, subtext, id }, index) => (\n <FlexView $flexDirection=\"row\" $flexGapX={1.05} key={`${id}-${index}`}>\n <FlexView $gapX={0.25}>\n <FlexView\n $borderRadiusX={1}\n $background={\n state === NODE_STATE.PENDING || state === NODE_STATE.NOT_STARTED\n ? 'RED'\n : 'BLACK_1'\n }\n $widthX={1}\n $heightX={1}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {!!state && stateIcon[state as NODE_STATE]}\n </FlexView>\n </FlexView>\n <FlexView $flexRowGap={4}>\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n {title || ''}\n </Text>\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext || ''}\n </Text>\n </FlexView>\n </FlexView>\n ))}\n {(remainingCount > 0 || showAllActivities) && activitiesList.length > 3 && (\n <FlexView $gutterX={2}>\n <TextButton\n label={showAllActivities ? 'Show less' : `+${remainingCount} activities`}\n size=\"regular\"\n color=\"BLACK_1\"\n onClick={handleToggleActivities}\n />\n </FlexView>\n )}\n </FlexView>\n ))}\n </FlexView>\n );\n};\n\nexport default memo(ActivitiesCard);\n"],"names":["lottieSettings","ActivitiesCard","cardType","nodeType","activitiesList","onPuzzleClick","lottieRef","useRef","showAllActivities","setShowAllActivities","useState","progressStatus","useMemo","totalDone","totalPending","totalOverdue","countActivitiesByState","cardHeaderText","displayedActivities","remainingCount","CARD_TYPE","maxVisible","hasMore","handleMouseEnter","useCallback","_a","handleMouseLeave","handleToggleActivities","prev","jsxs","FlexView","jsx","Styled.ActivityCardContainerWrapper","getCardTypeIconMap","Styled.ActivityCardContainer","LottieAnimation","CardTitle","Text","ActivitiesCardPuzzles","state","title","subtext","id","index","NODE_STATE","stateIcon","TextButton","ActivitiesCard$1","memo"],"mappings":";;;;;;;;;;;;;AAiBA,MAAMA,IAAiB;AAAA,EACrB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AACZ,GAEMC,IAA2C,CAAC;AAAA,EAChD,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC,IAAiB,CAAC;AAAA,EAClB,eAAAC;AACF,MAAM;AACE,QAAAC,IAAYC,EAA4B,IAAI,GAC5C,CAACC,GAAmBC,CAAoB,IAA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
|
12
|
-
import { IS_APP_RUNNING_IN_RN as g } from "../../../../../../../constants/app-config.js";
|
|
13
|
-
const j = ({
|
|
14
|
-
puzzles: u,
|
|
15
|
-
onPuzzleClick: o
|
|
16
|
-
}) => {
|
|
17
|
-
const n = u || [], r = v(null), [_, C] = m(!1), [b, p] = m(!1), S = s(() => {
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { memo as S, useRef as R, useState as h, useCallback as i, useEffect as b } from "react";
|
|
3
|
+
import x from "../../../../../../../assets/line-icons/icons/chevron-left.js";
|
|
4
|
+
import L from "../../../../../../../assets/line-icons/icons/chevron-right.js";
|
|
5
|
+
import { ContentWrapper as _, ScrollButton as a, ScrollContainer as w } from "./activities-card-puzzles.styled.js";
|
|
6
|
+
import c from "../../../../../../ui/layout/flex-view.js";
|
|
7
|
+
import I from "../../../../../../ui/separator/separator.js";
|
|
8
|
+
import { IS_APP_RUNNING_IN_RN as f } from "../../../../../../../constants/app-config.js";
|
|
9
|
+
import A from "./activity-puzzle-card.js";
|
|
10
|
+
const B = ({ puzzles: o, onPuzzleClick: u }) => {
|
|
11
|
+
const r = R(null), [d, m] = h(!1), [$, p] = h(!1), g = i(() => {
|
|
18
12
|
r.current && r.current.scrollBy({ left: -180, behavior: "smooth" });
|
|
19
|
-
}, []),
|
|
13
|
+
}, []), C = i(() => {
|
|
20
14
|
r.current && r.current.scrollBy({ left: 180, behavior: "smooth" });
|
|
21
|
-
}, []),
|
|
15
|
+
}, []), l = i(() => {
|
|
22
16
|
if (r.current) {
|
|
23
|
-
const { scrollLeft: t, scrollWidth:
|
|
24
|
-
|
|
17
|
+
const { scrollLeft: t, scrollWidth: n, clientWidth: v } = r.current;
|
|
18
|
+
m(t > 0), p(t < n - v - 10);
|
|
25
19
|
}
|
|
26
20
|
}, []);
|
|
27
|
-
|
|
21
|
+
return b(() => {
|
|
28
22
|
const t = r.current;
|
|
29
23
|
if (t)
|
|
30
|
-
return
|
|
31
|
-
t.removeEventListener("scroll",
|
|
24
|
+
return l(), t.addEventListener("scroll", l), () => {
|
|
25
|
+
t.removeEventListener("scroll", l);
|
|
32
26
|
};
|
|
33
|
-
}, [
|
|
34
|
-
const R = s(
|
|
35
|
-
(t, a) => /* @__PURE__ */ l(
|
|
36
|
-
T,
|
|
37
|
-
{
|
|
38
|
-
$gapX: 1,
|
|
39
|
-
$imageHue: t.image_hue || "BLUE",
|
|
40
|
-
$width: 146,
|
|
41
|
-
$height: 162,
|
|
42
|
-
$background: `${t.image_hue || "BLUE"}_2`,
|
|
43
|
-
onClick: () => o == null ? void 0 : o({
|
|
44
|
-
item_ref: t.item_ref,
|
|
45
|
-
feedback_comments: t.feedback_comments,
|
|
46
|
-
image_hue: t.image_hue,
|
|
47
|
-
title: t.title,
|
|
48
|
-
tip: t.tip
|
|
49
|
-
}),
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ e(
|
|
52
|
-
X,
|
|
53
|
-
{
|
|
54
|
-
$borderRadiusX: 1,
|
|
55
|
-
$background: t.state === h.PENDING || t.state === h.NOT_STARTED ? "RED" : "BLACK_1",
|
|
56
|
-
$widthX: 1,
|
|
57
|
-
$heightX: 1,
|
|
58
|
-
$alignItems: "center",
|
|
59
|
-
$justifyContent: "center",
|
|
60
|
-
children: t.state && ($[t.state] || $[h.COMPLETED])
|
|
61
|
-
}
|
|
62
|
-
),
|
|
63
|
-
/* @__PURE__ */ l(i, { $background: "TRANSPARENT", $alignItems: "center", children: [
|
|
64
|
-
t.image_url && /* @__PURE__ */ e(
|
|
65
|
-
k,
|
|
66
|
-
{
|
|
67
|
-
src: t.image_url ?? "",
|
|
68
|
-
alt: "Puzzle illustration",
|
|
69
|
-
width: 68,
|
|
70
|
-
height: 68,
|
|
71
|
-
withLoader: !0
|
|
72
|
-
}
|
|
73
|
-
),
|
|
74
|
-
/* @__PURE__ */ e(f, { heightX: 1 }),
|
|
75
|
-
/* @__PURE__ */ e(i, { $gutterX: 0.25, children: /* @__PURE__ */ e(D, { $renderAs: "ab3", $align: "center", children: t.title }) })
|
|
76
|
-
] })
|
|
77
|
-
]
|
|
78
|
-
},
|
|
79
|
-
`${t.id}-${a}`
|
|
80
|
-
),
|
|
81
|
-
[o]
|
|
82
|
-
);
|
|
83
|
-
return !n || n.length === 0 ? null : /* @__PURE__ */ e(x, { $flexRowGapX: 1, children: /* @__PURE__ */ l(i, { $position: "relative", $borderColor: "GREY_2", children: [
|
|
27
|
+
}, [l, o.length]), !o || o.length === 0 ? null : /* @__PURE__ */ e(_, { $flexRowGapX: 1, children: /* @__PURE__ */ s(c, { $position: "relative", $borderColor: "GREY_2", children: [
|
|
84
28
|
/* @__PURE__ */ e(
|
|
85
|
-
|
|
29
|
+
a,
|
|
86
30
|
{
|
|
87
31
|
$background: "BLACK_T_60",
|
|
88
32
|
$justifyContent: "center",
|
|
89
33
|
$alignItems: "center",
|
|
90
34
|
$widthX: 2,
|
|
91
35
|
$height: "100%",
|
|
92
|
-
onClick:
|
|
93
|
-
$visible: !
|
|
36
|
+
onClick: g,
|
|
37
|
+
$visible: !f && d,
|
|
94
38
|
$left: "0px",
|
|
95
39
|
$right: "auto",
|
|
96
|
-
children: /* @__PURE__ */ e(
|
|
40
|
+
children: /* @__PURE__ */ e(x, { width: 24, height: 24 })
|
|
97
41
|
}
|
|
98
42
|
),
|
|
99
|
-
/* @__PURE__ */ e(
|
|
100
|
-
/* @__PURE__ */ e(
|
|
101
|
-
|
|
43
|
+
/* @__PURE__ */ e(c, { $gapX: 1, children: /* @__PURE__ */ e(w, { ref: r, children: /* @__PURE__ */ s(c, { $flexDirection: "row", $flexGapX: 1, children: [
|
|
44
|
+
/* @__PURE__ */ e(I, {}),
|
|
45
|
+
o.map((t, n) => /* @__PURE__ */ e(
|
|
46
|
+
A,
|
|
47
|
+
{
|
|
48
|
+
puzzle: t,
|
|
49
|
+
onPuzzleClick: u
|
|
50
|
+
},
|
|
51
|
+
`${t.id}-${n}`
|
|
52
|
+
))
|
|
102
53
|
] }) }) }),
|
|
103
54
|
/* @__PURE__ */ e(
|
|
104
|
-
|
|
55
|
+
a,
|
|
105
56
|
{
|
|
106
57
|
$position: "absolute",
|
|
107
58
|
$widthX: 2,
|
|
@@ -109,16 +60,16 @@ const j = ({
|
|
|
109
60
|
$background: "BLACK_T_60",
|
|
110
61
|
$justifyContent: "center",
|
|
111
62
|
$alignItems: "center",
|
|
112
|
-
onClick:
|
|
113
|
-
$visible: !
|
|
63
|
+
onClick: C,
|
|
64
|
+
$visible: !f && $,
|
|
114
65
|
$left: "auto",
|
|
115
66
|
$right: "0px",
|
|
116
|
-
children: /* @__PURE__ */ e(
|
|
67
|
+
children: /* @__PURE__ */ e(L, { width: 24, height: 24 })
|
|
117
68
|
}
|
|
118
69
|
)
|
|
119
70
|
] }) });
|
|
120
|
-
},
|
|
71
|
+
}, z = S(B);
|
|
121
72
|
export {
|
|
122
|
-
|
|
73
|
+
z as default
|
|
123
74
|
};
|
|
124
75
|
//# sourceMappingURL=activities-card-puzzles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activities-card-puzzles.js","sources":["../../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.tsx"],"sourcesContent":["import { type FC, useRef, memo, useCallback, useState, useEffect } from 'react';\n\nimport ChevronLeftIcon from '../../../../../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../../../../../assets/line-icons/icons/chevron-right';\nimport { type IActivitiesCardPuzzlesProps } from './activities-card-puzzles-types';\nimport
|
|
1
|
+
{"version":3,"file":"activities-card-puzzles.js","sources":["../../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.tsx"],"sourcesContent":["import { type FC, useRef, memo, useCallback, useState, useEffect } from 'react';\n\nimport ChevronLeftIcon from '../../../../../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../../../../../assets/line-icons/icons/chevron-right';\nimport { type IActivitiesCardPuzzlesProps } from './activities-card-puzzles-types';\nimport * as Styled from './activities-card-puzzles.styled';\nimport FlexView from '../../../../../../ui/layout/flex-view';\nimport Separator from '../../../../../../ui/separator/separator';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../../../constants/app-config';\nimport ActivityPuzzleCard from './activity-puzzle-card';\n\nconst ActivitiesCardPuzzles: FC<IActivitiesCardPuzzlesProps> = ({ puzzles, onPuzzleClick }) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(false);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -180, behavior: 'smooth' });\n }\n }, []);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 180, behavior: 'smooth' });\n }\n }, []);\n\n const updateScrollButtons = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n setCanScrollLeft(scrollLeft > 0);\n setCanScrollRight(scrollLeft < scrollWidth - clientWidth - 10);\n }\n }, []);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n updateScrollButtons();\n\n scrollElement.addEventListener('scroll', updateScrollButtons);\n\n return () => {\n scrollElement.removeEventListener('scroll', updateScrollButtons);\n };\n }\n }, [updateScrollButtons, puzzles.length]);\n\n if (!puzzles || puzzles.length === 0) return null;\n\n return (\n <Styled.ContentWrapper $flexRowGapX={1}>\n <FlexView $position=\"relative\" $borderColor=\"GREY_2\">\n <Styled.ScrollButton\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $widthX={2}\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={!IS_APP_RUNNING_IN_RN && canScrollLeft}\n $left=\"0px\"\n $right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n <FlexView $gapX={1}>\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <Separator />\n {puzzles.map((item, index) => {\n return (\n <ActivityPuzzleCard\n key={`${item.id}-${index}`}\n puzzle={item}\n onPuzzleClick={onPuzzleClick}\n />\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\n </FlexView>\n\n <Styled.ScrollButton\n $position=\"absolute\"\n $widthX={2}\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={!IS_APP_RUNNING_IN_RN && canScrollRight}\n $left=\"auto\"\n $right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default memo(ActivitiesCardPuzzles);\n"],"names":["ActivitiesCardPuzzles","puzzles","onPuzzleClick","scrollRef","useRef","canScrollLeft","setCanScrollLeft","useState","canScrollRight","setCanScrollRight","handleScrollLeft","useCallback","handleScrollRight","updateScrollButtons","scrollLeft","scrollWidth","clientWidth","useEffect","scrollElement","jsx","Styled.ContentWrapper","jsxs","FlexView","Styled.ScrollButton","IS_APP_RUNNING_IN_RN","ChevronLeftIcon","Styled.ScrollContainer","Separator","item","index","ActivityPuzzleCard","ChevronRightIcon","ActivitiesCardPuzzles$1","memo"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAyD,CAAC,EAAE,SAAAC,GAAS,eAAAC,QAAoB;AACvF,QAAAC,IAAYC,EAAuB,IAAI,GACvC,CAACC,GAAeC,CAAgB,IAAIC,EAAS,EAAK,GAClD,CAACC,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GAEpDG,IAAmBC,EAAY,MAAM;AACzC,IAAIR,EAAU,WACZA,EAAU,QAAQ,SAAS,EAAE,MAAM,MAAM,UAAU,UAAU;AAAA,EAEjE,GAAG,CAAE,CAAA,GAECS,IAAoBD,EAAY,MAAM;AAC1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AU,EAAA;AAAA,MACV1B,EAAQ,IAAI,CAAC2B,GAAMC,MAEhB,gBAAAV;AAAA,QAACW;AAAA,QAAA;AAAA,UAEC,QAAQF;AAAA,UACR,eAAA1B;AAAA,QAAA;AAAA,QAFK,GAAG0B,EAAK,EAAE,IAAIC,CAAK;AAAA,MAAA,CAK7B;AAAA,IAAA,EACH,CAAA,EACF,CAAA,GACF;AAAA,IAEA,gBAAAV;AAAA,MAACI;AAAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,SAAS;AAAA,QACT,SAAQ;AAAA,QACR,aAAY;AAAA,QACZ,iBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,SAASX;AAAA,QACT,UAAU,CAACY,KAAwBhB;AAAA,QACnC,OAAM;AAAA,QACN,QAAO;AAAA,QAEP,UAAC,gBAAAW,EAAAY,GAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,MAAA;AAAA,IAC3C;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ,GAEeC,IAAAC,EAAKjC,CAAqB;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as h, useCallback as s } from "react";
|
|
3
|
+
import { PuzzleContainer as c, StatusIcon as d } from "./activities-card-puzzles.styled.js";
|
|
4
|
+
import m from "../../../../../../ui/layout/flex-view.js";
|
|
5
|
+
import g from "../../../../../../ui/image/image.js";
|
|
6
|
+
import $ from "../../../../../../ui/separator/separator.js";
|
|
7
|
+
import f from "../../../../../../ui/text/text.js";
|
|
8
|
+
import { NODE_STATE as i } from "../../../../../daily-timeline/daily-timeline-types.js";
|
|
9
|
+
import { stateIcon as o } from "../constants.js";
|
|
10
|
+
function _({ puzzle: t, onPuzzleClick: e }) {
|
|
11
|
+
const n = s(() => {
|
|
12
|
+
e && (e == null || e({
|
|
13
|
+
item_ref: t.item_ref,
|
|
14
|
+
feedback_comments: t.feedback_comments,
|
|
15
|
+
image_hue: t.image_hue,
|
|
16
|
+
title: t.title,
|
|
17
|
+
tip: t.tip
|
|
18
|
+
}));
|
|
19
|
+
}, [e, t]);
|
|
20
|
+
return /* @__PURE__ */ a(
|
|
21
|
+
c,
|
|
22
|
+
{
|
|
23
|
+
$gapX: 1,
|
|
24
|
+
$imageHue: t.image_hue || "BLUE",
|
|
25
|
+
$width: 146,
|
|
26
|
+
$height: 162,
|
|
27
|
+
$background: `${t.image_hue || "BLUE"}_2`,
|
|
28
|
+
onClick: n,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ r(
|
|
31
|
+
d,
|
|
32
|
+
{
|
|
33
|
+
$borderRadiusX: 1,
|
|
34
|
+
$background: t.state === i.PENDING || t.state === i.NOT_STARTED ? "RED" : "BLACK_1",
|
|
35
|
+
$widthX: 1,
|
|
36
|
+
$heightX: 1,
|
|
37
|
+
$alignItems: "center",
|
|
38
|
+
$justifyContent: "center",
|
|
39
|
+
children: t.state && (o[t.state] || o[i.COMPLETED])
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ a(m, { $background: "TRANSPARENT", $alignItems: "center", children: [
|
|
43
|
+
t.image_url && /* @__PURE__ */ r(
|
|
44
|
+
g,
|
|
45
|
+
{
|
|
46
|
+
src: t.image_url ?? "",
|
|
47
|
+
alt: "Puzzle illustration",
|
|
48
|
+
width: 68,
|
|
49
|
+
height: 68,
|
|
50
|
+
withLoader: !0
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ r($, { heightX: 1 }),
|
|
54
|
+
/* @__PURE__ */ r(m, { $gutterX: 0.25, children: /* @__PURE__ */ r(f, { $renderAs: "ab3", $align: "center", children: t.title }) })
|
|
55
|
+
] })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
const x = h(_);
|
|
61
|
+
export {
|
|
62
|
+
x as default
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=activity-puzzle-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-puzzle-card.js","sources":["../../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activity-puzzle-card.tsx"],"sourcesContent":["import { memo, useCallback } from 'react';\n\nimport * as Styled from './activities-card-puzzles.styled';\nimport FlexView from '../../../../../../ui/layout/flex-view';\nimport Image from '../../../../../../ui/image/image';\nimport Separator from '../../../../../../ui/separator/separator';\nimport Text from '../../../../../../ui/text/text';\nimport { NODE_STATE } from '../../../../../daily-timeline/daily-timeline-types';\nimport { stateIcon } from '../constants';\nimport { type IMonthlyReportProps, type IMonthlyActivity } from '../../../monthly-report-types';\n\ninterface IActivityPuzzleCardProps {\n puzzle: IMonthlyActivity;\n onPuzzleClick?: IMonthlyReportProps['onPuzzleClick'];\n}\n\nfunction ActivityPuzzleCard({ puzzle, onPuzzleClick }: IActivityPuzzleCardProps) {\n const handlePuzzleClick = useCallback(() => {\n if (onPuzzleClick) {\n onPuzzleClick?.({\n item_ref: puzzle.item_ref,\n feedback_comments: puzzle.feedback_comments,\n image_hue: puzzle.image_hue,\n title: puzzle.title,\n tip: puzzle.tip,\n });\n }\n }, [onPuzzleClick, puzzle]);\n\n return (\n <Styled.PuzzleContainer\n $gapX={1}\n $imageHue={puzzle.image_hue || 'BLUE'}\n $width={146}\n $height={162}\n $background={`${puzzle.image_hue || 'BLUE'}_2`}\n onClick={handlePuzzleClick}\n >\n <Styled.StatusIcon\n $borderRadiusX={1}\n $background={\n puzzle.state === NODE_STATE.PENDING || puzzle.state === NODE_STATE.NOT_STARTED\n ? 'RED'\n : 'BLACK_1'\n }\n $widthX={1}\n $heightX={1}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {puzzle.state && (stateIcon[puzzle.state as NODE_STATE] || stateIcon[NODE_STATE.COMPLETED])}\n </Styled.StatusIcon>\n <FlexView $background=\"TRANSPARENT\" $alignItems=\"center\">\n {puzzle.image_url && (\n <Image\n src={puzzle.image_url ?? ''}\n alt=\"Puzzle illustration\"\n width={68}\n height={68}\n withLoader={true}\n />\n )}\n <Separator heightX={1} />\n <FlexView $gutterX={0.25}>\n <Text $renderAs=\"ab3\" $align=\"center\">\n {puzzle.title}\n </Text>\n </FlexView>\n </FlexView>\n </Styled.PuzzleContainer>\n );\n}\n\nexport default memo(ActivityPuzzleCard);\n"],"names":["ActivityPuzzleCard","puzzle","onPuzzleClick","handlePuzzleClick","useCallback","jsxs","Styled.PuzzleContainer","jsx","Styled.StatusIcon","NODE_STATE","stateIcon","FlexView","Image","Separator","Text","ActivityPuzzleCard$1","memo"],"mappings":";;;;;;;;;AAgBA,SAASA,EAAmB,EAAE,QAAAC,GAAQ,eAAAC,KAA2C;AACzE,QAAAC,IAAoBC,EAAY,MAAM;AAC1C,IAAIF,MACcA,KAAA,QAAAA,EAAA;AAAA,MACd,UAAUD,EAAO;AAAA,MACjB,mBAAmBA,EAAO;AAAA,MAC1B,WAAWA,EAAO;AAAA,MAClB,OAAOA,EAAO;AAAA,MACd,KAAKA,EAAO;AAAA,IAAA;AAAA,EAEhB,GACC,CAACC,GAAeD,CAAM,CAAC;AAGxB,SAAA,gBAAAI;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,WAAWL,EAAO,aAAa;AAAA,MAC/B,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,aAAa,GAAGA,EAAO,aAAa,MAAM;AAAA,MAC1C,SAASE;AAAA,MAET,UAAA;AAAA,QAAA,gBAAAI;AAAA,UAACC;AAAAA,UAAA;AAAA,YACC,gBAAgB;AAAA,YAChB,aACEP,EAAO,UAAUQ,EAAW,WAAWR,EAAO,UAAUQ,EAAW,cAC/D,QACA;AAAA,YAEN,SAAS;AAAA,YACT,UAAU;AAAA,YACV,aAAY;AAAA,YACZ,iBAAgB;AAAA,YAEf,UAAAR,EAAO,UAAUS,EAAUT,EAAO,KAAmB,KAAKS,EAAUD,EAAW,SAAS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