@cuemath/leap 3.5.31-as1 → 3.5.31-as2
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 +3 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +10 -8
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/timeline/{api → daily-timeline/api}/use-daily-timeline-get.js +2 -2
- package/dist/features/timeline/daily-timeline/api/use-daily-timeline-get.js.map +1 -0
- package/dist/features/timeline/{comps → daily-timeline/comps}/accordion-item/accordion-item.js +6 -6
- package/dist/features/timeline/daily-timeline/comps/accordion-item/accordion-item.js.map +1 -0
- package/dist/features/timeline/{comps → daily-timeline/comps}/constants.js +2 -2
- package/dist/features/timeline/daily-timeline/comps/constants.js.map +1 -0
- package/dist/features/timeline/{comps → daily-timeline/comps}/daily-timeline-items/daily-timeline-items-styled.js +1 -1
- package/dist/features/timeline/daily-timeline/comps/daily-timeline-items/daily-timeline-items-styled.js.map +1 -0
- package/dist/features/timeline/{comps → daily-timeline/comps}/daily-timeline-items/daily-timeline-items.js +7 -7
- package/dist/features/timeline/daily-timeline/comps/daily-timeline-items/daily-timeline-items.js.map +1 -0
- package/dist/features/timeline/{comps → daily-timeline/comps}/month-break/month-break-styled.js +1 -1
- package/dist/features/timeline/daily-timeline/comps/month-break/month-break-styled.js.map +1 -0
- package/dist/features/timeline/daily-timeline/comps/month-break/month-break.js.map +1 -0
- package/dist/features/timeline/{comps → daily-timeline/comps}/no-activity.js +4 -4
- package/dist/features/timeline/daily-timeline/comps/no-activity.js.map +1 -0
- package/dist/features/timeline/{comps → daily-timeline/comps}/utils.js +5 -5
- package/dist/features/timeline/daily-timeline/comps/utils.js.map +1 -0
- package/dist/features/timeline/{comps → daily-timeline/comps}/year-break/year-break-styled.js +1 -1
- package/dist/features/timeline/daily-timeline/comps/year-break/year-break-styled.js.map +1 -0
- package/dist/features/timeline/{comps → daily-timeline/comps}/year-break/year-break.js +2 -2
- package/dist/features/timeline/daily-timeline/comps/year-break/year-break.js.map +1 -0
- package/dist/features/timeline/{daily-timeline-events.js → daily-timeline/daily-timeline-events.js} +1 -1
- package/dist/features/timeline/daily-timeline/daily-timeline-events.js.map +1 -0
- package/dist/features/timeline/{daily-timeline-styled.js → daily-timeline/daily-timeline-styled.js} +2 -2
- package/dist/features/timeline/daily-timeline/daily-timeline-styled.js.map +1 -0
- package/dist/features/timeline/daily-timeline/daily-timeline-types.js.map +1 -0
- package/dist/features/timeline/{daily-timeline-view.js → daily-timeline/daily-timeline-view.js} +18 -18
- package/dist/features/timeline/daily-timeline/daily-timeline-view.js.map +1 -0
- package/dist/features/timeline/{daily-timeline.js → daily-timeline/daily-timeline.js} +23 -23
- package/dist/features/timeline/daily-timeline/daily-timeline.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js +1 -1
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js.map +1 -1
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/api/use-monthly-report-get.js +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/api/use-monthly-report-get.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/achievements/achievements.js +5 -5
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/achievements/achievements.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/achievements/achievements.styled.js +2 -2
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/achievements/achievements.styled.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/achievements/constant.js.map +1 -0
- package/dist/features/timeline/{monthly-report → 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 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/activities/activities-card/activities-card.styled.js +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card/activities-card.styled.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/activities/activities-card-puzzles/activities-card-puzzles.js +43 -40
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.js +3 -3
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities.js +27 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/activities/constants.js +17 -17
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/constants.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/activities/utils.js +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/utils.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/attendance/attendance-constants.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/attendance/attendance-utils.js +123 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/attendance/attendance-utils.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/attendance/attendance.js +49 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/attendance/attendance.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/attendance/attendance.styled.js +48 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/attendance/attendance.styled.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/attendance/attendence-view.js +56 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/attendance/attendence-view.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/feedback/feedback-styled.js +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/feedback/feedback-styled.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/feedback/feedback.js +100 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/feedback/feedback.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/goals/goals-card/goal-chapter-card.js +3 -3
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/goals/goals-card/goals-card-styled.js +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/goals/goals-card/goals-card-styled.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/goals/goals-card/goals-card.js +118 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/goals/goals-card/goals-card.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/goals/goals-constants.js +2 -2
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/goals/goals-constants.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/goals/goals.js +3 -3
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/goals/goals.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report-events.js +11 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report-events.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/monthly-report-styled.js +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report-styled.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report-types.js.map +1 -0
- package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/monthly-report.js +5 -5
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/api/use-ptm-report-get.js +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/api/use-ptm-report-get.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/key-need/key-need-styled.js +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/key-need/key-need-styled.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/key-need/key-need.js +5 -5
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/key-need/key-need.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/parent-support/parent-support.js +3 -3
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/parent-support/parent-support.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/real-world-projects/real-world-projects-styled.js +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/real-world-projects/real-world-projects-styled.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/real-world-projects/real-world-projects.js +3 -3
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/real-world-projects/real-world-projects.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/report-card/report-card-styled.js +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/report-card/report-card-styled.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/report-card/report-card.js +4 -4
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/report-card/report-card.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/school-support/school-support-styled.js +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/school-support/school-support-styled.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/school-support/school-support.js +3 -3
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/school-support/school-support.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/strategies/strategies-constant.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/strategies/strategies.js +3 -3
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/strategies/strategies.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/strategy-card/strategy-card-styled.js +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/strategy-card/strategy-card-styled.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/strategy-card/strategy-card.js +3 -3
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/strategy-card/strategy-card.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/student-info/student-info-styled.js +2 -2
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/student-info/student-info-styled.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/student-info/student-info.js +5 -5
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/student-info/student-info.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/support-card/support-card-styled.js +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/support-card/support-card-styled.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/support-card/support-card.js +3 -3
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/support-card/support-card.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/teacher-observations/teacher-observations-constant.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/teacher-observations/teacher-observations.js +3 -3
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/teacher-observations/teacher-observations.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/upcoming-chapters/upcoming-chapters.js +3 -3
- package/dist/features/timeline/monthly-timeline/ptm-report/comps/upcoming-chapters/upcoming-chapters.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/ptm-report-constants.js +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report-constants.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report-helpers.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/ptm-report-styled.js +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report-styled.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report-types.js.map +1 -0
- package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/ptm-report.js +3 -3
- package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -4
- package/dist/static/node-learn-large-bg.faa03631.svg +1 -0
- package/dist/static/node-puzzle-large-bg.ba23382e.svg +1 -0
- package/dist/static/node-test-large-bg.e9120fd1.svg +1 -0
- package/package.json +1 -1
- package/dist/features/timeline/api/use-daily-timeline-get.js.map +0 -1
- package/dist/features/timeline/comps/accordion-item/accordion-item.js.map +0 -1
- package/dist/features/timeline/comps/constants.js.map +0 -1
- package/dist/features/timeline/comps/daily-timeline-items/daily-timeline-items-styled.js.map +0 -1
- package/dist/features/timeline/comps/daily-timeline-items/daily-timeline-items.js.map +0 -1
- package/dist/features/timeline/comps/month-break/month-break-styled.js.map +0 -1
- package/dist/features/timeline/comps/month-break/month-break.js.map +0 -1
- package/dist/features/timeline/comps/no-activity.js.map +0 -1
- package/dist/features/timeline/comps/utils.js.map +0 -1
- package/dist/features/timeline/comps/year-break/year-break-styled.js.map +0 -1
- package/dist/features/timeline/comps/year-break/year-break.js.map +0 -1
- package/dist/features/timeline/daily-timeline-events.js.map +0 -1
- package/dist/features/timeline/daily-timeline-styled.js.map +0 -1
- package/dist/features/timeline/daily-timeline-types.js.map +0 -1
- package/dist/features/timeline/daily-timeline-view.js.map +0 -1
- package/dist/features/timeline/daily-timeline.js.map +0 -1
- package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/achievements/constant.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities.js +0 -27
- package/dist/features/timeline/monthly-report/comps/activities/activities.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/constants.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/activities/utils.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-constants.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js +0 -107
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js +0 -44
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js +0 -39
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js +0 -52
- package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/feedback/feedback-styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js +0 -94
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card-styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js +0 -113
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-constants.js.map +0 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals.js.map +0 -1
- package/dist/features/timeline/monthly-report/monthly-report-styled.js.map +0 -1
- package/dist/features/timeline/monthly-report/monthly-report-types.js.map +0 -1
- package/dist/features/timeline/monthly-report/monthly-report.js.map +0 -1
- package/dist/features/timeline/ptm-report/api/use-ptm-report-get.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/key-need/key-need-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/key-need/key-need.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/parent-support/parent-support.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/report-card/report-card-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/report-card/report-card.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/school-support/school-support-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/school-support/school-support.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/strategies/strategies-constant.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/strategies/strategies.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/student-info/student-info-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/student-info/student-info.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/support-card/support-card-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/support-card/support-card.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations-constant.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations.js.map +0 -1
- package/dist/features/timeline/ptm-report/comps/upcoming-chapters/upcoming-chapters.js.map +0 -1
- package/dist/features/timeline/ptm-report/ptm-report-constants.js.map +0 -1
- package/dist/features/timeline/ptm-report/ptm-report-helpers.js.map +0 -1
- package/dist/features/timeline/ptm-report/ptm-report-styled.js.map +0 -1
- package/dist/features/timeline/ptm-report/ptm-report-types.js.map +0 -1
- package/dist/features/timeline/ptm-report/ptm-report.js.map +0 -1
- /package/dist/features/timeline/{comps → daily-timeline/comps}/month-break/month-break.js +0 -0
- /package/dist/features/timeline/{daily-timeline-types.js → daily-timeline/daily-timeline-types.js} +0 -0
- /package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/achievements/constant.js +0 -0
- /package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/comps/attendance/attendance-constants.js +0 -0
- /package/dist/features/timeline/{monthly-report → monthly-timeline/monthly-report}/monthly-report-types.js +0 -0
- /package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/strategies/strategies-constant.js +0 -0
- /package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/comps/teacher-observations/teacher-observations-constant.js +0 -0
- /package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/ptm-report-helpers.js +0 -0
- /package/dist/features/timeline/{ptm-report → monthly-timeline/ptm-report}/ptm-report-types.js +0 -0
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { jsx as s, jsxs as P } from "react/jsx-runtime";
|
|
2
2
|
import { memo as $, useState as I, useCallback as _, useMemo as w, useEffect as f, Fragment as D } from "react";
|
|
3
|
-
import R from "
|
|
4
|
-
import F from "
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { ScrollWrapper as k, DailyTimelineContainer as G } from "./daily-timeline-styled.js";
|
|
9
|
-
import { USER_TYPE as O, CARD_TYPE as y } from "./daily-timeline-types.js";
|
|
10
|
-
import { INITIAL_PAGE as U } from "./comps/constants.js";
|
|
11
|
-
import { getTimezone as W } from "../../helpers/date-time.js";
|
|
12
|
-
import { useUIContext as b } from "../ui/context/context.js";
|
|
13
|
-
import X from "../hooks/use-previous.js";
|
|
3
|
+
import { useDailyTimelineGet as R } from "./api/use-daily-timeline-get.js";
|
|
4
|
+
import { ScrollWrapper as F, DailyTimelineContainer as V } from "./daily-timeline-styled.js";
|
|
5
|
+
import { USER_TYPE as Y, CARD_TYPE as y } from "./daily-timeline-types.js";
|
|
6
|
+
import { INITIAL_PAGE as j } from "./comps/constants.js";
|
|
7
|
+
import { getTimezone as k } from "../../../helpers/date-time.js";
|
|
14
8
|
import { DAILY_TIMELINE_ANALYTICS_EVENTS as h } from "./daily-timeline-events.js";
|
|
15
|
-
import
|
|
9
|
+
import G from "./daily-timeline-view.js";
|
|
10
|
+
import { useUIContext as O } from "../../ui/context/context.js";
|
|
11
|
+
import U from "../../hooks/use-previous.js";
|
|
12
|
+
import W from "../../ui/error/error.js";
|
|
13
|
+
import b from "../../ui/layout/flex-view.js";
|
|
14
|
+
import X from "../../ui/intersection-loader/intersection-loader.js";
|
|
15
|
+
import q from "../../ui/loader/app-loader/app-loader.js";
|
|
16
16
|
const S = $(
|
|
17
17
|
({ userType: c, studentId: i, courseStreams: m, onPuzzleClick: A, onReviewClick: M, scrollAreaHeight: T }) => {
|
|
18
|
-
const [l, p] = I([]), [E, u] = I(!1), { onEvent: t } =
|
|
18
|
+
const [l, p] = I([]), [E, u] = I(!1), { onEvent: t } = O(), {
|
|
19
19
|
get: L,
|
|
20
20
|
data: e,
|
|
21
21
|
isProcessingFailed: d,
|
|
22
22
|
isProcessing: z
|
|
23
|
-
} =
|
|
24
|
-
(r =
|
|
23
|
+
} = R(i), C = U(e == null ? void 0 : e.curr_page), n = _(
|
|
24
|
+
(r = j, o = !1) => {
|
|
25
25
|
o && u(!0), L(i, {
|
|
26
26
|
page: r,
|
|
27
|
-
timezone:
|
|
28
|
-
course_stream: c ===
|
|
27
|
+
timezone: k(),
|
|
28
|
+
course_stream: c === Y.TEACHER ? m : []
|
|
29
29
|
});
|
|
30
30
|
},
|
|
31
31
|
[L, i, c, m]
|
|
@@ -59,17 +59,17 @@ const S = $(
|
|
|
59
59
|
});
|
|
60
60
|
}, [i, t]), f(() => {
|
|
61
61
|
n(1, !1);
|
|
62
|
-
}, [n]), d ? /* @__PURE__ */ s(
|
|
63
|
-
|
|
62
|
+
}, [n]), d ? /* @__PURE__ */ s(W, { height: T ?? "100vh", onTryAgain: x }) : z && !l.length ? /* @__PURE__ */ s(
|
|
63
|
+
b,
|
|
64
64
|
{
|
|
65
65
|
$alignItems: "center",
|
|
66
66
|
$justifyContent: "center",
|
|
67
67
|
$height: T || "100vh",
|
|
68
|
-
children: /* @__PURE__ */ s(
|
|
68
|
+
children: /* @__PURE__ */ s(q, { width: "100%", height: "100%" })
|
|
69
69
|
}
|
|
70
|
-
) : /* @__PURE__ */ s(
|
|
70
|
+
) : /* @__PURE__ */ s(F, { $alignItems: "center", $gapX: 1, children: /* @__PURE__ */ P(V, { children: [
|
|
71
71
|
l.map((r, o) => /* @__PURE__ */ s(D, { children: /* @__PURE__ */ s(
|
|
72
|
-
|
|
72
|
+
G,
|
|
73
73
|
{
|
|
74
74
|
entry: r,
|
|
75
75
|
isFirstElement: o === 0,
|
|
@@ -81,7 +81,7 @@ const S = $(
|
|
|
81
81
|
}
|
|
82
82
|
) }, `timeline-entry-${o}`)),
|
|
83
83
|
/* @__PURE__ */ s(
|
|
84
|
-
|
|
84
|
+
X,
|
|
85
85
|
{
|
|
86
86
|
onLoadMore: v,
|
|
87
87
|
isLoading: E,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daily-timeline.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, useEffect, useMemo, useState, type FC } from 'react';\n\nimport { type ITimelineData, useDailyTimelineGet } from './api/use-daily-timeline-get';\nimport * as Styled from './daily-timeline-styled';\nimport { CARD_TYPE, USER_TYPE, type IDailyTimelineProps } from './daily-timeline-types';\nimport { INITIAL_PAGE } from './comps/constants';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { DAILY_TIMELINE_ANALYTICS_EVENTS } from './daily-timeline-events';\nimport DailyTimelineView from './daily-timeline-view';\nimport { useUIContext } from '../../ui/context/context';\nimport usePrevious from '../../hooks/use-previous';\nimport Error from '../../ui/error/error';\nimport FlexView from '../../ui/layout/flex-view';\nimport IntersectionLoader from '../../ui/intersection-loader/intersection-loader';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\n\nconst DailyTimeline: FC<IDailyTimelineProps> = memo(\n ({ userType, studentId, courseStreams, onPuzzleClick, onReviewClick, scrollAreaHeight }) => {\n const [allTimelineData, setAllTimelineData] = useState<ITimelineData[]>([]);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const { onEvent: trackEvent } = useUIContext();\n const {\n get: getTimeline,\n data: timelineData,\n isProcessingFailed,\n isProcessing,\n } = useDailyTimelineGet(studentId);\n\n const prevCurrentPage = usePrevious(timelineData?.curr_page);\n\n const fetchTimeline = useCallback(\n (page = INITIAL_PAGE, append = false) => {\n if (append) {\n setIsLoadingMore(true);\n }\n\n getTimeline(studentId, {\n page,\n timezone: getTimezone(),\n course_stream: userType === USER_TYPE.TEACHER ? courseStreams : [],\n });\n },\n [getTimeline, studentId, userType, courseStreams],\n );\n\n const shouldShowTag = useMemo(() => {\n const allCourseStreams = new Set<string>();\n\n allTimelineData.forEach(entry => {\n if (entry.daily_logs) {\n entry.daily_logs.forEach(log => {\n if (log.course_stream && log.course_stream !== CARD_TYPE.CIRCLE) {\n allCourseStreams.add(log.course_stream);\n }\n });\n }\n });\n\n const courseStreamsSet = new Set(\n (courseStreams || []).filter(stream => String(stream) !== CARD_TYPE.CIRCLE),\n );\n\n return (\n courseStreamsSet.size > 1 ||\n allCourseStreams.size > 1 ||\n (courseStreamsSet.size > 0 &&\n allCourseStreams.size > 0 &&\n (courseStreamsSet.size !== allCourseStreams.size ||\n !Array.from(courseStreamsSet).every(stream => allCourseStreams.has(stream))))\n );\n }, [allTimelineData, courseStreams]);\n\n const handleLoadMore = useCallback(() => {\n if (timelineData?.next_page && !isLoadingMore) {\n fetchTimeline(timelineData.next_page, true);\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_SCROLLED, {\n student_id: studentId,\n });\n }\n }, [timelineData, studentId, trackEvent, isLoadingMore, fetchTimeline]);\n\n const onTryAgain = useCallback(() => {\n fetchTimeline(1, false);\n setAllTimelineData([]);\n }, [fetchTimeline]);\n\n useEffect(() => {\n if (timelineData) {\n if (timelineData.curr_page === 1) {\n setAllTimelineData(timelineData?.user_logs ?? []);\n } else if (timelineData.curr_page && prevCurrentPage !== timelineData.curr_page) {\n setAllTimelineData(prev => [...prev, ...(timelineData.user_logs ?? [])]);\n setIsLoadingMore(false);\n }\n }\n }, [timelineData, prevCurrentPage]);\n\n useEffect(() => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_VIEWED, {\n student_id: studentId,\n });\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n return () => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_CLOSED, {\n student_id: studentId,\n });\n };\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n fetchTimeline(1, false);\n }, [fetchTimeline]);\n\n if (isProcessingFailed) {\n return <Error height={scrollAreaHeight ?? '100vh'} onTryAgain={onTryAgain} />;\n }\n\n if (isProcessing && !allTimelineData.length) {\n return (\n <FlexView\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $height={scrollAreaHeight || '100vh'}\n >\n <AppLoader width=\"100%\" height=\"100%\" />\n </FlexView>\n );\n }\n\n return (\n <Styled.ScrollWrapper $alignItems=\"center\" $gapX={1}>\n <Styled.DailyTimelineContainer>\n {allTimelineData.map((entry, index) => (\n <Fragment key={`timeline-entry-${index}`}>\n <DailyTimelineView\n entry={entry}\n isFirstElement={index === 0}\n shouldShowTag={shouldShowTag}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n userType={userType}\n studentId={studentId}\n />\n </Fragment>\n ))}\n <IntersectionLoader\n onLoadMore={handleLoadMore}\n isLoading={isLoadingMore}\n hasMore={!!timelineData?.next_page}\n />\n </Styled.DailyTimelineContainer>\n </Styled.ScrollWrapper>\n );\n },\n);\n\nDailyTimeline.displayName = 'DailyTimeline';\n\nexport default DailyTimeline;\n"],"names":["DailyTimeline","memo","userType","studentId","courseStreams","onPuzzleClick","onReviewClick","scrollAreaHeight","allTimelineData","setAllTimelineData","useState","isLoadingMore","setIsLoadingMore","trackEvent","useUIContext","getTimeline","timelineData","isProcessingFailed","isProcessing","useDailyTimelineGet","prevCurrentPage","usePrevious","fetchTimeline","useCallback","page","INITIAL_PAGE","append","getTimezone","USER_TYPE","shouldShowTag","useMemo","allCourseStreams","entry","log","CARD_TYPE","courseStreamsSet","stream","handleLoadMore","DAILY_TIMELINE_ANALYTICS_EVENTS","onTryAgain","useEffect","prev","jsx","Error","FlexView","AppLoader","Styled.ScrollWrapper","jsxs","Styled.DailyTimelineContainer","index","Fragment","DailyTimelineView","IntersectionLoader","DailyTimeline$1"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,eAAAC,GAAe,eAAAC,GAAe,kBAAAC,QAAuB;AAC1F,UAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAA0B,CAAE,CAAA,GACpE,CAACC,GAAeC,CAAgB,IAAIF,EAAS,EAAK,GAClD,EAAE,SAASG,EAAW,IAAIC,EAAa,GACvC;AAAA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EAACI,GAAA,EAAqB,aAAY,UAAS,OAAO,GAChD,UAAA,gBAAAC,EAACC,GAAA,EACE,UAAA;AAAA,MAAAxC,EAAgB,IAAI,CAACwB,GAAOiB,wBAC1BC,GACC,EAAA,UAAA,gBAAAR;AAAA,QAACS;AAAA,QAAA;AAAA,UACC,OAAAnB;AAAA,UACA,gBAAgBiB,MAAU;AAAA,UAC1B,eAAApB;AAAA,UACA,eAAAxB;AAAA,UACA,eAAAC;AAAA,UACA,UAAAJ;AAAA,UACA,WAAAC;AAAA,QAAA;AAAA,MARW,EAAA,GAAA,kBAAkB8C,CAAK,EAUtC,CACD;AAAA,MACD,gBAAAP;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,YAAYf;AAAA,UACZ,WAAW1B;AAAA,UACX,SAAS,CAAC,EAACK,KAAA,QAAAA,EAAc;AAAA,QAAA;AAAA,MAC3B;AAAA,IAAA,EACF,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEAhB,EAAc,cAAc;AAE5B,MAAAqD,KAAerD;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as a, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { memo as x } from "react";
|
|
3
3
|
import { GoalsSection as P } from "./monthly-card.styled.js";
|
|
4
|
-
import I from "
|
|
4
|
+
import I from "../../monthly-report/comps/goals/goals-card/goals-card.js";
|
|
5
5
|
import n from "../../../../ui/layout/flex-view.js";
|
|
6
6
|
import M from "../../../../ui/buttons/clickable/clickable.js";
|
|
7
7
|
import w from "../../../../../assets/line-icons/icons/carat-right.js";
|
|
@@ -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 '
|
|
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;;AACJ,QAAMC,IAAoB,MAAM;AAC9B,IAAIH,KACYA,GAAAH,KAAA,gBA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,EAAS,UAAU,GAAG,cAAa,WACjC,UAAA;AAAA,QAAA,CAAC,CAACL,EAAiB,UAClB,gBAAAM,EAACK,GAAA,EAAoB,UAAU,GAC5B,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,EAAK7B,CAAiB;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createGetAPI as r, createPatchAPI as o } from "@cuemath/rest-api";
|
|
2
|
-
import { BASE_URL_V1 as e } from "
|
|
2
|
+
import { BASE_URL_V1 as e } from "../../../../../constants/api.js";
|
|
3
3
|
const { useGet: p, invalidate: a } = r({
|
|
4
4
|
getURL: (t) => `${e}/monthly-progress-reports/${t}`
|
|
5
5
|
}), { usePatch: h } = o({
|
package/dist/features/timeline/monthly-timeline/monthly-report/api/use-monthly-report-get.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-monthly-report-get.js","sources":["../../../../../../src/features/timeline/monthly-timeline/monthly-report/api/use-monthly-report-get.ts"],"sourcesContent":["import { createGetAPI, createPatchAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../../constants/api';\nimport { type IMonthlyReportResponse } from '../monthly-report-types';\n\nconst { useGet: useMonthlyReportGet, invalidate: invalidateMonthlyReport } =\n createGetAPI<IMonthlyReportResponse>({\n getURL: (reportId: string) => {\n return `${BASE_URL_V1}/monthly-progress-reports/${reportId}`;\n },\n });\n\nconst { usePatch: useMonthlyReportPatch } = createPatchAPI<\n IMonthlyReportResponse,\n { feedback: string }\n>({\n getURL: (reportId: string) => {\n return `${BASE_URL_V1}/monthly-progress-reports/${reportId}`;\n },\n});\n\nexport { useMonthlyReportGet, useMonthlyReportPatch, invalidateMonthlyReport };\n"],"names":["useMonthlyReportGet","invalidateMonthlyReport","createGetAPI","reportId","BASE_URL_V1","useMonthlyReportPatch","createPatchAPI"],"mappings":";;AAKA,MAAM,EAAE,QAAQA,GAAqB,YAAYC,EAAA,IAC/CC,EAAqC;AAAA,EACnC,QAAQ,CAACC,MACA,GAAGC,CAAW,6BAA6BD,CAAQ;AAE9D,CAAC,GAEG,EAAE,UAAUE,EAAsB,IAAIC,EAG1C;AAAA,EACA,QAAQ,CAACH,MACA,GAAGC,CAAW,6BAA6BD,CAAQ;AAE9D,CAAC;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as f, useMemo as l } from "react";
|
|
3
3
|
import { CarousalItem as u, CarouselWrapper as x } from "./achievements.styled.js";
|
|
4
|
-
import a from "
|
|
5
|
-
import n from "
|
|
6
|
-
import h from "
|
|
7
|
-
import c from "
|
|
8
|
-
import { IS_APP_RUNNING_IN_RN as t } from "
|
|
4
|
+
import a from "../../../../../ui/text/text.js";
|
|
5
|
+
import n from "../../../../../ui/separator/separator.js";
|
|
6
|
+
import h from "../../../../../ui/layout/flex-view.js";
|
|
7
|
+
import c from "../../../../../ui/swipeable-carousel/swipeable-carousel.js";
|
|
8
|
+
import { IS_APP_RUNNING_IN_RN as t } from "../../../../../../constants/app-config.js";
|
|
9
9
|
import { dotsConfig as w, navigationConfig as _ } from "./constant.js";
|
|
10
10
|
const L = ({ achievements: o, studentName: e }) => {
|
|
11
11
|
const m = f(null), s = l(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"achievements.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/achievements/achievements.tsx"],"sourcesContent":["import { useMemo, useRef, type FC } from 'react';\n\nimport { type IAchievementsProps } from './achievements-types';\nimport * as Styled from './achievements.styled';\nimport Text from '../../../../../ui/text/text';\nimport Separator from '../../../../../ui/separator/separator';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport SwipeableCarousel from '../../../../../ui/swipeable-carousel/swipeable-carousel';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../../constants/app-config';\nimport type { ISwipeableCarouselRefs } from '../../../../../ui/swipeable-carousel/swipeable-carousel-types';\nimport { dotsConfig, navigationConfig } from './constant';\n\nconst Achievements: FC<IAchievementsProps> = ({ achievements, studentName }) => {\n const carouselRef = useRef<ISwipeableCarouselRefs>(null);\n\n const carouselItems = useMemo(\n () =>\n achievements.map(achievement => (\n <Styled.CarousalItem\n key={achievement.asset_id}\n src={achievement.url}\n alt={`Achievement ${achievement.asset_id}`}\n withLoader\n height={IS_APP_RUNNING_IN_RN ? '343px' : '480px'}\n width={IS_APP_RUNNING_IN_RN ? '343px' : '480px'}\n />\n )),\n [achievements],\n );\n\n const tipText = useMemo(\n () =>\n achievements.length >= 2\n ? `Outstanding month! ${studentName} earned several achievements showing excellent progress across different areas.`\n : `Great work! ${studentName} earned new achievements this month, demonstrating growth in their skills.`,\n [achievements.length, studentName],\n );\n\n const showNavigationButtons = !IS_APP_RUNNING_IN_RN && carouselItems.length > 1;\n\n if (!achievements?.length) {\n return null;\n }\n\n return (\n <FlexView>\n <Text $renderAs=\"ab1-bold\" color=\"BLACK_1\">\n Achievements\n </Text>\n <Separator heightX={0.125} />\n <FlexView $marginBottom={-24}>\n <Text $renderAs=\"ub2\" color=\"BLUE_6\">\n {tipText}\n </Text>\n </FlexView>\n {IS_APP_RUNNING_IN_RN && <Separator heightX={1} />}\n <Styled.CarouselWrapper\n $height={IS_APP_RUNNING_IN_RN ? '380px' : '580px'}\n $marginBottomX={IS_APP_RUNNING_IN_RN ? -0.5 : -1}\n >\n <SwipeableCarousel\n ref={carouselRef}\n items={carouselItems}\n defaultIndex={0}\n transitionDuration={300}\n showIndicators={true}\n dotsConfig={dotsConfig}\n showNavigationButtons={showNavigationButtons}\n navigationConfig={navigationConfig}\n />\n </Styled.CarouselWrapper>\n <Separator heightX={0.75} />\n </FlexView>\n );\n};\n\nexport default Achievements;\n"],"names":["Achievements","achievements","studentName","carouselRef","useRef","carouselItems","useMemo","achievement","jsx","Styled.CarousalItem","IS_APP_RUNNING_IN_RN","tipText","showNavigationButtons","FlexView","Text","Separator","Styled.CarouselWrapper","SwipeableCarousel","dotsConfig","navigationConfig"],"mappings":";;;;;;;;;AAYA,MAAMA,IAAuC,CAAC,EAAE,cAAAC,GAAc,aAAAC,QAAkB;AACxE,QAAAC,IAAcC,EAA+B,IAAI,GAEjDC,IAAgBC;AAAA,IACpB,MACEL,EAAa,IAAI,CACfM,MAAA,gBAAAC;AAAA,MAACC;AAAAA,MAAA;AAAA,QAEC,KAAKF,EAAY;AAAA,QACjB,KAAK,eAAeA,EAAY,QAAQ;AAAA,QACxC,YAAU;AAAA,QACV,QAAQG,IAAuB,UAAU;AAAA,QACzC,OAAOA,IAAuB,UAAU;AAAA,MAAA;AAAA,MALnCH,EAAY;AAAA,IAAA,CAOpB;AAAA,IACH,CAACN,CAAY;AAAA,EAAA,GAGTU,IAAUL;AAAA,IACd,MACEL,EAAa,UAAU,IACnB,sBAAsBC,CAAW,oFACjC,eAAeA,CAAW;AAAA,IAChC,CAACD,EAAa,QAAQC,CAAW;AAAA,EAAA,GAG7BU,IAAwB,CAACF,KAAwBL,EAAc,SAAS;AAE1E,SAACJ,KAAA,QAAAA,EAAc,2BAKhBY,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAL,EAACM,GAAK,EAAA,WAAU,YAAW,OAAM,WAAU,UAE3C,gBAAA;AAAA,IACA,gBAAAN,EAACO,GAAU,EAAA,SAAS,MAAO,CAAA;AAAA,IAC3B,gBAAAP,EAACK,GAAS,EAAA,eAAe,KACvB,UAAA,gBAAAL,EAACM,GAAK,EAAA,WAAU,OAAM,OAAM,UACzB,UAAAH,EACH,CAAA,GACF;AAAA,IACCD,KAAwB,gBAAAF,EAACO,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,IAChD,gBAAAP;AAAA,MAACQ;AAAAA,MAAA;AAAA,QACC,SAASN,IAAuB,UAAU;AAAA,QAC1C,gBAAgBA,IAAuB,OAAO;AAAA,QAE9C,UAAA,gBAAAF;AAAA,UAACS;AAAA,UAAA;AAAA,YACC,KAAKd;AAAA,YACL,OAAOE;AAAA,YACP,cAAc;AAAA,YACd,oBAAoB;AAAA,YACpB,gBAAgB;AAAA,YAChB,YAAAa;AAAA,YACA,uBAAAN;AAAA,YACA,kBAAAO;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,IACA,gBAAAX,EAACO,GAAU,EAAA,SAAS,KAAM,CAAA;AAAA,EAC5B,EAAA,CAAA,IA/BO;AAiCX;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import o from "styled-components";
|
|
2
|
-
import t from "
|
|
3
|
-
import e from "
|
|
2
|
+
import t from "../../../../../ui/image/image.js";
|
|
3
|
+
import e from "../../../../../ui/layout/flex-view.js";
|
|
4
4
|
const m = o(e)`
|
|
5
5
|
overflow: hidden;
|
|
6
6
|
position: relative;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"achievements.styled.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/achievements/achievements.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport Image from '../../../../../ui/image/image';\nimport FlexView from '../../../../../ui/layout/flex-view';\n\nexport const CarouselWrapper = styled(FlexView)`\n overflow: hidden;\n position: relative;\n`;\n\nexport const CarousalItem = styled(Image)`\n position: relative;\n touch-action: auto;\n`;\n"],"names":["CarouselWrapper","styled","FlexView","CarousalItem","Image"],"mappings":";;;AAKa,MAAAA,IAAkBC,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAKjCC,IAAeF,EAAOG,CAAK;AAAA;AAAA;AAAA;"}
|
package/dist/features/timeline/monthly-timeline/monthly-report/comps/achievements/constant.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/achievements/constant.ts"],"sourcesContent":["const dotsConfig = {\n dotColor: 'BLACK_1',\n inactiveDotColor: 'WHITE_1',\n activeIndicatorSize: '8px',\n inactiveIndicatorSize: '8px',\n spacing: '8px',\n} as const;\n\nconst navigationConfig = {\n buttonVariant: 'secondary',\n buttonSize: 'xsmall',\n spacing: 8,\n} as const;\n\nexport { dotsConfig, navigationConfig };\n"],"names":["dotsConfig","navigationConfig"],"mappings":"AAAA,MAAMA,IAAa;AAAA,EACjB,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,SAAS;AACX,GAEMC,IAAmB;AAAA,EACvB,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,SAAS;AACX;"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import { getCardTypeIconMap as
|
|
2
|
+
import { memo as z, useRef as I, useState as B, useMemo as d, useCallback as u } from "react";
|
|
3
|
+
import { getCardTypeIconMap as $, stateIcon as p } from "../constants.js";
|
|
4
4
|
import { CARD_TYPE as f } from "../../../monthly-report-types.js";
|
|
5
|
-
import { ActivityCardContainerWrapper as
|
|
6
|
-
import n from "
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { NODE_STATE as h } from "
|
|
12
|
-
import
|
|
13
|
-
import { countActivitiesByState as
|
|
14
|
-
const
|
|
5
|
+
import { ActivityCardContainerWrapper as M, ActivityCardContainer as S } from "./activities-card.styled.js";
|
|
6
|
+
import n from "../../../../../../ui/layout/flex-view.js";
|
|
7
|
+
import T from "../../../../../../ui/lottie-animation/lottie-animation.js";
|
|
8
|
+
import m from "../../../../../../ui/text/text.js";
|
|
9
|
+
import j from "../../../../../../homework/card-title.js";
|
|
10
|
+
import k from "../activities-card-puzzles/activities-card-puzzles.js";
|
|
11
|
+
import { NODE_STATE as h } from "../../../../../daily-timeline/daily-timeline-types.js";
|
|
12
|
+
import G from "../../../../../../ui/buttons/text-button/text-button.js";
|
|
13
|
+
import { countActivitiesByState as K } from "../utils.js";
|
|
14
|
+
const O = {
|
|
15
15
|
autoplay: !1,
|
|
16
16
|
loop: !0,
|
|
17
17
|
renderer: "canvas"
|
|
18
|
-
},
|
|
18
|
+
}, P = ({
|
|
19
19
|
cardType: t,
|
|
20
20
|
nodeType: A,
|
|
21
21
|
activitiesList: o = [],
|
|
22
22
|
onPuzzleClick: C
|
|
23
23
|
}) => {
|
|
24
|
-
const a =
|
|
25
|
-
const { totalDone: e, totalPending: i, totalOverdue: c } =
|
|
24
|
+
const a = I(null), [s, x] = B(!1), b = d(() => {
|
|
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`,
|
|
@@ -47,16 +47,16 @@ const K = {
|
|
|
47
47
|
}, []);
|
|
48
48
|
return /* @__PURE__ */ l(n, { onMouseEnter: _, onMouseLeave: w, children: [
|
|
49
49
|
/* @__PURE__ */ r(
|
|
50
|
-
|
|
50
|
+
M,
|
|
51
51
|
{
|
|
52
|
-
$background:
|
|
52
|
+
$background: $(t).color,
|
|
53
53
|
children: /* @__PURE__ */ l(
|
|
54
|
-
|
|
54
|
+
S,
|
|
55
55
|
{
|
|
56
56
|
$flexDirection: "row",
|
|
57
57
|
$alignItems: "center",
|
|
58
58
|
$height: "56px",
|
|
59
|
-
$bgImage:
|
|
59
|
+
$bgImage: $(t).background,
|
|
60
60
|
$gutterX: 0.78125,
|
|
61
61
|
$flexGap: 8.5,
|
|
62
62
|
children: [
|
|
@@ -71,28 +71,28 @@ const K = {
|
|
|
71
71
|
$alignItems: "center",
|
|
72
72
|
$justifyContent: "center",
|
|
73
73
|
children: /* @__PURE__ */ r(
|
|
74
|
-
|
|
74
|
+
T,
|
|
75
75
|
{
|
|
76
76
|
ref: a,
|
|
77
|
-
src:
|
|
77
|
+
src: $(t).lottie,
|
|
78
78
|
width: 32,
|
|
79
79
|
height: 32,
|
|
80
|
-
settings:
|
|
80
|
+
settings: O
|
|
81
81
|
}
|
|
82
82
|
)
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
85
|
/* @__PURE__ */ l(n, { children: [
|
|
86
|
-
/* @__PURE__ */ r(
|
|
87
|
-
/* @__PURE__ */ r(
|
|
86
|
+
/* @__PURE__ */ r(j, { cardHeader: X, nodeType: A }),
|
|
87
|
+
/* @__PURE__ */ r(m, { $renderAs: "ub3", $color: "BLACK_1", children: b })
|
|
88
88
|
] })
|
|
89
89
|
]
|
|
90
90
|
}
|
|
91
91
|
)
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
|
-
o.length > 0 && (t === f.puzzle ? /* @__PURE__ */ r(
|
|
95
|
-
E.map(({ state: e, title: i, subtext: c, id: D }) => /* @__PURE__ */ l(n, { $flexDirection: "row", $flexGapX: 1.05, children: [
|
|
94
|
+
o.length > 0 && (t === f.puzzle ? /* @__PURE__ */ r(k, { puzzles: o, onPuzzleClick: C }) : /* @__PURE__ */ l(n, { $flexRowGapX: 1.25, $gutterX: 1, $gapX: 1, $borderColor: "GREY_2", children: [
|
|
95
|
+
E.map(({ state: e, title: i, subtext: c, id: D }, 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
|
{
|
|
@@ -106,12 +106,12 @@ const K = {
|
|
|
106
106
|
}
|
|
107
107
|
) }),
|
|
108
108
|
/* @__PURE__ */ l(n, { $flexRowGap: 4, children: [
|
|
109
|
-
/* @__PURE__ */ r(
|
|
110
|
-
/* @__PURE__ */ r(
|
|
109
|
+
/* @__PURE__ */ r(m, { $renderAs: "ub2", $color: "BLACK_1", children: i || "" }),
|
|
110
|
+
/* @__PURE__ */ r(m, { $renderAs: "ub3", $color: "BLACK_T_60", children: c || "" })
|
|
111
111
|
] })
|
|
112
|
-
] }, D)),
|
|
112
|
+
] }, `${D}-${R}`)),
|
|
113
113
|
(g > 0 || s) && o.length > 3 && /* @__PURE__ */ r(n, { $gutterX: 2, children: /* @__PURE__ */ r(
|
|
114
|
-
|
|
114
|
+
G,
|
|
115
115
|
{
|
|
116
116
|
label: s ? "Show less" : `+${g} activities`,
|
|
117
117
|
size: "regular",
|
|
@@ -121,8 +121,8 @@ const K = {
|
|
|
121
121
|
) })
|
|
122
122
|
] }))
|
|
123
123
|
] });
|
|
124
|
-
},
|
|
124
|
+
}, ee = z(P);
|
|
125
125
|
export {
|
|
126
|
-
|
|
126
|
+
ee as default
|
|
127
127
|
};
|
|
128
128
|
//# sourceMappingURL=activities-card.js.map
|
|
@@ -0,0 +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,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC,IAAiB,CAAC;AAAA,EAClB,eAAAC;AACF,MAAM;AACE,QAAAC,IAA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AI,CAAC,EAAE,OAAAqB,GAAO,OAAAC,GAAO,SAAAC,GAAS,IAAAC,EAAM,GAAAC,MACtD,gBAAAd,EAAAC,GAAA,EAAS,gBAAe,OAAM,WAAW,MACxC,UAAA;AAAA,QAAC,gBAAAC,EAAAD,GAAA,EAAS,OAAO,MACf,UAAA,gBAAAC;AAAA,UAACD;AAAA,UAAA;AAAA,YACC,gBAAgB;AAAA,YAChB,aACES,MAAUK,EAAW,WAAWL,MAAUK,EAAW,cACjD,QACA;AAAA,YAEN,SAAS;AAAA,YACT,UAAU;AAAA,YACV,aAAY;AAAA,YACZ,iBAAgB;AAAA,YAEf,UAAA,CAAC,CAACL,MAAUM,EAAUN,CAAmB,KAAKM,EAAUD,EAAW,SAAS;AAAA,UAAA;AAAA,QAAA,GAEjF;AAAA,QACA,gBAAAf,EAACC,GAAS,EAAA,aAAa,GACrB,UAAA;AAAA,UAAA,gBAAAC,EAACM,KAAK,WAAU,OAAM,QAAO,WAC1B,eAAS,IACZ;AAAA,4BACCA,GAAK,EAAA,WAAU,OAAM,QAAO,cAC1B,eAAW,IACd;AAAA,QAAA,GACF;AAAA,MAAA,EAAA,GAxBmD,GAAGK,CAAE,IAAIC,CAAK,EAyBnE,CACD;AAAA,OACCxB,IAAiB,KAAKX,MAAsBJ,EAAe,SAAS,KACpE,gBAAA2B,EAACD,GAAS,EAAA,UAAU,GAClB,UAAA,gBAAAC;AAAA,QAACe;AAAA,QAAA;AAAA,UACC,OAAOtC,IAAoB,cAAc,IAAIW,CAAc;AAAA,UAC3D,MAAK;AAAA,UACL,OAAM;AAAA,UACN,SAASQ;AAAA,QAAA;AAAA,MAAA,GAEb;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEN,EAAA,CAAA;AAEJ,GAEeoB,KAAAC,EAAK/C,CAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activities-card.styled.js","sources":["../../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card/activities-card.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../../../ui/layout/flex-view';\n\nexport const ActivityCardContainer = styled(FlexView)<{ $bgImage: string }>`\n background-image: url(${({ $bgImage }) => $bgImage});\n background-size: cover;\n background-position: center left;\n background-repeat: no-repeat;\n max-width: 512px;\n position: relative;\n overflow: hidden;\n`;\n\nexport const ActivityCardContainerWrapper = styled(FlexView)`\n position: relative;\n outline: 1px solid ${({ theme }) => theme.colors.WHITE_5};\n`;\n\nexport const MoreActivitiesContainer = styled(FlexView)`\n border: 2px dashed ${({ theme }) => theme.colors.ORANGE_2};\n border-radius: 8px;\n padding: 12px;\n margin-top: 8px;\n position: relative;\n`;\n\nexport const CountBadge = styled(FlexView)`\n background-color: ${({ theme }) => theme.colors.ORANGE_2};\n color: white;\n border-radius: 4px;\n padding: 4px 8px;\n font-size: 12px;\n font-weight: 600;\n min-width: 24px;\n height: 20px;\n align-items: center;\n justify-content: center;\n`;\n\nexport const MoreActivitiesLink = styled.button`\n background: none;\n border: none;\n color: ${({ theme }) => theme.colors.BLACK_1};\n text-decoration: underline;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n padding: 0;\n margin: 0;\n\n &:hover {\n color: ${({ theme }) => theme.colors.ORANGE_2};\n }\n`;\n"],"names":["ActivityCardContainer","styled","FlexView","$bgImage","ActivityCardContainerWrapper","theme"],"mappings":";;AAIa,MAAAA,IAAwBC,EAAOC,CAAQ;AAAA,0BAC1B,CAAC,EAAE,UAAAC,EAAS,MAAMA,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASvCC,IAA+BH,EAAOC,CAAQ;AAAA;AAAA,uBAEpC,CAAC,EAAE,OAAAG,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAGnBJ,EAAOC,CAAQ;AAAA,uBAC/B,CAAC,EAAE,OAAAG,EAAA,MAAYA,EAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAOjCJ,EAAOC,CAAQ;AAAA,sBACnB,CAAC,EAAE,OAAAG,EAAA,MAAYA,EAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYxBJ,EAAO;AAAA;AAAA;AAAA,WAG9B,CAAC,EAAE,OAAAI,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aASjC,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,QAAQ;AAAA;AAAA;"}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { PuzzleContainer as
|
|
6
|
-
import i from "
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import D from "
|
|
10
|
-
import { NODE_STATE as
|
|
11
|
-
import { stateIcon as
|
|
12
|
-
import { IS_APP_RUNNING_IN_RN as
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as I, useRef as v, useState as m, useCallback as s, useEffect as w } from "react";
|
|
3
|
+
import A from "../../../../../../../assets/line-icons/icons/chevron-left.js";
|
|
4
|
+
import N from "../../../../../../../assets/line-icons/icons/chevron-right.js";
|
|
5
|
+
import { PuzzleContainer as T, StatusIcon as X, ContentWrapper as x, ScrollButton as d, ScrollContainer as B } from "./activities-card-puzzles.styled.js";
|
|
6
|
+
import i from "../../../../../../ui/layout/flex-view.js";
|
|
7
|
+
import k from "../../../../../../ui/image/image.js";
|
|
8
|
+
import f from "../../../../../../ui/separator/separator.js";
|
|
9
|
+
import D from "../../../../../../ui/text/text.js";
|
|
10
|
+
import { NODE_STATE as h } from "../../../../../daily-timeline/daily-timeline-types.js";
|
|
11
|
+
import { stateIcon as $ } from "../constants.js";
|
|
12
|
+
import { IS_APP_RUNNING_IN_RN as g } from "../../../../../../../constants/app-config.js";
|
|
13
13
|
const j = ({
|
|
14
|
-
puzzles:
|
|
14
|
+
puzzles: u,
|
|
15
15
|
onPuzzleClick: o
|
|
16
16
|
}) => {
|
|
17
|
-
const n =
|
|
17
|
+
const n = u || [], r = v(null), [_, C] = m(!1), [b, p] = m(!1), S = s(() => {
|
|
18
18
|
r.current && r.current.scrollBy({ left: -180, behavior: "smooth" });
|
|
19
|
-
}, []),
|
|
19
|
+
}, []), E = s(() => {
|
|
20
20
|
r.current && r.current.scrollBy({ left: 180, behavior: "smooth" });
|
|
21
|
-
}, []), c =
|
|
21
|
+
}, []), c = s(() => {
|
|
22
22
|
if (r.current) {
|
|
23
|
-
const { scrollLeft: t, scrollWidth:
|
|
24
|
-
|
|
23
|
+
const { scrollLeft: t, scrollWidth: a, clientWidth: L } = r.current;
|
|
24
|
+
C(t > 0), p(t < a - L - 10);
|
|
25
25
|
}
|
|
26
26
|
}, []);
|
|
27
|
-
|
|
27
|
+
w(() => {
|
|
28
28
|
const t = r.current;
|
|
29
29
|
if (t)
|
|
30
30
|
return c(), t.addEventListener("scroll", c), () => {
|
|
31
31
|
t.removeEventListener("scroll", c);
|
|
32
32
|
};
|
|
33
33
|
}, [c, n.length]);
|
|
34
|
-
const
|
|
35
|
-
(t) => /* @__PURE__ */
|
|
36
|
-
|
|
34
|
+
const R = s(
|
|
35
|
+
(t, a) => /* @__PURE__ */ l(
|
|
36
|
+
T,
|
|
37
37
|
{
|
|
38
38
|
$gapX: 1,
|
|
39
39
|
$imageHue: t.image_hue || "BLUE",
|
|
@@ -49,20 +49,20 @@ const j = ({
|
|
|
49
49
|
}),
|
|
50
50
|
children: [
|
|
51
51
|
/* @__PURE__ */ e(
|
|
52
|
-
|
|
52
|
+
X,
|
|
53
53
|
{
|
|
54
54
|
$borderRadiusX: 1,
|
|
55
|
-
$background: t.state ===
|
|
55
|
+
$background: t.state === h.PENDING || t.state === h.NOT_STARTED ? "RED" : "BLACK_1",
|
|
56
56
|
$widthX: 1,
|
|
57
57
|
$heightX: 1,
|
|
58
58
|
$alignItems: "center",
|
|
59
59
|
$justifyContent: "center",
|
|
60
|
-
children: t.state && (
|
|
60
|
+
children: t.state && ($[t.state] || $[h.COMPLETED])
|
|
61
61
|
}
|
|
62
62
|
),
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ l(i, { $background: "TRANSPARENT", $alignItems: "center", children: [
|
|
64
64
|
t.image_url && /* @__PURE__ */ e(
|
|
65
|
-
|
|
65
|
+
k,
|
|
66
66
|
{
|
|
67
67
|
src: t.image_url ?? "",
|
|
68
68
|
alt: "Puzzle illustration",
|
|
@@ -71,34 +71,37 @@ const j = ({
|
|
|
71
71
|
withLoader: !0
|
|
72
72
|
}
|
|
73
73
|
),
|
|
74
|
-
/* @__PURE__ */ e(
|
|
74
|
+
/* @__PURE__ */ e(f, { heightX: 1 }),
|
|
75
75
|
/* @__PURE__ */ e(i, { $gutterX: 0.25, children: /* @__PURE__ */ e(D, { $renderAs: "ab3", $align: "center", children: t.title }) })
|
|
76
76
|
] })
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
|
-
t.id
|
|
79
|
+
`${t.id}-${a}`
|
|
80
80
|
),
|
|
81
81
|
[o]
|
|
82
82
|
);
|
|
83
|
-
return !n || n.length === 0 ? null : /* @__PURE__ */ e(
|
|
83
|
+
return !n || n.length === 0 ? null : /* @__PURE__ */ e(x, { $flexRowGapX: 1, children: /* @__PURE__ */ l(i, { $position: "relative", $borderColor: "GREY_2", children: [
|
|
84
84
|
/* @__PURE__ */ e(
|
|
85
|
-
|
|
85
|
+
d,
|
|
86
86
|
{
|
|
87
87
|
$background: "BLACK_T_60",
|
|
88
88
|
$justifyContent: "center",
|
|
89
89
|
$alignItems: "center",
|
|
90
90
|
$widthX: 2,
|
|
91
91
|
$height: "100%",
|
|
92
|
-
onClick:
|
|
93
|
-
$visible: !
|
|
92
|
+
onClick: S,
|
|
93
|
+
$visible: !g && _,
|
|
94
94
|
$left: "0px",
|
|
95
95
|
$right: "auto",
|
|
96
|
-
children: /* @__PURE__ */ e(
|
|
96
|
+
children: /* @__PURE__ */ e(A, { width: 24, height: 24 })
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
|
-
/* @__PURE__ */ e(i, { $
|
|
99
|
+
/* @__PURE__ */ e(i, { $gapX: 1, children: /* @__PURE__ */ e(B, { ref: r, children: /* @__PURE__ */ l(i, { $flexDirection: "row", $flexGapX: 1, children: [
|
|
100
|
+
/* @__PURE__ */ e(f, {}),
|
|
101
|
+
n.map(R)
|
|
102
|
+
] }) }) }),
|
|
100
103
|
/* @__PURE__ */ e(
|
|
101
|
-
|
|
104
|
+
d,
|
|
102
105
|
{
|
|
103
106
|
$position: "absolute",
|
|
104
107
|
$widthX: 2,
|
|
@@ -106,15 +109,15 @@ const j = ({
|
|
|
106
109
|
$background: "BLACK_T_60",
|
|
107
110
|
$justifyContent: "center",
|
|
108
111
|
$alignItems: "center",
|
|
109
|
-
onClick:
|
|
110
|
-
$visible: !
|
|
112
|
+
onClick: E,
|
|
113
|
+
$visible: !g && b,
|
|
111
114
|
$left: "auto",
|
|
112
115
|
$right: "0px",
|
|
113
|
-
children: /* @__PURE__ */ e(
|
|
116
|
+
children: /* @__PURE__ */ e(N, { width: 24, height: 24 })
|
|
114
117
|
}
|
|
115
118
|
)
|
|
116
119
|
] }) });
|
|
117
|
-
}, q =
|
|
120
|
+
}, q = I(j);
|
|
118
121
|
export {
|
|
119
122
|
q as default
|
|
120
123
|
};
|
|
@@ -0,0 +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 { type IMonthlyActivity } from '../../../monthly-report-types';\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 { IS_APP_RUNNING_IN_RN } from '../../../../../../../constants/app-config';\n\nconst ActivitiesCardPuzzles: FC<IActivitiesCardPuzzlesProps> = ({\n puzzles: newPuzzles,\n onPuzzleClick,\n}) => {\n const puzzles = newPuzzles || [];\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 const renderPuzzleCard = useCallback(\n (puzzle: IMonthlyActivity, index: number) => (\n <Styled.PuzzleContainer\n key={`${puzzle.id}-${index}`}\n $gapX={1}\n $imageHue={puzzle.image_hue || 'BLUE'}\n $width={146}\n $height={162}\n $background={`${puzzle.image_hue || 'BLUE'}_2`}\n onClick={() =>\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 >\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 &&\n (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 [onPuzzleClick],\n );\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(renderPuzzleCard)}\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","newPuzzles","onPuzzleClick","puzzles","scrollRef","useRef","canScrollLeft","setCanScrollLeft","useState","canScrollRight","setCanScrollRight","handleScrollLeft","useCallback","handleScrollRight","updateScrollButtons","scrollLeft","scrollWidth","clientWidth","useEffect","scrollElement","renderPuzzleCard","puzzle","index","jsxs","Styled.PuzzleContainer","jsx","Styled.StatusIcon","NODE_STATE","stateIcon","FlexView","Image","Separator","Text","Styled.ContentWrapper","Styled.ScrollButton","IS_APP_RUNNING_IN_RN","ChevronLeftIcon","Styled.ScrollContainer","ChevronRightIcon","ActivitiesCardPuzzles$1","memo"],"mappings":";;;;;;;;;;;;AAeA,MAAMA,IAAyD,CAAC;AAAA,EAC9D,SAASC;AAAA,EACT,eAAAC;AACF,MAAM;AACE,QAAAC,IAAUF,KAAc,IACxBG,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;AAC1C,IAAIR,EAAU,WACZA,EAAU,QAAQ,SAAS,EAAE,MAAM,KAAK,UAAU,UAAU;AAAA,EAEhE,GAAG,CAAE,CAAA,GAECU,IAAsBF,EAAY,MAAM;AAC5C,QAAIR,EAAU,SAAS;AACrB,YAAM,EAAE,YAAAW,GAAY,aAAAC,GAAa,aAAAC,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AEA,gBAAAK;AAAA,MAACS;AAAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,SAAS;AAAA,QACT,SAAQ;AAAA,QACR,aAAY;AAAA,QACZ,iBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,SAASrB;AAAA,QACT,UAAU,CAACsB,KAAwB1B;AAAA,QACnC,OAAM;AAAA,QACN,QAAO;AAAA,QAEP,UAAC,gBAAAgB,EAAAa,GAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,MAAA;AAAA,IAC3C;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ,GAEeC,IAAAC,EAAKxC,CAAqB;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "styled-components";
|
|
2
|
-
import i from "
|
|
3
|
-
import { EDeviceType as r } from "
|
|
4
|
-
import { getPuzzleCardPattern as n } from "
|
|
2
|
+
import i from "../../../../../../ui/layout/flex-view.js";
|
|
3
|
+
import { EDeviceType as r } from "../../../../../../ui/theme/constants.js";
|
|
4
|
+
import { getPuzzleCardPattern as n } from "../../../../../../puzzles/utils/puzzle-pattern.js";
|
|
5
5
|
const c = t(i)`
|
|
6
6
|
position: relative;
|
|
7
7
|
min-width: 126px;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activities-card-puzzles.styled.js","sources":["../../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../../../ui/layout/flex-view';\nimport { type THueNames } from '../../../../../../ui/types';\nimport { EDeviceType } from '../../../../../../ui/theme/constants';\nimport { getPuzzleCardPattern } from '../../../../../../puzzles/utils/puzzle-pattern';\n\nexport const PuzzleContainer = styled(FlexView)<{\n $imageHue: THueNames;\n}>`\n position: relative;\n min-width: 126px;\n max-width: 126px;\n margin-top: 6px;\n border: 2px solid ${({ theme, $imageHue }) => theme.colors[`${$imageHue || 'BLUE'}_4`]};\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-image: ${({ $imageHue }) => `url(${getPuzzleCardPattern($imageHue)})`};\n background-size: cover;\n opacity: 0.4;\n }\n`;\n\nexport const ContentWrapper = styled(FlexView)`\n width: 100%;\n max-width: 512px;\n position: relative;\n`;\n\nexport const ScrollButton = styled(FlexView)<{\n $visible?: boolean;\n $left: string;\n $right: string;\n}>`\n position: absolute;\n right: ${({ $right }) => $right};\n left: ${({ $left }) => $left};\n cursor: pointer;\n transition: opacity 0.3s ease-in-out;\n opacity: ${({ $visible }) => ($visible ? 1 : 0)};\n pointer-events: ${({ $visible }) => ($visible ? 'auto' : 'none')};\n z-index: 10;\n path {\n fill: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const ScrollContainer = styled(FlexView)`\n overflow-x: ${({ theme }) => (theme.device <= EDeviceType.TABLET ? 'scroll' : 'hidden')};\n overflow-y: visible;\n scroll-behavior: smooth;\n &::-webkit-scrollbar {\n display: none;\n }\n`;\n\nexport const StatusIcon = styled(FlexView)`\n position: absolute;\n right: -8px;\n top: -8px;\n`;\n"],"names":["PuzzleContainer","styled","FlexView","theme","$imageHue","getPuzzleCardPattern","ContentWrapper","ScrollButton","$right","$left","$visible","ScrollContainer","EDeviceType","StatusIcon"],"mappings":";;;;AAOa,MAAAA,IAAkBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,sBAOxB,CAAC,EAAE,OAAAC,GAAO,WAAAC,EAAU,MAAMD,EAAM,OAAO,GAAGC,KAAa,MAAM,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAShE,CAAC,EAAE,WAAAA,EAAU,MAAM,OAAOC,EAAqBD,CAAS,CAAC,GAAG;AAAA;AAAA;AAAA;AAAA,GAMvEE,IAAiBL,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAMhCK,IAAeN,EAAOC,CAAQ;AAAA;AAAA,WAMhC,CAAC,EAAE,QAAAM,EAAO,MAAMA,CAAM;AAAA,UACvB,CAAC,EAAE,OAAAC,EAAM,MAAMA,CAAK;AAAA;AAAA;AAAA,aAGjB,CAAC,EAAE,UAAAC,EAAA,MAAgBA,IAAW,IAAI,CAAE;AAAA,oBAC7B,CAAC,EAAE,UAAAA,EAAA,MAAgBA,IAAW,SAAS,MAAO;AAAA;AAAA;AAAA,YAGtD,CAAC,EAAE,OAAAP,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAIhCQ,IAAkBV,EAAOC,CAAQ;AAAA,gBAC9B,CAAC,EAAE,OAAAC,EAAM,MAAOA,EAAM,UAAUS,EAAY,SAAS,WAAW,QAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ5EC,IAAaZ,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
|