@cuemath/leap 3.0.10 → 3.0.11-akm-2
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/features/chapters/chapters-list/chapter-item/chapter-item-styled.js +36 -27
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +43 -31
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapters-list.js +16 -15
- package/dist/features/chapters/chapters-list/chapters-list.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +2 -2
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +30 -30
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details.js +35 -35
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +44 -44
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js +74 -74
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js.map +1 -1
- package/dist/features/homework/homework-card.js +146 -131
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/journey/hooks/use-chapter-journey.js +28 -28
- package/dist/features/journey/hooks/use-chapter-journey.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +40 -38
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js +53 -50
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js +64 -62
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +44 -42
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-list/resources-list.js +39 -37
- package/dist/features/milestone/milestone-resources/resources-list/resources-list.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js +38 -31
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js.map +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy.js +40 -39
- package/dist/features/post-game-stats/accuracy/accuracy.js.map +1 -1
- package/dist/features/post-game-stats/clock/clock.js +45 -45
- package/dist/features/post-game-stats/clock/clock.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/package.json +1 -1
@@ -1,118 +1,118 @@
|
|
1
|
-
import { useCallback as
|
1
|
+
import { useCallback as a, useRef as C, useEffect as T } from "react";
|
2
2
|
import { CircleSoundKeyMapper as A, SWIPE_SOUND_ORDER as E } from "./constants.js";
|
3
|
-
import { CircleSoundKey as
|
4
|
-
let
|
5
|
-
const
|
6
|
-
[
|
7
|
-
[
|
8
|
-
[
|
9
|
-
[
|
10
|
-
[
|
11
|
-
[
|
12
|
-
[
|
13
|
-
[
|
14
|
-
[
|
15
|
-
[
|
16
|
-
[
|
17
|
-
[
|
18
|
-
[
|
19
|
-
[
|
20
|
-
[
|
21
|
-
[
|
22
|
-
[
|
23
|
-
[
|
24
|
-
[
|
25
|
-
[
|
26
|
-
[
|
27
|
-
[
|
28
|
-
[
|
29
|
-
},
|
30
|
-
const
|
31
|
-
if (!
|
32
|
-
const l = new Audio(A[
|
33
|
-
|
3
|
+
import { CircleSoundKey as e } from "./use-circle-sounds-enums.js";
|
4
|
+
let I = 0;
|
5
|
+
const r = {
|
6
|
+
[e.BACKGROUND]: null,
|
7
|
+
[e.BACKGROUND_RUSHHOUR]: null,
|
8
|
+
[e.TUTORIAL]: null,
|
9
|
+
[e.SWIPE_01]: null,
|
10
|
+
[e.SWIPE_02]: null,
|
11
|
+
[e.SWIPE_03]: null,
|
12
|
+
[e.SWIPE_04]: null,
|
13
|
+
[e.SWIPE_DOWN]: null,
|
14
|
+
[e.TOGGLE]: null,
|
15
|
+
[e.POINTS_AWARDED]: null,
|
16
|
+
[e.POINTS_ADDED]: null,
|
17
|
+
[e.GAME_CARD_CLICK]: null,
|
18
|
+
[e.CLOCK_IN]: null,
|
19
|
+
[e.CLOCK_OUT]: null,
|
20
|
+
[e.ACCURACY_IN]: null,
|
21
|
+
[e.ACCURACY_OUT]: null,
|
22
|
+
[e.STREAK_IN]: null,
|
23
|
+
[e.STREAK_OUT]: null,
|
24
|
+
[e.ACCURACY_INTRO]: null,
|
25
|
+
[e.ACCURACY_TARGET]: null,
|
26
|
+
[e.TIME_INTRO]: null,
|
27
|
+
[e.TIME_TARGET]: null,
|
28
|
+
[e.METER_FILL]: null
|
29
|
+
}, f = {}, D = () => {
|
30
|
+
const c = a((n) => {
|
31
|
+
if (!r[n]) {
|
32
|
+
const l = new Audio(A[n]);
|
33
|
+
r[n] = l;
|
34
34
|
}
|
35
|
-
}, []),
|
36
|
-
document.visibilityState === "hidden" ? Object.keys(
|
37
|
-
const l =
|
38
|
-
l && !l.paused && (l.pause(),
|
39
|
-
}) : document.visibilityState === "visible" && (
|
40
|
-
const l =
|
35
|
+
}, []), v = C(/* @__PURE__ */ new Set()), o = C({}), p = a(() => {
|
36
|
+
document.visibilityState === "hidden" ? Object.keys(r).forEach((n) => {
|
37
|
+
const l = r[n];
|
38
|
+
l && !l.paused && (l.pause(), v.current.add(n));
|
39
|
+
}) : document.visibilityState === "visible" && (v.current.forEach((n) => {
|
40
|
+
const l = r[n];
|
41
41
|
l == null || l.play();
|
42
|
-
}),
|
42
|
+
}), v.current.clear());
|
43
43
|
}, []);
|
44
44
|
T(() => {
|
45
|
-
document.addEventListener("visibilitychange",
|
46
|
-
const
|
45
|
+
document.addEventListener("visibilitychange", p);
|
46
|
+
const n = o.current;
|
47
47
|
return () => {
|
48
|
-
document.removeEventListener("visibilitychange",
|
49
|
-
for (const l of Object.values(
|
48
|
+
document.removeEventListener("visibilitychange", p);
|
49
|
+
for (const l of Object.values(n))
|
50
50
|
l != null && clearInterval(l);
|
51
51
|
};
|
52
|
-
}, [
|
53
|
-
const S =
|
52
|
+
}, [p]);
|
53
|
+
const S = a(() => {
|
54
54
|
var l;
|
55
55
|
E.forEach((u) => {
|
56
|
-
|
56
|
+
c(u);
|
57
57
|
});
|
58
|
-
const
|
59
|
-
|
60
|
-
}, [
|
58
|
+
const n = E[I] || e.SWIPE_01;
|
59
|
+
I < E.length - 1 ? I++ : I = 0, (l = r[n]) == null || l.play();
|
60
|
+
}, [c]), m = a(() => {
|
61
61
|
var l;
|
62
|
-
return
|
63
|
-
}, [
|
64
|
-
(
|
65
|
-
|
66
|
-
const t =
|
62
|
+
return c(e.TOGGLE), (l = r[e.TOGGLE]) == null ? void 0 : l.play();
|
63
|
+
}, [c]), _ = a(
|
64
|
+
(n, l = !0, u = !1) => {
|
65
|
+
c(n);
|
66
|
+
const t = r[n];
|
67
67
|
if (!t) return;
|
68
|
-
if (!t.paused && t.currentTime > 0 && !t.ended)
|
68
|
+
if (o.current[n] && clearInterval(o.current[n]), !t.paused && t.currentTime > 0 && !t.ended)
|
69
69
|
return t;
|
70
70
|
if (t.loop = u, l) {
|
71
71
|
t.volume = 1;
|
72
|
-
const
|
73
|
-
|
72
|
+
const d = t.play();
|
73
|
+
f[n] = d;
|
74
74
|
return;
|
75
75
|
}
|
76
76
|
t.volume = 0;
|
77
|
-
const
|
78
|
-
|
77
|
+
const s = t.play();
|
78
|
+
f[n] = s;
|
79
79
|
const i = setInterval(() => {
|
80
80
|
if (!t) {
|
81
81
|
clearInterval(i);
|
82
82
|
return;
|
83
83
|
}
|
84
|
-
const
|
85
|
-
|
84
|
+
const d = t.volume || 0;
|
85
|
+
d < 1 ? t.volume = Math.min(d + 0.1, 1) : clearInterval(i);
|
86
86
|
}, 100);
|
87
|
-
return
|
87
|
+
return o.current[n] = i, t;
|
88
88
|
},
|
89
|
-
[
|
90
|
-
), R =
|
89
|
+
[c]
|
90
|
+
), R = a((n, l = !0) => {
|
91
91
|
var t;
|
92
|
-
const u =
|
93
|
-
|
92
|
+
const u = r[n];
|
93
|
+
f[n] !== void 0 && ((t = f[n]) == null || t.then(() => {
|
94
94
|
if (!u) return;
|
95
|
-
if (l) {
|
95
|
+
if (o.current[n] && clearInterval(o.current[n]), l) {
|
96
96
|
u.pause();
|
97
97
|
return;
|
98
98
|
}
|
99
|
-
const
|
99
|
+
const s = setInterval(() => {
|
100
100
|
if (!u) {
|
101
|
-
clearInterval(
|
101
|
+
clearInterval(s);
|
102
102
|
return;
|
103
103
|
}
|
104
104
|
const i = u.volume || 0;
|
105
|
-
i - 0.1 <= 0 ? (u.volume = 0, u.pause(), clearInterval(
|
105
|
+
i - 0.1 <= 0 ? (u.volume = 0, u.pause(), clearInterval(s)) : u.volume = i - 0.1;
|
106
106
|
}, 100);
|
107
|
-
|
108
|
-
}).catch((
|
109
|
-
console.log("sound not playing",
|
107
|
+
o.current[n] = s;
|
108
|
+
}).catch((s) => {
|
109
|
+
console.log("sound not playing", s);
|
110
110
|
}));
|
111
111
|
}, []);
|
112
112
|
return { playSwipSound: S, play: _, stop: R, playButtonSound: m };
|
113
113
|
};
|
114
114
|
export {
|
115
|
-
|
115
|
+
r as soundMapper,
|
116
116
|
D as useCircleSounds
|
117
117
|
};
|
118
118
|
//# sourceMappingURL=use-circle-sounds.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-circle-sounds.js","sources":["../../../../../src/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.ts"],"sourcesContent":["import type { TimeoutMap } from './use-circle-sound-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport { CircleSoundKeyMapper, SWIPE_SOUND_ORDER } from './constants';\nimport { CircleSoundKey } from './use-circle-sounds-enums';\n\nlet swipeSoundIndex = 0;\n\nexport const soundMapper: Record<keyof typeof CircleSoundKeyMapper, null | HTMLAudioElement> = {\n [CircleSoundKey.BACKGROUND]: null,\n [CircleSoundKey.BACKGROUND_RUSHHOUR]: null,\n [CircleSoundKey.TUTORIAL]: null,\n [CircleSoundKey.SWIPE_01]: null,\n [CircleSoundKey.SWIPE_02]: null,\n [CircleSoundKey.SWIPE_03]: null,\n [CircleSoundKey.SWIPE_04]: null,\n [CircleSoundKey.SWIPE_DOWN]: null,\n [CircleSoundKey.TOGGLE]: null,\n [CircleSoundKey.POINTS_AWARDED]: null,\n [CircleSoundKey.POINTS_ADDED]: null,\n [CircleSoundKey.GAME_CARD_CLICK]: null,\n [CircleSoundKey.CLOCK_IN]: null,\n [CircleSoundKey.CLOCK_OUT]: null,\n [CircleSoundKey.ACCURACY_IN]: null,\n [CircleSoundKey.ACCURACY_OUT]: null,\n [CircleSoundKey.STREAK_IN]: null,\n [CircleSoundKey.STREAK_OUT]: null,\n [CircleSoundKey.ACCURACY_INTRO]: null,\n [CircleSoundKey.ACCURACY_TARGET]: null,\n [CircleSoundKey.TIME_INTRO]: null,\n [CircleSoundKey.TIME_TARGET]: null,\n [CircleSoundKey.METER_FILL]: null,\n};\n\nconst soundInstancePromise: Partial<Record<keyof typeof CircleSoundKeyMapper, Promise<void>>> = {};\n\nexport const useCircleSounds = () => {\n const loadSound = useCallback((key: CircleSoundKey) => {\n if (!soundMapper[key]) {\n const loadedSound = new Audio(CircleSoundKeyMapper[key]);\n\n soundMapper[key] = loadedSound;\n }\n }, []);\n\n const pausedSoundsRef = useRef<Set<CircleSoundKey>>(new Set());\n const timeoutRefs = useRef<TimeoutMap>({});\n\n const handleVisibilityChange = useCallback(() => {\n if (document.visibilityState === 'hidden') {\n (Object.keys(soundMapper) as CircleSoundKey[]).forEach(key => {\n const sound = soundMapper[key];\n\n if (sound && !sound.paused) {\n sound.pause();\n pausedSoundsRef.current.add(key);\n }\n });\n } else if (document.visibilityState === 'visible') {\n pausedSoundsRef.current.forEach(key => {\n const sound = soundMapper[key];\n\n sound?.play();\n });\n pausedSoundsRef.current.clear();\n }\n }, []);\n\n useEffect(() => {\n document.addEventListener('visibilitychange', handleVisibilityChange);\n const timeouts = timeoutRefs.current;\n\n return () => {\n document.removeEventListener('visibilitychange', handleVisibilityChange);\n for (const id of Object.values(timeouts)) {\n if (id != null) clearInterval(id);\n }\n };\n }, [handleVisibilityChange]);\n\n const playSwipSound = useCallback(() => {\n SWIPE_SOUND_ORDER.forEach(key => {\n loadSound(key);\n });\n\n const key = SWIPE_SOUND_ORDER[swipeSoundIndex] || CircleSoundKey.SWIPE_01;\n\n if (swipeSoundIndex < SWIPE_SOUND_ORDER.length - 1) {\n swipeSoundIndex++;\n } else {\n swipeSoundIndex = 0;\n }\n soundMapper[key]?.play();\n }, [loadSound]);\n\n const playButtonSound = useCallback(() => {\n loadSound(CircleSoundKey.TOGGLE);\n const sound = soundMapper[CircleSoundKey.TOGGLE]?.play();\n\n return sound;\n }, [loadSound]);\n\n const play = useCallback(\n (key: CircleSoundKey, immediately: boolean = true, loop = false) => {\n loadSound(key);\n const soundInstance = soundMapper[key];\n\n if (!soundInstance) return;\n\n if (!soundInstance.paused && soundInstance.currentTime > 0 && !soundInstance.ended) {\n return soundInstance;\n }\n\n soundInstance.loop = loop;\n if (immediately) {\n soundInstance.volume = 1;\n const promise = soundInstance.play();\n\n soundInstancePromise[key] = promise;\n\n return;\n }\n\n soundInstance.volume = 0;\n const promise = soundInstance.play();\n\n soundInstancePromise[key] = promise;\n\n const intervalId = setInterval(() => {\n if (!soundInstance) {\n clearInterval(intervalId);\n\n return;\n }\n\n const vol = soundInstance.volume || 0;\n\n if (vol < 1) {\n soundInstance.volume = Math.min(vol + 0.1, 1);\n } else {\n clearInterval(intervalId);\n }\n }, 100);\n\n timeoutRefs.current[key] = intervalId;\n\n return soundInstance;\n },\n [loadSound],\n );\n\n const stop = useCallback((key: CircleSoundKey, immediately: boolean = true) => {\n const soundInstance = soundMapper[key];\n\n if (soundInstancePromise[key] !== undefined) {\n soundInstancePromise[key]\n ?.then(() => {\n if (!soundInstance) return;\n\n if (immediately) {\n soundInstance.pause();\n\n return;\n }\n\n const intervalId = setInterval(() => {\n if (!soundInstance) {\n clearInterval(intervalId);\n\n return;\n }\n\n const vol = soundInstance.volume || 0;\n\n if (vol - 0.1 <= 0) {\n soundInstance.volume = 0;\n soundInstance.pause();\n clearInterval(intervalId);\n } else {\n soundInstance.volume = vol - 0.1;\n }\n }, 100);\n\n timeoutRefs.current[key] = intervalId;\n })\n .catch(err => {\n // eslint-disable-next-line no-console\n console.log('sound not playing', err);\n });\n }\n }, []);\n\n return { playSwipSound, play, stop, playButtonSound };\n};\n"],"names":["swipeSoundIndex","soundMapper","CircleSoundKey","soundInstancePromise","useCircleSounds","loadSound","useCallback","key","loadedSound","CircleSoundKeyMapper","pausedSoundsRef","useRef","timeoutRefs","handleVisibilityChange","sound","useEffect","timeouts","id","playSwipSound","SWIPE_SOUND_ORDER","_a","playButtonSound","play","immediately","loop","soundInstance","promise","intervalId","vol","stop","err"],"mappings":";;;AAOA,IAAIA,IAAkB;AAEf,MAAMC,IAAkF;AAAA,EAC7F,CAACC,EAAe,UAAU,GAAG;AAAA,EAC7B,CAACA,EAAe,mBAAmB,GAAG;AAAA,EACtC,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,UAAU,GAAG;AAAA,EAC7B,CAACA,EAAe,MAAM,GAAG;AAAA,EACzB,CAACA,EAAe,cAAc,GAAG;AAAA,EACjC,CAACA,EAAe,YAAY,GAAG;AAAA,EAC/B,CAACA,EA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BAAiB,oBAAoBF,CAAsB;AACpE,UAAMG,IAAWJ,EAAY;AAE7B,WAAO,MAAM;AACF,eAAA,oBAAoB,oBAAoBC,CAAsB;AACvE,iBAAWI,KAAM,OAAO,OAAOD,CAAQ;AACjC,QAAAC,KAAM,QAAM,cAAcA,CAAE;AAAA,IAClC;AAAA,EACF,GACC,CAACJ,CAAsB,CAAC;AAErB,QAAAK,IAAgBZ,EAAY,MAAM;;AACpB,IAAAa,EAAA,QAAQ,CAAAZ,MAAO;AAC/B,MAAAF,EAAUE,CAAG;AAAA,IAAA,CACd;AAED,UAAMA,IAAMY,EAAkBnB,CAAe,KAAKE,EAAe;AAE7D,IAAAF,IAAkBmB,EAAkB,SAAS,IAC/CnB,MAEkBA,IAAA,IAERoB,IAAAnB,EAAAM,CAAG,MAAH,QAAAa,EAAM;AAAA,EAAK,GACtB,CAACf,CAAS,CAAC,GAERgB,IAAkBf,EAAY,MAAM;;AACxC,WAAAD,EAAUH,EAAe,MAAM,IACjBkB,IAAAnB,EAAYC,EAAe,MAAM,MAAjC,gBAAAkB,EAAoC;AAAA,EAE3C,GACN,CAACf,CAAS,CAAC,GAERiB,IAAOhB;AAAA,IACX,CAACC,GAAqBgB,IAAuB,IAAMC,IAAO,OAAU;AAClE,MAAAnB,EAAUE,CAAG;AACP,YAAAkB,IAAgBxB,EAAYM,CAAG;AAErC,UAAI,CAACkB,EAAe;
|
1
|
+
{"version":3,"file":"use-circle-sounds.js","sources":["../../../../../src/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.ts"],"sourcesContent":["import type { TimeoutMap } from './use-circle-sound-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport { CircleSoundKeyMapper, SWIPE_SOUND_ORDER } from './constants';\nimport { CircleSoundKey } from './use-circle-sounds-enums';\n\nlet swipeSoundIndex = 0;\n\nexport const soundMapper: Record<keyof typeof CircleSoundKeyMapper, null | HTMLAudioElement> = {\n [CircleSoundKey.BACKGROUND]: null,\n [CircleSoundKey.BACKGROUND_RUSHHOUR]: null,\n [CircleSoundKey.TUTORIAL]: null,\n [CircleSoundKey.SWIPE_01]: null,\n [CircleSoundKey.SWIPE_02]: null,\n [CircleSoundKey.SWIPE_03]: null,\n [CircleSoundKey.SWIPE_04]: null,\n [CircleSoundKey.SWIPE_DOWN]: null,\n [CircleSoundKey.TOGGLE]: null,\n [CircleSoundKey.POINTS_AWARDED]: null,\n [CircleSoundKey.POINTS_ADDED]: null,\n [CircleSoundKey.GAME_CARD_CLICK]: null,\n [CircleSoundKey.CLOCK_IN]: null,\n [CircleSoundKey.CLOCK_OUT]: null,\n [CircleSoundKey.ACCURACY_IN]: null,\n [CircleSoundKey.ACCURACY_OUT]: null,\n [CircleSoundKey.STREAK_IN]: null,\n [CircleSoundKey.STREAK_OUT]: null,\n [CircleSoundKey.ACCURACY_INTRO]: null,\n [CircleSoundKey.ACCURACY_TARGET]: null,\n [CircleSoundKey.TIME_INTRO]: null,\n [CircleSoundKey.TIME_TARGET]: null,\n [CircleSoundKey.METER_FILL]: null,\n};\n\nconst soundInstancePromise: Partial<Record<keyof typeof CircleSoundKeyMapper, Promise<void>>> = {};\n\nexport const useCircleSounds = () => {\n const loadSound = useCallback((key: CircleSoundKey) => {\n if (!soundMapper[key]) {\n const loadedSound = new Audio(CircleSoundKeyMapper[key]);\n\n soundMapper[key] = loadedSound;\n }\n }, []);\n\n const pausedSoundsRef = useRef<Set<CircleSoundKey>>(new Set());\n const timeoutRefs = useRef<TimeoutMap>({});\n\n const handleVisibilityChange = useCallback(() => {\n if (document.visibilityState === 'hidden') {\n (Object.keys(soundMapper) as CircleSoundKey[]).forEach(key => {\n const sound = soundMapper[key];\n\n if (sound && !sound.paused) {\n sound.pause();\n pausedSoundsRef.current.add(key);\n }\n });\n } else if (document.visibilityState === 'visible') {\n pausedSoundsRef.current.forEach(key => {\n const sound = soundMapper[key];\n\n sound?.play();\n });\n pausedSoundsRef.current.clear();\n }\n }, []);\n\n useEffect(() => {\n document.addEventListener('visibilitychange', handleVisibilityChange);\n const timeouts = timeoutRefs.current;\n\n return () => {\n document.removeEventListener('visibilitychange', handleVisibilityChange);\n for (const id of Object.values(timeouts)) {\n if (id != null) clearInterval(id);\n }\n };\n }, [handleVisibilityChange]);\n\n const playSwipSound = useCallback(() => {\n SWIPE_SOUND_ORDER.forEach(key => {\n loadSound(key);\n });\n\n const key = SWIPE_SOUND_ORDER[swipeSoundIndex] || CircleSoundKey.SWIPE_01;\n\n if (swipeSoundIndex < SWIPE_SOUND_ORDER.length - 1) {\n swipeSoundIndex++;\n } else {\n swipeSoundIndex = 0;\n }\n soundMapper[key]?.play();\n }, [loadSound]);\n\n const playButtonSound = useCallback(() => {\n loadSound(CircleSoundKey.TOGGLE);\n const sound = soundMapper[CircleSoundKey.TOGGLE]?.play();\n\n return sound;\n }, [loadSound]);\n\n const play = useCallback(\n (key: CircleSoundKey, immediately: boolean = true, loop = false) => {\n loadSound(key);\n const soundInstance = soundMapper[key];\n\n if (!soundInstance) return;\n\n if (timeoutRefs.current[key]) {\n clearInterval(timeoutRefs.current[key]);\n }\n\n if (!soundInstance.paused && soundInstance.currentTime > 0 && !soundInstance.ended) {\n return soundInstance;\n }\n\n soundInstance.loop = loop;\n if (immediately) {\n soundInstance.volume = 1;\n const promise = soundInstance.play();\n\n soundInstancePromise[key] = promise;\n\n return;\n }\n\n soundInstance.volume = 0;\n const promise = soundInstance.play();\n\n soundInstancePromise[key] = promise;\n\n const intervalId = setInterval(() => {\n if (!soundInstance) {\n clearInterval(intervalId);\n\n return;\n }\n\n const vol = soundInstance.volume || 0;\n\n if (vol < 1) {\n soundInstance.volume = Math.min(vol + 0.1, 1);\n } else {\n clearInterval(intervalId);\n }\n }, 100);\n\n timeoutRefs.current[key] = intervalId;\n\n return soundInstance;\n },\n [loadSound],\n );\n\n const stop = useCallback((key: CircleSoundKey, immediately: boolean = true) => {\n const soundInstance = soundMapper[key];\n\n if (soundInstancePromise[key] !== undefined) {\n soundInstancePromise[key]\n ?.then(() => {\n if (!soundInstance) return;\n\n if (timeoutRefs.current[key]) {\n clearInterval(timeoutRefs.current[key]);\n }\n\n if (immediately) {\n soundInstance.pause();\n\n return;\n }\n\n const intervalId = setInterval(() => {\n if (!soundInstance) {\n clearInterval(intervalId);\n\n return;\n }\n\n const vol = soundInstance.volume || 0;\n\n if (vol - 0.1 <= 0) {\n soundInstance.volume = 0;\n soundInstance.pause();\n clearInterval(intervalId);\n } else {\n soundInstance.volume = vol - 0.1;\n }\n }, 100);\n\n timeoutRefs.current[key] = intervalId;\n })\n .catch(err => {\n // eslint-disable-next-line no-console\n console.log('sound not playing', err);\n });\n }\n }, []);\n\n return { playSwipSound, play, stop, playButtonSound };\n};\n"],"names":["swipeSoundIndex","soundMapper","CircleSoundKey","soundInstancePromise","useCircleSounds","loadSound","useCallback","key","loadedSound","CircleSoundKeyMapper","pausedSoundsRef","useRef","timeoutRefs","handleVisibilityChange","sound","useEffect","timeouts","id","playSwipSound","SWIPE_SOUND_ORDER","_a","playButtonSound","play","immediately","loop","soundInstance","promise","intervalId","vol","stop","err"],"mappings":";;;AAOA,IAAIA,IAAkB;AAEf,MAAMC,IAAkF;AAAA,EAC7F,CAACC,EAAe,UAAU,GAAG;AAAA,EAC7B,CAACA,EAAe,mBAAmB,GAAG;AAAA,EACtC,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,UAAU,GAAG;AAAA,EAC7B,CAACA,EAAe,MAAM,GAAG;AAAA,EACzB,CAACA,EAAe,cAAc,GAAG;AAAA,EACjC,CAACA,EAAe,YAAY,GAAG;AAAA,EAC/B,CAACA,EAAe,eAAe,GAAG;AAAA,EAClC,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,SAAS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as D, useRef as M, useCallback as b, useMemo as N } from "react";
|
3
|
+
import X from "../../assets/line-icons/icons/eye2.js";
|
4
|
+
import ee from "../../assets/line-icons/icons/home2.js";
|
5
|
+
import re from "../../assets/line-icons/icons/more-vertical.js";
|
5
6
|
import H from "../../assets/line-icons/icons/redo.js";
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import { CardContainer as
|
13
|
-
import { getCardAnalyticProps as
|
14
|
-
const
|
7
|
+
import I from "../ui/arrow-tooltip/arrow-tooltip.js";
|
8
|
+
import te from "../ui/buttons/clickable/clickable.js";
|
9
|
+
import j from "../ui/hooks/use-context-menu-click-handler.js";
|
10
|
+
import ie from "../ui/layout/flex-view.js";
|
11
|
+
import F from "./card-menu-options.js";
|
12
|
+
import ne from "./homework-card-view.js";
|
13
|
+
import { CardContainer as ce, MenuWrapper as oe, CardKebabMenuWrapper as ae, BlurContainer as se, BlurFlexView as le, StyledMinus2Icon as ue } from "./styles.js";
|
14
|
+
import { getCardAnalyticProps as he } from "./utils.js";
|
15
|
+
const de = ({
|
15
16
|
// callbacks
|
16
17
|
nodeData: e,
|
17
|
-
onNodeAttempt:
|
18
|
-
onNodeReattempt:
|
18
|
+
onNodeAttempt: C,
|
19
|
+
onNodeReattempt: h,
|
19
20
|
onNodeReview: n,
|
20
|
-
onNodeUnassign:
|
21
|
-
onNodeView:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
onNodeUnassign: d,
|
22
|
+
onNodeView: k,
|
23
|
+
onNodeAssignAsHomework: m,
|
24
|
+
header: L,
|
25
|
+
isInQueue: v,
|
26
|
+
renderAs: P,
|
27
|
+
shouldOpenOnRight: B,
|
28
|
+
studentId: g,
|
29
|
+
subHeader: z,
|
28
30
|
userMilestoneId: t,
|
29
|
-
userType:
|
31
|
+
userType: R
|
30
32
|
}) => {
|
31
|
-
const i =
|
32
|
-
node_type:
|
33
|
-
state:
|
34
|
-
permissions:
|
35
|
-
user_node_id:
|
36
|
-
user_milestone_id:
|
37
|
-
homework_id:
|
38
|
-
} = e, y =
|
39
|
-
can_start:
|
40
|
-
can_resume:
|
41
|
-
can_review:
|
42
|
-
can_unassign:
|
43
|
-
can_reset:
|
44
|
-
|
45
|
-
|
33
|
+
const i = P === "homework", {
|
34
|
+
node_type: _,
|
35
|
+
state: K,
|
36
|
+
permissions: Y,
|
37
|
+
user_node_id: c,
|
38
|
+
user_milestone_id: l,
|
39
|
+
homework_id: o
|
40
|
+
} = e, y = M(null), $ = M(null), { menuVisible: V, onMenuClick: q } = j(y), { menuVisible: G, onMenuClick: S } = j($), {
|
41
|
+
can_start: f,
|
42
|
+
can_resume: p,
|
43
|
+
can_review: a,
|
44
|
+
can_unassign: J,
|
45
|
+
can_reset: O,
|
46
|
+
can_assign_as_homework: Z
|
47
|
+
} = Y, u = R === "STUDENT", w = b(() => {
|
48
|
+
if (a) {
|
46
49
|
if (typeof n != "function")
|
47
50
|
throw new Error("onReview must be a function");
|
48
|
-
if (!
|
51
|
+
if (!c)
|
49
52
|
throw new Error("user node id must be present to review the sheet");
|
50
53
|
n(e, t);
|
51
54
|
return;
|
52
55
|
}
|
53
|
-
}, [
|
54
|
-
if (
|
55
|
-
if (typeof
|
56
|
+
}, [a, n, c, e, t]), Q = b(() => {
|
57
|
+
if (f || p) {
|
58
|
+
if (typeof C != "function")
|
56
59
|
throw new Error("onNodeAttempt must be a function");
|
57
|
-
|
60
|
+
C(e, o);
|
58
61
|
return;
|
59
62
|
}
|
60
63
|
if (!i) {
|
61
|
-
|
64
|
+
S();
|
62
65
|
return;
|
63
66
|
}
|
64
|
-
|
67
|
+
w();
|
65
68
|
}, [
|
66
|
-
h,
|
67
69
|
f,
|
68
|
-
i,
|
69
70
|
p,
|
70
|
-
|
71
|
+
i,
|
72
|
+
w,
|
73
|
+
C,
|
71
74
|
e,
|
72
|
-
|
73
|
-
|
74
|
-
]),
|
75
|
-
if (
|
75
|
+
o,
|
76
|
+
S
|
77
|
+
]), E = b(() => {
|
78
|
+
if (a) {
|
76
79
|
if (typeof n != "function")
|
77
80
|
throw new Error("onNodeReview must be a function");
|
78
|
-
if (!
|
81
|
+
if (!c)
|
79
82
|
throw new Error("user node id must be present to review the sheet");
|
80
|
-
n(e, t ||
|
83
|
+
n(e, t || l, o);
|
81
84
|
return;
|
82
85
|
}
|
83
|
-
if (typeof
|
86
|
+
if (typeof k != "function")
|
84
87
|
throw new Error("onNodeView must be a function");
|
85
|
-
|
88
|
+
k(e, t || l);
|
86
89
|
}, [
|
87
|
-
|
88
|
-
|
90
|
+
a,
|
91
|
+
k,
|
89
92
|
e,
|
90
93
|
t,
|
91
|
-
|
94
|
+
l,
|
92
95
|
n,
|
93
|
-
|
94
|
-
|
95
|
-
]),
|
96
|
-
(
|
97
|
-
switch (
|
96
|
+
c,
|
97
|
+
o
|
98
|
+
]), s = b(
|
99
|
+
(W) => {
|
100
|
+
switch (W) {
|
98
101
|
case "teacher-card-view":
|
99
|
-
|
102
|
+
E();
|
100
103
|
return;
|
101
104
|
case "student-card-view":
|
102
|
-
|
105
|
+
w();
|
103
106
|
return;
|
104
107
|
case "teacher-card-unassign":
|
105
|
-
|
108
|
+
d == null || d(e, t);
|
106
109
|
return;
|
107
110
|
case "student-card-reattempt":
|
108
111
|
case "teacher-card-redo":
|
109
|
-
|
112
|
+
h == null || h(e, t);
|
113
|
+
return;
|
114
|
+
case "teacher-card-assign-as-hw":
|
115
|
+
m == null || m(e, t);
|
110
116
|
return;
|
111
117
|
default:
|
112
|
-
throw new Error(`No callback function for ${
|
118
|
+
throw new Error(`No callback function for ${W}`);
|
113
119
|
}
|
114
120
|
},
|
115
121
|
[
|
116
122
|
e,
|
117
|
-
d,
|
118
123
|
m,
|
119
|
-
|
120
|
-
|
124
|
+
h,
|
125
|
+
d,
|
126
|
+
w,
|
127
|
+
E,
|
121
128
|
t
|
122
129
|
]
|
123
|
-
),
|
130
|
+
), A = [
|
124
131
|
{
|
125
132
|
id: "teacher-card-view",
|
126
|
-
label:
|
127
|
-
icon:
|
133
|
+
label: a ? "Review" : "View",
|
134
|
+
icon: X,
|
128
135
|
disabled: !1,
|
129
|
-
onClick:
|
136
|
+
onClick: s
|
130
137
|
},
|
131
138
|
{
|
132
139
|
id: "teacher-card-unassign",
|
133
140
|
label: "Unassign",
|
134
|
-
icon:
|
135
|
-
disabled: i ?
|
136
|
-
onClick:
|
141
|
+
icon: ue,
|
142
|
+
disabled: i ? _ === "MASTERY" : !J,
|
143
|
+
onClick: s
|
137
144
|
},
|
138
145
|
{
|
139
146
|
id: "teacher-card-redo",
|
140
147
|
label: "Redo",
|
141
148
|
icon: H,
|
142
|
-
disabled: !
|
143
|
-
onClick:
|
149
|
+
disabled: !O,
|
150
|
+
onClick: s
|
151
|
+
},
|
152
|
+
{
|
153
|
+
id: "teacher-card-assign-as-hw",
|
154
|
+
label: "Assign as HW",
|
155
|
+
icon: ee,
|
156
|
+
disabled: !Z,
|
157
|
+
onClick: s
|
144
158
|
}
|
145
|
-
],
|
159
|
+
], U = [
|
146
160
|
{
|
147
161
|
id: "student-card-view",
|
148
162
|
label: "Review",
|
149
|
-
icon:
|
150
|
-
disabled: !
|
151
|
-
onClick:
|
163
|
+
icon: X,
|
164
|
+
disabled: !a,
|
165
|
+
onClick: s
|
152
166
|
},
|
153
167
|
{
|
154
168
|
id: "student-card-reattempt",
|
155
169
|
label: "Reattempt",
|
156
170
|
icon: H,
|
157
|
-
disabled: !
|
158
|
-
onClick:
|
171
|
+
disabled: !O,
|
172
|
+
onClick: s
|
159
173
|
}
|
160
|
-
],
|
161
|
-
() =>
|
162
|
-
canResume:
|
163
|
-
canStart:
|
164
|
-
homeworkId:
|
174
|
+
], T = N(
|
175
|
+
() => he({
|
176
|
+
canResume: p,
|
177
|
+
canStart: f,
|
178
|
+
homeworkId: o,
|
165
179
|
isHomeWork: i,
|
166
|
-
isStudent:
|
167
|
-
milestoneId:
|
168
|
-
nodeType:
|
169
|
-
studentId:
|
170
|
-
userNodeId:
|
180
|
+
isStudent: u,
|
181
|
+
milestoneId: l,
|
182
|
+
nodeType: _,
|
183
|
+
studentId: g,
|
184
|
+
userNodeId: c
|
171
185
|
}),
|
172
186
|
[
|
173
|
-
|
187
|
+
u,
|
174
188
|
i,
|
175
|
-
|
176
|
-
|
177
|
-
h,
|
189
|
+
g,
|
190
|
+
_,
|
178
191
|
f,
|
179
|
-
|
192
|
+
p,
|
180
193
|
o,
|
181
|
-
|
194
|
+
c,
|
195
|
+
l
|
182
196
|
]
|
183
197
|
);
|
184
|
-
return /* @__PURE__ */
|
198
|
+
return /* @__PURE__ */ x(ce, { $position: "relative", $width: "fit-content", children: [
|
185
199
|
/* @__PURE__ */ r(
|
186
|
-
|
200
|
+
te,
|
187
201
|
{
|
188
|
-
onClick:
|
202
|
+
onClick: u ? Q : E,
|
189
203
|
label: "homework-card",
|
190
|
-
analyticsLabel:
|
191
|
-
analyticsProps:
|
204
|
+
analyticsLabel: T.analyticsLabel,
|
205
|
+
analyticsProps: T.analyticsProps,
|
192
206
|
children: /* @__PURE__ */ r(
|
193
|
-
|
207
|
+
ne,
|
194
208
|
{
|
195
|
-
header:
|
196
|
-
isInQueue:
|
209
|
+
header: L,
|
210
|
+
isInQueue: v,
|
197
211
|
nodeData: e,
|
198
212
|
studentContainerRef: $,
|
199
|
-
subHeader:
|
200
|
-
userType:
|
213
|
+
subHeader: z,
|
214
|
+
userType: R
|
201
215
|
}
|
202
216
|
)
|
203
217
|
}
|
204
218
|
),
|
205
|
-
|
206
|
-
|
219
|
+
u && !i && /* @__PURE__ */ r(
|
220
|
+
F,
|
207
221
|
{
|
208
222
|
$width: 200,
|
209
|
-
options:
|
223
|
+
options: U,
|
210
224
|
triggerRef: $,
|
211
|
-
visible:
|
225
|
+
visible: G,
|
212
226
|
shouldOpenOnRight: !1
|
213
227
|
}
|
214
228
|
),
|
215
|
-
!
|
229
|
+
!u && /* @__PURE__ */ x(oe, { $position: "absolute", $width: "fit-content", $borderRadiusX: 2, children: [
|
216
230
|
/* @__PURE__ */ r(
|
217
|
-
|
231
|
+
I,
|
218
232
|
{
|
219
233
|
renderAs: "primary",
|
220
234
|
tooltipItem: "Review",
|
221
235
|
position: "bottom",
|
222
236
|
zIndex: 6,
|
223
237
|
parentWidth: "100%",
|
224
|
-
hidden:
|
238
|
+
hidden: V || K !== "WAIT_FOR_REVIEW" && i,
|
225
239
|
children: /* @__PURE__ */ r(
|
226
|
-
|
240
|
+
ae,
|
227
241
|
{
|
228
242
|
$alignItems: "center",
|
229
243
|
$justifyContent: "center",
|
230
244
|
ref: y,
|
231
|
-
onClick:
|
232
|
-
children: /* @__PURE__ */ r(
|
245
|
+
onClick: q,
|
246
|
+
children: /* @__PURE__ */ r(re, { width: 16, height: 16 })
|
233
247
|
}
|
234
248
|
)
|
235
249
|
}
|
236
250
|
),
|
237
251
|
/* @__PURE__ */ r(
|
238
|
-
|
252
|
+
F,
|
239
253
|
{
|
240
|
-
options:
|
254
|
+
options: A,
|
241
255
|
triggerRef: y,
|
242
|
-
visible:
|
243
|
-
shouldOpenOnRight:
|
256
|
+
visible: V,
|
257
|
+
shouldOpenOnRight: B,
|
258
|
+
$width: 144
|
244
259
|
}
|
245
260
|
)
|
246
261
|
] }),
|
247
|
-
|
262
|
+
v && /* @__PURE__ */ r(se, { $background: "WHITE_5", children: /* @__PURE__ */ r(le, { $heightX: 1, $widthX: 6, children: /* @__PURE__ */ r(I, { renderAs: "primary", tooltipItem: "Not visible to student", position: "bottom", children: /* @__PURE__ */ r(ie, { $heightX: 1, $widthX: 6 }) }) }) })
|
248
263
|
] });
|
249
|
-
},
|
264
|
+
}, Ve = D(de);
|
250
265
|
export {
|
251
|
-
|
266
|
+
Ve as default
|
252
267
|
};
|
253
268
|
//# sourceMappingURL=homework-card.js.map
|