@cuemath/leap 3.2.17-mb → 3.2.17-pzd-0.1
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 +6 -5
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/cue-board-filled.js +33 -0
- package/dist/assets/line-icons/icons/cue-board-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/cue-board.js +23 -0
- package/dist/assets/line-icons/icons/cue-board.js.map +1 -0
- package/dist/assets/line-icons/icons/hint-fill.js +35 -0
- package/dist/assets/line-icons/icons/hint-fill.js.map +1 -0
- package/dist/assets/line-icons/icons/screen-grab-filled.js +35 -0
- package/dist/assets/line-icons/icons/screen-grab-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/screen-grab.js +23 -0
- package/dist/assets/line-icons/icons/screen-grab.js.map +1 -0
- package/dist/assets/line-icons/icons/sticker-filled.js +64 -0
- package/dist/assets/line-icons/icons/sticker-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/sticker.js +46 -0
- package/dist/assets/line-icons/icons/sticker.js.map +1 -0
- package/dist/assets/lottie/lottie.js +6 -1
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +2 -1
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +6 -4
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +10 -8
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/auth/account-selector/account-selector.js +26 -25
- package/dist/features/auth/account-selector/account-selector.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +15 -14
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/user-list/user-item/user-item.js +30 -31
- package/dist/features/auth/comps/user-list/user-item/user-item.js.map +1 -1
- package/dist/features/auth/comps/user-list/user-list.js +35 -34
- package/dist/features/auth/comps/user-list/user-list.js.map +1 -1
- package/dist/features/auth/forgot-password/forgot-password-styled.js +14 -15
- package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +6 -7
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
- package/dist/features/auth/login/login-styled.js +8 -9
- package/dist/features/auth/login/login-styled.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +9 -9
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +4 -4
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +85 -85
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +121 -98
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +29 -28
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +43 -42
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/games/tutorial/tutorial.js +43 -35
- package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js +2 -2
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/username-input/username-input.js +26 -24
- package/dist/features/circle-games/sign-up/comp/username-input/username-input.js.map +1 -1
- package/dist/features/circle-games/sign-up/constants.js +3 -1
- package/dist/features/circle-games/sign-up/constants.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +7 -4
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +42 -42
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +85 -97
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +44 -42
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +31 -29
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +54 -48
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +33 -27
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/comps/coachmark/coachmark.js +29 -27
- package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +17 -11
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +72 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +63 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +67 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +70 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +70 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +1 -0
- package/dist/features/journey/journey-id/journey-id-student.js +2 -2
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +73 -72
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/journey/use-journey/journey-styled.js +6 -4
- package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +10 -0
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +1 -0
- package/dist/features/puzzles/app/puzzle-app-styled.js +85 -0
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -0
- package/dist/features/puzzles/app/puzzle-app-view.js +120 -0
- package/dist/features/puzzles/app/puzzle-app-view.js.map +1 -0
- package/dist/features/puzzles/app/puzzle-app.js +62 -0
- package/dist/features/puzzles/app/puzzle-app.js.map +1 -0
- package/dist/features/puzzles/comps/puzzle-card-styled.js +24 -69
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +79 -30
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/constants/puzzle-container.js +8 -0
- package/dist/features/puzzles/constants/puzzle-container.js.map +1 -0
- package/dist/features/puzzles/puzzle-analytics-events.js +11 -0
- package/dist/features/puzzles/puzzle-analytics-events.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +55 -25
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +55 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +100 -107
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +37 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +1 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +110 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +1 -0
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map +1 -1
- package/dist/features/puzzles/utils/puzzle-pattern.js +28 -13
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +6 -0
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +12 -60
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +72 -77
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +63 -0
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +21 -0
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +1 -0
- package/dist/features/ui/error/error.js +65 -27
- package/dist/features/ui/error/error.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +25 -29
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +34 -58
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +40 -14
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/ui/nudge/nudge-styled.js +14 -7
- package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
- package/dist/features/ui/nudge/nudge.js +13 -12
- package/dist/features/ui/nudge/nudge.js.map +1 -1
- package/dist/features/{stickers/sticker-selector/sticker-selector-styles.js → ui/sticker-grid/sticker-grid-styles.js} +3 -4
- package/dist/features/ui/sticker-grid/sticker-grid-styles.js.map +1 -0
- package/dist/features/ui/sticker-grid/sticker-grid.js +24 -0
- package/dist/features/ui/sticker-grid/sticker-grid.js.map +1 -0
- package/dist/features/ui/sticker-grid/sticker.js +57 -0
- package/dist/features/ui/sticker-grid/sticker.js.map +1 -0
- package/dist/features/ui/stickers/constants.js +6 -0
- package/dist/features/ui/stickers/constants.js.map +1 -0
- package/dist/features/{stickers/stickers-effects/effects.js → ui/stickers/stickers-effects.js} +6 -6
- package/dist/features/ui/stickers/stickers-effects.js.map +1 -0
- package/dist/features/{stickers/stickers-effects/stickers-effects-styled.js → ui/stickers/stickers-styled.js} +2 -2
- package/dist/features/ui/stickers/stickers-styled.js.map +1 -0
- package/dist/features/{stickers/stickers-effects/stickers-effects-utils.js → ui/stickers/stickers-utils.js} +6 -6
- package/dist/features/ui/stickers/stickers-utils.js.map +1 -0
- package/dist/features/ui/stickers/stickers.js +40 -0
- package/dist/features/ui/stickers/stickers.js.map +1 -0
- package/dist/features/ui/streak-icon/streak-icon-styled.js +13 -13
- package/dist/features/ui/streak-icon/streak-icon-styled.js.map +1 -1
- package/dist/features/ui/streak-icon/streak-icon.js +17 -15
- package/dist/features/ui/streak-icon/streak-icon.js.map +1 -1
- package/dist/features/ui/text/text.js +40 -36
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/ui/theme/constants.js +4 -2
- package/dist/features/ui/theme/constants.js.map +1 -1
- package/dist/features/ui/theme/get-device.js +3 -3
- package/dist/features/ui/theme/get-device.js.map +1 -1
- package/dist/features/worksheet/worksheet/constants.js +12 -13
- package/dist/features/worksheet/worksheet/constants.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +28 -0
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +20 -19
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +29 -25
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +101 -47
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +244 -255
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +242 -207
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +45 -36
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +321 -325
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +44 -35
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +152 -56
- package/dist/index.js +563 -539
- package/dist/index.js.map +1 -1
- package/dist/static/nudge-tap.0591aef4.json +1 -0
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +1 -0
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +12760 -0
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +1 -0
- package/dist/static/puzzle-green-lottie.1da90698.json +1 -0
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +1 -0
- package/dist/static/puzzle-pattern-blue.abff0164.svg +1 -0
- package/dist/static/puzzle-pattern-green.b8ba1840.svg +1 -0
- package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +1 -0
- package/dist/static/puzzle-pattern-purple.14b09759.svg +1 -0
- package/dist/static/puzzle-pattern-yellow.50917fab.svg +1 -0
- package/dist/static/puzzle-purple-lottie.e70de110.json +9860 -0
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +1 -0
- package/package.json +1 -1
- package/dist/features/hooks/use-viewport/use-viewport.js +0 -22
- package/dist/features/hooks/use-viewport/use-viewport.js.map +0 -1
- package/dist/features/stickers/sticker-data.js +0 -234
- package/dist/features/stickers/sticker-data.js.map +0 -1
- package/dist/features/stickers/sticker-selector/sticker-selector-styles.js.map +0 -1
- package/dist/features/stickers/sticker-selector/sticker-selector.js +0 -25
- package/dist/features/stickers/sticker-selector/sticker-selector.js.map +0 -1
- package/dist/features/stickers/sticker-selector/sticker.js +0 -57
- package/dist/features/stickers/sticker-selector/sticker.js.map +0 -1
- package/dist/features/stickers/stickers-effects/effects.js.map +0 -1
- package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +0 -1
- package/dist/features/stickers/stickers-effects/stickers-effects-utils.js.map +0 -1
- package/dist/features/stickers/stickers-effects/stickers-effects.js +0 -39
- package/dist/features/stickers/stickers-effects/stickers-effects.js.map +0 -1
- package/dist/static/nudge-tap.5cb30093.json +0 -1057
- package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +0 -1
- package/dist/static/puzzle-pattern-green.c9f84bbc.svg +0 -1
- package/dist/static/puzzle-pattern-orange.3da09665.svg +0 -1
- package/dist/static/puzzle-pattern-purple.5fb5a319.svg +0 -1
- package/dist/static/puzzle-pattern-yellow.aadbf457.svg +0 -1
@@ -1,13 +1,13 @@
|
|
1
1
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
2
|
+
import { memo as Q, useState as y, useRef as V, useMemo as S, useCallback as d, useEffect as B } from "react";
|
3
|
+
import F from "../../../assets/line-icons/icons/chevron-left.js";
|
4
|
+
import q from "../../../assets/line-icons/icons/chevron-right.js";
|
5
5
|
import u from "../../ui/layout/flex-view.js";
|
6
6
|
import g from "../../ui/text/text.js";
|
7
7
|
import E from "../homework-card.js";
|
8
|
-
import { ContentWrapper as
|
9
|
-
import { getWaitForReviewSheetsCount as
|
10
|
-
const
|
8
|
+
import { ContentWrapper as Y, ScrollButton as W, ScrollContainer as z, QueueWrapper as J, QueueText as P } from "./hw-card-list-styled.js";
|
9
|
+
import { getWaitForReviewSheetsCount as Z } from "./hw-card-list-utils.js";
|
10
|
+
const U = ({
|
11
11
|
userType: C,
|
12
12
|
studentId: _,
|
13
13
|
isHwProcessing: K,
|
@@ -18,23 +18,24 @@ const Z = ({
|
|
18
18
|
onNodeView: x,
|
19
19
|
onTestReview: H,
|
20
20
|
onNodeReview: L,
|
21
|
-
onNodeUnassign: A
|
21
|
+
onNodeUnassign: A,
|
22
|
+
puzzleHWCardRef: T
|
22
23
|
}) => {
|
23
|
-
const [
|
24
|
+
const [j, a] = y(!1), [D, I] = y(!1), t = V(null), { assigned_homeworks: h = [], queued_homeworks: f = [] } = s || {}, R = S(
|
24
25
|
() => h.length + f.length,
|
25
26
|
[h, f]
|
26
|
-
),
|
27
|
+
), G = S(() => Z(s), [s]), o = d(() => {
|
27
28
|
if (t.current) {
|
28
29
|
const { scrollLeft: e, scrollWidth: i, clientWidth: c } = t.current;
|
29
30
|
e > 1 && a(!0), e < i - c - 1 && I(!0);
|
30
31
|
}
|
31
|
-
}, []),
|
32
|
+
}, []), M = d(() => {
|
32
33
|
t.current && o();
|
33
|
-
}, [o]),
|
34
|
+
}, [o]), N = d(() => {
|
34
35
|
a(!1), I(!1);
|
35
|
-
}, []),
|
36
|
+
}, []), X = d(() => {
|
36
37
|
t.current && (t.current.scrollBy({ left: -200, behavior: "smooth" }), o());
|
37
|
-
}, [o]),
|
38
|
+
}, [o]), O = d(() => {
|
38
39
|
t.current && (t.current.scrollBy({ left: 200, behavior: "smooth" }), o());
|
39
40
|
}, [o]);
|
40
41
|
return B(() => {
|
@@ -51,10 +52,10 @@ const Z = ({
|
|
51
52
|
}, [o]), R === 0 ? /* @__PURE__ */ l(u, { $flexRowGapX: 1, children: [
|
52
53
|
/* @__PURE__ */ r(g, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: "Homework (0)" }),
|
53
54
|
/* @__PURE__ */ r(g, { $renderAs: "ab2", $color: "BLACK_T_60", children: "No Homework assigned yet" })
|
54
|
-
] }) : /* @__PURE__ */ l(
|
55
|
+
] }) : /* @__PURE__ */ l(Y, { $flexRowGapX: 1, $disablePointerEvents: K, children: [
|
55
56
|
/* @__PURE__ */ l(g, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
56
57
|
"Homework (",
|
57
|
-
|
58
|
+
G,
|
58
59
|
"/",
|
59
60
|
R,
|
60
61
|
")"
|
@@ -63,8 +64,8 @@ const Z = ({
|
|
63
64
|
u,
|
64
65
|
{
|
65
66
|
$position: "relative",
|
66
|
-
onMouseEnter:
|
67
|
-
onMouseLeave:
|
67
|
+
onMouseEnter: M,
|
68
|
+
onMouseLeave: N,
|
68
69
|
children: [
|
69
70
|
/* @__PURE__ */ r(
|
70
71
|
W,
|
@@ -74,14 +75,14 @@ const Z = ({
|
|
74
75
|
$justifyContent: "center",
|
75
76
|
$alignItems: "center",
|
76
77
|
$height: "100%",
|
77
|
-
onClick:
|
78
|
-
$visible:
|
78
|
+
onClick: X,
|
79
|
+
$visible: j,
|
79
80
|
left: "0px",
|
80
81
|
right: "auto",
|
81
|
-
children: /* @__PURE__ */ r(
|
82
|
+
children: /* @__PURE__ */ r(F, { width: 24, height: 24 })
|
82
83
|
}
|
83
84
|
),
|
84
|
-
/* @__PURE__ */ r(
|
85
|
+
/* @__PURE__ */ r(z, { ref: t, children: /* @__PURE__ */ l(u, { $flexDirection: "row", $flexGapX: 1, children: [
|
85
86
|
h.map((e, i) => {
|
86
87
|
const {
|
87
88
|
node_id: c,
|
@@ -108,7 +109,8 @@ const Z = ({
|
|
108
109
|
shouldOpenOnRight: !0,
|
109
110
|
onNodeView: n ? b : x,
|
110
111
|
onNodeReview: n ? H : L,
|
111
|
-
onNodeUnassign: A
|
112
|
+
onNodeUnassign: A,
|
113
|
+
puzzleHWCardRef: T
|
112
114
|
}
|
113
115
|
)
|
114
116
|
},
|
@@ -130,13 +132,13 @@ const Z = ({
|
|
130
132
|
$flexGapX: 1,
|
131
133
|
children: [
|
132
134
|
i === 0 && /* @__PURE__ */ r(
|
133
|
-
|
135
|
+
J,
|
134
136
|
{
|
135
137
|
$background: "BLACK_4",
|
136
138
|
$justifyContent: "center",
|
137
139
|
$gutter: 4,
|
138
140
|
$gap: 8,
|
139
|
-
children: /* @__PURE__ */ r(
|
141
|
+
children: /* @__PURE__ */ r(P, { $renderAs: "ac3", $color: "WHITE", children: "In Queue" })
|
140
142
|
}
|
141
143
|
),
|
142
144
|
/* @__PURE__ */ r(
|
@@ -171,19 +173,19 @@ const Z = ({
|
|
171
173
|
$background: "BLACK_T_60",
|
172
174
|
$justifyContent: "center",
|
173
175
|
$alignItems: "center",
|
174
|
-
onClick:
|
175
|
-
$visible:
|
176
|
+
onClick: O,
|
177
|
+
$visible: D,
|
176
178
|
left: "auto",
|
177
179
|
right: "0px",
|
178
|
-
children: /* @__PURE__ */ r(
|
180
|
+
children: /* @__PURE__ */ r(q, { width: 24, height: 24 })
|
179
181
|
}
|
180
182
|
)
|
181
183
|
]
|
182
184
|
}
|
183
185
|
)
|
184
186
|
] });
|
185
|
-
},
|
187
|
+
}, de = Q(U);
|
186
188
|
export {
|
187
|
-
|
189
|
+
de as default
|
188
190
|
};
|
189
191
|
//# sourceMappingURL=hw-card-list-view.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hw-card-list-view.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-view.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../../ui/types';\nimport type { IHomeworkDetails } from './api/get-homeworks';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport * as Styled from './hw-card-list-styled';\nimport { getWaitForReviewSheetsCount } from './hw-card-list-utils';\n\ninterface IHwCardListView extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n isHwProcessing: boolean;\n hwDetails?: IHomeworkDetails;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps, homeworkId?: string) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n}\n\nconst HwCardListView: FC<IHwCardListView> = ({\n userType,\n studentId,\n isHwProcessing,\n hwDetails,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n}) => {\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const scrollRef = useRef<HTMLDivElement>(null);\n\n const { assigned_homeworks: assignedHomeworks = [], queued_homeworks: queuedHomeworks = [] } =\n hwDetails || {};\n\n const totalHWSheetsCount = useMemo(\n () => assignedHomeworks.length + queuedHomeworks.length,\n [assignedHomeworks, queuedHomeworks],\n );\n const waitForReviewSheets = useMemo(() => getWaitForReviewSheetsCount(hwDetails), [hwDetails]);\n\n const updatedCanScroll = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n\n if (scrollLeft < scrollWidth - clientWidth - 1) {\n setIsRightHovered(true);\n }\n }\n }, []);\n const handleHoverEnter = useCallback(() => {\n if (!scrollRef.current) return;\n\n updatedCanScroll();\n }, [updatedCanScroll]);\n\n const handleHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n setIsRightHovered(false);\n }, []);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n useEffect(() => {\n if (hwDetails && scrollRef.current) {\n const { scrollLeft } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n }\n }, [hwDetails]);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', updatedCanScroll);\n\n return () => {\n scrollElement.removeEventListener('scroll', updatedCanScroll);\n };\n }\n }, [updatedCanScroll]);\n\n if (totalHWSheetsCount === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework (0)\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n return (\n <Styled.ContentWrapper $flexRowGapX={1} $disablePointerEvents={isHwProcessing}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({waitForReviewSheets}/{totalHWSheetsCount})\n </Text>\n <FlexView\n $position=\"relative\"\n onMouseEnter={handleHoverEnter}\n onMouseLeave={handleHoverLeave}\n >\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\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {assignedHomeworks.map((sheet, idx) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n key={`${worksheetId}_${nodeId}_${idx}`}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n <HomeworkCard\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n studentId={studentId}\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={true}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n\n {queuedHomeworks.map((sheet, idx) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n key={`${worksheetId}_${nodeId}_${idx}`}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {idx === 0 && (\n <Styled.QueueWrapper\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\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n studentId={studentId}\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={true}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\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 </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default memo(HwCardListView);\n"],"names":["HwCardListView","userType","studentId","isHwProcessing","hwDetails","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","scrollRef","useRef","assignedHomeworks","queuedHomeworks","totalHWSheetsCount","useMemo","waitForReviewSheets","getWaitForReviewSheetsCount","updatedCanScroll","useCallback","scrollLeft","scrollWidth","clientWidth","handleHoverEnter","handleHoverLeave","handleScrollLeft","handleScrollRight","useEffect","scrollElement","jsxs","FlexView","jsx","Text","Styled.ContentWrapper","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","sheet","idx","nodeId","worksheetId","nodeType","title","subtext","isDynamic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EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAKzD,CAAc;"}
|
1
|
+
{"version":3,"file":"hw-card-list-view.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-view.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../../ui/types';\nimport type { IHomeworkDetails } from './api/get-homeworks';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport * as Styled from './hw-card-list-styled';\nimport { getWaitForReviewSheetsCount } from './hw-card-list-utils';\n\ninterface IHwCardListView extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n isHwProcessing: boolean;\n hwDetails?: IHomeworkDetails;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps, homeworkId?: string) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n puzzleHWCardRef?: React.RefObject<HTMLDivElement>;\n}\n\nconst HwCardListView: FC<IHwCardListView> = ({\n userType,\n studentId,\n isHwProcessing,\n hwDetails,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n puzzleHWCardRef,\n}) => {\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const scrollRef = useRef<HTMLDivElement>(null);\n\n const { assigned_homeworks: assignedHomeworks = [], queued_homeworks: queuedHomeworks = [] } =\n hwDetails || {};\n\n const totalHWSheetsCount = useMemo(\n () => assignedHomeworks.length + queuedHomeworks.length,\n [assignedHomeworks, queuedHomeworks],\n );\n const waitForReviewSheets = useMemo(() => getWaitForReviewSheetsCount(hwDetails), [hwDetails]);\n\n const updatedCanScroll = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n\n if (scrollLeft < scrollWidth - clientWidth - 1) {\n setIsRightHovered(true);\n }\n }\n }, []);\n const handleHoverEnter = useCallback(() => {\n if (!scrollRef.current) return;\n\n updatedCanScroll();\n }, [updatedCanScroll]);\n\n const handleHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n setIsRightHovered(false);\n }, []);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n useEffect(() => {\n if (hwDetails && scrollRef.current) {\n const { scrollLeft } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n }\n }, [hwDetails]);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', updatedCanScroll);\n\n return () => {\n scrollElement.removeEventListener('scroll', updatedCanScroll);\n };\n }\n }, [updatedCanScroll]);\n\n if (totalHWSheetsCount === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework (0)\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n return (\n <Styled.ContentWrapper $flexRowGapX={1} $disablePointerEvents={isHwProcessing}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({waitForReviewSheets}/{totalHWSheetsCount})\n </Text>\n <FlexView\n $position=\"relative\"\n onMouseEnter={handleHoverEnter}\n onMouseLeave={handleHoverLeave}\n >\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\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {assignedHomeworks.map((sheet, idx) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n key={`${worksheetId}_${nodeId}_${idx}`}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n <HomeworkCard\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n studentId={studentId}\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={true}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n puzzleHWCardRef={puzzleHWCardRef}\n />\n </FlexView>\n );\n })}\n\n {queuedHomeworks.map((sheet, idx) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n key={`${worksheetId}_${nodeId}_${idx}`}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {idx === 0 && (\n <Styled.QueueWrapper\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\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n studentId={studentId}\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={true}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\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 </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default memo(HwCardListView);\n"],"names":["HwCardListView","userType","studentId","isHwProcessing","hwDetails","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","puzzleHWCardRef","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","scrollRef","useRef","assignedHomeworks","queuedHomeworks","totalHWSheetsCount","useMemo","waitForReviewSheets","getWaitForReviewSheetsCount","updatedCanScroll","useCallback","scrollLeft","scrollWidth","clientWidth","handleHoverEnter","handleHoverLeave","handleScrollLeft","handleScrollRight","useEffect","scrollElement","jsxs","FlexView","jsx","Text","Styled.ContentWrapper","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","sheet","idx","nodeId","worksheetId","nodeType","title","subtext","isDynamicSheet","HomeworkCard","Styled.QueueWrapper","Styled.QueueText","ChevronRightIcon","HwCardListView$1","memo"],"mappings":";;;;;;;;;AA6BA,MAAMA,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AAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAK1D,CAAc;"}
|
@@ -1,67 +1,73 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
2
|
+
import { memo as A, useMemo as W, useEffect as e, useCallback as b } from "react";
|
3
|
+
import { usePuzzleAssignedJourney as j } from "../../journey/hooks/use-puzzles-journey/use-puzzle-assigned.js";
|
4
|
+
import { useJourney as E } from "../../journey/use-journey/use-journey.js";
|
5
|
+
import { getPuzzleCardData as F } from "../utils.js";
|
6
|
+
import { useGetHomeworks as G } from "./api/get-homeworks.js";
|
7
|
+
import J from "./hw-card-list-view.js";
|
8
|
+
const M = ({
|
9
|
+
userType: f,
|
10
|
+
studentId: o,
|
11
|
+
stream: i,
|
12
|
+
onTestStart: g,
|
13
|
+
onNodeAttempt: H,
|
14
|
+
onTestPreview: d,
|
15
|
+
onNodeView: h,
|
16
|
+
onTestReview: k,
|
17
|
+
onNodeReview: P,
|
16
18
|
onNodeUnassign: v,
|
17
|
-
homeworkRef:
|
18
|
-
startHomePageJourney:
|
19
|
-
canStartJourney:
|
19
|
+
homeworkRef: D,
|
20
|
+
startHomePageJourney: t,
|
21
|
+
canStartJourney: n,
|
22
|
+
canStartPuzzleAssignedJourney: p
|
20
23
|
}) => {
|
21
24
|
const {
|
22
|
-
get:
|
23
|
-
data:
|
24
|
-
isProcessingFailed:
|
25
|
-
isProcessing:
|
25
|
+
get: u,
|
26
|
+
data: m,
|
27
|
+
isProcessingFailed: L,
|
28
|
+
isProcessing: c,
|
26
29
|
isProcessed: w,
|
27
|
-
isStale:
|
28
|
-
} =
|
30
|
+
isStale: z
|
31
|
+
} = G(o), { isJourneyActive: r } = E(), { puzzleHWCardRef: x, startJourney: l } = j(), a = W(() => F(m), [m]);
|
29
32
|
e(() => {
|
30
|
-
w &&
|
33
|
+
w && t && !r && n && t({ studentId: o, stream: i, userType: f });
|
31
34
|
}, [
|
32
|
-
m,
|
33
35
|
n,
|
36
|
+
r,
|
34
37
|
w,
|
35
|
-
|
36
|
-
o,
|
38
|
+
t,
|
37
39
|
i,
|
38
|
-
|
40
|
+
o,
|
41
|
+
f
|
39
42
|
]);
|
40
|
-
const s =
|
41
|
-
|
42
|
-
}, [
|
43
|
+
const s = b(() => {
|
44
|
+
u(o, void 0, { stream: i });
|
45
|
+
}, [u, i, o]);
|
43
46
|
return e(() => {
|
44
|
-
!
|
45
|
-
}, [s,
|
47
|
+
!c && z && s();
|
48
|
+
}, [s, c, z]), e(() => {
|
46
49
|
s();
|
47
|
-
}, [s]),
|
48
|
-
|
50
|
+
}, [s]), e(() => {
|
51
|
+
p && !r && l && a && l(a);
|
52
|
+
}, [p, a, r, l]), L ? null : /* @__PURE__ */ C("div", { ref: D, children: /* @__PURE__ */ C(
|
53
|
+
J,
|
49
54
|
{
|
50
|
-
isHwProcessing:
|
51
|
-
hwDetails:
|
52
|
-
onTestStart:
|
53
|
-
onNodeAttempt:
|
54
|
-
onTestPreview:
|
55
|
-
onNodeView:
|
56
|
-
onTestReview:
|
57
|
-
onNodeReview:
|
55
|
+
isHwProcessing: c,
|
56
|
+
hwDetails: m,
|
57
|
+
onTestStart: g,
|
58
|
+
onNodeAttempt: H,
|
59
|
+
onTestPreview: d,
|
60
|
+
onNodeView: h,
|
61
|
+
onTestReview: k,
|
62
|
+
onNodeReview: P,
|
58
63
|
onNodeUnassign: v,
|
59
|
-
userType:
|
60
|
-
studentId:
|
64
|
+
userType: f,
|
65
|
+
studentId: o,
|
66
|
+
puzzleHWCardRef: x
|
61
67
|
}
|
62
68
|
) });
|
63
|
-
},
|
69
|
+
}, Q = A(M);
|
64
70
|
export {
|
65
|
-
|
71
|
+
Q as default
|
66
72
|
};
|
67
73
|
//# sourceMappingURL=hw-card-list.js.map
|
@@ -1 +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 { IHomepageStartJourneyProps } from '../../journey/hooks/use-home-page-journey/homepage-journey-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport React, { memo, useCallback, useEffect } from 'react';\n\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport HwCardListView from './hw-card-list-view';\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, homeworkId?: string) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n homeworkRef?: React.RefObject<HTMLDivElement>;\n startHomePageJourney?: ({ studentId, stream, userType }: IHomepageStartJourneyProps) => void;\n canStartJourney?: boolean;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType,\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n startHomePageJourney,\n canStartJourney,\n}) => {\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isProcessed,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n useEffect(() => {\n if (isProcessed && startHomePageJourney && !isJourneyActive && canStartJourney) {\n startHomePageJourney({ studentId, stream, userType });\n }\n }, [\n canStartJourney,\n isJourneyActive,\n isProcessed,\n startHomePageJourney,\n stream,\n studentId,\n userType,\n ]);\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 if (isProcessingFailed) {\n return null;\n }\n\n return (\n <div ref={homeworkRef}>\n <HwCardListView\n isHwProcessing={isProcessing}\n hwDetails={hwDetails}\n onTestStart={onTestStart}\n onNodeAttempt={onNodeAttempt}\n onTestPreview={onTestPreview}\n onNodeView={onNodeView}\n onTestReview={onTestReview}\n onNodeReview={onNodeReview}\n onNodeUnassign={onNodeUnassign}\n userType={userType}\n studentId={studentId}\n />\n </div>\n );\n};\n\nexport default memo(HWCardList);\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","startHomePageJourney","canStartJourney","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isProcessed","isStale","useGetHomeworks","isJourneyActive","useJourney","useEffect","fetchHomeworks","useCallback","jsx","HwCardListView","hwCardList","memo"],"mappings":"
|
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 { IHomepageStartJourneyProps } from '../../journey/hooks/use-home-page-journey/homepage-journey-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport React, { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { usePuzzleAssignedJourney } from '../../journey/hooks/use-puzzles-journey/use-puzzle-assigned';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { getPuzzleCardData } from '../utils';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport HwCardListView from './hw-card-list-view';\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, homeworkId?: string) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n homeworkRef?: React.RefObject<HTMLDivElement>;\n startHomePageJourney?: ({ studentId, stream, userType }: IHomepageStartJourneyProps) => void;\n canStartJourney?: boolean;\n canStartPuzzleAssignedJourney?: boolean;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType,\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n startHomePageJourney,\n canStartJourney,\n canStartPuzzleAssignedJourney,\n}) => {\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isProcessed,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n const { puzzleHWCardRef, startJourney: startPuzzleAssignedJourney } = usePuzzleAssignedJourney();\n\n const puzzleCardData = useMemo(() => getPuzzleCardData(hwDetails), [hwDetails]);\n\n useEffect(() => {\n if (isProcessed && startHomePageJourney && !isJourneyActive && canStartJourney) {\n startHomePageJourney({ studentId, stream, userType });\n }\n }, [\n canStartJourney,\n isJourneyActive,\n isProcessed,\n startHomePageJourney,\n stream,\n studentId,\n userType,\n ]);\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 useEffect(() => {\n if (\n canStartPuzzleAssignedJourney &&\n !isJourneyActive &&\n startPuzzleAssignedJourney &&\n puzzleCardData\n ) {\n startPuzzleAssignedJourney(puzzleCardData);\n }\n }, [canStartPuzzleAssignedJourney, puzzleCardData, isJourneyActive, startPuzzleAssignedJourney]);\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <div ref={homeworkRef}>\n <HwCardListView\n isHwProcessing={isProcessing}\n hwDetails={hwDetails}\n onTestStart={onTestStart}\n onNodeAttempt={onNodeAttempt}\n onTestPreview={onTestPreview}\n onNodeView={onNodeView}\n onTestReview={onTestReview}\n onNodeReview={onNodeReview}\n onNodeUnassign={onNodeUnassign}\n userType={userType}\n studentId={studentId}\n puzzleHWCardRef={puzzleHWCardRef}\n />\n </div>\n );\n};\n\nexport default memo(HWCardList);\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","startHomePageJourney","canStartJourney","canStartPuzzleAssignedJourney","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isProcessed","isStale","useGetHomeworks","isJourneyActive","useJourney","puzzleHWCardRef","startPuzzleAssignedJourney","usePuzzleAssignedJourney","puzzleCardData","useMemo","getPuzzleCardData","useEffect","fetchHomeworks","useCallback","jsx","HwCardListView","hwCardList","memo"],"mappings":";;;;;;;AA4BA,MAAMA,IAAwC,CAAC;AAAA,EAC7C,UAAAC;AAAA,EACA,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;AAAA,EACA,aAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,+BAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,oBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,EAAgBnB,CAAS,GACvB,EAAE,iBAAAoB,MAAoBC,KAEtB,EAAE,iBAAAC,GAAiB,cAAcC,MAA+BC,EAAyB,GAEzFC,IAAiBC,EAAQ,MAAMC,EAAkBb,CAAS,GAAG,CAACA,CAAS,CAAC;AAE9E,EAAAc,EAAU,MAAM;AACd,IAAIX,KAAeP,KAAwB,CAACU,KAAmBT,KAC7DD,EAAqB,EAAE,WAAAV,GAAW,QAAAC,GAAQ,UAAAF,EAAU,CAAA;AAAA,EACtD,GACC;AAAA,IACDY;AAAA,IACAS;AAAA,IACAH;AAAA,IACAP;AAAA,IACAT;AAAA,IACAD;AAAA,IACAD;AAAA,EAAA,CACD;AAEK,QAAA8B,IAAiBC,EAAY,MAAM;AACvC,IAAAjB,EAAab,GAAW,QAAW,EAAE,QAAAC,EAAQ,CAAA;AAAA,EAC5C,GAAA,CAACY,GAAcZ,GAAQD,CAAS,CAAC;AAuBpC,SArBA4B,EAAU,MAAM;AACV,IAAA,CAACZ,KAAgBE,KACJW;EAEhB,GAAA,CAACA,GAAgBb,GAAcE,CAAO,CAAC,GAE1CU,EAAU,MAAM;AACC,IAAAC;EAAA,GACd,CAACA,CAAc,CAAC,GAEnBD,EAAU,MAAM;AACd,IACEhB,KACA,CAACQ,KACDG,KACAE,KAEAF,EAA2BE,CAAc;AAAA,KAE1C,CAACb,GAA+Ba,GAAgBL,GAAiBG,CAA0B,CAAC,GAE3FR,IACK,OAIP,gBAAAgB,EAAC,OAAI,EAAA,KAAKtB,GACR,UAAA,gBAAAsB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAgBhB;AAAA,MAChB,WAAAF;AAAA,MACA,aAAAZ;AAAA,MACA,eAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,UAAAT;AAAA,MACA,WAAAC;AAAA,MACA,iBAAAsB;AAAA,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEeW,IAAAC,EAAKpC,CAAU;"}
|
@@ -1,48 +1,54 @@
|
|
1
1
|
import { TESTS_CREATION_ANALYTICS_EVENTS as l } from "../milestone/milestone-tests/tests-creation/tests-creation-analytics-events.js";
|
2
|
-
import { NODE_TYPE as
|
2
|
+
import { NODE_TYPE as n } from "../sheets/constants/sheet.js";
|
3
3
|
import { HOMEWORK_ANALYTICS_EVENTS as c } from "./homework-analytics-events.js";
|
4
4
|
const y = ({
|
5
|
-
canResume:
|
6
|
-
canStart:
|
7
|
-
homeworkId:
|
8
|
-
isHomeWork:
|
9
|
-
isStudent:
|
10
|
-
milestoneId:
|
11
|
-
nodeType:
|
12
|
-
studentId:
|
13
|
-
userNodeId:
|
5
|
+
canResume: t,
|
6
|
+
canStart: e,
|
7
|
+
homeworkId: i,
|
8
|
+
isHomeWork: o,
|
9
|
+
isStudent: _,
|
10
|
+
milestoneId: s,
|
11
|
+
nodeType: r,
|
12
|
+
studentId: a,
|
13
|
+
userNodeId: d
|
14
14
|
}) => {
|
15
|
-
if (
|
16
|
-
if (
|
17
|
-
return
|
15
|
+
if (_) {
|
16
|
+
if (o)
|
17
|
+
return e || t ? {
|
18
18
|
analyticsLabel: c.HOMEWORK_ATTEMPTED,
|
19
|
-
analyticsProps: { student_id:
|
19
|
+
analyticsProps: { student_id: a, node_type: r, homework_id: i }
|
20
20
|
} : {
|
21
21
|
analyticsLabel: "homework-student-menu",
|
22
|
-
analyticsProps: { student_id:
|
22
|
+
analyticsProps: { student_id: a, node_type: r, homework_id: i }
|
23
23
|
};
|
24
|
-
if (
|
24
|
+
if (e || t)
|
25
25
|
return {
|
26
|
-
analyticsLabel:
|
26
|
+
analyticsLabel: r === n.DYNAMIC ? l.CUSTOM_TEST_ATTEMPTED : "node-attempted",
|
27
27
|
analyticsProps: {
|
28
|
-
student_id:
|
29
|
-
node_type:
|
30
|
-
user_node_id:
|
31
|
-
milestone_id:
|
32
|
-
can_start:
|
33
|
-
can_resume:
|
28
|
+
student_id: a,
|
29
|
+
node_type: r,
|
30
|
+
user_node_id: d,
|
31
|
+
milestone_id: s,
|
32
|
+
can_start: e,
|
33
|
+
can_resume: t
|
34
34
|
}
|
35
35
|
};
|
36
36
|
}
|
37
|
-
return
|
37
|
+
return o ? {
|
38
38
|
analyticsLabel: "homework-card-teacher",
|
39
|
-
analyticsProps: { student_id:
|
39
|
+
analyticsProps: { student_id: a, node_type: r }
|
40
40
|
} : {
|
41
41
|
analyticsLabel: "goals-card-teacher",
|
42
|
-
analyticsProps: { student_id:
|
42
|
+
analyticsProps: { student_id: a, node_type: r }
|
43
43
|
};
|
44
|
+
}, T = (t) => {
|
45
|
+
if (!t)
|
46
|
+
return;
|
47
|
+
const { assigned_homeworks: e } = t;
|
48
|
+
return e.find((i) => i.node_type === n.PUZZLE_CARD);
|
44
49
|
};
|
45
50
|
export {
|
46
|
-
y as getCardAnalyticProps
|
51
|
+
y as getCardAnalyticProps,
|
52
|
+
T as getPuzzleCardData
|
47
53
|
};
|
48
54
|
//# sourceMappingURL=utils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/features/homework/utils.ts"],"sourcesContent":["import type { TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\n\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../milestone/milestone-tests/tests-creation/tests-creation-analytics-events';\nimport { NODE_TYPE } from '../sheets/constants/sheet';\nimport { HOMEWORK_ANALYTICS_EVENTS } from './homework-analytics-events';\n\ninterface IGetCardAnalyticProps {\n canResume: boolean;\n canStart: boolean;\n homeworkId?: string;\n isHomeWork: boolean;\n isStudent: boolean;\n milestoneId?: string;\n nodeType: TNodeTypes;\n studentId: string;\n userNodeId: string | null;\n}\n\nconst getCardAnalyticProps = ({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n}: IGetCardAnalyticProps) => {\n if (isStudent) {\n if (isHomeWork) {\n if (canStart || canResume) {\n return {\n analyticsLabel: HOMEWORK_ANALYTICS_EVENTS.HOMEWORK_ATTEMPTED,\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n return {\n analyticsLabel: 'homework-student-menu',\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n if (canStart || canResume) {\n return {\n analyticsLabel:\n nodeType === NODE_TYPE.DYNAMIC\n ? TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_ATTEMPTED\n : 'node-attempted',\n analyticsProps: {\n student_id: studentId,\n node_type: nodeType,\n user_node_id: userNodeId,\n milestone_id: milestoneId,\n can_start: canStart,\n can_resume: canResume,\n },\n };\n }\n }\n\n if (isHomeWork) {\n return {\n analyticsLabel: 'homework-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n }\n\n return {\n analyticsLabel: 'goals-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n};\n\nexport { getCardAnalyticProps };\n"],"names":["getCardAnalyticProps","canResume","canStart","homeworkId","isHomeWork","isStudent","milestoneId","nodeType","studentId","userNodeId","HOMEWORK_ANALYTICS_EVENTS","NODE_TYPE","TESTS_CREATION_ANALYTICS_EVENTS"],"mappings":";;;
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/features/homework/utils.ts"],"sourcesContent":["import type { TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\nimport type { IHomeworkDetails } from './hw-card-list/api/get-homeworks';\n\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../milestone/milestone-tests/tests-creation/tests-creation-analytics-events';\nimport { NODE_TYPE } from '../sheets/constants/sheet';\nimport { HOMEWORK_ANALYTICS_EVENTS } from './homework-analytics-events';\n\ninterface IGetCardAnalyticProps {\n canResume: boolean;\n canStart: boolean;\n homeworkId?: string;\n isHomeWork: boolean;\n isStudent: boolean;\n milestoneId?: string;\n nodeType: TNodeTypes;\n studentId: string;\n userNodeId: string | null;\n}\n\nconst getCardAnalyticProps = ({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n}: IGetCardAnalyticProps) => {\n if (isStudent) {\n if (isHomeWork) {\n if (canStart || canResume) {\n return {\n analyticsLabel: HOMEWORK_ANALYTICS_EVENTS.HOMEWORK_ATTEMPTED,\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n return {\n analyticsLabel: 'homework-student-menu',\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n if (canStart || canResume) {\n return {\n analyticsLabel:\n nodeType === NODE_TYPE.DYNAMIC\n ? TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_ATTEMPTED\n : 'node-attempted',\n analyticsProps: {\n student_id: studentId,\n node_type: nodeType,\n user_node_id: userNodeId,\n milestone_id: milestoneId,\n can_start: canStart,\n can_resume: canResume,\n },\n };\n }\n }\n\n if (isHomeWork) {\n return {\n analyticsLabel: 'homework-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n }\n\n return {\n analyticsLabel: 'goals-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n};\n\nconst getPuzzleCardData = (hwDetails?: IHomeworkDetails) => {\n if (!hwDetails) {\n return undefined;\n }\n\n const { assigned_homeworks: assignedHomework } = hwDetails;\n\n return assignedHomework.find(homework => homework.node_type === NODE_TYPE.PUZZLE_CARD);\n};\n\nexport { getCardAnalyticProps, getPuzzleCardData };\n"],"names":["getCardAnalyticProps","canResume","canStart","homeworkId","isHomeWork","isStudent","milestoneId","nodeType","studentId","userNodeId","HOMEWORK_ANALYTICS_EVENTS","NODE_TYPE","TESTS_CREATION_ANALYTICS_EVENTS","getPuzzleCardData","hwDetails","assignedHomework","homework"],"mappings":";;;AAmBA,MAAMA,IAAuB,CAAC;AAAA,EAC5B,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AACF,MAA6B;AAC3B,MAAIJ,GAAW;AACb,QAAID;AACF,aAAIF,KAAYD,IACP;AAAA,QACL,gBAAgBS,EAA0B;AAAA,QAC1C,gBAAgB,EAAE,YAAYF,GAAW,WAAWD,GAAU,aAAaJ,EAAW;AAAA,MAAA,IAInF;AAAA,QACL,gBAAgB;AAAA,QAChB,gBAAgB,EAAE,YAAYK,GAAW,WAAWD,GAAU,aAAaJ,EAAW;AAAA,MAAA;AAI1F,QAAID,KAAYD;AACP,aAAA;AAAA,QACL,gBACEM,MAAaI,EAAU,UACnBC,EAAgC,wBAChC;AAAA,QACN,gBAAgB;AAAA,UACd,YAAYJ;AAAA,UACZ,WAAWD;AAAA,UACX,cAAcE;AAAA,UACd,cAAcH;AAAA,UACd,WAAWJ;AAAA,UACX,YAAYD;AAAA,QACd;AAAA,MAAA;AAAA,EAGN;AAEA,SAAIG,IACK;AAAA,IACL,gBAAgB;AAAA,IAChB,gBAAgB,EAAE,YAAYI,GAAW,WAAWD,EAAS;AAAA,EAAA,IAI1D;AAAA,IACL,gBAAgB;AAAA,IAChB,gBAAgB,EAAE,YAAYC,GAAW,WAAWD,EAAS;AAAA,EAAA;AAEjE,GAEMM,IAAoB,CAACC,MAAiC;AAC1D,MAAI,CAACA;AACI;AAGH,QAAA,EAAE,oBAAoBC,EAAqB,IAAAD;AAEjD,SAAOC,EAAiB,KAAK,CAAAC,MAAYA,EAAS,cAAcL,EAAU,WAAW;AACvF;"}
|
@@ -1,17 +1,19 @@
|
|
1
1
|
import { jsx as i, jsxs as g, Fragment as m } from "react/jsx-runtime";
|
2
2
|
import L from "../../../../node_modules/lodash.throttle/index.js";
|
3
|
-
import { useState as
|
3
|
+
import { useState as a, useEffect as O, useMemo as p } from "react";
|
4
|
+
import { useTheme as $ } from "styled-components";
|
4
5
|
import c from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
5
6
|
import R from "../../../ui/nudge/nudge.js";
|
6
|
-
import
|
7
|
+
import A from "../../../ui/portal/portal.js";
|
8
|
+
import { EDeviceType as X } from "../../../ui/theme/constants.js";
|
7
9
|
import { IndicatorType as u } from "../../use-journey/constants.js";
|
8
|
-
import { CoachmarkBody as
|
9
|
-
import { getTooltipXCoordinates as
|
10
|
-
const
|
10
|
+
import { CoachmarkBody as Y, ClonedElementWrapper as h } from "./coachmark-styled.js";
|
11
|
+
import { getTooltipXCoordinates as x } from "./coachmark-utils.js";
|
12
|
+
const S = ({
|
11
13
|
coachmark: e,
|
12
14
|
isInsideScrollView: T
|
13
15
|
}) => {
|
14
|
-
const t = e.originalElementToHighlightRef.current,
|
16
|
+
const t = e.originalElementToHighlightRef.current, { device: C, zIndex: I } = $(), [P, v] = a(() => {
|
15
17
|
const o = t == null ? void 0 : t.getBoundingClientRect();
|
16
18
|
return {
|
17
19
|
top: ((o == null ? void 0 : o.top) ?? 0) + window.scrollY,
|
@@ -19,32 +21,32 @@ const V = ({
|
|
19
21
|
width: (o == null ? void 0 : o.width) ?? 0,
|
20
22
|
height: (o == null ? void 0 : o.height) ?? 0
|
21
23
|
};
|
22
|
-
}),
|
24
|
+
}), r = L(() => {
|
23
25
|
const o = t == null ? void 0 : t.getBoundingClientRect();
|
24
|
-
o &&
|
26
|
+
o && v({
|
25
27
|
top: o.top + window.scrollY,
|
26
28
|
left: o.left + window.scrollX,
|
27
29
|
width: o.width,
|
28
30
|
height: o.height
|
29
31
|
});
|
30
32
|
}, 100), {
|
31
|
-
top:
|
33
|
+
top: n = 0,
|
32
34
|
left: l = 0,
|
33
|
-
height:
|
34
|
-
width:
|
35
|
-
} = T ?
|
36
|
-
O(() => (window.addEventListener("resize",
|
37
|
-
window.removeEventListener("resize",
|
38
|
-
}), [
|
39
|
-
const
|
35
|
+
height: E = 0,
|
36
|
+
width: b = 0
|
37
|
+
} = T ? P : (t == null ? void 0 : t.getBoundingClientRect()) ?? {};
|
38
|
+
O(() => (window.addEventListener("resize", r), window.addEventListener("scroll", r), () => {
|
39
|
+
window.removeEventListener("resize", r), window.removeEventListener("scroll", r);
|
40
|
+
}), [r, t]);
|
41
|
+
const f = C === X.MOBILE, d = I.JOURNEY_OVERLAY, s = p(() => t ? window.getComputedStyle(t).position === "absolute" : !1, [t]), w = p(() => {
|
40
42
|
const o = e.indicator;
|
41
43
|
return {
|
42
|
-
width:
|
44
|
+
width: f ? 246 : 264,
|
43
45
|
// Can be over ridden
|
44
|
-
tooltipXCoOrdinates:
|
46
|
+
tooltipXCoOrdinates: x(o),
|
45
47
|
zIndex: d + 1,
|
46
48
|
...o,
|
47
|
-
tooltipItem: /* @__PURE__ */ i(
|
49
|
+
tooltipItem: /* @__PURE__ */ i(Y, { children: o.tooltipItem }),
|
48
50
|
alwaysVisible: !0,
|
49
51
|
renderAs: "primary",
|
50
52
|
// Deprecate this
|
@@ -54,31 +56,31 @@ const V = ({
|
|
54
56
|
type: u.TOOLTIP,
|
55
57
|
isAnimated: !0
|
56
58
|
};
|
57
|
-
}, [d, e.indicator,
|
59
|
+
}, [d, e.indicator, f]), y = p(() => {
|
58
60
|
const o = e.indicator;
|
59
61
|
return {
|
60
62
|
...o,
|
61
63
|
nudgePointerX: l + (o.nudgePointerX ?? 0),
|
62
|
-
nudgePointerY:
|
64
|
+
nudgePointerY: n + (o.nudgePointerY ?? 0)
|
63
65
|
};
|
64
|
-
}, [e.indicator, l,
|
66
|
+
}, [e.indicator, l, n]);
|
65
67
|
return !t || !e.isActive ? null : e.type === u.TOOLTIP ? s ? /* @__PURE__ */ g(m, { children: [
|
66
68
|
e.elementToHighlight,
|
67
|
-
/* @__PURE__ */ i(h, { $position: "absolute", $top:
|
68
|
-
] }) : /* @__PURE__ */ i(h, { $position: "absolute", $top:
|
69
|
+
/* @__PURE__ */ i(h, { $position: "absolute", $top: n, $left: l, children: /* @__PURE__ */ i(c, { ...w, children: /* @__PURE__ */ i("div", { style: { height: E, width: b } }) }) })
|
70
|
+
] }) : /* @__PURE__ */ i(h, { $position: "absolute", $top: n, $left: l, children: /* @__PURE__ */ i(c, { ...w, children: e.elementToHighlight }) }) : e.type === u.NUDGE ? /* @__PURE__ */ g(m, { children: [
|
69
71
|
/* @__PURE__ */ i(
|
70
72
|
h,
|
71
73
|
{
|
72
|
-
$top: s ? 0 :
|
74
|
+
$top: s ? 0 : n,
|
73
75
|
$left: s ? 0 : l,
|
74
76
|
$position: s ? "relative" : "absolute",
|
75
77
|
children: e.elementToHighlight
|
76
78
|
}
|
77
79
|
),
|
78
|
-
/* @__PURE__ */ i(R, { zIndex: d + 1, ...
|
80
|
+
/* @__PURE__ */ i(A, { portalId: "tooltip-root", children: /* @__PURE__ */ i(R, { zIndex: d + 1, ...y }) })
|
79
81
|
] }) : null;
|
80
82
|
};
|
81
83
|
export {
|
82
|
-
|
84
|
+
S as Coachmark
|
83
85
|
};
|
84
86
|
//# sourceMappingURL=coachmark.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"coachmark.js","sources":["../../../../../src/features/journey/comps/coachmark/coachmark.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../ui/nudge/nudge-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport throttle from 'lodash.throttle';\nimport React, { useEffect, useMemo, useState } from 'react';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Nudge from '../../../ui/nudge/nudge';\nimport {
|
1
|
+
{"version":3,"file":"coachmark.js","sources":["../../../../../src/features/journey/comps/coachmark/coachmark.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../ui/nudge/nudge-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport throttle from 'lodash.throttle';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Nudge from '../../../ui/nudge/nudge';\nimport Portal from '../../../ui/portal/portal';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport { IndicatorType } from '../../use-journey/constants';\nimport * as S from './coachmark-styled';\nimport { getTooltipXCoordinates } from './coachmark-utils';\n\nexport const Coachmark: React.FC<{ coachmark: ICoachmarkProps; isInsideScrollView: boolean }> = ({\n coachmark,\n isInsideScrollView,\n}) => {\n const targetElement = coachmark.originalElementToHighlightRef.current;\n const { device, zIndex } = useTheme();\n\n const [position, setPosition] = useState(() => {\n const rect = targetElement?.getBoundingClientRect();\n\n return {\n top: (rect?.top ?? 0) + window.scrollY,\n left: rect?.left ?? 0 + window.scrollX,\n width: rect?.width ?? 0,\n height: rect?.height ?? 0,\n };\n });\n\n const handlePositionChange = throttle(() => {\n const rect = targetElement?.getBoundingClientRect();\n\n if (rect) {\n setPosition({\n top: rect.top + window.scrollY,\n left: rect.left + window.scrollX,\n width: rect.width,\n height: rect.height,\n });\n }\n }, 100);\n\n const {\n top = 0,\n left = 0,\n height = 0,\n width = 0,\n } = isInsideScrollView ? position : targetElement?.getBoundingClientRect() ?? {};\n\n useEffect(() => {\n window.addEventListener('resize', handlePositionChange);\n window.addEventListener('scroll', handlePositionChange);\n\n return () => {\n window.removeEventListener('resize', handlePositionChange);\n window.removeEventListener('scroll', handlePositionChange);\n };\n }, [handlePositionChange, targetElement]);\n\n const isMobile = device === EDeviceType.MOBILE;\n\n const BLUR_OVERLAY_Z_INDEX = zIndex.JOURNEY_OVERLAY;\n\n const isAbsolute = useMemo(() => {\n if (!targetElement) return false;\n\n return window.getComputedStyle(targetElement).position === 'absolute';\n }, [targetElement]);\n\n const tooltipProps = useMemo(() => {\n const arrowToolTipProps = coachmark.indicator as IArrowTooltipProps;\n\n return {\n width: isMobile ? 246 : 264, // Can be over ridden\n tooltipXCoOrdinates: getTooltipXCoordinates(arrowToolTipProps),\n zIndex: BLUR_OVERLAY_Z_INDEX + 1,\n ...arrowToolTipProps,\n tooltipItem: <S.CoachmarkBody>{arrowToolTipProps.tooltipItem}</S.CoachmarkBody>,\n alwaysVisible: true,\n renderAs: 'primary', // Deprecate this\n borderWidth: 1,\n arrowColor: arrowToolTipProps.arrowColor || 'WHITE',\n borderColor: arrowToolTipProps.borderColor || 'WHITE',\n type: IndicatorType.TOOLTIP,\n isAnimated: true,\n } as IArrowTooltipProps;\n }, [BLUR_OVERLAY_Z_INDEX, coachmark.indicator, isMobile]);\n\n const nudgeProps = useMemo(() => {\n const props: INudgeProps = coachmark.indicator as INudgeProps;\n\n return {\n ...props,\n nudgePointerX: left + (props.nudgePointerX ?? 0),\n nudgePointerY: top + (props.nudgePointerY ?? 0),\n };\n }, [coachmark.indicator, left, top]);\n\n if (!targetElement || !coachmark.isActive) {\n return null;\n }\n\n if (coachmark.type === IndicatorType.TOOLTIP) {\n if (isAbsolute) {\n return (\n <>\n {coachmark.elementToHighlight}\n <S.ClonedElementWrapper $position=\"absolute\" $top={top} $left={left}>\n <ArrowTooltip {...tooltipProps}>\n <div style={{ height, width }} />\n </ArrowTooltip>\n </S.ClonedElementWrapper>\n </>\n );\n }\n\n return (\n <S.ClonedElementWrapper $position=\"absolute\" $top={top} $left={left}>\n <ArrowTooltip {...tooltipProps}>{coachmark.elementToHighlight}</ArrowTooltip>\n </S.ClonedElementWrapper>\n );\n }\n\n if (coachmark.type === IndicatorType.NUDGE) {\n return (\n <>\n <S.ClonedElementWrapper\n $top={isAbsolute ? 0 : top}\n $left={isAbsolute ? 0 : left}\n $position={isAbsolute ? 'relative' : 'absolute'}\n >\n {coachmark.elementToHighlight}\n </S.ClonedElementWrapper>\n <Portal portalId=\"tooltip-root\">\n <Nudge zIndex={BLUR_OVERLAY_Z_INDEX + 1} {...nudgeProps} />\n </Portal>\n </>\n );\n }\n\n return null;\n};\n"],"names":["Coachmark","coachmark","isInsideScrollView","targetElement","device","zIndex","useTheme","position","setPosition","useState","rect","handlePositionChange","throttle","top","left","height","width","useEffect","isMobile","EDeviceType","BLUR_OVERLAY_Z_INDEX","isAbsolute","useMemo","tooltipProps","arrowToolTipProps","getTooltipXCoordinates","jsx","S.CoachmarkBody","IndicatorType","nudgeProps","props","jsxs","Fragment","S.ClonedElementWrapper","ArrowTooltip","Portal","Nudge"],"mappings":";;;;;;;;;;;AAgBO,MAAMA,IAAmF,CAAC;AAAA,EAC/F,WAAAC;AAAA,EACA,oBAAAC;AACF,MAAM;AACE,QAAAC,IAAgBF,EAAU,8BAA8B,SACxD,EAAE,QAAAG,GAAQ,QAAAC,EAAO,IAAIC,EAAS,GAE9B,CAACC,GAAUC,CAAW,IAAIC,EAAS,MAAM;AACvC,UAAAC,IAAOP,KAAA,gBAAAA,EAAe;AAErB,WAAA;AAAA,MACL,OAAMO,KAAA,gBAAAA,EAAM,QAAO,KAAK,OAAO;AAAA,MAC/B,OAAMA,KAAA,gBAAAA,EAAM,SAAQ,IAAI,OAAO;AAAA,MAC/B,QAAOA,KAAA,gBAAAA,EAAM,UAAS;AAAA,MACtB,SAAQA,KAAA,gBAAAA,EAAM,WAAU;AAAA,IAAA;AAAA,EAC1B,CACD,GAEKC,IAAuBC,EAAS,MAAM;AACpC,UAAAF,IAAOP,KAAA,gBAAAA,EAAe;AAE5B,IAAIO,KACUF,EAAA;AAAA,MACV,KAAKE,EAAK,MAAM,OAAO;AAAA,MACvB,MAAMA,EAAK,OAAO,OAAO;AAAA,MACzB,OAAOA,EAAK;AAAA,MACZ,QAAQA,EAAK;AAAA,IAAA,CACd;AAAA,KAEF,GAAG,GAEA;AAAA,IACJ,KAAAG,IAAM;AAAA,IACN,MAAAC,IAAO;AAAA,IACP,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ;AAAA,MACNd,IAAqBK,KAAWJ,KAAA,gBAAAA,EAAe,4BAA2B,CAAA;AAE9E,EAAAc,EAAU,OACD,OAAA,iBAAiB,UAAUN,CAAoB,GAC/C,OAAA,iBAAiB,UAAUA,CAAoB,GAE/C,MAAM;AACJ,WAAA,oBAAoB,UAAUA,CAAoB,GAClD,OAAA,oBAAoB,UAAUA,CAAoB;AA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