@cuemath/leap 2.9.5 → 2.9.6-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 +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/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 +89 -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 +51 -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 +180 -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 +175 -0
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -0
- package/dist/features/communication/pub-sub/constants.js +12 -6
- 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 +15 -0
- package/dist/features/homework/card-title.js.map +1 -0
- package/dist/features/homework/homework-card-view.js +141 -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 +63 -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 +185 -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/journey/comps/coachmark/coachmark-styled.js +12 -5
- package/dist/features/journey/comps/coachmark/coachmark-styled.js.map +1 -1
- package/dist/features/journey/comps/coachmark/coachmark.js +24 -24
- package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey.js +188 -0
- package/dist/features/journey/hooks/use-home-page-journey.js.map +1 -0
- package/dist/features/journey/journey-id/journey-id-student.js +3 -2
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +65 -57
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/journey/use-journey/journey-styled.js +10 -5
- package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
- 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 +137 -105
- 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 +118 -120
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/api/goal-resource-assign.js +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/api/goal-resource-assign.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js +8 -8
- package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.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/api/test-sheet-assign.js +5 -5
- package/dist/features/milestone/milestone-tests/tests-creation/api/test-sheet-assign.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js +46 -50
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.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 +39 -0
- package/dist/features/recent-chapters/recent-chapters.js.map +1 -0
- package/dist/features/sentry/constants/ignored.js +33 -0
- package/dist/features/sentry/constants/ignored.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 +336 -35
- package/dist/index.js +500 -468
- 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-utils.js +0 -38
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.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,103 @@
|
|
1
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { memo as B, useCallback as x, useEffect as l } from "react";
|
3
|
+
import { ILLUSTRATIONS as y } from "../../../assets/illustrations/illustrations.js";
|
4
|
+
import I from "../../../assets/line-icons/icons/back2.js";
|
5
|
+
import w from "../../ui/buttons/button/button.js";
|
6
|
+
import L from "../../ui/buttons/icon-button/icon-button.js";
|
7
|
+
import N from "../../ui/layout/flex-view.js";
|
8
|
+
import S from "../../ui/loader/app-loader/app-loader.js";
|
9
|
+
import _ from "../../ui/text/text.js";
|
10
|
+
import { useGetChapterDetails as b } from "../api/chapter.js";
|
11
|
+
import D from "./block-sections/block-sections.js";
|
12
|
+
import E from "./chapter-banner/chapter-banner.js";
|
13
|
+
import { ContentWrapper as T, BackButtonContainer as v, BackButtonWrapper as R, LoaderWrapper as j } from "./chapter-details-styled.js";
|
14
|
+
const P = B((c) => {
|
15
|
+
const {
|
16
|
+
userChapterId: i,
|
17
|
+
studentId: n,
|
18
|
+
userType: a,
|
19
|
+
onBlockSkipUnskip: h,
|
20
|
+
onNodeAttempt: d,
|
21
|
+
onNodeAttemptLocationChange: g,
|
22
|
+
onNodeMarkAsDone: f,
|
23
|
+
onNodeReattempt: u,
|
24
|
+
onNodeReview: C,
|
25
|
+
onNodeView: k,
|
26
|
+
onExit: $
|
27
|
+
} = c, {
|
28
|
+
get: s,
|
29
|
+
data: e,
|
30
|
+
isProcessing: r,
|
31
|
+
isProcessingFailed: A,
|
32
|
+
isStale: m
|
33
|
+
} = b(), o = x(() => {
|
34
|
+
s(i, void 0, { studentId: n });
|
35
|
+
}, [s, i, n]);
|
36
|
+
return l(() => {
|
37
|
+
o();
|
38
|
+
}, [o]), l(() => {
|
39
|
+
!r && m && o();
|
40
|
+
}, [o, r, m]), A ? /* @__PURE__ */ p(N, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
|
41
|
+
/* @__PURE__ */ t(_, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
|
42
|
+
/* @__PURE__ */ t(
|
43
|
+
w,
|
44
|
+
{
|
45
|
+
widthX: 14,
|
46
|
+
size: "small",
|
47
|
+
shape: "square",
|
48
|
+
renderAs: "primary",
|
49
|
+
label: "Try again",
|
50
|
+
onClick: o
|
51
|
+
}
|
52
|
+
)
|
53
|
+
] }) : !e && r ? /* @__PURE__ */ t(S, { height: "80vh" }) : /* @__PURE__ */ p(
|
54
|
+
T,
|
55
|
+
{
|
56
|
+
$widthX: 50,
|
57
|
+
$disablePointerEvents: r,
|
58
|
+
$justifyContent: "center",
|
59
|
+
$alignItems: "center",
|
60
|
+
children: [
|
61
|
+
a === "TEACHER" && /* @__PURE__ */ t(v, { $height: "100%", children: /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(
|
62
|
+
L,
|
63
|
+
{
|
64
|
+
Icon: I,
|
65
|
+
renderAs: "secondary-gray",
|
66
|
+
analyticsLabel: "chapter_page_exit",
|
67
|
+
size: "xsmall",
|
68
|
+
onClick: $
|
69
|
+
}
|
70
|
+
) }) }),
|
71
|
+
r && /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t("img", { src: y.LOADER_1, alt: "loader" }) }),
|
72
|
+
e && /* @__PURE__ */ t(
|
73
|
+
E,
|
74
|
+
{
|
75
|
+
title: e.name,
|
76
|
+
imageHue: e.image_hue,
|
77
|
+
imageUrl: e.image_url,
|
78
|
+
progressStats: e == null ? void 0 : e.progress_stat
|
79
|
+
}
|
80
|
+
),
|
81
|
+
e && /* @__PURE__ */ t(
|
82
|
+
D,
|
83
|
+
{
|
84
|
+
imageHue: e.image_hue,
|
85
|
+
userType: a,
|
86
|
+
blocks: e.blocks,
|
87
|
+
onBlockSkipUnskip: h,
|
88
|
+
onNodeAttempt: d,
|
89
|
+
onNodeAttemptLocationChange: g,
|
90
|
+
onNodeMarkAsDone: f,
|
91
|
+
onNodeReattempt: u,
|
92
|
+
onNodeReview: C,
|
93
|
+
onNodeView: k
|
94
|
+
}
|
95
|
+
)
|
96
|
+
]
|
97
|
+
}
|
98
|
+
);
|
99
|
+
}), Q = P;
|
100
|
+
export {
|
101
|
+
Q as default
|
102
|
+
};
|
103
|
+
//# sourceMappingURL=chapter-details.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n } = props;\n\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"80vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n />\n )}\n\n {chapterDetails && (\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n />\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;AAiBA,MAAMA,IAAsCC,EAAK,CAASC,MAAA;AAClD,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAX,GAEE;AAAA,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;AAAA,QAGDG,KACC,gBAAAS,EAACS,GAAA,EACC,UAAA,gBAAAT,EAAC,OAAI,EAAA,KAAKU,EAAc,UAAU,KAAI,SAAA,CAAS,EACjD,CAAA;AAAA,QAGDpB,KACC,gBAAAU;AAAA,UAACW;AAAA,UAAA;AAAA,YACC,OAAOrB,EAAe;AAAA,YACtB,UAAUA,EAAe;AAAA,YACzB,UAAUA,EAAe;AAAA,YACzB,eAAeA,KAAA,gBAAAA,EAAgB;AAAA,UAAA;AAAA,QACjC;AAAA,QAGDA,KACC,gBAAAU;AAAA,UAACY;AAAA,UAAA;AAAA,YACC,UAAUtB,EAAe;AAAA,YACzB,UAAAV;AAAA,YACA,QAAQU,EAAe;AAAA,YACvB,mBAAAT;AAAA,YACA,eAAAC;AAAA,YACA,6BAAAC;AAAA,YACA,kBAAAC;AAAA,YACA,iBAAAC;AAAA,YACA,cAAAC;AAAA,YACA,YAAAC;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAED0B,IAAetC;"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
2
|
+
const o = () => /* @__PURE__ */ r("svg", { className: "node-card-border", viewBox: "0 0 170 56", preserveAspectRatio: "none", children: [
|
3
|
+
/* @__PURE__ */ e("defs", { children: /* @__PURE__ */ r("linearGradient", { id: "gradient", x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
|
4
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: "black" }),
|
5
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: "gray" })
|
6
|
+
] }) }),
|
7
|
+
/* @__PURE__ */ e("rect", { className: "border-path", x: "0", y: "0", width: "100%", height: "100%" }),
|
8
|
+
/* @__PURE__ */ e("rect", { className: "border-path-animation", x: "0", y: "0", width: "100%", height: "100%" })
|
9
|
+
] });
|
10
|
+
export {
|
11
|
+
o as default
|
12
|
+
};
|
13
|
+
//# sourceMappingURL=border-path-animation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"border-path-animation.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/border-path-animation.tsx"],"sourcesContent":["import type { FC } from 'react';\n\nconst BorderPathAnimation: FC = () => {\n return (\n <svg className=\"node-card-border\" viewBox=\"0 0 170 56\" preserveAspectRatio=\"none\">\n <defs>\n <linearGradient id=\"gradient\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n <stop offset=\"0%\" stopColor=\"black\" />\n <stop offset=\"100%\" stopColor=\"gray\" />\n </linearGradient>\n </defs>\n <rect className=\"border-path\" x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" />\n <rect className=\"border-path-animation\" x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" />\n </svg>\n );\n};\n\nexport default BorderPathAnimation;\n"],"names":["BorderPathAnimation","jsx","jsxs"],"mappings":";AAEA,MAAMA,IAA0B,wBAE3B,OAAI,EAAA,WAAU,oBAAmB,SAAQ,cAAa,qBAAoB,QACzE,UAAA;AAAA,EAAA,gBAAAC,EAAC,QACC,EAAA,UAAA,gBAAAC,EAAC,kBAAe,EAAA,IAAG,YAAW,IAAG,MAAK,IAAG,MAAK,IAAG,QAAO,IAAG,MACzD,UAAA;AAAA,IAAA,gBAAAD,EAAC,QAAK,EAAA,QAAO,MAAK,WAAU,SAAQ;AAAA,IACnC,gBAAAA,EAAA,QAAA,EAAK,QAAO,QAAO,WAAU,QAAO;AAAA,EAAA,EAAA,CACvC,EACF,CAAA;AAAA,EACA,gBAAAA,EAAC,QAAK,EAAA,WAAU,eAAc,GAAE,KAAI,GAAE,KAAI,OAAM,QAAO,QAAO,OAAO,CAAA;AAAA,EACrE,gBAAAA,EAAC,QAAK,EAAA,WAAU,yBAAwB,GAAE,KAAI,GAAE,KAAI,OAAM,QAAO,QAAO,OAAO,CAAA;AACjF,EAAA,CAAA;"}
|
@@ -0,0 +1,153 @@
|
|
1
|
+
import t from "styled-components";
|
2
|
+
import d from "../../../../assets/line-icons/icons/important.js";
|
3
|
+
import c from "../../../../assets/line-icons/icons/lock2.js";
|
4
|
+
import e from "../../../ui/layout/flex-view.js";
|
5
|
+
import l from "../../../ui/text/text.js";
|
6
|
+
const f = t(e)(({
|
7
|
+
$showOutline: o,
|
8
|
+
theme: r,
|
9
|
+
$disabled: n,
|
10
|
+
$isSheetLocked: s
|
11
|
+
}) => {
|
12
|
+
const { BLACK_1: p, BLACK: a, BLACK_T_15: i } = r.colors;
|
13
|
+
return `
|
14
|
+
cursor: ${n ? "not-allowed" : "pointer"};
|
15
|
+
${n ? "pointer-events: none;" : "pointer-events: auto;"};
|
16
|
+
position: relative;
|
17
|
+
border-image: linear-gradient(to right, ${i} 0%, ${i} 100%);
|
18
|
+
${o && `outline: 1px solid ${i};`};
|
19
|
+
|
20
|
+
.node-card-border {
|
21
|
+
position: absolute;
|
22
|
+
top: 0;
|
23
|
+
left: 0;
|
24
|
+
z-index: 2;
|
25
|
+
width: 100%;
|
26
|
+
height: 100%;
|
27
|
+
pointer-events: none;
|
28
|
+
background: transparent;
|
29
|
+
}
|
30
|
+
|
31
|
+
.node-card-border > .border-path {
|
32
|
+
fill: none;
|
33
|
+
stroke: ${i};
|
34
|
+
stroke-width: 1.5;
|
35
|
+
}
|
36
|
+
|
37
|
+
.node-card-border > .border-path-animation {
|
38
|
+
fill: none;
|
39
|
+
stroke: ${a};
|
40
|
+
stroke-width: 1.5;
|
41
|
+
//* view box size 170 + 56 + 170 + 56 = 452
|
42
|
+
//* 452 / 2 = 226
|
43
|
+
stroke-dasharray: 226 226;
|
44
|
+
stroke-dashoffset: 0;
|
45
|
+
|
46
|
+
animation: dashmove 6s linear infinite;
|
47
|
+
}
|
48
|
+
|
49
|
+
@keyframes dashmove {
|
50
|
+
to {
|
51
|
+
stroke-dashoffset: -900;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
&:hover {
|
56
|
+
${!n && `
|
57
|
+
.node-card-border > .border-path-animation {
|
58
|
+
stroke: ${p};
|
59
|
+
stroke-dasharray: 452;
|
60
|
+
animation: none;
|
61
|
+
}
|
62
|
+
`}
|
63
|
+
|
64
|
+
${o && !s && `outline: 1px solid ${a};`};
|
65
|
+
}
|
66
|
+
`;
|
67
|
+
}), g = t(d)(({ theme: o }) => {
|
68
|
+
const { layout: r } = o;
|
69
|
+
return `
|
70
|
+
width: ${r.gutter * 0.75}px;
|
71
|
+
height: ${r.gutter * 0.75}px;
|
72
|
+
position: absolute;
|
73
|
+
top: -2.5px;
|
74
|
+
right: -2.5px;
|
75
|
+
`;
|
76
|
+
}), k = t(e)(({ $bgImage: o }) => `
|
77
|
+
background-image: url(${o});
|
78
|
+
|
79
|
+
& .context-menu {
|
80
|
+
justify-self: flex-end;
|
81
|
+
margin-left: auto;
|
82
|
+
}
|
83
|
+
`), $ = t(e)`
|
84
|
+
border-radius: 50%;
|
85
|
+
`, v = t(e)(() => `
|
86
|
+
position: relative;
|
87
|
+
padding: 12px 8px 12px 12px;
|
88
|
+
`), w = t(e)(({ $top: o, $right: r }) => `
|
89
|
+
position: absolute;
|
90
|
+
top: ${o ?? 0}px;
|
91
|
+
right: ${r ?? 0}px;
|
92
|
+
z-index: 3;
|
93
|
+
`);
|
94
|
+
t(c)(({}) => `
|
95
|
+
width: 28px;
|
96
|
+
height: 28px;
|
97
|
+
`);
|
98
|
+
const I = t(e)(({ theme: o }) => {
|
99
|
+
const { BLACK_1: r, WHITE_1: n } = o.colors;
|
100
|
+
return `
|
101
|
+
position: absolute;
|
102
|
+
top: -10px;
|
103
|
+
right: -10px;
|
104
|
+
background: ${r};
|
105
|
+
|
106
|
+
path {
|
107
|
+
fill: ${n};
|
108
|
+
}
|
109
|
+
`;
|
110
|
+
}), y = t(l)(() => `
|
111
|
+
display: -webkit-box;
|
112
|
+
-webkit-box-orient: vertical;
|
113
|
+
-webkit-line-clamp: 2;
|
114
|
+
text-overflow: ellipsis;
|
115
|
+
overflow: hidden;
|
116
|
+
`), C = t(e)(({ theme: o }) => `
|
117
|
+
cursor: pointer;
|
118
|
+
|
119
|
+
&:hover {
|
120
|
+
border-radius: 50%;
|
121
|
+
background: ${o.colors.WHITE_5};
|
122
|
+
}
|
123
|
+
`), W = t(e)(({ theme: o, $visible: r }) => `
|
124
|
+
cursor: pointer;
|
125
|
+
|
126
|
+
position: absolute;
|
127
|
+
z-index: 6;
|
128
|
+
top: calc(100% + 4px);
|
129
|
+
left: 0;
|
130
|
+
|
131
|
+
transform-origin: top;
|
132
|
+
transform: scaleY(${r ? 1 : 0});
|
133
|
+
opacity: ${r ? 1 : 0};
|
134
|
+
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
|
135
|
+
|
136
|
+
&:hover {
|
137
|
+
border-radius: 50%;
|
138
|
+
background: ${o.colors.WHITE_5};
|
139
|
+
}
|
140
|
+
`);
|
141
|
+
export {
|
142
|
+
$ as IconWrapper,
|
143
|
+
I as InProgressIconWrapper,
|
144
|
+
f as NodeCardContainer,
|
145
|
+
v as NodeCardContentWrapper,
|
146
|
+
k as NodeCardInfoWrapper,
|
147
|
+
y as NodeCardTitle,
|
148
|
+
C as NodeKebabMenuWrapper,
|
149
|
+
W as NodeMenuOptionsWrapper,
|
150
|
+
w as SheetTagWrapper,
|
151
|
+
g as StyledImportantIcon
|
152
|
+
};
|
153
|
+
//# sourceMappingURL=node-card-styled.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"node-card-styled.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport ImportantIcon from '../../../../assets/line-icons/icons/important';\nimport Lock2Icon from '../../../../assets/line-icons/icons/lock2';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ninterface INodeCardContainer {\n $showOutline?: boolean;\n $disabled: boolean;\n $isSheetLocked?: boolean;\n}\n\nconst NodeCardContainer = styled(FlexView)<INodeCardContainer>(({\n $showOutline,\n theme,\n $disabled,\n $isSheetLocked,\n}) => {\n const { BLACK_1, BLACK, BLACK_T_15 } = theme.colors;\n\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n ${$disabled ? 'pointer-events: none;' : 'pointer-events: auto;'};\n position: relative;\n border-image: linear-gradient(to right, ${BLACK_T_15} 0%, ${BLACK_T_15} 100%);\n ${$showOutline && `outline: 1px solid ${BLACK_T_15};`};\n\n .node-card-border {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n width: 100%;\n height: 100%;\n pointer-events: none;\n background: transparent;\n }\n\n .node-card-border > .border-path {\n fill: none;\n stroke: ${BLACK_T_15};\n stroke-width: 1.5;\n }\n\n .node-card-border > .border-path-animation {\n fill: none;\n stroke: ${BLACK};\n stroke-width: 1.5;\n //* view box size 170 + 56 + 170 + 56 = 452\n //* 452 / 2 = 226\n stroke-dasharray: 226 226;\n stroke-dashoffset: 0;\n\n animation: dashmove 6s linear infinite;\n }\n \n @keyframes dashmove {\n to {\n stroke-dashoffset: -900;\n }\n }\n \n &:hover {\n ${\n !$disabled &&\n `\n .node-card-border > .border-path-animation {\n stroke: ${BLACK_1};\n stroke-dasharray: 452;\n animation: none;\n }\n `\n }\n\n ${$showOutline && !$isSheetLocked && `outline: 1px solid ${BLACK};`};\n }\n `;\n});\n\nconst StyledImportantIcon = styled(ImportantIcon)(({ theme }) => {\n const { layout } = theme;\n\n return `\n width: ${layout.gutter * 0.75}px;\n height: ${layout.gutter * 0.75}px;\n position: absolute;\n top: -2.5px;\n right: -2.5px;\n `;\n});\n\ninterface INodeCardInfoWrapper {\n $bgImage: string;\n}\n\nconst NodeCardInfoWrapper = styled(FlexView)<INodeCardInfoWrapper>(({ $bgImage }) => {\n return `\n background-image: url(${$bgImage});\n\n & .context-menu {\n justify-self: flex-end;\n margin-left: auto;\n }\n `;\n});\n\nconst IconWrapper = styled(FlexView)`\n border-radius: 50%;\n`;\n\nconst NodeCardContentWrapper = styled(FlexView)(() => {\n return `\n position: relative;\n padding: 12px 8px 12px 12px;\n `;\n});\n\ninterface ISheetTagWrapper {\n $top?: number;\n $right?: number;\n}\n\nconst SheetTagWrapper = styled(FlexView)<ISheetTagWrapper>(({ $top, $right }) => {\n return `\n position: absolute;\n top: ${$top ?? 0}px;\n right: ${$right ?? 0}px;\n z-index: 3;\n`;\n});\n\nconst StyledLockIcon = styled(Lock2Icon)(({}) => {\n return `\n width: 28px;\n height: 28px;\n `;\n});\n\nconst InProgressIconWrapper = styled(FlexView)(({ theme }) => {\n const { BLACK_1, WHITE_1 } = theme.colors;\n\n return `\n position: absolute;\n top: -10px;\n right: -10px;\n background: ${BLACK_1};\n\n path {\n fill: ${WHITE_1};\n }\n `;\n});\n\nconst NodeCardTitle = styled(Text)(() => {\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n `;\n});\n\nconst NodeKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\ninterface INodeOptionsMenuWrapper {\n $visible: boolean;\n}\n\nconst NodeMenuOptionsWrapper = styled(FlexView)<INodeOptionsMenuWrapper>(({ theme, $visible }) => {\n return `\n cursor: pointer;\n\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n left: 0;\n\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 \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport {\n NodeCardContainer,\n StyledImportantIcon,\n NodeCardInfoWrapper,\n IconWrapper,\n NodeCardContentWrapper,\n SheetTagWrapper,\n StyledLockIcon,\n InProgressIconWrapper,\n NodeCardTitle,\n NodeKebabMenuWrapper,\n NodeMenuOptionsWrapper,\n};\n"],"names":["NodeCardContainer","styled","FlexView","$showOutline","theme","$disabled","$isSheetLocked","BLACK_1","BLACK","BLACK_T_15","StyledImportantIcon","ImportantIcon","layout","NodeCardInfoWrapper","$bgImage","IconWrapper","NodeCardContentWrapper","SheetTagWrapper","$top","$right","Lock2Icon","InProgressIconWrapper","WHITE_1","NodeCardTitle","Text","NodeKebabMenuWrapper","NodeMenuOptionsWrapper","$visible"],"mappings":";;;;;AAaA,MAAMA,IAAoBC,EAAOC,CAAQ,EAAsB,CAAC;AAAA,EAC9D,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACJ,QAAM,EAAE,SAAAC,GAAS,OAAAC,GAAO,YAAAC,EAAA,IAAeL,EAAM;AAEtC,SAAA;AAAA,cACKC,IAAY,gBAAgB,SAAS;AAAA,MAC7CA,IAAY,0BAA0B,uBAAuB;AAAA;AAAA,8CAErBI,CAAU,QAAQA,CAAU;AAAA,MACpEN,KAAgB,sBAAsBM,CAAU,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAezCA,CAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAMVD,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAkBb,CAACH,KACD;AAAA;AAAA,sBAEcE,CAAO;AAAA;AAAA;AAAA;AAAA,SAKvB;AAAA;AAAA,QAEEJ,KAAgB,CAACG,KAAkB,sBAAsBE,CAAK,GAAG;AAAA;AAAA;AAGzE,CAAC,GAEKE,IAAsBT,EAAOU,CAAa,EAAE,CAAC,EAAE,OAAAP,QAAY;AACzD,QAAA,EAAE,QAAAQ,EAAW,IAAAR;AAEZ,SAAA;AAAA,aACIQ,EAAO,SAAS,IAAI;AAAA,cACnBA,EAAO,SAAS,IAA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-0,0 +1,16 @@
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
2
|
+
import { memo as S } from "react";
|
3
|
+
import { getNodeStateBasedTagInfo as p } from "../../utils/node-card-utils.js";
|
4
|
+
import { SheetTagWrapper as T } from "./node-card-styled.js";
|
5
|
+
const E = S((t) => {
|
6
|
+
const { state: e, accuracy: a, nodeType: o, dueDateTs: r, isStudent: c } = t, i = o === "DYNAMIC" || o === "ASSESSMENT" || o === "CHAPTER_ASSESSMENT" ? a : void 0, {
|
7
|
+
icon: n,
|
8
|
+
top: s,
|
9
|
+
right: d
|
10
|
+
} = p(e, !!c, i, r);
|
11
|
+
return /* @__PURE__ */ m(T, { $top: s, $right: d, children: n });
|
12
|
+
});
|
13
|
+
export {
|
14
|
+
E as default
|
15
|
+
};
|
16
|
+
//# sourceMappingURL=node-card-tags.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"node-card-tags.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-tags.tsx"],"sourcesContent":["import type { INodeCardTagsProps } from './node-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport { getNodeStateBasedTagInfo } from '../../utils/node-card-utils';\nimport * as Styled from './node-card-styled';\n\nconst NodeCardTags: FC<INodeCardTagsProps> = memo(props => {\n const { state, accuracy, nodeType, dueDateTs, isStudent } = props;\n\n const isDynamicNode =\n nodeType === 'DYNAMIC' || nodeType === 'ASSESSMENT' || nodeType === 'CHAPTER_ASSESSMENT';\n const accuracyValue = isDynamicNode ? accuracy : undefined;\n\n const {\n icon: NodeTagIcon,\n top,\n right,\n } = getNodeStateBasedTagInfo(state, !!isStudent, accuracyValue, dueDateTs);\n\n return (\n <Styled.SheetTagWrapper $top={top} $right={right}>\n {NodeTagIcon}\n </Styled.SheetTagWrapper>\n );\n});\n\nexport default NodeCardTags;\n"],"names":["NodeCardTags","memo","props","state","accuracy","nodeType","dueDateTs","isStudent","accuracyValue","NodeTagIcon","top","right","getNodeStateBasedTagInfo","jsx","Styled.SheetTagWrapper"],"mappings":";;;;AAQM,MAAAA,IAAuCC,EAAK,CAASC,MAAA;AACzD,QAAM,EAAE,OAAAC,GAAO,UAAAC,GAAU,UAAAC,GAAU,WAAAC,GAAW,WAAAC,EAAc,IAAAL,GAItDM,IADJH,MAAa,aAAaA,MAAa,gBAAgBA,MAAa,uBAChCD,IAAW,QAE3C;AAAA,IACJ,MAAMK;AAAA,IACN,KAAAC;AAAA,IACA,OAAAC;AAAA,EAAA,IACEC,EAAyBT,GAAO,CAAC,CAACI,GAAWC,GAAeF,CAAS;AAGvE,SAAA,gBAAAO,EAACC,GAAA,EAAuB,MAAMJ,GAAK,QAAQC,GACxC,UACHF,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
2
|
+
import { memo as o } from "react";
|
3
|
+
import n from "./student-actions/student-actions.js";
|
4
|
+
import i from "./teacher-actions/teacher-actions.js";
|
5
|
+
const f = o((t) => {
|
6
|
+
const { userType: r } = t;
|
7
|
+
return r === "STUDENT" ? /* @__PURE__ */ e(n, { ...t, isStudent: !0 }) : /* @__PURE__ */ e(i, { ...t });
|
8
|
+
});
|
9
|
+
export {
|
10
|
+
f as default
|
11
|
+
};
|
12
|
+
//# sourceMappingURL=node-card.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"node-card.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card.tsx"],"sourcesContent":["import type { INodeCardProps } from './node-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport StudentActions from './student-actions/student-actions';\nimport TeacherActions from './teacher-actions/teacher-actions';\n\nconst NodeCard: FC<INodeCardProps> = memo(props => {\n const { userType } = props;\n const isStudent = userType === 'STUDENT';\n\n if (isStudent) {\n return <StudentActions {...props} isStudent />;\n }\n\n return <TeacherActions {...props} />;\n});\n\nexport default NodeCard;\n"],"names":["NodeCard","memo","props","userType","jsx","StudentActions","TeacherActions"],"mappings":";;;;AAQM,MAAAA,IAA+BC,EAAK,CAASC,MAAA;AAC3C,QAAA,EAAE,UAAAC,EAAa,IAAAD;AAGrB,SAFkBC,MAAa,YAGrB,gBAAAC,EAAAC,GAAA,EAAgB,GAAGH,GAAO,WAAS,GAAC,CAAA,IAGvC,gBAAAE,EAACE,GAAgB,EAAA,GAAGJ,EAAO,CAAA;AACpC,CAAC;"}
|
package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options-styled.js
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
import o from "styled-components";
|
2
|
+
import t from "../../../../ui/layout/flex-view.js";
|
3
|
+
import i from "../../../../ui/text/text.js";
|
4
|
+
const s = o(t)(({}) => `
|
5
|
+
box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.40);
|
6
|
+
width: 180px;
|
7
|
+
position: relative;
|
8
|
+
left: 0;
|
9
|
+
top: 0;
|
10
|
+
`), x = o(t)(({ theme: r, $disabled: e }) => `
|
11
|
+
cursor: ${e ? "not-allowed" : "pointer"};
|
12
|
+
|
13
|
+
&:hover {
|
14
|
+
background: ${r.colors.BLACK};
|
15
|
+
};
|
16
|
+
|
17
|
+
path {
|
18
|
+
fill: ${r.colors.WHITE_1};
|
19
|
+
}
|
20
|
+
`);
|
21
|
+
o(i)(() => `
|
22
|
+
display: -webkit-box;
|
23
|
+
-webkit-box-orient: vertical;
|
24
|
+
-webkit-line-clamp: 2;
|
25
|
+
text-overflow: ellipsis;
|
26
|
+
overflow: hidden;
|
27
|
+
`);
|
28
|
+
export {
|
29
|
+
x as NodeOptionWrapper,
|
30
|
+
s as NodeOptions
|
31
|
+
};
|
32
|
+
//# sourceMappingURL=node-menu-options-styled.js.map
|
package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options-styled.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"node-menu-options-styled.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\n\nconst NodeOptions = styled(FlexView)(({}) => {\n return `\n box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.40);\n width: 180px;\n position: relative;\n left: 0;\n top: 0;\n `;\n});\n\ninterface INodeOptionWrapper {\n $disabled?: boolean;\n}\n\nconst NodeOptionWrapper = styled(FlexView)<INodeOptionWrapper>(({ theme, $disabled }) => {\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n\n &:hover {\n background: ${theme.colors.BLACK};\n };\n\n path {\n fill: ${theme.colors.WHITE_1};\n }\n `;\n});\n\nconst NodeOptionText = styled(Text)(() => {\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n `;\n});\n\nexport { NodeOptions, NodeOptionWrapper, NodeOptionText };\n"],"names":["NodeOptions","styled","FlexView","NodeOptionWrapper","theme","$disabled","Text"],"mappings":";;;AAKA,MAAMA,IAAcC,EAAOC,CAAQ,EAAE,CAAC,CAAA,MAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAOR,GAMKC,IAAoBF,EAAOC,CAAQ,EAAsB,CAAC,EAAE,OAAAE,GAAO,WAAAC,QAChE;AAAA,kBACSA,IAAY,gBAAgB,SAAS;AAAA;AAAA;AAAA,0BAG7BD,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,oBAIxBA,EAAM,OAAO,OAAO;AAAA;AAAA,KAGvC;AAEsBH,EAAOK,CAAI,EAAE,MAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAOR;"}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
2
|
+
import { memo as c } from "react";
|
3
|
+
import a from "../../../../ui/text/text.js";
|
4
|
+
import { NodeOptions as m, NodeOptionWrapper as $ } from "./node-menu-options-styled.js";
|
5
|
+
const h = c(({ options: o }) => o.length === 0 ? null : /* @__PURE__ */ e(m, { $background: "BLACK_2", $borderColor: "WHITE_T_38", $gapX: 0.5, children: o.map((t) => {
|
6
|
+
const { icon: n, label: l, id: i, disabled: r, onClick: d } = t;
|
7
|
+
return /* @__PURE__ */ p(
|
8
|
+
$,
|
9
|
+
{
|
10
|
+
$flexDirection: "row",
|
11
|
+
$alignItems: "center",
|
12
|
+
$flexGap: 8,
|
13
|
+
$gapX: 0.5,
|
14
|
+
$gutterX: 1,
|
15
|
+
$opacity: r ? 0.5 : 1,
|
16
|
+
$disabled: r,
|
17
|
+
onClick: () => {
|
18
|
+
r || d(i);
|
19
|
+
},
|
20
|
+
children: [
|
21
|
+
/* @__PURE__ */ e(n, { width: 20, height: 20 }),
|
22
|
+
/* @__PURE__ */ e(a, { $renderAs: "ub3", $color: "WHITE", children: l })
|
23
|
+
]
|
24
|
+
},
|
25
|
+
i
|
26
|
+
);
|
27
|
+
}) }));
|
28
|
+
export {
|
29
|
+
h as default
|
30
|
+
};
|
31
|
+
//# sourceMappingURL=node-menu-options.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"node-menu-options.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options.tsx"],"sourcesContent":["import type { INodeMenuOptions } from './node-menu-options-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport Text from '../../../../ui/text/text';\nimport * as Styled from './node-menu-options-styled';\n\nconst NodeMenuOptions: FC<INodeMenuOptions> = memo(({ options }) => {\n if (options.length === 0) return null;\n\n return (\n <Styled.NodeOptions $background=\"BLACK_2\" $borderColor=\"WHITE_T_38\" $gapX={0.5}>\n {options.map(optionInfo => {\n const { icon: OptionIcon, label, id, disabled, onClick } = optionInfo;\n\n return (\n <Styled.NodeOptionWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGap={8}\n $gapX={0.5}\n $gutterX={1}\n $opacity={disabled ? 0.5 : 1}\n $disabled={disabled}\n key={id}\n onClick={() => {\n if (!disabled) {\n onClick(id);\n }\n }}\n >\n <OptionIcon width={20} height={20} />\n\n <Text $renderAs=\"ub3\" $color=\"WHITE\">\n {label}\n </Text>\n </Styled.NodeOptionWrapper>\n );\n })}\n </Styled.NodeOptions>\n );\n});\n\nexport default NodeMenuOptions;\n"],"names":["NodeMenuOptions","memo","options","jsx","Styled.NodeOptions","optionInfo","OptionIcon","label","id","disabled","onClick","jsxs","Styled.NodeOptionWrapper","Text"],"mappings":";;;;AAQA,MAAMA,IAAwCC,EAAK,CAAC,EAAE,SAAAC,QAChDA,EAAQ,WAAW,IAAU,OAG9B,gBAAAC,EAAAC,GAAA,EAAmB,aAAY,WAAU,cAAa,cAAa,OAAO,KACxE,UAAQF,EAAA,IAAI,CAAcG,MAAA;AACzB,QAAM,EAAE,MAAMC,GAAY,OAAAC,GAAO,IAAAC,GAAI,UAAAC,GAAU,SAAAC,EAAY,IAAAL;AAGzD,SAAA,gBAAAM;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,UAAUH,IAAW,MAAM;AAAA,MAC3B,WAAWA;AAAA,MAEX,SAAS,MAAM;AACb,QAAKA,KACHC,EAAQF,CAAE;AAAA,MAEd;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAL,EAACG,GAAW,EAAA,OAAO,IAAI,QAAQ,IAAI;AAAA,0BAElCO,GAAK,EAAA,WAAU,OAAM,QAAO,SAC1B,UACHN,GAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAXKC;AAAA,EAAA;AAcV,CAAA,EACH,CAAA,CAEH;"}
|
@@ -0,0 +1,180 @@
|
|
1
|
+
import { jsx as e, jsxs as d, Fragment as F } from "react/jsx-runtime";
|
2
|
+
import { memo as Y, useState as Z, useCallback as m } from "react";
|
3
|
+
import q from "../../../../../assets/line-icons/icons/eye2.js";
|
4
|
+
import J from "../../../../../assets/line-icons/icons/redo.js";
|
5
|
+
import Q from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
6
|
+
import U from "../../../../ui/context-menu/context-menu.js";
|
7
|
+
import V from "../../../../ui/lottie-animation/lottie-animation.js";
|
8
|
+
import ee from "../../../../ui/text/text.js";
|
9
|
+
import { BLOCK_TYPE as te } from "../../../constants/block-constants.js";
|
10
|
+
import { NODE_CARD_STATES as f } from "../../../constants/node-constants.js";
|
11
|
+
import { getNodeTypeBasedBgImage as oe } from "../../../utils/index.js";
|
12
|
+
import { getNodeCardBasedIcon as re } from "../../../utils/node-card-utils.js";
|
13
|
+
import ne from "../border-path-animation.js";
|
14
|
+
import { NodeCardContainer as ae, NodeCardInfoWrapper as ie, IconWrapper as ce, StyledImportantIcon as se, NodeCardContentWrapper as de, NodeCardTitle as me } from "../node-card-styled.js";
|
15
|
+
import le from "../node-card-tags.js";
|
16
|
+
import pe from "../node-menu-options/node-menu-options.js";
|
17
|
+
const we = Y((b) => {
|
18
|
+
const {
|
19
|
+
nodeData: t,
|
20
|
+
imageHue: A,
|
21
|
+
blockType: L,
|
22
|
+
onNodeAttempt: n,
|
23
|
+
onNodeReattempt: a,
|
24
|
+
onNodeReview: i,
|
25
|
+
onNodeView: o,
|
26
|
+
isStudent: T
|
27
|
+
} = b, {
|
28
|
+
accuracy: E,
|
29
|
+
attempt_location: w,
|
30
|
+
node_type: l,
|
31
|
+
card_header: y,
|
32
|
+
title: N,
|
33
|
+
state: c,
|
34
|
+
is_optional: C,
|
35
|
+
sheet_statement: $,
|
36
|
+
permissions: R,
|
37
|
+
marked_as_completed: s
|
38
|
+
} = t, {
|
39
|
+
can_review: g,
|
40
|
+
can_start: p,
|
41
|
+
can_resume: h,
|
42
|
+
can_reset: I
|
43
|
+
} = R, x = L === te.GOAL, r = c === f.LOCKED, B = c === f.NOT_STARTED, v = c === f.IN_PROGRESS, M = w === "INCLASS", W = p || h, _ = !C && (v || B), u = !W && (I || g), [D, O] = Z(!1), G = oe(l), { icon: H, lottie: K } = re(l), k = m(
|
44
|
+
(S) => {
|
45
|
+
switch (S) {
|
46
|
+
case "node-card-review":
|
47
|
+
s ? o == null || o(t) : i == null || i(t);
|
48
|
+
return;
|
49
|
+
case "node-card-reattempt":
|
50
|
+
a == null || a(t);
|
51
|
+
return;
|
52
|
+
default:
|
53
|
+
throw new Error(`No callback function for ${S}`);
|
54
|
+
}
|
55
|
+
},
|
56
|
+
[t, a, i, o, s]
|
57
|
+
), P = m(() => {
|
58
|
+
u || r || (p || h ? n == null || n(t) : s && (o == null || o(t)));
|
59
|
+
}, [
|
60
|
+
h,
|
61
|
+
p,
|
62
|
+
t,
|
63
|
+
n,
|
64
|
+
o,
|
65
|
+
u,
|
66
|
+
r,
|
67
|
+
s
|
68
|
+
]), X = m(() => {
|
69
|
+
O(!0);
|
70
|
+
}, []), j = m(() => {
|
71
|
+
O(!1);
|
72
|
+
}, []), z = [
|
73
|
+
{
|
74
|
+
id: "node-card-review",
|
75
|
+
label: "Review",
|
76
|
+
icon: q,
|
77
|
+
disabled: !g,
|
78
|
+
onClick: k
|
79
|
+
},
|
80
|
+
{
|
81
|
+
id: "node-card-reattempt",
|
82
|
+
label: "Reattempt",
|
83
|
+
icon: J,
|
84
|
+
disabled: !I,
|
85
|
+
onClick: k
|
86
|
+
}
|
87
|
+
];
|
88
|
+
return /* @__PURE__ */ e(
|
89
|
+
U,
|
90
|
+
{
|
91
|
+
targetElement: /* @__PURE__ */ e(
|
92
|
+
ae,
|
93
|
+
{
|
94
|
+
$showOutline: !_,
|
95
|
+
$background: `${A}_2`,
|
96
|
+
$disabled: r,
|
97
|
+
onClick: P,
|
98
|
+
onMouseEnter: X,
|
99
|
+
onMouseLeave: j,
|
100
|
+
children: /* @__PURE__ */ d(
|
101
|
+
Q,
|
102
|
+
{
|
103
|
+
renderAs: "primary",
|
104
|
+
tooltipItem: $,
|
105
|
+
position: "bottom",
|
106
|
+
zIndex: 5,
|
107
|
+
hidden: !$,
|
108
|
+
parentWidth: "100%",
|
109
|
+
widthX: 11.25,
|
110
|
+
children: [
|
111
|
+
/* @__PURE__ */ d(
|
112
|
+
ie,
|
113
|
+
{
|
114
|
+
$flexDirection: "row",
|
115
|
+
$alignItems: "center",
|
116
|
+
$heightX: 3.5,
|
117
|
+
$bgImage: G,
|
118
|
+
$gutterX: 0.78125,
|
119
|
+
$flexGap: 8.5,
|
120
|
+
$opacity: r ? 0.5 : 1,
|
121
|
+
children: [
|
122
|
+
/* @__PURE__ */ d(
|
123
|
+
ce,
|
124
|
+
{
|
125
|
+
$width: 31,
|
126
|
+
$height: 31,
|
127
|
+
$background: "WHITE_1",
|
128
|
+
$position: "relative",
|
129
|
+
$alignItems: "center",
|
130
|
+
$justifyContent: "center",
|
131
|
+
children: [
|
132
|
+
D ? /* @__PURE__ */ e(V, { src: K }) : /* @__PURE__ */ e(H, { width: 20, height: 20 }),
|
133
|
+
!C && /* @__PURE__ */ e(se, {})
|
134
|
+
]
|
135
|
+
}
|
136
|
+
),
|
137
|
+
/* @__PURE__ */ d(ee, { $renderAs: "ac4-black", $color: "BLACK", children: [
|
138
|
+
y,
|
139
|
+
" ",
|
140
|
+
M && ". CW"
|
141
|
+
] }),
|
142
|
+
_ && /* @__PURE__ */ e(ne, {})
|
143
|
+
]
|
144
|
+
}
|
145
|
+
),
|
146
|
+
/* @__PURE__ */ e(
|
147
|
+
le,
|
148
|
+
{
|
149
|
+
nodeType: l,
|
150
|
+
state: c,
|
151
|
+
accuracy: E,
|
152
|
+
isStudent: T
|
153
|
+
}
|
154
|
+
),
|
155
|
+
!x && /* @__PURE__ */ e(de, { $background: "WHITE_1", $heightX: 4, children: /* @__PURE__ */ e(
|
156
|
+
me,
|
157
|
+
{
|
158
|
+
$renderAs: "ab3",
|
159
|
+
$color: "BLACK_1",
|
160
|
+
$opacity: r ? 0.5 : 1,
|
161
|
+
children: N
|
162
|
+
}
|
163
|
+
) })
|
164
|
+
]
|
165
|
+
}
|
166
|
+
)
|
167
|
+
}
|
168
|
+
),
|
169
|
+
startLeft: !0,
|
170
|
+
menuWidth: "100%",
|
171
|
+
menuZIndex: 6,
|
172
|
+
menuOffset: 2,
|
173
|
+
menuElement: /* @__PURE__ */ e(F, { children: u ? /* @__PURE__ */ e(pe, { options: z }) : void 0 })
|
174
|
+
}
|
175
|
+
);
|
176
|
+
});
|
177
|
+
export {
|
178
|
+
we as default
|
179
|
+
};
|
180
|
+
//# sourceMappingURL=student-actions.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"student-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/student-actions/student-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\n\nimport { memo, useCallback, useState, type FC } from 'react';\n\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport BorderPathAnimation from '../border-path-animation';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst StudentActions: FC<Omit<INodeCardProps, 'userType'>> = memo(props => {\n const {\n nodeData,\n imageHue,\n blockType,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n isStudent,\n } = props;\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n marked_as_completed: teacherMarkedAsCompleted,\n } = nodeData;\n\n const {\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n can_reset: canReset,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n const canStartOrResume = canStart || canResume;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n const renderOptions = !canStartOrResume && (canReset || canReview);\n\n const [renderLottie, setRenderLottie] = useState(false);\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const { icon: NodeCardIcon, lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n teacherMarkedAsCompleted ? onNodeView?.(nodeData) : onNodeReview?.(nodeData);\n\n return;\n\n case 'node-card-reattempt':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeReview, onNodeView, teacherMarkedAsCompleted],\n );\n\n const handleOnNodeCardClick = useCallback(() => {\n if (renderOptions || sheetLocked) return;\n\n if (canStart || canResume) {\n onNodeAttempt?.(nodeData);\n } else if (teacherMarkedAsCompleted) {\n onNodeView?.(nodeData);\n }\n }, [\n canResume,\n canStart,\n nodeData,\n onNodeAttempt,\n onNodeView,\n renderOptions,\n sheetLocked,\n teacherMarkedAsCompleted,\n ]);\n\n const handleOnMouseEnter = useCallback(() => {\n setRenderLottie(true);\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <ContextMenu\n targetElement={\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={!sheetStatement}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {renderLottie ? (\n <LottieAnimation src={nodeCardLottie} />\n ) : (\n <NodeCardIcon width={20} height={20} />\n )}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\">\n {cardHeader} {inClassSheet && `. CW`}\n </Text>\n\n {showCardAnimation && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n isStudent={isStudent}\n />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper $background=\"WHITE_1\" $heightX={4}>\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n }\n startLeft\n menuWidth=\"100%\"\n menuZIndex={6}\n menuOffset={2}\n menuElement={<>{renderOptions ? <NodeMenuOptions options={menuOptions} /> : undefined}</>}\n />\n );\n});\n\nexport default StudentActions;\n"],"names":["StudentActions","memo","props","nodeData","imageHue","blockType","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeView","isStudent","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","teacherMarkedAsCompleted","canReview","canStart","canResume","canReset","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","canStartOrResume","showCardAnimation","renderOptions","renderLottie","setRenderLottie","useState","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","nodeCardLottie","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","handleOnMouseEnter","handleOnMouseLeave","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;AAoBM,MAAAA,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,EACE,IAAAR,GACE;AAAA,IACJ,UAAAS;AAAA,IACA,kBAAkBC;AAAA,IAClB,WAAWC;AAAA,IACX,aAAaC;AAAA,IACb,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAaC;AAAA,IACb,iBAAiBC;AAAA,IACjB,aAAAC;AA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