@cuemath/leap 3.2.17-pzd-0.1 → 3.2.18-mb
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 +5 -6
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lottie/lottie.js +1 -6
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +1 -2
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +4 -6
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +8 -10
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/auth/account-selector/account-selector.js +25 -26
- package/dist/features/auth/account-selector/account-selector.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +14 -15
- 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 +31 -30
- 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 +34 -35
- package/dist/features/auth/comps/user-list/user-list.js.map +1 -1
- package/dist/features/auth/forgot-password/forgot-password-styled.js +15 -14
- 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 +7 -6
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
- package/dist/features/auth/login/login-styled.js +9 -8
- 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 +98 -121
- 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 +28 -29
- 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 +42 -43
- 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 +35 -43
- 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 +24 -26
- 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 +1 -3
- package/dist/features/circle-games/sign-up/constants.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +4 -7
- 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 +97 -85
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +42 -44
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +29 -31
- 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 +48 -54
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +27 -33
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/hooks/use-viewport/use-viewport.js +22 -0
- package/dist/features/hooks/use-viewport/use-viewport.js.map +1 -0
- package/dist/features/journey/comps/coachmark/coachmark.js +27 -29
- package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +11 -17
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- 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 +72 -73
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/journey/use-journey/journey-styled.js +4 -6
- package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +69 -24
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +30 -79
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +25 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +107 -100
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- 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 +13 -28
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/stickers/sticker-data.js +234 -0
- package/dist/features/stickers/sticker-data.js.map +1 -0
- package/dist/features/{ui/sticker-grid/sticker-grid-styles.js → stickers/sticker-selector/sticker-selector-styles.js} +4 -3
- package/dist/features/stickers/sticker-selector/sticker-selector-styles.js.map +1 -0
- package/dist/features/stickers/sticker-selector/sticker-selector.js +25 -0
- package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -0
- package/dist/features/stickers/sticker-selector/sticker.js +57 -0
- package/dist/features/stickers/sticker-selector/sticker.js.map +1 -0
- package/dist/features/{ui/stickers/stickers-effects.js → stickers/stickers-effects/effects.js} +6 -6
- package/dist/features/stickers/stickers-effects/effects.js.map +1 -0
- package/dist/features/{ui/stickers/stickers-styled.js → stickers/stickers-effects/stickers-effects-styled.js} +2 -2
- package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +1 -0
- package/dist/features/stickers/stickers-effects/stickers-effects-utils.js +93 -0
- package/dist/features/stickers/stickers-effects/stickers-effects-utils.js.map +1 -0
- package/dist/features/stickers/stickers-effects/stickers-effects.js +39 -0
- package/dist/features/stickers/stickers-effects/stickers-effects.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +60 -12
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +77 -72
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
- package/dist/features/ui/error/error.js +27 -65
- package/dist/features/ui/error/error.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +29 -25
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +58 -34
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +14 -40
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/ui/nudge/nudge-styled.js +7 -14
- package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
- package/dist/features/ui/nudge/nudge.js +12 -13
- package/dist/features/ui/nudge/nudge.js.map +1 -1
- 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 +15 -17
- package/dist/features/ui/streak-icon/streak-icon.js.map +1 -1
- package/dist/features/ui/text/text.js +36 -40
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/ui/theme/constants.js +2 -4
- 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 +13 -12
- package/dist/features/worksheet/worksheet/constants.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +19 -20
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +25 -29
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +47 -101
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +255 -244
- 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 +207 -242
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +36 -45
- 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 +325 -321
- 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 +35 -44
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +56 -152
- package/dist/index.js +539 -563
- package/dist/index.js.map +1 -1
- package/dist/static/nudge-tap.5cb30093.json +1057 -0
- package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +1 -0
- package/dist/static/puzzle-pattern-green.c9f84bbc.svg +1 -0
- package/dist/static/puzzle-pattern-orange.3da09665.svg +1 -0
- package/dist/static/puzzle-pattern-purple.5fb5a319.svg +1 -0
- package/dist/static/puzzle-pattern-yellow.aadbf457.svg +1 -0
- package/package.json +1 -1
- package/dist/assets/line-icons/icons/cue-board-filled.js +0 -33
- package/dist/assets/line-icons/icons/cue-board-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/cue-board.js +0 -23
- package/dist/assets/line-icons/icons/cue-board.js.map +0 -1
- package/dist/assets/line-icons/icons/hint-fill.js +0 -35
- package/dist/assets/line-icons/icons/hint-fill.js.map +0 -1
- package/dist/assets/line-icons/icons/screen-grab-filled.js +0 -35
- package/dist/assets/line-icons/icons/screen-grab-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/screen-grab.js +0 -23
- package/dist/assets/line-icons/icons/screen-grab.js.map +0 -1
- package/dist/assets/line-icons/icons/sticker-filled.js +0 -64
- package/dist/assets/line-icons/icons/sticker-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/sticker.js +0 -46
- package/dist/assets/line-icons/icons/sticker.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +0 -72
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +0 -63
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +0 -67
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +0 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +0 -10
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app-styled.js +0 -85
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app-view.js +0 -120
- package/dist/features/puzzles/app/puzzle-app-view.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app.js +0 -62
- package/dist/features/puzzles/app/puzzle-app.js.map +0 -1
- package/dist/features/puzzles/constants/puzzle-container.js +0 -8
- package/dist/features/puzzles/constants/puzzle-container.js.map +0 -1
- package/dist/features/puzzles/puzzle-analytics-events.js +0 -11
- package/dist/features/puzzles/puzzle-analytics-events.js.map +0 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +0 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +0 -37
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +0 -110
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +0 -6
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +0 -63
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +0 -21
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker-grid-styles.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker-grid.js +0 -24
- package/dist/features/ui/sticker-grid/sticker-grid.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker.js +0 -57
- package/dist/features/ui/sticker-grid/sticker.js.map +0 -1
- package/dist/features/ui/stickers/constants.js +0 -6
- package/dist/features/ui/stickers/constants.js.map +0 -1
- package/dist/features/ui/stickers/stickers-effects.js.map +0 -1
- package/dist/features/ui/stickers/stickers-styled.js.map +0 -1
- package/dist/features/ui/stickers/stickers-utils.js +0 -91
- package/dist/features/ui/stickers/stickers-utils.js.map +0 -1
- package/dist/features/ui/stickers/stickers.js +0 -40
- package/dist/features/ui/stickers/stickers.js.map +0 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +0 -28
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +0 -1
- package/dist/static/nudge-tap.0591aef4.json +0 -1
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +0 -1
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +0 -12760
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +0 -1
- package/dist/static/puzzle-green-lottie.1da90698.json +0 -1
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +0 -1
- package/dist/static/puzzle-pattern-blue.abff0164.svg +0 -1
- package/dist/static/puzzle-pattern-green.b8ba1840.svg +0 -1
- package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +0 -1
- package/dist/static/puzzle-pattern-purple.14b09759.svg +0 -1
- package/dist/static/puzzle-pattern-yellow.50917fab.svg +0 -1
- package/dist/static/puzzle-purple-lottie.e70de110.json +0 -9860
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +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 O, useState as y, useRef as Q, useMemo as S, useCallback as d, useEffect as B } from "react";
|
3
|
+
import V from "../../../assets/line-icons/icons/chevron-left.js";
|
4
|
+
import F 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 q, ScrollButton as W, ScrollContainer as Y, QueueWrapper as z, QueueText as J } from "./hw-card-list-styled.js";
|
9
|
+
import { getWaitForReviewSheetsCount as P } from "./hw-card-list-utils.js";
|
10
|
+
const Z = ({
|
11
11
|
userType: C,
|
12
12
|
studentId: _,
|
13
13
|
isHwProcessing: K,
|
@@ -18,24 +18,23 @@ const U = ({
|
|
18
18
|
onNodeView: x,
|
19
19
|
onTestReview: H,
|
20
20
|
onNodeReview: L,
|
21
|
-
onNodeUnassign: A
|
22
|
-
puzzleHWCardRef: T
|
21
|
+
onNodeUnassign: A
|
23
22
|
}) => {
|
24
|
-
const [
|
23
|
+
const [T, a] = y(!1), [j, I] = y(!1), t = Q(null), { assigned_homeworks: h = [], queued_homeworks: f = [] } = s || {}, R = S(
|
25
24
|
() => h.length + f.length,
|
26
25
|
[h, f]
|
27
|
-
),
|
26
|
+
), D = S(() => P(s), [s]), o = d(() => {
|
28
27
|
if (t.current) {
|
29
28
|
const { scrollLeft: e, scrollWidth: i, clientWidth: c } = t.current;
|
30
29
|
e > 1 && a(!0), e < i - c - 1 && I(!0);
|
31
30
|
}
|
32
|
-
}, []),
|
31
|
+
}, []), G = d(() => {
|
33
32
|
t.current && o();
|
34
|
-
}, [o]),
|
33
|
+
}, [o]), M = d(() => {
|
35
34
|
a(!1), I(!1);
|
36
|
-
}, []),
|
35
|
+
}, []), N = d(() => {
|
37
36
|
t.current && (t.current.scrollBy({ left: -200, behavior: "smooth" }), o());
|
38
|
-
}, [o]),
|
37
|
+
}, [o]), X = d(() => {
|
39
38
|
t.current && (t.current.scrollBy({ left: 200, behavior: "smooth" }), o());
|
40
39
|
}, [o]);
|
41
40
|
return B(() => {
|
@@ -52,10 +51,10 @@ const U = ({
|
|
52
51
|
}, [o]), R === 0 ? /* @__PURE__ */ l(u, { $flexRowGapX: 1, children: [
|
53
52
|
/* @__PURE__ */ r(g, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: "Homework (0)" }),
|
54
53
|
/* @__PURE__ */ r(g, { $renderAs: "ab2", $color: "BLACK_T_60", children: "No Homework assigned yet" })
|
55
|
-
] }) : /* @__PURE__ */ l(
|
54
|
+
] }) : /* @__PURE__ */ l(q, { $flexRowGapX: 1, $disablePointerEvents: K, children: [
|
56
55
|
/* @__PURE__ */ l(g, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
57
56
|
"Homework (",
|
58
|
-
|
57
|
+
D,
|
59
58
|
"/",
|
60
59
|
R,
|
61
60
|
")"
|
@@ -64,8 +63,8 @@ const U = ({
|
|
64
63
|
u,
|
65
64
|
{
|
66
65
|
$position: "relative",
|
67
|
-
onMouseEnter:
|
68
|
-
onMouseLeave:
|
66
|
+
onMouseEnter: G,
|
67
|
+
onMouseLeave: M,
|
69
68
|
children: [
|
70
69
|
/* @__PURE__ */ r(
|
71
70
|
W,
|
@@ -75,14 +74,14 @@ const U = ({
|
|
75
74
|
$justifyContent: "center",
|
76
75
|
$alignItems: "center",
|
77
76
|
$height: "100%",
|
78
|
-
onClick:
|
79
|
-
$visible:
|
77
|
+
onClick: N,
|
78
|
+
$visible: T,
|
80
79
|
left: "0px",
|
81
80
|
right: "auto",
|
82
|
-
children: /* @__PURE__ */ r(
|
81
|
+
children: /* @__PURE__ */ r(V, { width: 24, height: 24 })
|
83
82
|
}
|
84
83
|
),
|
85
|
-
/* @__PURE__ */ r(
|
84
|
+
/* @__PURE__ */ r(Y, { ref: t, children: /* @__PURE__ */ l(u, { $flexDirection: "row", $flexGapX: 1, children: [
|
86
85
|
h.map((e, i) => {
|
87
86
|
const {
|
88
87
|
node_id: c,
|
@@ -109,8 +108,7 @@ const U = ({
|
|
109
108
|
shouldOpenOnRight: !0,
|
110
109
|
onNodeView: n ? b : x,
|
111
110
|
onNodeReview: n ? H : L,
|
112
|
-
onNodeUnassign: A
|
113
|
-
puzzleHWCardRef: T
|
111
|
+
onNodeUnassign: A
|
114
112
|
}
|
115
113
|
)
|
116
114
|
},
|
@@ -132,13 +130,13 @@ const U = ({
|
|
132
130
|
$flexGapX: 1,
|
133
131
|
children: [
|
134
132
|
i === 0 && /* @__PURE__ */ r(
|
135
|
-
|
133
|
+
z,
|
136
134
|
{
|
137
135
|
$background: "BLACK_4",
|
138
136
|
$justifyContent: "center",
|
139
137
|
$gutter: 4,
|
140
138
|
$gap: 8,
|
141
|
-
children: /* @__PURE__ */ r(
|
139
|
+
children: /* @__PURE__ */ r(J, { $renderAs: "ac3", $color: "WHITE", children: "In Queue" })
|
142
140
|
}
|
143
141
|
),
|
144
142
|
/* @__PURE__ */ r(
|
@@ -173,19 +171,19 @@ const U = ({
|
|
173
171
|
$background: "BLACK_T_60",
|
174
172
|
$justifyContent: "center",
|
175
173
|
$alignItems: "center",
|
176
|
-
onClick:
|
177
|
-
$visible:
|
174
|
+
onClick: X,
|
175
|
+
$visible: j,
|
178
176
|
left: "auto",
|
179
177
|
right: "0px",
|
180
|
-
children: /* @__PURE__ */ r(
|
178
|
+
children: /* @__PURE__ */ r(F, { width: 24, height: 24 })
|
181
179
|
}
|
182
180
|
)
|
183
181
|
]
|
184
182
|
}
|
185
183
|
)
|
186
184
|
] });
|
187
|
-
},
|
185
|
+
}, ce = O(Z);
|
188
186
|
export {
|
189
|
-
|
187
|
+
ce as default
|
190
188
|
};
|
191
189
|
//# 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 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,IAAsC,CAAC;AAAA,EAC3C,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACJ,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAS,EAAK,GAClD,CAACC,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GACpDG,IAAYC,EAAuB,IAAI,GAEvC,EAAE,oBAAoBC,IAAoB,IAAI,kBAAkBC,IAAkB,CAAC,EAAA,IACvFjB,KAAa,IAETkB,IAAqBC;AAAA,IACzB,MAAMH,EAAkB,SAASC,EAAgB;AAAA,IACjD,CAACD,GAAmBC,CAAe;AAAA,EAAA,GAE/BG,IAAsBD,EAAQ,MAAME,EAA4BrB,CAAS,GAAG,CAACA,CAAS,CAAC,GAEvFsB,IAAmBC,EAAY,MAAM;AACzC,QAAIT,EAAU,SAAS;AACrB,YAAM,EAAE,YAAAU,GAAY,aAAAC,GAAa,aAAAC,EAAA,IAAgBZ,EAAU;AAE3D,MAAIU,IAAa,KACfd,EAAiB,EAAI,GAGnBc,IAAaC,IAAcC,IAAc,KAC3Cb,EAAkB,EAAI;AAAA,IAE1B;AAAA,EACF,GAAG,CAAE,CAAA,GACCc,IAAmBJ,EAAY,MAAM;AACrC,IAACT,EAAU,WAEEQ;EAAA,GAChB,CAACA,CAAgB,CAAC,GAEfM,IAAmBL,EAAY,MAAM;AACzC,IAAAb,EAAiB,EAAK,GACtBG,E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gB;AAAA,cAChB,aAAY;AAAA,cACZ,SAASR;AAAA,cACT,UAAUlB;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cAEN,UAAC,gBAAAuB,EAAAiB,GAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAK1D,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}\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","isDynamicSheet","HomeworkCard","Styled.QueueWrapper","Styled.QueueText","ChevronRightIcon","HwCardListView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AAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAKzD,CAAc;"}
|
@@ -1,73 +1,67 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
onTestReview: k,
|
17
|
-
onNodeReview: P,
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
2
|
+
import { memo as b, useEffect as e, useCallback as j } from "react";
|
3
|
+
import { useJourney as A } from "../../journey/use-journey/use-journey.js";
|
4
|
+
import { useGetHomeworks as D } from "./api/get-homeworks.js";
|
5
|
+
import E from "./hw-card-list-view.js";
|
6
|
+
const F = ({
|
7
|
+
userType: r,
|
8
|
+
studentId: i,
|
9
|
+
stream: o,
|
10
|
+
onTestStart: k,
|
11
|
+
onNodeAttempt: p,
|
12
|
+
onTestPreview: C,
|
13
|
+
onNodeView: H,
|
14
|
+
onTestReview: a,
|
15
|
+
onNodeReview: g,
|
18
16
|
onNodeUnassign: v,
|
19
|
-
homeworkRef:
|
20
|
-
startHomePageJourney:
|
21
|
-
canStartJourney:
|
22
|
-
canStartPuzzleAssignedJourney: p
|
17
|
+
homeworkRef: L,
|
18
|
+
startHomePageJourney: c,
|
19
|
+
canStartJourney: m
|
23
20
|
}) => {
|
24
21
|
const {
|
25
|
-
get:
|
26
|
-
data:
|
27
|
-
isProcessingFailed:
|
28
|
-
isProcessing:
|
22
|
+
get: l,
|
23
|
+
data: x,
|
24
|
+
isProcessingFailed: P,
|
25
|
+
isProcessing: f,
|
29
26
|
isProcessed: w,
|
30
|
-
isStale:
|
31
|
-
} =
|
27
|
+
isStale: t
|
28
|
+
} = D(i), { isJourneyActive: n } = A();
|
32
29
|
e(() => {
|
33
|
-
w &&
|
30
|
+
w && c && !n && m && c({ studentId: i, stream: o, userType: r });
|
34
31
|
}, [
|
32
|
+
m,
|
35
33
|
n,
|
36
|
-
r,
|
37
34
|
w,
|
38
|
-
|
39
|
-
i,
|
35
|
+
c,
|
40
36
|
o,
|
41
|
-
|
37
|
+
i,
|
38
|
+
r
|
42
39
|
]);
|
43
|
-
const s =
|
44
|
-
|
45
|
-
}, [
|
40
|
+
const s = j(() => {
|
41
|
+
l(i, void 0, { stream: o });
|
42
|
+
}, [l, o, i]);
|
46
43
|
return e(() => {
|
47
|
-
!
|
48
|
-
}, [s,
|
44
|
+
!f && t && s();
|
45
|
+
}, [s, f, t]), e(() => {
|
49
46
|
s();
|
50
|
-
}, [s]),
|
51
|
-
|
52
|
-
}, [p, a, r, l]), L ? null : /* @__PURE__ */ C("div", { ref: D, children: /* @__PURE__ */ C(
|
53
|
-
J,
|
47
|
+
}, [s]), P ? null : /* @__PURE__ */ h("div", { ref: L, children: /* @__PURE__ */ h(
|
48
|
+
E,
|
54
49
|
{
|
55
|
-
isHwProcessing:
|
56
|
-
hwDetails:
|
57
|
-
onTestStart:
|
58
|
-
onNodeAttempt:
|
59
|
-
onTestPreview:
|
60
|
-
onNodeView:
|
61
|
-
onTestReview:
|
62
|
-
onNodeReview:
|
50
|
+
isHwProcessing: f,
|
51
|
+
hwDetails: x,
|
52
|
+
onTestStart: k,
|
53
|
+
onNodeAttempt: p,
|
54
|
+
onTestPreview: C,
|
55
|
+
onNodeView: H,
|
56
|
+
onTestReview: a,
|
57
|
+
onNodeReview: g,
|
63
58
|
onNodeUnassign: v,
|
64
|
-
userType:
|
65
|
-
studentId:
|
66
|
-
puzzleHWCardRef: x
|
59
|
+
userType: r,
|
60
|
+
studentId: i
|
67
61
|
}
|
68
62
|
) });
|
69
|
-
},
|
63
|
+
}, u = b(F);
|
70
64
|
export {
|
71
|
-
|
65
|
+
u as default
|
72
66
|
};
|
73
67
|
//# 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
|
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":";;;;;AAyBA,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;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,EAAgBlB,CAAS,GACvB,EAAE,iBAAAmB,MAAoBC;AAE5B,EAAAC,EAAU,MAAM;AACd,IAAIL,KAAeN,KAAwB,CAACS,KAAmBR,KAC7DD,EAAqB,EAAE,WAAAV,GAAW,QAAAC,GAAQ,UAAAF,EAAU,CAAA;AAAA,EACtD,GACC;AAAA,IACDY;AAAA,IACAQ;AAAA,IACAH;AAAA,IACAN;AAAA,IACAT;AAAA,IACAD;AAAA,IACAD;AAAA,EAAA,CACD;AAEK,QAAAuB,IAAiBC,EAAY,MAAM;AACvC,IAAAX,EAAaZ,GAAW,QAAW,EAAE,QAAAC,EAAQ,CAAA;AAAA,EAC5C,GAAA,CAACW,GAAcX,GAAQD,CAAS,CAAC;AAYpC,SAVAqB,EAAU,MAAM;AACV,IAAA,CAACN,KAAgBE,KACJK;EAEhB,GAAA,CAACA,GAAgBP,GAAcE,CAAO,CAAC,GAE1CI,EAAU,MAAM;AACC,IAAAC;EAAA,GACd,CAACA,CAAc,CAAC,GAEfR,IACK,OAIP,gBAAAU,EAAC,OAAI,EAAA,KAAKf,GACR,UAAA,gBAAAe;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAgBV;AAAA,MAChB,WAAAF;AAAA,MACA,aAAAX;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,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEe0B,IAAAC,EAAK7B,CAAU;"}
|
@@ -1,54 +1,48 @@
|
|
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 E } 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: a,
|
6
|
+
canStart: i,
|
7
|
+
homeworkId: e,
|
8
|
+
isHomeWork: _,
|
9
|
+
isStudent: o,
|
10
|
+
milestoneId: n,
|
11
|
+
nodeType: t,
|
12
|
+
studentId: r,
|
13
|
+
userNodeId: s
|
14
14
|
}) => {
|
15
|
-
if (
|
16
|
-
if (
|
17
|
-
return
|
15
|
+
if (o) {
|
16
|
+
if (_)
|
17
|
+
return i || a ? {
|
18
18
|
analyticsLabel: c.HOMEWORK_ATTEMPTED,
|
19
|
-
analyticsProps: { student_id:
|
19
|
+
analyticsProps: { student_id: r, node_type: t, homework_id: e }
|
20
20
|
} : {
|
21
21
|
analyticsLabel: "homework-student-menu",
|
22
|
-
analyticsProps: { student_id:
|
22
|
+
analyticsProps: { student_id: r, node_type: t, homework_id: e }
|
23
23
|
};
|
24
|
-
if (
|
24
|
+
if (i || a)
|
25
25
|
return {
|
26
|
-
analyticsLabel:
|
26
|
+
analyticsLabel: t === E.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: r,
|
29
|
+
node_type: t,
|
30
|
+
user_node_id: s,
|
31
|
+
milestone_id: n,
|
32
|
+
can_start: i,
|
33
|
+
can_resume: a
|
34
34
|
}
|
35
35
|
};
|
36
36
|
}
|
37
|
-
return
|
37
|
+
return _ ? {
|
38
38
|
analyticsLabel: "homework-card-teacher",
|
39
|
-
analyticsProps: { student_id:
|
39
|
+
analyticsProps: { student_id: r, node_type: t }
|
40
40
|
} : {
|
41
41
|
analyticsLabel: "goals-card-teacher",
|
42
|
-
analyticsProps: { student_id:
|
42
|
+
analyticsProps: { student_id: r, node_type: t }
|
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);
|
49
44
|
};
|
50
45
|
export {
|
51
|
-
y as getCardAnalyticProps
|
52
|
-
T as getPuzzleCardData
|
46
|
+
y as getCardAnalyticProps
|
53
47
|
};
|
54
48
|
//# 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';\
|
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":";;;AAkBA,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;"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { useState as c, useEffect as r } from "react";
|
2
|
+
import { getTheme as i } from "../../ui/theme/get-theme.js";
|
3
|
+
const a = () => {
|
4
|
+
const [e, o] = c(() => i().device);
|
5
|
+
r(() => {
|
6
|
+
function t() {
|
7
|
+
const { device: n } = i();
|
8
|
+
o(n);
|
9
|
+
}
|
10
|
+
return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
|
11
|
+
}, []);
|
12
|
+
const s = e === "mobile";
|
13
|
+
return {
|
14
|
+
isMobile: s,
|
15
|
+
isCompact: s || e === "tablet",
|
16
|
+
isDesktop: e === "small-desktop" || e === "desktop" || e === "large-device" || e === "xlarge-device"
|
17
|
+
};
|
18
|
+
}, w = a;
|
19
|
+
export {
|
20
|
+
w as default
|
21
|
+
};
|
22
|
+
//# sourceMappingURL=use-viewport.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-viewport.js","sources":["../../../../src/features/hooks/use-viewport/use-viewport.ts"],"sourcesContent":["import type { IUseViewportReturn } from './use-viewport-types';\n\nimport { useEffect, useState } from 'react';\n\nimport { getTheme } from '../../ui/theme/get-theme';\n\nconst useViewport = (): IUseViewportReturn => {\n const [deviceType, setDeviceType] = useState(() => getTheme().device);\n\n useEffect(() => {\n function handleResize() {\n const { device: newDeviceType } = getTheme();\n\n setDeviceType(newDeviceType);\n }\n\n window.addEventListener('resize', handleResize);\n\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n const isMobile = deviceType === 'mobile';\n const isTablet = deviceType === 'tablet';\n const isSmallDesktop = deviceType === 'small-desktop';\n const isDesktop = deviceType === 'desktop';\n const isLarge = deviceType === 'large-device';\n const isXL = deviceType === 'xlarge-device';\n\n return {\n isMobile: isMobile,\n isCompact: isMobile || isTablet,\n isDesktop: isSmallDesktop || isDesktop || isLarge || isXL,\n };\n};\n\nexport default useViewport;\n"],"names":["useViewport","deviceType","setDeviceType","useState","getTheme","useEffect","handleResize","newDeviceType","isMobile","useViewport$1"],"mappings":";;AAMA,MAAMA,IAAc,MAA0B;AACtC,QAAA,CAACC,GAAYC,CAAa,IAAIC,EAAS,MAAMC,EAAA,EAAW,MAAM;AAEpE,EAAAC,EAAU,MAAM;AACd,aAASC,IAAe;AACtB,YAAM,EAAE,QAAQC,EAAc,IAAIH,EAAS;AAE3C,MAAAF,EAAcK,CAAa;AAAA,IAC7B;AAEO,kBAAA,iBAAiB,UAAUD,CAAY,GAEvC,MAAM,OAAO,oBAAoB,UAAUA,CAAY;AAAA,EAChE,GAAG,CAAE,CAAA;AAEL,QAAME,IAAWP,MAAe;AAOzB,SAAA;AAAA,IACL,UAAAO;AAAA,IACA,WAAWA,KARIP,MAAe;AAAA,IAS9B,WARqBA,MAAe,mBACpBA,MAAe,aACjBA,MAAe,kBAClBA,MAAe;AAAA,EAK2B;AAEzD,GAEAQ,IAAeT;"}
|
@@ -1,19 +1,17 @@
|
|
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
|
4
|
-
import { useTheme as $ } from "styled-components";
|
3
|
+
import { useState as $, useEffect as O, useMemo as p } from "react";
|
5
4
|
import c from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
6
5
|
import R from "../../../ui/nudge/nudge.js";
|
7
|
-
import
|
8
|
-
import { EDeviceType as X } from "../../../ui/theme/constants.js";
|
6
|
+
import { getTheme as a } from "../../../ui/theme/get-theme.js";
|
9
7
|
import { IndicatorType as u } from "../../use-journey/constants.js";
|
10
|
-
import { CoachmarkBody as
|
11
|
-
import { getTooltipXCoordinates as
|
12
|
-
const
|
8
|
+
import { CoachmarkBody as A, ClonedElementWrapper as h } from "./coachmark-styled.js";
|
9
|
+
import { getTooltipXCoordinates as X } from "./coachmark-utils.js";
|
10
|
+
const V = ({
|
13
11
|
coachmark: e,
|
14
12
|
isInsideScrollView: T
|
15
13
|
}) => {
|
16
|
-
const t = e.originalElementToHighlightRef.current,
|
14
|
+
const t = e.originalElementToHighlightRef.current, [C, b] = $(() => {
|
17
15
|
const o = t == null ? void 0 : t.getBoundingClientRect();
|
18
16
|
return {
|
19
17
|
top: ((o == null ? void 0 : o.top) ?? 0) + window.scrollY,
|
@@ -21,32 +19,32 @@ const S = ({
|
|
21
19
|
width: (o == null ? void 0 : o.width) ?? 0,
|
22
20
|
height: (o == null ? void 0 : o.height) ?? 0
|
23
21
|
};
|
24
|
-
}),
|
22
|
+
}), n = L(() => {
|
25
23
|
const o = t == null ? void 0 : t.getBoundingClientRect();
|
26
|
-
o &&
|
24
|
+
o && b({
|
27
25
|
top: o.top + window.scrollY,
|
28
26
|
left: o.left + window.scrollX,
|
29
27
|
width: o.width,
|
30
28
|
height: o.height
|
31
29
|
});
|
32
30
|
}, 100), {
|
33
|
-
top:
|
31
|
+
top: r = 0,
|
34
32
|
left: l = 0,
|
35
|
-
height:
|
36
|
-
width:
|
37
|
-
} = T ?
|
38
|
-
O(() => (window.addEventListener("resize",
|
39
|
-
window.removeEventListener("resize",
|
40
|
-
}), [
|
41
|
-
const
|
33
|
+
height: I = 0,
|
34
|
+
width: P = 0
|
35
|
+
} = T ? C : (t == null ? void 0 : t.getBoundingClientRect()) ?? {};
|
36
|
+
O(() => (window.addEventListener("resize", n), window.addEventListener("scroll", n), () => {
|
37
|
+
window.removeEventListener("resize", n), window.removeEventListener("scroll", n);
|
38
|
+
}), [n, t]);
|
39
|
+
const { zIndex: v, device: y } = a(), w = y === "mobile", d = v.JOURNEY_OVERLAY, s = p(() => t ? window.getComputedStyle(t).position === "absolute" : !1, [t]), f = p(() => {
|
42
40
|
const o = e.indicator;
|
43
41
|
return {
|
44
|
-
width:
|
42
|
+
width: w ? 246 : 264,
|
45
43
|
// Can be over ridden
|
46
|
-
tooltipXCoOrdinates:
|
44
|
+
tooltipXCoOrdinates: X(o),
|
47
45
|
zIndex: d + 1,
|
48
46
|
...o,
|
49
|
-
tooltipItem: /* @__PURE__ */ i(
|
47
|
+
tooltipItem: /* @__PURE__ */ i(A, { children: o.tooltipItem }),
|
50
48
|
alwaysVisible: !0,
|
51
49
|
renderAs: "primary",
|
52
50
|
// Deprecate this
|
@@ -56,31 +54,31 @@ const S = ({
|
|
56
54
|
type: u.TOOLTIP,
|
57
55
|
isAnimated: !0
|
58
56
|
};
|
59
|
-
}, [d, e.indicator,
|
57
|
+
}, [d, e.indicator, w]), E = p(() => {
|
60
58
|
const o = e.indicator;
|
61
59
|
return {
|
62
60
|
...o,
|
63
61
|
nudgePointerX: l + (o.nudgePointerX ?? 0),
|
64
|
-
nudgePointerY:
|
62
|
+
nudgePointerY: r + (o.nudgePointerY ?? 0)
|
65
63
|
};
|
66
|
-
}, [e.indicator, l,
|
64
|
+
}, [e.indicator, l, r]);
|
67
65
|
return !t || !e.isActive ? null : e.type === u.TOOLTIP ? s ? /* @__PURE__ */ g(m, { children: [
|
68
66
|
e.elementToHighlight,
|
69
|
-
/* @__PURE__ */ i(h, { $position: "absolute", $top:
|
70
|
-
] }) : /* @__PURE__ */ i(h, { $position: "absolute", $top:
|
67
|
+
/* @__PURE__ */ i(h, { $position: "absolute", $top: r, $left: l, children: /* @__PURE__ */ i(c, { ...f, children: /* @__PURE__ */ i("div", { style: { height: I, width: P } }) }) })
|
68
|
+
] }) : /* @__PURE__ */ i(h, { $position: "absolute", $top: r, $left: l, children: /* @__PURE__ */ i(c, { ...f, children: e.elementToHighlight }) }) : e.type === u.NUDGE ? /* @__PURE__ */ g(m, { children: [
|
71
69
|
/* @__PURE__ */ i(
|
72
70
|
h,
|
73
71
|
{
|
74
|
-
$top: s ? 0 :
|
72
|
+
$top: s ? 0 : r,
|
75
73
|
$left: s ? 0 : l,
|
76
74
|
$position: s ? "relative" : "absolute",
|
77
75
|
children: e.elementToHighlight
|
78
76
|
}
|
79
77
|
),
|
80
|
-
/* @__PURE__ */ i(
|
78
|
+
/* @__PURE__ */ i(R, { zIndex: d + 1, ...E })
|
81
79
|
] }) : null;
|
82
80
|
};
|
83
81
|
export {
|
84
|
-
|
82
|
+
V as Coachmark
|
85
83
|
};
|
86
84
|
//# sourceMappingURL=coachmark.js.map
|