@cuemath/leap 3.0.4-rj-4 → 3.0.4
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/circle-games/games/tutorial/tutorial-styled.js +19 -20
- package/dist/features/circle-games/games/tutorial/tutorial-styled.js.map +1 -1
- package/dist/features/circle-games/games/tutorial/tutorial.js +33 -38
- package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
- package/dist/features/circle-games/{comps → leaderboard/comps}/info-bar/info-bar-styled.js +1 -1
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.js.map +1 -0
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar.js.map +1 -0
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js +1 -1
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.js +31 -26
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/package.json +1 -1
- package/dist/features/circle-games/comps/info-bar/info-bar-styled.js.map +0 -1
- package/dist/features/circle-games/comps/info-bar/info-bar.js.map +0 -1
- /package/dist/features/circle-games/{comps → leaderboard/comps}/info-bar/info-bar.js +0 -0
@@ -1,7 +1,6 @@
|
|
1
1
|
import o from "styled-components";
|
2
|
-
import {
|
3
|
-
|
4
|
-
const s = o.div`
|
2
|
+
import { HEADER_HEIGHT as t } from "./constants.js";
|
3
|
+
const n = o.div`
|
5
4
|
display: flex;
|
6
5
|
flex-direction: column;
|
7
6
|
height: 100%;
|
@@ -9,15 +8,15 @@ const s = o.div`
|
|
9
8
|
background: ${({ theme: i }) => i.colors.BLACK_1};
|
10
9
|
position: relative;
|
11
10
|
width: inherit;
|
12
|
-
`,
|
13
|
-
height: ${
|
11
|
+
`, d = o.div`
|
12
|
+
height: ${t}px;
|
14
13
|
padding-top: ${(window.ReactNativeTopInset || 0) + 24}px;
|
15
14
|
width: 100%;
|
16
15
|
background: ${({ theme: i }) => i.colors.WHITE_T_03};
|
17
16
|
backdrop-filter: blur(40px);
|
18
17
|
position: relative;
|
19
18
|
flex-shrink: 0;
|
20
|
-
`,
|
19
|
+
`, s = o.div`
|
21
20
|
position: absolute;
|
22
21
|
right: 16px;
|
23
22
|
top: ${(window.ReactNativeTopInset || 0) + 22}px;
|
@@ -26,13 +25,13 @@ const s = o.div`
|
|
26
25
|
background: ${({ theme: i }) => i.colors.BLACK_4};
|
27
26
|
cursor: pointer;
|
28
27
|
}
|
29
|
-
`,
|
28
|
+
`, a = o.div`
|
30
29
|
display: flex;
|
31
30
|
flex-direction: column;
|
32
31
|
/* overflow: hidden; */
|
33
32
|
flex-grow: 1;
|
34
33
|
position: relative;
|
35
|
-
`,
|
34
|
+
`, p = o.div`
|
36
35
|
width: 100%;
|
37
36
|
position: absolute;
|
38
37
|
top: 0;
|
@@ -40,20 +39,20 @@ const s = o.div`
|
|
40
39
|
bottom: 0;
|
41
40
|
right: 0;
|
42
41
|
& video {
|
43
|
-
height:
|
42
|
+
height: 100%;
|
44
43
|
width: 100%;
|
45
44
|
}
|
46
|
-
`,
|
45
|
+
`, l = o.div`
|
47
46
|
height: 40px;
|
48
47
|
width: 100%;
|
49
48
|
position: relative;
|
50
49
|
display: flex;
|
51
|
-
`,
|
50
|
+
`, h = o.div`
|
52
51
|
height: 2px;
|
53
52
|
position: relative;
|
54
53
|
width: 100%;
|
55
54
|
z-index: 1;
|
56
|
-
`,
|
55
|
+
`, c = o.div`
|
57
56
|
height: inherit;
|
58
57
|
background: ${({ theme: i }) => i.colors.WHITE};
|
59
58
|
position: absolute;
|
@@ -62,13 +61,13 @@ const s = o.div`
|
|
62
61
|
transition: width 0.4s linear;
|
63
62
|
`;
|
64
63
|
export {
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
64
|
+
a as GameTutorialContainer,
|
65
|
+
d as GameTutorialHeader,
|
66
|
+
n as GameTutorialWrapper,
|
67
|
+
s as HeaderIconContainer,
|
68
|
+
p as VideoContainer,
|
69
|
+
c as VideoProgress,
|
70
|
+
h as VideoProgressContainer,
|
71
|
+
l as VideoProgressWrapper
|
73
72
|
};
|
74
73
|
//# sourceMappingURL=tutorial-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tutorial-styled.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport {
|
1
|
+
{"version":3,"file":"tutorial-styled.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { HEADER_HEIGHT } from './constants';\n\nexport const GameTutorialWrapper = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 250px;\n background: ${({ theme }) => theme.colors.BLACK_1};\n position: relative;\n width: inherit;\n`;\n\nexport const GameTutorialHeader = styled.div`\n height: ${HEADER_HEIGHT}px;\n padding-top: ${(window.ReactNativeTopInset || 0) + 24}px;\n width: 100%;\n background: ${({ theme }) => theme.colors.WHITE_T_03};\n backdrop-filter: blur(40px);\n position: relative;\n flex-shrink: 0;\n`;\n\nexport const HeaderIconContainer = styled.div`\n position: absolute;\n right: 16px;\n top: ${(window.ReactNativeTopInset || 0) + 22}px;\n z-index: 1;\n &:hover {\n background: ${({ theme }) => theme.colors.BLACK_4};\n cursor: pointer;\n }\n`;\n\nexport const GameTutorialContainer = styled.div`\n display: flex;\n flex-direction: column;\n /* overflow: hidden; */\n flex-grow: 1;\n position: relative;\n`;\n\nexport const VideoContainer = styled.div`\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n & video {\n height: 100%;\n width: 100%;\n }\n`;\n\nexport const VideoProgressWrapper = styled.div`\n height: 40px;\n width: 100%;\n position: relative;\n display: flex;\n`;\n\nexport const VideoProgressContainer = styled.div`\n height: 2px;\n position: relative;\n width: 100%;\n z-index: 1;\n`;\n\nexport const VideoProgress = styled.div<{ $width: number }>`\n height: inherit;\n background: ${({ theme }) => theme.colors.WHITE};\n position: absolute;\n z-index: 2;\n width: ${({ $width }) => $width || 0}%;\n transition: width 0.4s linear;\n`;\n"],"names":["GameTutorialWrapper","styled","theme","GameTutorialHeader","HEADER_HEIGHT","HeaderIconContainer","GameTutorialContainer","VideoContainer","VideoProgressWrapper","VideoProgressContainer","VideoProgress","$width"],"mappings":";;AAIO,MAAMA,IAAsBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAK1B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,GAKtCC,IAAqBF,EAAO;AAAA,YAC7BG,CAAa;AAAA,kBACP,OAAO,uBAAuB,KAAK,EAAE;AAAA;AAAA,gBAEvC,CAAC,EAAE,OAAAF,EAAA,MAAYA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA,GAMzCG,IAAsBJ,EAAO;AAAA;AAAA;AAAA,UAGhC,OAAO,uBAAuB,KAAK,EAAE;AAAA;AAAA;AAAA,kBAG7B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,GAKxCI,IAAwBL,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ/BM,IAAiBN,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAaxBO,IAAuBP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAO9BQ,IAAyBR,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOhCS,IAAgBT,EAAO;AAAA;AAAA,gBAEpB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA,WAGtC,CAAC,EAAE,QAAAS,QAAaA,KAAU,CAAC;AAAA;AAAA;"}
|
@@ -1,49 +1,44 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useState as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
onCross: t,
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { useState as l, useRef as f, useCallback as h } from "react";
|
3
|
+
import g from "../../../../assets/line-icons/icons/cross.js";
|
4
|
+
import C from "../../../ui/text/text.js";
|
5
|
+
import { GameTutorialWrapper as I, GameTutorialHeader as V, HeaderIconContainer as x, GameTutorialContainer as T, VideoContainer as $, VideoProgressWrapper as G, VideoProgressContainer as H, VideoProgress as P } from "./tutorial-styled.js";
|
6
|
+
const E = ({
|
7
|
+
src: d,
|
8
|
+
title: t,
|
9
|
+
onCross: o,
|
11
10
|
showProgress: m = !0,
|
12
|
-
onTutorialPlayedOnce: e
|
13
|
-
isJourneyActive: n
|
11
|
+
onTutorialPlayedOnce: e
|
14
12
|
}) => {
|
15
|
-
const [
|
16
|
-
(
|
17
|
-
const c = (
|
18
|
-
c >= 90 && !
|
13
|
+
const [i, u] = l(0), s = f(!1), p = h(
|
14
|
+
(n) => {
|
15
|
+
const c = (n.target.currentTime || 0) / (n.target.duration || 1) * 100;
|
16
|
+
c >= 90 && !s.current && (s.current = !0, e == null || e()), u(c);
|
19
17
|
},
|
20
18
|
[e]
|
21
19
|
);
|
22
|
-
return /* @__PURE__ */
|
23
|
-
(
|
24
|
-
|
25
|
-
|
20
|
+
return /* @__PURE__ */ a(I, { children: [
|
21
|
+
(t || o) && /* @__PURE__ */ a(V, { children: [
|
22
|
+
t && /* @__PURE__ */ r(C, { $renderAs: "ac3", $color: "WHITE", $align: "center", children: t }),
|
23
|
+
o && /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(g, { color: "#fff", onClick: o }) })
|
26
24
|
] }),
|
27
|
-
/* @__PURE__ */ r(
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
)
|
42
|
-
] }) }),
|
43
|
-
m && /* @__PURE__ */ r(E, { children: /* @__PURE__ */ r(H, { children: s > 0 && /* @__PURE__ */ r(W, { $width: s }) }) })
|
25
|
+
/* @__PURE__ */ r(T, { children: /* @__PURE__ */ r($, { children: /* @__PURE__ */ r(
|
26
|
+
"video",
|
27
|
+
{
|
28
|
+
loop: !0,
|
29
|
+
autoPlay: !0,
|
30
|
+
muted: !0,
|
31
|
+
src: d,
|
32
|
+
onTimeUpdate: p,
|
33
|
+
disablePictureInPicture: !0,
|
34
|
+
itemType: "video/mp4",
|
35
|
+
playsInline: !0
|
36
|
+
}
|
37
|
+
) }) }),
|
38
|
+
m && /* @__PURE__ */ r(G, { children: /* @__PURE__ */ r(H, { children: i > 0 && /* @__PURE__ */ r(P, { $width: i }) }) })
|
44
39
|
] });
|
45
40
|
};
|
46
41
|
export {
|
47
|
-
|
42
|
+
E as Tutorial
|
48
43
|
};
|
49
44
|
//# sourceMappingURL=tutorial.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tutorial.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial.tsx"],"sourcesContent":["import type { ITutorialProps } from './tutorial-types';\nimport type { ChangeEvent } from 'react';\n\nimport { useCallback, useRef, useState } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport Text from '../../../ui/text/text';\nimport
|
1
|
+
{"version":3,"file":"tutorial.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial.tsx"],"sourcesContent":["import type { ITutorialProps } from './tutorial-types';\nimport type { ChangeEvent } from 'react';\n\nimport { useCallback, useRef, useState } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport Text from '../../../ui/text/text';\nimport * as Styled from './tutorial-styled';\n\nexport const Tutorial = ({\n src,\n title,\n onCross,\n showProgress = true,\n onTutorialPlayedOnce,\n}: ITutorialProps) => {\n const [progress, setProgress] = useState(0);\n const hasVideoEnded = useRef(false);\n\n const onProgress = useCallback(\n (e: ChangeEvent<HTMLVideoElement>) => {\n const p = ((e.target.currentTime || 0) / (e.target.duration || 1)) * 100;\n\n if (p >= 90 && !hasVideoEnded.current) {\n hasVideoEnded.current = true;\n onTutorialPlayedOnce?.();\n }\n\n setProgress(p);\n },\n [onTutorialPlayedOnce],\n );\n\n return (\n <Styled.GameTutorialWrapper>\n {(title || onCross) && (\n <Styled.GameTutorialHeader>\n {title && (\n <Text $renderAs=\"ac3\" $color=\"WHITE\" $align=\"center\">\n {title}\n </Text>\n )}\n {onCross && (\n <Styled.HeaderIconContainer>\n <CrossIcon color=\"#fff\" onClick={onCross} />\n </Styled.HeaderIconContainer>\n )}\n </Styled.GameTutorialHeader>\n )}\n\n <Styled.GameTutorialContainer>\n <Styled.VideoContainer>\n <video\n loop={true}\n autoPlay={true}\n muted={true}\n src={src}\n onTimeUpdate={onProgress}\n disablePictureInPicture={true}\n itemType=\"video/mp4\"\n playsInline\n />\n </Styled.VideoContainer>\n </Styled.GameTutorialContainer>\n\n {showProgress && (\n <Styled.VideoProgressWrapper>\n <Styled.VideoProgressContainer>\n {progress > 0 && <Styled.VideoProgress $width={progress} />}\n </Styled.VideoProgressContainer>\n </Styled.VideoProgressWrapper>\n )}\n </Styled.GameTutorialWrapper>\n );\n};\n"],"names":["Tutorial","src","title","onCross","showProgress","onTutorialPlayedOnce","progress","setProgress","useState","hasVideoEnded","useRef","onProgress","useCallback","e","p","jsxs","Styled.GameTutorialWrapper","Styled.GameTutorialHeader","jsx","Text","Styled.HeaderIconContainer","CrossIcon","Styled.GameTutorialContainer","Styled.VideoContainer","Styled.VideoProgressWrapper","Styled.VideoProgressContainer","Styled.VideoProgress"],"mappings":";;;;;AASO,MAAMA,IAAW,C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AA,CAAA;AAEJ;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info-bar-styled.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\n\nexport const InfoBarWrapper = styled(FlexView)`\n padding: 16px;\n margin: 16px;\n border-width: 1px;\n border-style: solid;\n`;\n"],"names":["InfoBarWrapper","styled","FlexView"],"mappings":";;AAIa,MAAAA,IAAiBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info-bar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar.tsx"],"sourcesContent":["import type { TColorNames, THueNames } from '../../../../ui/types';\nimport type { IInfoBarProps } from './info-bar-types';\n\nimport { useMemo } from 'react';\n\nimport * as Styled from './info-bar-styled';\n\nconst computeColorsFromHue = (\n hue: THueNames,\n): { backgroundColor: TColorNames; borderColor: TColorNames } => {\n return { backgroundColor: `${hue}_6`, borderColor: `${hue}_4` };\n};\n\nexport const InfoBar: React.FC<IInfoBarProps> = ({ children, hue }) => {\n const { backgroundColor, borderColor } = useMemo(() => computeColorsFromHue(hue), [hue]);\n\n return (\n <Styled.InfoBarWrapper $background={backgroundColor} $borderColor={borderColor}>\n {children}\n </Styled.InfoBarWrapper>\n );\n};\n"],"names":["computeColorsFromHue","hue","InfoBar","children","backgroundColor","borderColor","useMemo","jsx","Styled.InfoBarWrapper"],"mappings":";;;AAOA,MAAMA,IAAuB,CAC3BC,OAEO,EAAE,iBAAiB,GAAGA,CAAG,MAAM,aAAa,GAAGA,CAAG,SAG9CC,IAAmC,CAAC,EAAE,UAAAC,GAAU,KAAAF,QAAU;AAC/D,QAAA,EAAE,iBAAAG,GAAiB,aAAAC,EAAA,IAAgBC,EAAQ,MAAMN,EAAqBC,CAAG,GAAG,CAACA,CAAG,CAAC;AAGrF,SAAA,gBAAAM,EAACC,GAAA,EAAsB,aAAaJ,GAAiB,cAAcC,GAChE,UAAAF,EACH,CAAA;AAEJ;"}
|
@@ -3,8 +3,8 @@ import { useState as u, useCallback as h } from "react";
|
|
3
3
|
import I from "../../../../../assets/line-icons/icons/cross.js";
|
4
4
|
import i from "../../../../ui/layout/flex-view.js";
|
5
5
|
import o from "../../../../ui/text/text.js";
|
6
|
-
import { InfoBar as k } from "../../../comps/info-bar/info-bar.js";
|
7
6
|
import { StreakReductionLocalStorageUtil as c } from "../../../utils/streak-reduction-localstorage-util.js";
|
7
|
+
import { InfoBar as k } from "../info-bar/info-bar.js";
|
8
8
|
import { STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP as a } from "./streak-reduction-infobar-constants.js";
|
9
9
|
const T = ({
|
10
10
|
startTimestampToday: e,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"streak-reduction-infobar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.tsx"],"sourcesContent":["import type { IStreakReductionLeaderboard } from './streak-reduction-infobar-types';\n\nimport { useCallback, useState } from 'react';\n\nimport CrossIcon from '../../../../../assets/line-icons/icons/cross';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport {
|
1
|
+
{"version":3,"file":"streak-reduction-infobar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.tsx"],"sourcesContent":["import type { IStreakReductionLeaderboard } from './streak-reduction-infobar-types';\n\nimport { useCallback, useState } from 'react';\n\nimport CrossIcon from '../../../../../assets/line-icons/icons/cross';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { StreakReductionLocalStorageUtil } from '../../../utils/streak-reduction-localstorage-util';\nimport { InfoBar } from '../info-bar/info-bar';\nimport { STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP } from './streak-reduction-infobar-constants';\n\nexport const StreakReductionInfoBar = ({\n startTimestampToday,\n streakReduction,\n}: IStreakReductionLeaderboard) => {\n const [showInfoBar, setShowInfoBar] = useState(\n StreakReductionLocalStorageUtil.showStreakReduction(\n STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP,\n startTimestampToday,\n ),\n );\n\n const hasStreakReduced = streakReduction > 0;\n\n const onInfoBarClose = useCallback(() => {\n StreakReductionLocalStorageUtil.markStreakReductionDismissed(\n STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP,\n startTimestampToday,\n );\n setShowInfoBar(false);\n }, [startTimestampToday]);\n\n if (!showInfoBar) {\n return null;\n }\n\n return (\n <InfoBar\n children={\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"space-between\">\n <FlexView>\n {hasStreakReduced ? (\n <>\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n Keep building your streak by completing an activity each day.\n </Text>\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n For each day missed, your streak reduces by 1.\n </Text>\n </>\n ) : (\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n Streak saved for the day! Come back tomorrow to keep increasing it.\n </Text>\n )}\n </FlexView>\n\n <CrossIcon cursor={'pointer'} color=\"WHITE\" onClick={onInfoBarClose} />\n </FlexView>\n }\n hue={hasStreakReduced ? 'YELLOW' : 'GREEN'}\n />\n );\n};\n"],"names":["StreakReductionInfoBar","startTimestampToday","streakReduction","showInfoBar","setShowInfoBar","useState","StreakReductionLocalStorageUtil","STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP","hasStreakReduced","onInfoBarClose","useCallback","jsx","InfoBar","FlexView","jsxs","Fragment","Text","CrossIcon"],"mappings":";;;;;;;;AAWO,MAAMA,IAAyB,CAAC;AAAA,EACrC,qBAAAC;AAAA,EACA,iBAAAC;AACF,MAAmC;AAC3B,QAAA,CAACC,GAAaC,CAAc,IAAIC;AAAA,IACpCC,EAAgC;AAAA,MAC9BC;AAAA,MACAN;AAAA,IACF;AAAA,EAAA,GAGIO,IAAmBN,IAAkB,GAErCO,IAAiBC,EAAY,MAAM;AACP,IAAAJ,EAAA;AAAA,MAC9BC;AAAA,MACAN;AAAA,IAAA,GAEFG,EAAe,EAAK;AAAA,EAAA,GACnB,CAACH,CAAmB,CAAC;AAExB,SAAKE,IAKH,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,4BACGC,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,iBAAgB,iBAClE,UAAA;AAAA,QAAC,gBAAAF,EAAAE,GAAA,EACE,cAEG,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAJ,EAACK,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,iEAAA;AAAA,4BACCA,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,kDAAA;AAAA,QACF,EAAA,CAAA,sBAECA,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,iFAE1C,EAEJ,CAAA;AAAA,0BAECC,GAAU,EAAA,QAAQ,WAAW,OAAM,SAAQ,SAASR,GAAgB;AAAA,MAAA,GACvE;AAAA,MAEF,KAAKD,IAAmB,WAAW;AAAA,IAAA;AAAA,EAAA,IA3B9B;AA8BX;"}
|
@@ -1,30 +1,35 @@
|
|
1
|
-
import { jsx as r, jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import u from "../../../../../../ui/
|
5
|
-
import
|
6
|
-
import
|
7
|
-
|
1
|
+
import { jsx as r, jsxs as b } from "react/jsx-runtime";
|
2
|
+
import { memo as $, useCallback as T } from "react";
|
3
|
+
import { NODE_TYPE as l } from "../../../../../../sheets/constants/sheet.js";
|
4
|
+
import u from "../../../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
5
|
+
import f from "../../../../../../ui/image/image.js";
|
6
|
+
import C from "../../../../../../ui/layout/flex-view.js";
|
7
|
+
import { ChapterItemWrapper as E, StyledText as g } from "./chapter-item-styled.js";
|
8
|
+
const y = $(({ chapter: m, selected: t, onChapterSelection: o }) => {
|
8
9
|
const {
|
9
|
-
image_url:
|
10
|
-
name:
|
11
|
-
id:
|
12
|
-
|
13
|
-
item_bank_enabled:
|
14
|
-
} =
|
10
|
+
image_url: s,
|
11
|
+
name: i,
|
12
|
+
id: a,
|
13
|
+
blocks: d,
|
14
|
+
item_bank_enabled: p
|
15
|
+
} = m, h = d.some(
|
16
|
+
(_) => _.sheets.some(
|
17
|
+
(n) => n.node_type === l.ASSESSMENT || n.node_type === l.CHAPTER_ASSESSMENT
|
18
|
+
)
|
19
|
+
), e = !p && !h, c = T(() => {
|
15
20
|
if (e) return null;
|
16
|
-
o(
|
17
|
-
}, [o,
|
21
|
+
o(a);
|
22
|
+
}, [o, a, e]);
|
18
23
|
return /* @__PURE__ */ r(
|
19
|
-
|
24
|
+
u,
|
20
25
|
{
|
21
26
|
position: "bottom",
|
22
27
|
renderAs: "primary",
|
23
28
|
tooltipItem: "Chapter unavailable for test creation",
|
24
29
|
hidden: !e,
|
25
30
|
widthX: 9.5,
|
26
|
-
children: /* @__PURE__ */
|
27
|
-
|
31
|
+
children: /* @__PURE__ */ b(
|
32
|
+
E,
|
28
33
|
{
|
29
34
|
$widthX: 9.5,
|
30
35
|
$heightX: 8.875,
|
@@ -36,13 +41,13 @@ const k = c(({ chapter: l, selected: t, onChapterSelection: o }) => {
|
|
36
41
|
$disabled: e,
|
37
42
|
$borderColor: t ? "BLACK_T_87" : "WHITE_5",
|
38
43
|
$background: t ? "WHITE_3" : "WHITE_1",
|
39
|
-
onClick:
|
44
|
+
onClick: c,
|
40
45
|
children: [
|
41
|
-
/* @__PURE__ */ r(
|
42
|
-
|
46
|
+
/* @__PURE__ */ r(C, { $position: "relative", children: /* @__PURE__ */ r(
|
47
|
+
f,
|
43
48
|
{
|
44
|
-
src:
|
45
|
-
alt:
|
49
|
+
src: s || "",
|
50
|
+
alt: i,
|
46
51
|
withLoader: !0,
|
47
52
|
width: 56,
|
48
53
|
height: 56,
|
@@ -50,12 +55,12 @@ const k = c(({ chapter: l, selected: t, onChapterSelection: o }) => {
|
|
50
55
|
}
|
51
56
|
) }),
|
52
57
|
/* @__PURE__ */ r(
|
53
|
-
|
58
|
+
g,
|
54
59
|
{
|
55
60
|
$renderAs: t ? "ab3-bold" : "ab3",
|
56
61
|
$align: "center",
|
57
62
|
$color: e ? "BLACK_T_38" : "BLACK_T_87",
|
58
|
-
children:
|
63
|
+
children: i
|
59
64
|
}
|
60
65
|
)
|
61
66
|
]
|
@@ -65,6 +70,6 @@ const k = c(({ chapter: l, selected: t, onChapterSelection: o }) => {
|
|
65
70
|
);
|
66
71
|
});
|
67
72
|
export {
|
68
|
-
|
73
|
+
y as default
|
69
74
|
};
|
70
75
|
//# sourceMappingURL=chapter-item.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter-item.js","sources":["../../../../../../../../src/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItem } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, memo } from 'react';\n\nimport ArrowTooltip from '../../../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../../../ui/image/image';\nimport FlexView from '../../../../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItem> = memo(({ chapter, selected, onChapterSelection }) => {\n const {\n image_url: imageUrl,\n name,\n id: userChapterId,\n
|
1
|
+
{"version":3,"file":"chapter-item.js","sources":["../../../../../../../../src/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItem } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, memo } from 'react';\n\nimport { NODE_TYPE } from '../../../../../../sheets/constants/sheet';\nimport ArrowTooltip from '../../../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../../../ui/image/image';\nimport FlexView from '../../../../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItem> = memo(({ chapter, selected, onChapterSelection }) => {\n const {\n image_url: imageUrl,\n name,\n id: userChapterId,\n blocks,\n item_bank_enabled: itemBankEnabled,\n } = chapter;\n const hasTestSheets = blocks.some(block =>\n block.sheets.some(\n sheet =>\n sheet.node_type === NODE_TYPE.ASSESSMENT ||\n sheet.node_type === NODE_TYPE.CHAPTER_ASSESSMENT,\n ),\n );\n\n const isDisabled = !itemBankEnabled && !hasTestSheets;\n\n const handleOnChapterSelection = useCallback(() => {\n if (isDisabled) return null;\n\n onChapterSelection(userChapterId);\n }, [onChapterSelection, userChapterId, isDisabled]);\n\n return (\n <ArrowTooltip\n position=\"bottom\"\n renderAs=\"primary\"\n tooltipItem=\"Chapter unavailable for test creation\"\n hidden={!isDisabled}\n widthX={9.5}\n >\n <Styled.ChapterItemWrapper\n $widthX={9.5}\n $heightX={8.875}\n $gapX={1}\n $gutterX={1}\n $flexGap={12}\n $position=\"relative\"\n $alignItems=\"center\"\n $disabled={isDisabled}\n $borderColor={selected ? 'BLACK_T_87' : 'WHITE_5'}\n $background={selected ? 'WHITE_3' : 'WHITE_1'}\n onClick={handleOnChapterSelection}\n >\n <FlexView $position=\"relative\">\n <Image\n src={imageUrl || ''}\n alt={name}\n withLoader\n width={56}\n height={56}\n borderRadius={50}\n />\n </FlexView>\n <Styled.StyledText\n $renderAs={selected ? 'ab3-bold' : 'ab3'}\n $align=\"center\"\n $color={isDisabled ? 'BLACK_T_38' : 'BLACK_T_87'}\n >\n {name}\n </Styled.StyledText>\n </Styled.ChapterItemWrapper>\n </ArrowTooltip>\n );\n});\n\nexport default ChapterItem;\n"],"names":["ChapterItem","memo","chapter","selected","onChapterSelection","imageUrl","name","userChapterId","blocks","itemBankEnabled","hasTestSheets","block","sheet","NODE_TYPE","isDisabled","handleOnChapterSelection","useCallback","jsx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;AAAA,cAAA;AAAA,YAAA,GAElB;AAAA,YACA,gBAAAW;AAAA,cAACM;AAAAA,cAAA;AAAA,gBACC,WAAWpB,IAAW,aAAa;AAAA,gBACnC,QAAO;AAAA,gBACP,QAAQW,IAAa,eAAe;AAAA,gBAEnC,UAAAR;AAAA,cAAA;AAAA,YACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
package/dist/index.d.ts
CHANGED
@@ -3214,7 +3214,6 @@ export declare interface ITutorialProps {
|
|
3214
3214
|
onCross?: () => void;
|
3215
3215
|
showProgress?: boolean;
|
3216
3216
|
onTutorialPlayedOnce?: () => void;
|
3217
|
-
isJourneyActive?: boolean;
|
3218
3217
|
}
|
3219
3218
|
|
3220
3219
|
declare interface IUpdateImages {
|
@@ -5286,7 +5285,7 @@ declare type TUserProgram = {
|
|
5286
5285
|
|
5287
5286
|
export declare type TUserTypes = 'TEACHER' | 'STUDENT';
|
5288
5287
|
|
5289
|
-
export declare const Tutorial: ({ src, title, onCross, showProgress, onTutorialPlayedOnce,
|
5288
|
+
export declare const Tutorial: ({ src, title, onCross, showProgress, onTutorialPlayedOnce, }: ITutorialProps) => JSX_2.Element;
|
5290
5289
|
|
5291
5290
|
export declare const TutoringIcon: React_2.FC<React_2.SVGProps<SVGSVGElement>>;
|
5292
5291
|
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"info-bar-styled.js","sources":["../../../../../src/features/circle-games/comps/info-bar/info-bar-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const InfoBarWrapper = styled(FlexView)`\n padding: 16px;\n margin: 16px;\n border-width: 1px;\n border-style: solid;\n`;\n"],"names":["InfoBarWrapper","styled","FlexView"],"mappings":";;AAIa,MAAAA,IAAiBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"info-bar.js","sources":["../../../../../src/features/circle-games/comps/info-bar/info-bar.tsx"],"sourcesContent":["import type { TColorNames, THueNames } from '../../../ui/types';\nimport type { IInfoBarProps } from './info-bar-types';\n\nimport { useMemo } from 'react';\n\nimport * as Styled from './info-bar-styled';\n\nconst computeColorsFromHue = (\n hue: THueNames,\n): { backgroundColor: TColorNames; borderColor: TColorNames } => {\n return { backgroundColor: `${hue}_6`, borderColor: `${hue}_4` };\n};\n\nexport const InfoBar: React.FC<IInfoBarProps> = ({ children, hue }) => {\n const { backgroundColor, borderColor } = useMemo(() => computeColorsFromHue(hue), [hue]);\n\n return (\n <Styled.InfoBarWrapper $background={backgroundColor} $borderColor={borderColor}>\n {children}\n </Styled.InfoBarWrapper>\n );\n};\n"],"names":["computeColorsFromHue","hue","InfoBar","children","backgroundColor","borderColor","useMemo","jsx","Styled.InfoBarWrapper"],"mappings":";;;AAOA,MAAMA,IAAuB,CAC3BC,OAEO,EAAE,iBAAiB,GAAGA,CAAG,MAAM,aAAa,GAAGA,CAAG,SAG9CC,IAAmC,CAAC,EAAE,UAAAC,GAAU,KAAAF,QAAU;AAC/D,QAAA,EAAE,iBAAAG,GAAiB,aAAAC,EAAA,IAAgBC,EAAQ,MAAMN,EAAqBC,CAAG,GAAG,CAACA,CAAG,CAAC;AAGrF,SAAA,gBAAAM,EAACC,GAAA,EAAsB,aAAaJ,GAAiB,cAAcC,GAChE,UAAAF,EACH,CAAA;AAEJ;"}
|
File without changes
|