@cuemath/leap 2.9.1 → 2.9.2-as1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/illustrations/illustrations.js +9 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/alarm.js +41 -0
- package/dist/assets/line-icons/icons/alarm.js.map +1 -0
- package/dist/assets/line-icons/icons/bin2.js +7 -8
- package/dist/assets/line-icons/icons/bin2.js.map +1 -1
- package/dist/assets/line-icons/icons/chevron-left.js.map +1 -1
- package/dist/assets/line-icons/icons/chevron-right.js.map +1 -1
- package/dist/assets/line-icons/icons/dart.js +23 -0
- package/dist/assets/line-icons/icons/dart.js.map +1 -0
- package/dist/assets/line-icons/icons/exclamation.js +26 -0
- package/dist/assets/line-icons/icons/exclamation.js.map +1 -0
- package/dist/assets/line-icons/icons/home2.js +25 -0
- package/dist/assets/line-icons/icons/home2.js.map +1 -0
- package/dist/assets/line-icons/icons/important.js +23 -0
- package/dist/assets/line-icons/icons/important.js.map +1 -0
- package/dist/assets/line-icons/icons/puzzle.js +25 -0
- package/dist/assets/line-icons/icons/puzzle.js.map +1 -0
- package/dist/assets/line-icons/icons/recap.js +32 -0
- package/dist/assets/line-icons/icons/recap.js.map +1 -0
- package/dist/assets/line-icons/icons/skip-colored.js +43 -0
- package/dist/assets/line-icons/icons/skip-colored.js.map +1 -0
- package/dist/assets/line-icons/icons/status.js +41 -0
- package/dist/assets/line-icons/icons/status.js.map +1 -0
- package/dist/assets/line-icons/icons/testtube.js +33 -0
- package/dist/assets/line-icons/icons/testtube.js.map +1 -0
- package/dist/assets/lottie/lottie.js +9 -1
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/constants/api.js +3 -2
- package/dist/constants/api.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js +99 -33
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +92 -49
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapters-list-styled.js +5 -5
- package/dist/features/chapters/chapters-list/chapters-list-styled.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapters-list.js +64 -70
- package/dist/features/chapters/chapters-list/chapters-list.js.map +1 -1
- package/dist/features/chapters-v2/api/chapter.js +10 -0
- package/dist/features/chapters-v2/api/chapter.js.map +1 -0
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +112 -0
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -0
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections-styled.js +26 -0
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections-styled.js.map +1 -0
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +73 -0
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -0
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner-styled.js +90 -0
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner-styled.js.map +1 -0
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js +97 -0
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js.map +1 -0
- package/dist/features/chapters-v2/chapter-details/chapter-details-styled.js +52 -0
- package/dist/features/chapters-v2/chapter-details/chapter-details-styled.js.map +1 -0
- package/dist/features/chapters-v2/chapter-details/chapter-details.js +103 -0
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -0
- package/dist/features/chapters-v2/comps/node-card/border-path-animation.js +13 -0
- package/dist/features/chapters-v2/comps/node-card/border-path-animation.js.map +1 -0
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js +153 -0
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -0
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +16 -0
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -0
- package/dist/features/chapters-v2/comps/node-card/node-card.js +12 -0
- package/dist/features/chapters-v2/comps/node-card/node-card.js.map +1 -0
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options-styled.js +32 -0
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options-styled.js.map +1 -0
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options.js +31 -0
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options.js.map +1 -0
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +171 -0
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -0
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +192 -0
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -0
- package/dist/features/chapters-v2/comps/tag/tag-styled.js +13 -0
- package/dist/features/chapters-v2/comps/tag/tag-styled.js.map +1 -0
- package/dist/features/chapters-v2/comps/tag/tag.js +28 -0
- package/dist/features/chapters-v2/comps/tag/tag.js.map +1 -0
- package/dist/features/chapters-v2/constants/block-constants.js +20 -0
- package/dist/features/chapters-v2/constants/block-constants.js.map +1 -0
- package/dist/features/chapters-v2/constants/node-constants.js +14 -0
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -0
- package/dist/features/chapters-v2/utils/index.js +41 -0
- package/dist/features/chapters-v2/utils/index.js.map +1 -0
- package/dist/features/chapters-v2/utils/node-card-utils.js +144 -0
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -0
- package/dist/features/communication/pub-sub/constants.js +5 -2
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/card-menu-options.js +38 -0
- package/dist/features/homework/card-menu-options.js.map +1 -0
- package/dist/features/homework/card-title.js +21 -0
- package/dist/features/homework/card-title.js.map +1 -0
- package/dist/features/homework/homework-card-view.js +133 -0
- package/dist/features/homework/homework-card-view.js.map +1 -0
- package/dist/features/homework/homework-card.js +206 -0
- package/dist/features/homework/homework-card.js.map +1 -0
- package/dist/features/homework/hw-card-list/api/get-homeworks.js +10 -0
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js +71 -0
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list.js +182 -0
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -0
- package/dist/features/homework/node-progress.js +29 -0
- package/dist/features/homework/node-progress.js.map +1 -0
- package/dist/features/homework/styles.js +130 -0
- package/dist/features/homework/styles.js.map +1 -0
- package/dist/features/milestone/create/api/goal-submit.js +1 -1
- package/dist/features/milestone/create/api/goal-submit.js.map +1 -1
- package/dist/features/milestone/create/comps/chapter-item/chapter-item.js +42 -49
- package/dist/features/milestone/create/comps/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step-styled.js +12 -4
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step-styled.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js +128 -105
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js.map +1 -1
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js +14 -20
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js.map +1 -1
- package/dist/features/milestone/create/comps/sheets-list/sheets-list.js +26 -50
- package/dist/features/milestone/create/comps/sheets-list/sheets-list.js.map +1 -1
- package/dist/features/milestone/create/milestone-create.js +49 -43
- package/dist/features/milestone/create/milestone-create.js.map +1 -1
- package/dist/features/milestone/create/utils/index.js +33 -38
- package/dist/features/milestone/create/utils/index.js.map +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/api/get-milestone.js +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/api/get-milestone.js.map +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/api/patch-goal-plan.js +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/api/patch-goal-plan.js.map +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/index.js +51 -53
- package/dist/features/milestone/edit/comps/edit-milestone-modal/index.js.map +1 -1
- package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js +42 -40
- package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js.map +1 -1
- package/dist/features/milestone/edit/goal-edit-container.js +64 -62
- package/dist/features/milestone/edit/goal-edit-container.js.map +1 -1
- package/dist/features/milestone/edit/goal-edit-helpers.js +50 -53
- package/dist/features/milestone/edit/goal-edit-helpers.js.map +1 -1
- package/dist/features/milestone/edit/milestone-edit-container.js +54 -52
- package/dist/features/milestone/edit/milestone-edit-container.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-milestone-resources.js +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-milestone-resources.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-milestones.js +9 -17
- package/dist/features/milestone/milestone-list-container/api/get-milestones.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-tests-list.js +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-tests-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +136 -104
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js +107 -123
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +155 -175
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs-styled.js +24 -10
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs-styled.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js +80 -86
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-utils.js +10 -22
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-utils.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.js +70 -37
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js +114 -176
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-rank.js +29 -16
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-rank.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-styled.js +19 -23
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-styled.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome.js +23 -35
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +96 -100
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-list/resources-list-styled.js +1 -1
- package/dist/features/milestone/milestone-resources/resources-list/resources-list-styled.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-list/resources-list.js +114 -112
- package/dist/features/milestone/milestone-resources/resources-list/resources-list.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js +165 -0
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js.map +1 -0
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view-styled.js +25 -0
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view-styled.js.map +1 -0
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +85 -0
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -0
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js +16 -18
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js +6 -34
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js.map +1 -1
- package/dist/features/recent-chapters/api/get-recent-chapters.js +9 -0
- package/dist/features/recent-chapters/api/get-recent-chapters.js.map +1 -0
- package/dist/features/recent-chapters/recent-chapters-styled.js +16 -0
- package/dist/features/recent-chapters/recent-chapters-styled.js.map +1 -0
- package/dist/features/recent-chapters/recent-chapters.js +34 -0
- package/dist/features/recent-chapters/recent-chapters.js.map +1 -0
- package/dist/features/sheet-v2/resource-list/resource-list.js +39 -0
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -0
- package/dist/features/sheets/resources-list/resource-item/styled.js +1 -1
- package/dist/features/sheets/resources-list/resource-item/styled.js.map +1 -1
- package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions-constant.js +4 -3
- package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions-constant.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +30 -29
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
- package/dist/features/ui/constants/z-index.js +1 -1
- package/dist/features/ui/constants/z-index.js.map +1 -1
- package/dist/features/ui/context-menu/context-menu-styled.js +28 -14
- package/dist/features/ui/context-menu/context-menu-styled.js.map +1 -1
- package/dist/features/ui/context-menu/context-menu.js +30 -15
- package/dist/features/ui/context-menu/context-menu.js.map +1 -1
- package/dist/features/ui/theme/button.js +22 -107
- package/dist/features/ui/theme/button.js.map +1 -1
- package/dist/index.d.ts +280 -29
- package/dist/index.js +496 -470
- package/dist/index.js.map +1 -1
- package/dist/node_modules/date-fns/differenceInDays.js +17 -0
- package/dist/node_modules/date-fns/differenceInDays.js.map +1 -0
- package/dist/static/chapter-header-bg-2.c8d96894.svg +1 -0
- package/dist/static/competitive-arena.b9c40801.json +1 -0
- package/dist/static/learn.71b13323.json +1 -0
- package/dist/static/node-custom-test-bg.d3b757be.svg +1 -0
- package/dist/static/node-learn-bg.b61f815c.svg +1 -0
- package/dist/static/node-practice-bg.16cbaf2a.svg +1 -0
- package/dist/static/node-project-bg.e6a33e28.svg +1 -0
- package/dist/static/node-puzzle-bg.3422135c.svg +1 -0
- package/dist/static/node-recap-bg.546154e4.svg +1 -0
- package/dist/static/node-test-prep-bg.42c0b9c4.svg +1 -0
- package/dist/static/node-video-bg.3df3f73a.svg +1 -0
- package/dist/static/practice.158dd488.json +1 -0
- package/dist/static/project.eb665827.json +1 -0
- package/dist/static/puzzle.b298c7e4.json +1 -0
- package/dist/static/recap.0dd2c1e2.json +1 -0
- package/dist/static/test.803d6036.json +1 -0
- package/dist/static/video.b41451e2.json +1 -0
- package/package.json +1 -1
- package/dist/features/milestone/create/comps/milestone-progress-v2/milestone-progress-v2.js +0 -92
- package/dist/features/milestone/create/comps/milestone-progress-v2/milestone-progress-v2.js.map +0 -1
- package/dist/features/milestone/create/comps/milestone-progress-v2/styled.js +0 -25
- package/dist/features/milestone/create/comps/milestone-progress-v2/styled.js.map +0 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/context-menu-helper/menu-element-styled.js +0 -13
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/context-menu-helper/menu-element-styled.js.map +0 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/context-menu-helper/menu-element.js +0 -38
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/context-menu-helper/menu-element.js.map +0 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-status.js +0 -53
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-status.js.map +0 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-info.js +0 -25
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-info.js.map +0 -1
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-cta.js +0 -71
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-cta.js.map +0 -1
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-styled.js +0 -31
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-styled.js.map +0 -1
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item.js +0 -79
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item.js.map +0 -1
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheets-list-styled.js +0 -18
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheets-list-styled.js.map +0 -1
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheets-list.js +0 -51
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheets-list.js.map +0 -1
- package/dist/features/milestone/milestone-tests/tests-list/tests-list-styled.js +0 -11
- package/dist/features/milestone/milestone-tests/tests-list/tests-list-styled.js.map +0 -1
- package/dist/features/milestone/milestone-tests/tests-list/tests-list.js +0 -135
- package/dist/features/milestone/milestone-tests/tests-list/tests-list.js.map +0 -1
@@ -0,0 +1,182 @@
|
|
1
|
+
import { jsxs as s, jsx as t, Fragment as J } from "react/jsx-runtime";
|
2
|
+
import { useRef as D, useState as a, useCallback as n, useEffect as d } from "react";
|
3
|
+
import ee from "../../../assets/line-icons/icons/chevron-left.js";
|
4
|
+
import te from "../../../assets/line-icons/icons/chevron-right.js";
|
5
|
+
import { getTopicsFromItems as oe } from "../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js";
|
6
|
+
import g from "../../ui/layout/flex-view.js";
|
7
|
+
import $ from "../../ui/text/text.js";
|
8
|
+
import re from "../homework-card.js";
|
9
|
+
import { useGetHomeworks as ne } from "./api/get-homeworks.js";
|
10
|
+
import { ContentWrapper as ie, HoverZone as k, ScrollButton as b, ScrollContainer as le, QueueWrapper as se, QueueText as ce } from "./hw-card-list-styled.js";
|
11
|
+
const he = ({
|
12
|
+
userType: _ = "STUDENT",
|
13
|
+
studentId: f,
|
14
|
+
stream: p,
|
15
|
+
onTestStart: w,
|
16
|
+
onNodeAttempt: R,
|
17
|
+
onTestPreview: A,
|
18
|
+
onNodeView: E,
|
19
|
+
onTestReview: S,
|
20
|
+
onNodeReview: x,
|
21
|
+
onNodeUnassign: I
|
22
|
+
}) => {
|
23
|
+
const r = D(null), [T, v] = a(!1), [y, C] = a(!1), [B, W] = a(!1), [N, j] = a(!0), {
|
24
|
+
get: L,
|
25
|
+
data: e,
|
26
|
+
isProcessingFailed: F,
|
27
|
+
isProcessing: u,
|
28
|
+
isStale: H
|
29
|
+
} = ne(f), K = n(() => {
|
30
|
+
r.current && r.current.scrollBy({ left: -200, behavior: "smooth" });
|
31
|
+
}, []), M = n(() => {
|
32
|
+
r.current && r.current.scrollBy({ left: 200, behavior: "smooth" });
|
33
|
+
}, []), G = n(() => {
|
34
|
+
v(!0);
|
35
|
+
}, []), P = n(() => {
|
36
|
+
v(!1);
|
37
|
+
}, []), Q = n(() => {
|
38
|
+
C(!0);
|
39
|
+
}, []), X = n(() => {
|
40
|
+
C(!1);
|
41
|
+
}, []), i = n(() => {
|
42
|
+
if (r.current) {
|
43
|
+
const { scrollLeft: o, scrollWidth: l, clientWidth: m } = r.current;
|
44
|
+
W(o > 10), j(o < l - m - 10);
|
45
|
+
}
|
46
|
+
}, []);
|
47
|
+
d(() => {
|
48
|
+
const o = r.current;
|
49
|
+
if (o)
|
50
|
+
return o.addEventListener("scroll", i), i(), () => {
|
51
|
+
o.removeEventListener("scroll", i);
|
52
|
+
};
|
53
|
+
}, [i]), d(() => {
|
54
|
+
i();
|
55
|
+
}, [e, i]);
|
56
|
+
const c = n(() => {
|
57
|
+
L(f, void 0, { stream: p });
|
58
|
+
}, [L, p, f]);
|
59
|
+
d(() => {
|
60
|
+
!u && H && c();
|
61
|
+
}, [c, u, H]), d(() => {
|
62
|
+
c();
|
63
|
+
}, [c]);
|
64
|
+
const O = ((e == null ? void 0 : e.filter((o) => o.state === "WAIT_FOR_REVIEW")) || []).length;
|
65
|
+
return e && e.length === 0 ? /* @__PURE__ */ s(g, { $flexRowGapX: 1, children: [
|
66
|
+
/* @__PURE__ */ s($, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
67
|
+
"Homework (",
|
68
|
+
e == null ? void 0 : e.length,
|
69
|
+
")"
|
70
|
+
] }),
|
71
|
+
/* @__PURE__ */ t($, { $renderAs: "ab2", $color: "BLACK_T_60", children: "No Homework assigned yet" })
|
72
|
+
] }) : F ? null : /* @__PURE__ */ s(ie, { $flexRowGapX: 1, $disablePointerEvents: u, children: [
|
73
|
+
/* @__PURE__ */ s($, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
74
|
+
"Homework (",
|
75
|
+
O,
|
76
|
+
"/",
|
77
|
+
e == null ? void 0 : e.length,
|
78
|
+
")"
|
79
|
+
] }),
|
80
|
+
/* @__PURE__ */ s(g, { $position: "relative", onMouseEnter: i, children: [
|
81
|
+
B && /* @__PURE__ */ t(
|
82
|
+
k,
|
83
|
+
{
|
84
|
+
$position: "absolute",
|
85
|
+
$width: "60px",
|
86
|
+
left: "0",
|
87
|
+
right: "auto",
|
88
|
+
onMouseEnter: G,
|
89
|
+
onMouseLeave: P,
|
90
|
+
children: /* @__PURE__ */ t(
|
91
|
+
b,
|
92
|
+
{
|
93
|
+
$position: "absolute",
|
94
|
+
$background: "BLACK_T_60",
|
95
|
+
$justifyContent: "center",
|
96
|
+
$alignItems: "center",
|
97
|
+
$height: "100%",
|
98
|
+
onClick: K,
|
99
|
+
$visible: T,
|
100
|
+
left: "0px",
|
101
|
+
right: "auto",
|
102
|
+
children: /* @__PURE__ */ t(ee, { width: 24, height: 24 })
|
103
|
+
}
|
104
|
+
)
|
105
|
+
},
|
106
|
+
"left-hover-zone"
|
107
|
+
),
|
108
|
+
/* @__PURE__ */ t(le, { ref: r, children: /* @__PURE__ */ t(g, { $flexDirection: "row", $flexGapX: 1, children: e == null ? void 0 : e.map((o, l) => {
|
109
|
+
const {
|
110
|
+
items: m,
|
111
|
+
node_id: V,
|
112
|
+
worksheet_id: z,
|
113
|
+
node_type: U,
|
114
|
+
title: Y,
|
115
|
+
subtext: Z
|
116
|
+
} = o, q = oe(m).join(", "), h = U === "DYNAMIC";
|
117
|
+
return /* @__PURE__ */ s(J, { children: [
|
118
|
+
e.length > 10 && l === 10 && /* @__PURE__ */ t(
|
119
|
+
se,
|
120
|
+
{
|
121
|
+
$widthX: 9.5,
|
122
|
+
$background: "BLACK_4",
|
123
|
+
$justifyContent: "center",
|
124
|
+
$gutter: 4,
|
125
|
+
$gap: 8,
|
126
|
+
children: /* @__PURE__ */ t(ce, { $renderAs: "ac3", $color: "WHITE", children: "In Queue" })
|
127
|
+
}
|
128
|
+
),
|
129
|
+
/* @__PURE__ */ t(
|
130
|
+
re,
|
131
|
+
{
|
132
|
+
isInQueue: e.length > 10 && l > 9,
|
133
|
+
userType: _,
|
134
|
+
header: h ? q : Y,
|
135
|
+
subHeader: Z || "",
|
136
|
+
nodeData: o,
|
137
|
+
renderAs: "homework",
|
138
|
+
onNodeAttempt: h ? w : R,
|
139
|
+
shouldOpenOnRight: e.length > 3 && l === e.length - 1,
|
140
|
+
onNodeView: h ? A : E,
|
141
|
+
onNodeReview: h ? S : x,
|
142
|
+
onNodeUnassign: I
|
143
|
+
},
|
144
|
+
`${z}_${V}_${l}`
|
145
|
+
)
|
146
|
+
] });
|
147
|
+
}) }) }),
|
148
|
+
N && /* @__PURE__ */ t(
|
149
|
+
k,
|
150
|
+
{
|
151
|
+
$position: "absolute",
|
152
|
+
$width: "60px",
|
153
|
+
right: "0",
|
154
|
+
left: "auto",
|
155
|
+
onMouseEnter: Q,
|
156
|
+
onMouseLeave: X,
|
157
|
+
children: /* @__PURE__ */ t(
|
158
|
+
b,
|
159
|
+
{
|
160
|
+
$position: "absolute",
|
161
|
+
$width: "60px",
|
162
|
+
$height: "100%",
|
163
|
+
$background: "BLACK_T_60",
|
164
|
+
$justifyContent: "center",
|
165
|
+
$alignItems: "center",
|
166
|
+
onClick: M,
|
167
|
+
$visible: y,
|
168
|
+
left: "auto",
|
169
|
+
right: "0px",
|
170
|
+
children: /* @__PURE__ */ t(te, { width: 24, height: 24 })
|
171
|
+
}
|
172
|
+
)
|
173
|
+
},
|
174
|
+
"right-hover-zone"
|
175
|
+
)
|
176
|
+
] })
|
177
|
+
] });
|
178
|
+
}, He = he;
|
179
|
+
export {
|
180
|
+
He as default
|
181
|
+
};
|
182
|
+
//# sourceMappingURL=hw-card-list.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport { getTopicsFromItems } from '../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport * as Styled from './hw-card-list-styled';\n\ninterface HWCardListProps extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n stream: string;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType = 'STUDENT',\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n}) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(true);\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isStale,\n } = useGetHomeworks(studentId);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n }\n }, []);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n }\n }, []);\n\n const handleLeftHoverEnter = useCallback(() => {\n setIsLeftHovered(true);\n }, []);\n\n const handleLeftHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n }, []);\n\n const handleRightHoverEnter = useCallback(() => {\n setIsRightHovered(true);\n }, []);\n\n const handleRightHoverLeave = useCallback(() => {\n setIsRightHovered(false);\n }, []);\n\n const checkScrollPosition = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n setCanScrollLeft(scrollLeft > 10);\n setCanScrollRight(scrollLeft < scrollWidth - clientWidth - 10);\n }\n }, []);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', checkScrollPosition);\n checkScrollPosition();\n\n return () => {\n scrollElement.removeEventListener('scroll', checkScrollPosition);\n };\n }\n }, [checkScrollPosition]);\n\n // Also check when content changes\n useEffect(() => {\n checkScrollPosition();\n }, [hwDetails, checkScrollPosition]);\n\n const fetchHomeworks = useCallback(() => {\n getHomeworks(studentId, undefined, { stream });\n }, [getHomeworks, stream, studentId]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchHomeworks();\n }\n }, [fetchHomeworks, isProcessing, isStale]);\n\n useEffect(() => {\n fetchHomeworks();\n }, [fetchHomeworks]);\n\n const waitForReviewSheets = (hwDetails?.filter(sheet => sheet.state === 'WAIT_FOR_REVIEW') || [])\n .length;\n\n if (hwDetails && hwDetails.length === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({hwDetails?.length})\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <Styled.ContentWrapper $flexRowGapX={1} $disablePointerEvents={isProcessing}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({waitForReviewSheets}/{hwDetails?.length})\n </Text>\n <FlexView $position=\"relative\" onMouseEnter={checkScrollPosition}>\n {/* Left hover zone */}\n {canScrollLeft && (\n <Styled.HoverZone\n key=\"left-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n left=\"0\"\n right=\"auto\"\n onMouseEnter={handleLeftHoverEnter}\n onMouseLeave={handleLeftHoverLeave}\n >\n {/* Left scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={isLeftHovered}\n left=\"0px\"\n right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {hwDetails?.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const topics = getTopicsFromItems(items);\n const testChapterName = topics.join(', ');\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <>\n {hwDetails.length > 10 && idx === 10 && (\n <Styled.QueueWrapper\n $widthX={9.5}\n $background=\"BLACK_4\"\n $justifyContent=\"center\"\n $gutter={4}\n $gap={8}\n >\n <Styled.QueueText $renderAs=\"ac3\" $color=\"WHITE\">\n In Queue\n </Styled.QueueText>\n </Styled.QueueWrapper>\n )}\n <HomeworkCard\n isInQueue={hwDetails.length > 10 && idx > 9}\n key={`${worksheetId}_${nodeId}_${idx}`}\n userType={userType}\n header={isDynamicSheet ? testChapterName : title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={hwDetails.length > 3 && idx === hwDetails.length - 1}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\n\n {/* Right hover zone */}\n {canScrollRight && (\n <Styled.HoverZone\n key=\"right-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n right=\"0\"\n left=\"auto\"\n onMouseEnter={handleRightHoverEnter}\n onMouseLeave={handleRightHoverLeave}\n >\n {/* Right scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $width=\"60px\"\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={isRightHovered}\n left=\"auto\"\n right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default HWCardList;\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","scrollRef","useRef","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","canScrollLeft","setCanScrollLeft","canScrollRight","setCanScrollRight","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isStale","useGetHomeworks","handleScrollLeft","useCallback","handleScrollRight","handleLeftHoverEnter","handleLeftHoverLeave","handleRightHoverEnter","handleRightHoverLeave","checkScrollPosition","scrollLeft","scrollWidth","clientWidth","useEffect","scrollElement","fetchHomeworks","waitForReviewSheets","sheet","jsxs","FlexView","Text","Styled.ContentWrapper","jsx","Styled.HoverZone","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","idx","items","nodeId","worksheetId","nodeType","title","subtext","testChapterName","getTopicsFromItems","isDynamicSheet","Fragment","Styled.QueueWrapper","Styled.QueueText","HomeworkCard","ChevronRightIcon","HWCardList$1"],"mappings":";;;;;;;;;;AA0BA,MAAMA,KAAwC,CAAC;AAAA,EAC7C,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACE,QAAAC,IAAYC,EAAuB,IAAI,GACvC,CAACC,GAAeC,CAAgB,IAAIC,EAAS,EAAK,GAClD,CAACC,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GACpD,CAACG,GAAeC,CAAgB,IAAIJ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B,IAAM;AAAA,cAE1C,UAAApD;AAAA,cACA,QAAQ6D,IAAiBF,IAAkBF;AAAA,cAC3C,WAAWC,KAAW;AAAA,cACtB,UAAUhB;AAAA,cACV,UAAS;AAAA,cACT,eAAemB,IAAiB1D,IAAcC;AAAA,cAC9C,mBAAmBkB,EAAU,SAAS,KAAK8B,MAAQ9B,EAAU,SAAS;AAAA,cACtE,YAAYuC,IAAiBxD,IAAgBC;AAAA,cAC7C,cAAcuD,IAAiBtD,IAAeC;AAAA,cAC9C,gBAAAC;AAAA,YAAA;AAAA,YAVK,GAAG8C,CAAW,IAAID,CAAM,IAAIF,CAAG;AAAA,UAWtC;AAAA,QACF,EAAA,CAAA;AAAA,MAAA,IAGN,EACF,CAAA;AAAA,MAGCjC,KACC,gBAAA4B;AAAA,QAACC;AAAAA,QAAA;AAAA,UAEC,WAAU;AAAA,UACV,QAAO;AAAA,UACP,OAAM;AAAA,UACN,MAAK;AAAA,UACL,cAAchB;AAAA,UACd,cAAcC;AAAA,UAGd,UAAA,gBAAAc;AAAA,YAACE;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,QAAO;AAAA,cACP,SAAQ;AAAA,cACR,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,aAAY;AAAA,cACZ,SAASpB;AAAA,cACT,UAAUd;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cAEN,UAAC,gBAAAgC,EAAAmB,IAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,QAtBI;AAAA,MAuBN;AAAA,IAAA,GAEJ;AAAA,EACF,EAAA,CAAA;AAEJ,GAEAC,KAAepE;"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
2
|
+
import { memo as m } from "react";
|
3
|
+
import a from "styled-components";
|
4
|
+
import n from "../ui/layout/flex-view.js";
|
5
|
+
import { differenceInDays as e } from "../../node_modules/date-fns/differenceInDays.js";
|
6
|
+
const g = a(n)`
|
7
|
+
height: 100%;
|
8
|
+
border-radius: 4px;
|
9
|
+
transition: all 300ms;
|
10
|
+
width: ${(r) => r.progress}%;
|
11
|
+
`, d = a(n)`
|
12
|
+
position: absolute;
|
13
|
+
top: -1px;
|
14
|
+
right: 0px;
|
15
|
+
width: 100%;
|
16
|
+
height: 2px;
|
17
|
+
background-color: ${(r) => r.theme.colors.BLACK};
|
18
|
+
z-index: 2;
|
19
|
+
`, l = ({ unlockedOn: r, dueDate: i, progressBg: c }) => {
|
20
|
+
const p = (() => {
|
21
|
+
const o = e(i, r), s = e(/* @__PURE__ */ new Date(), r);
|
22
|
+
return s > o ? 100 : Math.min(Math.max(s / o * 100, 0), 100);
|
23
|
+
})();
|
24
|
+
return /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(g, { progress: p, $background: c }) });
|
25
|
+
}, y = m(l);
|
26
|
+
export {
|
27
|
+
y as default
|
28
|
+
};
|
29
|
+
//# sourceMappingURL=node-progress.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"node-progress.js","sources":["../../../src/features/homework/node-progress.tsx"],"sourcesContent":["import type { TColorNames } from '../ui/types';\n\nimport { differenceInDays } from 'date-fns';\nimport React, { memo } from 'react';\nimport styled from 'styled-components';\n\nimport FlexView from '../ui/layout/flex-view';\n\ninterface NodeProgressProps {\n unlockedOn: number | string | Date;\n dueDate: number | string | Date;\n progressBg: TColorNames;\n}\n\nconst ProgressBar = styled(FlexView)<{ progress: number }>`\n height: 100%;\n border-radius: 4px;\n transition: all 300ms;\n width: ${props => props.progress}%;\n`;\n\nconst ProgressContainer = styled(FlexView)`\n position: absolute;\n top: -1px;\n right: 0px;\n width: 100%;\n height: 2px;\n background-color: ${props => props.theme.colors.BLACK};\n z-index: 2;\n`;\n\nconst NodeProgress: React.FC<NodeProgressProps> = ({ unlockedOn, dueDate, progressBg }) => {\n const calculateProgress = () => {\n const totalDays = differenceInDays(dueDate, unlockedOn);\n const daysElapsed = differenceInDays(new Date(), unlockedOn);\n\n if (daysElapsed > totalDays) return 100;\n\n const progress = Math.min(Math.max((daysElapsed / totalDays) * 100, 0), 100);\n\n return progress;\n };\n\n const progress = calculateProgress();\n\n return (\n <ProgressContainer>\n <ProgressBar progress={progress} $background={progressBg} />\n </ProgressContainer>\n );\n};\n\nexport default memo(NodeProgress);\n"],"names":["ProgressBar","styled","FlexView","props","ProgressContainer","NodeProgress","unlockedOn","dueDate","progressBg","progress","totalDays","differenceInDays","daysElapsed","jsx","NodeProgress$1","memo"],"mappings":";;;;;AAcA,MAAMA,IAAcC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,WAIxB,CAAAC,MAASA,EAAM,QAAQ;AAAA,GAG5BC,IAAoBH,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAMnB,CAASC,MAAAA,EAAM,MAAM,OAAO,KAAK;AAAA;AAAA,GAIjDE,IAA4C,CAAC,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,QAAiB;AAYzF,QAAMC,KAXoB,MAAM;AACxB,UAAAC,IAAYC,EAAiBJ,GAASD,CAAU,GAChDM,IAAcD,EAAqB,oBAAA,QAAQL,CAAU;AAEvD,WAAAM,IAAcF,IAAkB,MAEnB,KAAK,IAAI,KAAK,IAAKE,IAAcF,IAAa,KAAK,CAAC,GAAG,GAAG;AAAA,EAEpE;AAKT,2BACGN,GACC,EAAA,UAAA,gBAAAS,EAACb,KAAY,UAAAS,GAAoB,aAAaD,EAAY,CAAA,EAC5D,CAAA;AAEJ,GAEeM,IAAAC,EAAKV,CAAY;"}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
import r from "styled-components";
|
2
|
+
import n from "../../assets/line-icons/icons/minus2.js";
|
3
|
+
import e from "../ui/layout/flex-view.js";
|
4
|
+
import i from "../ui/text/text.js";
|
5
|
+
const l = r(e)(({ theme: o }) => `
|
6
|
+
cursor: pointer;
|
7
|
+
width: 24px;
|
8
|
+
height: 24px;
|
9
|
+
|
10
|
+
|
11
|
+
&:hover {
|
12
|
+
border-radius: 50%;
|
13
|
+
background: ${o.colors.WHITE_5};
|
14
|
+
}
|
15
|
+
`), d = r(i)`
|
16
|
+
display: -webkit-box;
|
17
|
+
-webkit-line-clamp: 1;
|
18
|
+
-webkit-box-orient: vertical;
|
19
|
+
overflow: hidden;
|
20
|
+
text-overflow: ellipsis;
|
21
|
+
`, u = r(e)(({
|
22
|
+
$shouldopenonright: o,
|
23
|
+
$visible: t
|
24
|
+
}) => `
|
25
|
+
cursor: pointer;
|
26
|
+
position: absolute;
|
27
|
+
z-index: 6;
|
28
|
+
top: calc(100% + 4px);
|
29
|
+
right: ${o ? 0 : "auto"};
|
30
|
+
transform-origin: top;
|
31
|
+
transform: scaleY(${t ? 1 : 0});
|
32
|
+
opacity: ${t ? 1 : 0};
|
33
|
+
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
|
34
|
+
box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);
|
35
|
+
z-index: 10;
|
36
|
+
`), x = r(e)`
|
37
|
+
border: 1px solid ${({ theme: o }) => o.colors.BLACK_T_15};
|
38
|
+
|
39
|
+
&:hover {
|
40
|
+
border: 1px solid ${({ theme: o }) => o.colors.BLACK};
|
41
|
+
}
|
42
|
+
`, b = r(e)(({ $bgImage: o }) => o ? `
|
43
|
+
background-image: url(${o});
|
44
|
+
background-repeat: no-repeat;
|
45
|
+
background-size: cover;
|
46
|
+
background-position: center;
|
47
|
+
overflow: hidden;
|
48
|
+
` : "overflow: hidden;"), h = r(e)`
|
49
|
+
display: flex;
|
50
|
+
align-items: center;
|
51
|
+
justify-content: center;
|
52
|
+
`, w = r(e)`
|
53
|
+
position: absolute;
|
54
|
+
right: -18px;
|
55
|
+
top: -4px;
|
56
|
+
`, f = r.img(({ theme: o }) => {
|
57
|
+
const { gutter: t } = o.layout;
|
58
|
+
return `
|
59
|
+
border: 1px solid ${o.colors.BLACK_T_15};
|
60
|
+
width: ${t * 4}px;
|
61
|
+
height: ${t * 4}px;
|
62
|
+
border-radius: 50%;
|
63
|
+
`;
|
64
|
+
}), g = r(n)`
|
65
|
+
path {
|
66
|
+
stroke: ${({ theme: o }) => o.colors.WHITE};
|
67
|
+
}
|
68
|
+
`, m = r(i)`
|
69
|
+
display: -webkit-box;
|
70
|
+
-webkit-line-clamp: 2;
|
71
|
+
-webkit-box-orient: vertical;
|
72
|
+
overflow: hidden;
|
73
|
+
text-overflow: ellipsis;
|
74
|
+
white-space: break-spaces;
|
75
|
+
`;
|
76
|
+
r(e)``;
|
77
|
+
const k = r(e)(({
|
78
|
+
theme: o,
|
79
|
+
$disabled: t
|
80
|
+
}) => `
|
81
|
+
cursor: ${t ? "not-allowed" : "pointer"};
|
82
|
+
|
83
|
+
&:hover {
|
84
|
+
background: ${t ? "transparent" : o.colors.BLACK};
|
85
|
+
};
|
86
|
+
|
87
|
+
path {
|
88
|
+
fill: ${o.colors.WHITE_1};
|
89
|
+
}
|
90
|
+
`), v = r(i)`
|
91
|
+
white-space: nowrap;
|
92
|
+
overflow: hidden;
|
93
|
+
text-overflow: ellipsis;
|
94
|
+
`, C = r(e)`
|
95
|
+
position: absolute;
|
96
|
+
z-index: 6;
|
97
|
+
top: calc(100% - 36px);
|
98
|
+
right: 12px;
|
99
|
+
transform-origin: top;
|
100
|
+
transform: scaleY(1);
|
101
|
+
`, $ = r(e)`
|
102
|
+
position: absolute;
|
103
|
+
top: 0;
|
104
|
+
left: 0;
|
105
|
+
width: 100%;
|
106
|
+
height: 100%;
|
107
|
+
opacity: 0.5;
|
108
|
+
`, y = r(e)`
|
109
|
+
position: absolute;
|
110
|
+
right: 42px;
|
111
|
+
top: 24px;
|
112
|
+
`;
|
113
|
+
export {
|
114
|
+
f as BannerImage,
|
115
|
+
w as BannerImageWrapper,
|
116
|
+
$ as BlurContainer,
|
117
|
+
y as BlurFlexView,
|
118
|
+
x as CardContainer,
|
119
|
+
l as CardKebabMenuWrapper,
|
120
|
+
u as CardMenuOptionsWrapper,
|
121
|
+
k as CardOptionWrapper,
|
122
|
+
b as CardWrapper,
|
123
|
+
m as HeaderText,
|
124
|
+
h as IconWrapper,
|
125
|
+
C as MenuWrapper,
|
126
|
+
v as OptionText,
|
127
|
+
g as StyledMinus2Icon,
|
128
|
+
d as SubHeaderText
|
129
|
+
};
|
130
|
+
//# sourceMappingURL=styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../src/features/homework/styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Minus2Icon from '../../assets/line-icons/icons/minus2';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\ninterface ICardWrapperProps {\n $bgImage: string;\n}\ninterface ICardOptionsMenuWrapperProps {\n $visible: boolean;\n $shouldopenonright: boolean;\n}\n\nexport const CardKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n width: 24px;\n height: 24px;\n \n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport const SubHeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const CardMenuOptionsWrapper = styled(FlexView)<ICardOptionsMenuWrapperProps>(({\n $shouldopenonright,\n $visible,\n}) => {\n return `\n cursor: pointer;\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n right: ${$shouldopenonright ? 0 : 'auto'};\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);\n z-index: 10;\n `;\n});\n\nexport const CardContainer = styled(FlexView)`\n border: 1px solid ${({ theme }) => theme.colors.BLACK_T_15};\n\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.BLACK};\n }\n`;\n\nexport const CardWrapper = styled(FlexView)<ICardWrapperProps>(({ $bgImage }) => {\n if ($bgImage) {\n return `\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n overflow: hidden;\n `;\n }\n\n return 'overflow: hidden;';\n});\n\nexport const IconWrapper = styled(FlexView)`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const BannerImageWrapper = styled(FlexView)`\n position: absolute;\n right: -18px;\n top: -4px;\n`;\n\nexport const BannerImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n border: 1px solid ${theme.colors.BLACK_T_15};\n width: ${gutter * 4}px;\n height: ${gutter * 4}px;\n border-radius: 50%;\n `;\n});\n\nexport const StyledMinus2Icon = styled(Minus2Icon)`\n path {\n stroke: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const HeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\ninterface ICardOptionWrapperProps {\n $disabled?: boolean;\n}\ninterface ICardOptionsProps {\n $top: number;\n $left: number;\n}\n\nexport const CardOptions = styled(FlexView)<ICardOptionsProps>``;\n\nexport const CardOptionWrapper = styled(FlexView)<ICardOptionWrapperProps>(({\n theme,\n $disabled,\n}) => {\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n \n &:hover {\n background: ${$disabled ? 'transparent' : theme.colors.BLACK};\n };\n \n path {\n fill: ${theme.colors.WHITE_1};\n }\n `;\n});\n\nexport const OptionText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const MenuWrapper = styled(FlexView)`\n position: absolute;\n z-index: 6;\n top: calc(100% - 36px);\n right: 12px;\n transform-origin: top;\n transform: scaleY(1);\n`;\n\nexport const BlurContainer = styled(FlexView)`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.5;\n`;\n\nexport const BlurFlexView = styled(FlexView)`\n position: absolute;\n right: 42px;\n top: 24px;\n`;\n"],"names":["CardKebabMenuWrapper","styled","FlexView","theme","SubHeaderText","Text","CardMenuOptionsWrapper","$shouldopenonright","$visible","CardContainer","CardWrapper","$bgImage","IconWrapper","BannerImageWrapper","BannerImage","gutter","StyledMinus2Icon","Minus2Icon","HeaderText","CardOptionWrapper","$disabled","OptionText","MenuWrapper","BlurContainer","BlurFlexView"],"mappings":";;;;AAcO,MAAMA,IAAuBC,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAQWA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC,GAEYC,IAAgBH,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ3BC,IAAyBL,EAAOC,CAAQ,EAAgC,CAAC;AAAA,EACpF,oBAAAK;AAAA,EACA,UAAAC;AACF,MACS;AAAA;AAAA;AAAA;AAAA;AAAA,aAKID,IAAqB,IAAI,MAAM;AAAA;AAAA,wBAEpBC,IAAW,IAAI,CAAC;AAAA,eACzBA,IAAW,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,GAK9B,GAEYC,IAAgBR,EAAOC,CAAQ;AAAA,sBACtB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA,wBAGpC,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAI5CO,IAAcT,EAAOC,CAAQ,EAAqB,CAAC,EAAE,UAAAS,QAC5DA,IACK;AAAA,8BACmBA,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,QAQ7B,mBACR,GAEYC,IAAcX,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAM7BW,IAAqBZ,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAMpCY,IAAcb,EAAO,IAAI,CAAC,EAAE,OAAAE,QAAY;AAC7C,QAAA,EAAE,QAAAY,EAAO,IAAIZ,EAAM;AAElB,SAAA;AAAA,wBACeA,EAAM,OAAO,UAAU;AAAA,aAClCY,IAAS,CAAC;AAAA,cACTA,IAAS,CAAC;AAAA;AAAA;AAGxB,CAAC,GAEYC,IAAmBf,EAAOgB,CAAU;AAAA;AAAA,cAEnC,CAAC,EAAE,OAAAd,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAIlCe,IAAajB,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBVJ,EAAOC,CAAQ;AAEnC,MAAMiB,IAAoBlB,EAAOC,CAAQ,EAA2B,CAAC;AAAA,EAC1E,OAAAC;AAAA,EACA,WAAAiB;AACF,MACS;AAAA,cACKA,IAAY,gBAAgB,SAAS;AAAA;AAAA;AAAA,oBAG/BA,IAAY,gBAAgBjB,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,cAIpDA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGjC,GAEYkB,IAAapB,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA,GAMxBiB,IAAcrB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAS7BqB,IAAgBtB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAS/BsB,IAAevB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createPostAPI as t } from "@cuemath/rest-api";
|
2
|
-
import {
|
2
|
+
import { BASE_URL_V3_2 as e } from "../../../../constants/api.js";
|
3
3
|
const { usePost: i } = t({
|
4
4
|
getURL: (s, { studentId: o }) => `${e}/users/${o}/milestones/`
|
5
5
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"goal-submit.js","sources":["../../../../../src/features/milestone/create/api/goal-submit.ts"],"sourcesContent":["import type { TMilestonePayload } from '../milestone-create-types';\n\nimport { createPostAPI } from '@cuemath/rest-api';\n\nimport {
|
1
|
+
{"version":3,"file":"goal-submit.js","sources":["../../../../../src/features/milestone/create/api/goal-submit.ts"],"sourcesContent":["import type { TMilestonePayload } from '../milestone-create-types';\n\nimport { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3_2 } from '../../../../constants/api';\n\nconst { usePost: useGoalCreationPost } = createPostAPI<\n { id: string },\n TMilestonePayload,\n { studentId: string }\n>({\n getURL: (_, { studentId }) => `${BASE_URL_V3_2}/users/${studentId}/milestones/`,\n});\n\nexport { useGoalCreationPost };\n"],"names":["useGoalCreationPost","createPostAPI","_","studentId","BASE_URL_V3_2"],"mappings":";;AAMA,MAAM,EAAE,SAASA,EAAoB,IAAIC,EAIvC;AAAA,EACA,QAAQ,CAACC,GAAG,EAAE,WAAAC,EAAgB,MAAA,GAAGC,CAAa,UAAUD,CAAS;AACnE,CAAC;"}
|
@@ -1,75 +1,68 @@
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
2
|
-
import { memo as
|
3
|
-
import { SHEET_STATE as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
2
|
+
import { memo as B, useState as G, useRef as L, useCallback as s } from "react";
|
3
|
+
import { SHEET_STATE as p } from "../../../../sheets/constants/sheet.js";
|
4
|
+
import N from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
5
|
+
import O from "../../../../ui/hooks/use-context-menu-click-handler.js";
|
6
|
+
import X from "../../../../ui/image/image.js";
|
7
7
|
import w from "../../../../ui/layout/flex-view.js";
|
8
|
-
import
|
9
|
-
import { ChapterInfoWrapper as
|
10
|
-
const
|
8
|
+
import j from "../sheets-list/sheets-list.js";
|
9
|
+
import { ChapterInfoWrapper as F, ChapterInfoIcon as K, SheetsListWrapper as P, ChapterListWrapper as U, ChapterProgressSVG as q, ChapterProgressSVGCircle as A, StyledText as E } from "./chapter-item-styled.js";
|
10
|
+
const z = [
|
11
11
|
"STARTED",
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
],
|
16
|
-
const { chapterData: x, onChapterItemClick: h, isThisPrimaryChapter: R, showChapterTags: k, canAddChapter: l } =
|
12
|
+
p.FAMILIAR,
|
13
|
+
p.PROFICIENT,
|
14
|
+
p.MASTERED
|
15
|
+
], ie = B((_) => {
|
16
|
+
const { chapterData: x, onChapterItemClick: h, isThisPrimaryChapter: R, showChapterTags: k, canAddChapter: l } = _, {
|
17
17
|
name: d,
|
18
|
-
image_url:
|
18
|
+
image_url: W,
|
19
19
|
added: m,
|
20
20
|
learning_sheet_data: g,
|
21
|
-
total_supplementary_sheets: W,
|
22
21
|
id: f,
|
23
22
|
chapter_tags: H,
|
24
23
|
state: a
|
25
|
-
} = x, M = a &&
|
26
|
-
var
|
27
|
-
const { current:
|
28
|
-
if (
|
29
|
-
const r = (
|
24
|
+
} = x, M = a && z.includes(a) && g.length > 0, u = a === "MASTERED", [e, C] = G(null), i = L(null), V = s(() => {
|
25
|
+
var b;
|
26
|
+
const { current: I } = i;
|
27
|
+
if (I) {
|
28
|
+
const r = (b = I.children[0]) == null ? void 0 : b.getBoundingClientRect();
|
30
29
|
if (r) {
|
31
|
-
const
|
32
|
-
r.left + 296 <
|
30
|
+
const v = window.innerWidth, S = window.innerHeight, o = {};
|
31
|
+
r.left + 296 < v ? o.left = r.left : o.left = r.left + 20 - 296, r.top + 252 < S ? o.top = r.top + 20 : o.bottom = S - r.top + 8, Object.keys(o).length && C({ ...o });
|
33
32
|
}
|
34
33
|
}
|
35
34
|
}, [C, i]), {
|
36
|
-
menuVisible:
|
35
|
+
menuVisible: c,
|
37
36
|
onMenuClick: $,
|
38
|
-
hideMenu:
|
39
|
-
} =
|
40
|
-
|
41
|
-
}, [$,
|
37
|
+
hideMenu: T
|
38
|
+
} = O(i, V), y = s(() => {
|
39
|
+
c ? T() : $();
|
40
|
+
}, [$, T, c]), D = s(() => {
|
42
41
|
if (!l) return null;
|
43
42
|
h(f);
|
44
43
|
}, [l, f, h]);
|
45
44
|
return /* @__PURE__ */ n(w, { $flexGap: 4, $position: "relative", children: [
|
46
|
-
/* @__PURE__ */ n(
|
47
|
-
/* @__PURE__ */ t(
|
48
|
-
|
49
|
-
|
45
|
+
/* @__PURE__ */ n(F, { ref: i, onClick: y, children: [
|
46
|
+
/* @__PURE__ */ t(K, { className: "goal-chapter-info-icon" }),
|
47
|
+
c && /* @__PURE__ */ t(
|
48
|
+
P,
|
50
49
|
{
|
51
50
|
$top: e == null ? void 0 : e.top,
|
52
51
|
$left: e == null ? void 0 : e.left,
|
53
52
|
$bottom: e == null ? void 0 : e.bottom,
|
54
|
-
children: /* @__PURE__ */ t(
|
55
|
-
F,
|
56
|
-
{
|
57
|
-
learningSheetData: g,
|
58
|
-
supplementarySheetsCount: W
|
59
|
-
}
|
60
|
-
)
|
53
|
+
children: /* @__PURE__ */ t(j, { learningSheetData: g })
|
61
54
|
}
|
62
55
|
)
|
63
56
|
] }),
|
64
57
|
/* @__PURE__ */ t(
|
65
|
-
|
58
|
+
N,
|
66
59
|
{
|
67
60
|
position: "bottom",
|
68
61
|
renderAs: "primary",
|
69
62
|
tooltipItem: "Duplicates can’t be added",
|
70
63
|
hidden: !R,
|
71
64
|
children: /* @__PURE__ */ n(
|
72
|
-
|
65
|
+
U,
|
73
66
|
{
|
74
67
|
$widthX: 9.5,
|
75
68
|
$heightX: 8.875,
|
@@ -81,13 +74,13 @@ const J = [
|
|
81
74
|
$selectable: l,
|
82
75
|
$borderColor: m ? "BLACK_T_87" : "WHITE_5",
|
83
76
|
$background: m ? "WHITE_3" : "WHITE_1",
|
84
|
-
onClick:
|
77
|
+
onClick: D,
|
85
78
|
children: [
|
86
79
|
/* @__PURE__ */ n(w, { $position: "relative", children: [
|
87
|
-
M && /* @__PURE__ */ n(
|
88
|
-
/* @__PURE__ */ t(
|
80
|
+
M && /* @__PURE__ */ n(q, { width: "62px", height: "62px", children: [
|
81
|
+
/* @__PURE__ */ t(A, { $progress: 0, r: "30", cx: "31", cy: "31" }),
|
89
82
|
/* @__PURE__ */ t(
|
90
|
-
|
83
|
+
A,
|
91
84
|
{
|
92
85
|
$progressCircle: !0,
|
93
86
|
$progressBackground: u ? "GREEN_5" : "BLACK",
|
@@ -99,9 +92,9 @@ const J = [
|
|
99
92
|
)
|
100
93
|
] }),
|
101
94
|
/* @__PURE__ */ t(
|
102
|
-
|
95
|
+
X,
|
103
96
|
{
|
104
|
-
src:
|
97
|
+
src: W || "",
|
105
98
|
alt: d,
|
106
99
|
withLoader: !0,
|
107
100
|
width: 56,
|
@@ -110,16 +103,16 @@ const J = [
|
|
110
103
|
}
|
111
104
|
)
|
112
105
|
] }),
|
113
|
-
/* @__PURE__ */ t(
|
106
|
+
/* @__PURE__ */ t(E, { $renderAs: "ab3", $align: "center", children: d })
|
114
107
|
]
|
115
108
|
}
|
116
109
|
)
|
117
110
|
}
|
118
111
|
),
|
119
|
-
k && /* @__PURE__ */ t(
|
112
|
+
k && /* @__PURE__ */ t(E, { $renderAs: "ab3", $lineClampNo: 1, $color: "BLACK_T_60", children: H })
|
120
113
|
] });
|
121
114
|
});
|
122
115
|
export {
|
123
|
-
|
116
|
+
ie as default
|
124
117
|
};
|
125
118
|
//# sourceMappingURL=chapter-item.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter-item.js","sources":["../../../../../../src/features/milestone/create/comps/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItem, ISheetsListPosition } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useRef, useState } from 'react';\n\nimport { SHEET_STATE } from '../../../../sheets/constants/sheet';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport useContextMenuClickHandler from '../../../../ui/hooks/use-context-menu-click-handler';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport SheetsList from '../sheets-list/sheets-list';\nimport * as Styled from './chapter-item-styled';\n\nconst progressVisibleStates = [\n 'STARTED',\n SHEET_STATE.FAMILIAR,\n SHEET_STATE.PROFICIENT,\n SHEET_STATE.MASTERED,\n];\n\nconst ChapterItemV2: FC<IChapterItem> = memo(props => {\n const { chapterData, onChapterItemClick, isThisPrimaryChapter, showChapterTags, canAddChapter } =\n props;\n const {\n name,\n image_url: imageUrl,\n added,\n learning_sheet_data: learningSheetData,\n
|
1
|
+
{"version":3,"file":"chapter-item.js","sources":["../../../../../../src/features/milestone/create/comps/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItem, ISheetsListPosition } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useRef, useState } from 'react';\n\nimport { SHEET_STATE } from '../../../../sheets/constants/sheet';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport useContextMenuClickHandler from '../../../../ui/hooks/use-context-menu-click-handler';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport SheetsList from '../sheets-list/sheets-list';\nimport * as Styled from './chapter-item-styled';\n\nconst progressVisibleStates = [\n 'STARTED',\n SHEET_STATE.FAMILIAR,\n SHEET_STATE.PROFICIENT,\n SHEET_STATE.MASTERED,\n];\n\nconst ChapterItemV2: FC<IChapterItem> = memo(props => {\n const { chapterData, onChapterItemClick, isThisPrimaryChapter, showChapterTags, canAddChapter } =\n props;\n const {\n name,\n image_url: imageUrl,\n added,\n learning_sheet_data: learningSheetData,\n id: chapterId,\n chapter_tags: chapterTags,\n state,\n } = chapterData;\n\n const showProgress =\n state && progressVisibleStates.includes(state) && learningSheetData.length > 0;\n const isMastered = state === 'MASTERED';\n\n const [sheetsListPositionCoordinates, setSheetsListPositionCoordinates] =\n useState<ISheetsListPosition | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const handleSetCoordinates = useCallback(() => {\n const { current } = containerRef;\n\n if (current) {\n const boundingClientRect = current.children[0]?.getBoundingClientRect();\n\n if (boundingClientRect) {\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n const positions: ISheetsListPosition = {};\n\n //* 288 (Width of card) + 8 (left position) = 296\n if (boundingClientRect.left + 296 < viewportWidth) {\n positions.left = boundingClientRect.left;\n } else {\n positions.left = boundingClientRect.left + 20 - 296;\n }\n\n //* 252 (Max height of card)\n if (boundingClientRect.top + 252 < viewportHeight) {\n positions.top = boundingClientRect.top + 20;\n } else {\n positions.bottom = viewportHeight - boundingClientRect.top + 8;\n }\n\n if (Object.keys(positions).length) {\n setSheetsListPositionCoordinates({ ...positions });\n }\n }\n }\n }, [setSheetsListPositionCoordinates, containerRef]);\n\n const {\n menuVisible,\n onMenuClick: onMenuClick,\n hideMenu,\n } = useContextMenuClickHandler(containerRef, handleSetCoordinates);\n\n const handleOnSheetsView = useCallback(() => {\n if (!menuVisible) {\n onMenuClick();\n } else {\n hideMenu();\n }\n }, [onMenuClick, hideMenu, menuVisible]);\n\n const handleOnChapterItemClick = useCallback(() => {\n if (!canAddChapter) return null;\n\n onChapterItemClick(chapterId);\n }, [canAddChapter, chapterId, onChapterItemClick]);\n\n return (\n <FlexView $flexGap={4} $position=\"relative\">\n <Styled.ChapterInfoWrapper ref={containerRef} onClick={handleOnSheetsView}>\n <Styled.ChapterInfoIcon className=\"goal-chapter-info-icon\" />\n {menuVisible && (\n <Styled.SheetsListWrapper\n $top={sheetsListPositionCoordinates?.top}\n $left={sheetsListPositionCoordinates?.left}\n $bottom={sheetsListPositionCoordinates?.bottom}\n >\n <SheetsList learningSheetData={learningSheetData} />\n </Styled.SheetsListWrapper>\n )}\n </Styled.ChapterInfoWrapper>\n\n <ArrowTooltip\n position=\"bottom\"\n renderAs=\"primary\"\n tooltipItem=\"Duplicates can’t be added\"\n hidden={!isThisPrimaryChapter}\n >\n <Styled.ChapterListWrapper\n $widthX={9.5}\n $heightX={8.875}\n $gapX={1}\n $gutterX={1}\n $flexGap={12}\n $position=\"relative\"\n $alignItems=\"center\"\n $selectable={canAddChapter}\n $borderColor={added ? 'BLACK_T_87' : 'WHITE_5'}\n $background={added ? 'WHITE_3' : 'WHITE_1'}\n onClick={handleOnChapterItemClick}\n >\n <FlexView $position=\"relative\">\n {showProgress && (\n <Styled.ChapterProgressSVG width=\"62px\" height=\"62px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"30\" cx=\"31\" cy=\"31\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground={isMastered ? 'GREEN_5' : 'BLACK'}\n $progress={isMastered ? 360 : 95}\n r=\"30\"\n cx=\"31\"\n cy=\"31\"\n />\n </Styled.ChapterProgressSVG>\n )}\n <Image\n src={imageUrl || ''}\n alt={name}\n withLoader\n width={56}\n height={56}\n borderRadius={50}\n />\n </FlexView>\n\n <Styled.StyledText $renderAs=\"ab3\" $align=\"center\">\n {name}\n </Styled.StyledText>\n </Styled.ChapterListWrapper>\n </ArrowTooltip>\n\n {showChapterTags && (\n <Styled.StyledText $renderAs=\"ab3\" $lineClampNo={1} $color=\"BLACK_T_60\">\n {chapterTags}\n </Styled.StyledText>\n )}\n </FlexView>\n );\n});\n\nexport default ChapterItemV2;\n"],"names":["progressVisibleStates","SHEET_STATE","ChapterItemV2","memo","props","chapterData","onChapterItemClick","isThisPrimaryChapter","showChapterTags","canAddChapter","name","imageUrl","added","learningSheetData","chapterId","chapterTags","state","showProgress","isMastered","sheetsListPositionCoordinates","setSheetsListPositionCoordinates","useState","containerRef","useRef","handleSetCoordinates","useCallback","current","boundingClientRect","_a","viewportWidth","viewportHeight","positions","menuVisible","onMenuClick","hideMenu","useContextMenuClickHandler","handleOnSheetsView","handleOnChapterItemClick","jsxs","FlexView","Styled.ChapterInfoWrapper","jsx","Styled.ChapterInfoIcon","Styled.SheetsListWrapper","SheetsList","ArrowTooltip","Styled.ChapterListWrapper","Styled.ChapterProgressSVG","Styled.ChapterProgressSVGCircle","Image","Styled.StyledText"],"mappings":";;;;;;;;;AA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AAA,EAA0B,OAAM,QAAO,QAAO,QAC7C,UAAA;AAAA,kBAAC,gBAAAN,EAAAO,GAAA,EAAgC,WAAW,GAAG,GAAE,MAAK,IAAG,MAAK,IAAG,KAAK,CAAA;AAAA,kBACtE,gBAAAP;AAAA,oBAACO;AAAAA,oBAAA;AAAA,sBACC,iBAAe;AAAA,sBACf,qBAAqB9B,IAAa,YAAY;AAAA,sBAC9C,WAAWA,IAAa,MAAM;AAAA,sBAC9B,GAAE;AAAA,sBACF,IAAG;AAAA,sBACH,IAAG;AAAA,oBAAA;AAAA,kBACL;AAAA,gBAAA,GACF;AAAA,gBAEF,gBAAAuB;AAAA,kBAACQ;AAAA,kBAAA;AAAA,oBACC,KAAKtC,KAAY;AAAA,oBACjB,KAAKD;AAAA,oBACL,YAAU;AAAA,oBACV,OAAO;AAAA,oBACP,QAAQ;AAAA,oBACR,cAAc;AAAA,kBAAA;AAAA,gBAChB;AAAA,cAAA,GACF;AAAA,cAEA,gBAAA+B,EAACS,GAAA,EAAkB,WAAU,OAAM,QAAO,UACvC,UACHxC,GAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,IAECF,KACE,gBAAAiC,EAAAS,GAAA,EAAkB,WAAU,OAAM,cAAc,GAAG,QAAO,cACxD,UACHnC,EAAA,CAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -1,9 +1,17 @@
|
|
1
1
|
import r from "styled-components";
|
2
|
-
import
|
3
|
-
const
|
4
|
-
box-shadow: 0px 10px 20px 0px ${
|
2
|
+
import o from "../../../../ui/layout/flex-view.js";
|
3
|
+
const x = r(o)(({ theme: t }) => `
|
4
|
+
box-shadow: 0px 10px 20px 0px ${t.colors.BLACK_T_20};
|
5
|
+
`), n = r(o)(() => `
|
6
|
+
margin-left: auto;
|
7
|
+
|
8
|
+
svg {
|
9
|
+
width: 24px;
|
10
|
+
height: 24px;
|
11
|
+
}
|
5
12
|
`);
|
6
13
|
export {
|
7
|
-
|
14
|
+
n as BinIconWrapper,
|
15
|
+
x as ButtonWrapper
|
8
16
|
};
|
9
17
|
//# sourceMappingURL=chapters-selection-step-styled.js.map
|