@cuemath/leap 3.5.11-ak1 → 3.5.11-ak2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { memo as y, useState as T, useMemo as E, useCallback as
|
|
1
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { memo as y, useState as T, useMemo as E, useCallback as p, useEffect as G } from "react";
|
|
3
3
|
import { useTheme as V } from "styled-components";
|
|
4
4
|
import _ from "../../../assets/line-icons/icons/back2.js";
|
|
5
5
|
import { useGetTrackedViews as N } from "../../journey/hooks/use-get-tracked-views.js";
|
|
@@ -9,43 +9,43 @@ import F from "../../ui/buttons/button/button.js";
|
|
|
9
9
|
import O from "../../ui/buttons/icon-button/icon-button.js";
|
|
10
10
|
import M from "../../ui/separator/separator.js";
|
|
11
11
|
import C from "../../ui/text/text.js";
|
|
12
|
-
import { ArcContainer as
|
|
13
|
-
import { getAboutGameActivitiesStepsForKTo1 as
|
|
14
|
-
import { Wrapper as
|
|
12
|
+
import { ArcContainer as H } from "../comps/arc-container/arc-container.js";
|
|
13
|
+
import { getAboutGameActivitiesStepsForKTo1 as L, getAboutGameActivitiesSteps as U } from "./about-game-activities-constants.js";
|
|
14
|
+
import { Wrapper as w, ContentContainer as z, VideoContainer as W, Video as j, Header as P, Footer as J, NavigationContainer as K } from "./about-game-activities-styled.js";
|
|
15
15
|
import { EDeviceType as R } from "../../ui/theme/constants.js";
|
|
16
16
|
import { useCircleSounds as Y } from "../hooks/use-circle-sounds/use-circle-sounds.js";
|
|
17
17
|
const S = y(
|
|
18
|
-
({ show:
|
|
19
|
-
const { device: v } = V(),
|
|
18
|
+
({ show: o = !1, isGradeKTo1: f = !1, onDismiss: n }) => {
|
|
19
|
+
const { device: v } = V(), c = v <= R.TABLET, [e, l] = T(0), { trackView: A } = B(), k = N(), { playButtonSound: b } = Y(), d = k.includes(
|
|
20
20
|
I.INFO_ABOUT_GAME_ACTIVITIES
|
|
21
|
-
), [g,
|
|
22
|
-
() =>
|
|
23
|
-
[
|
|
24
|
-
),
|
|
25
|
-
|
|
26
|
-
}, [n,
|
|
27
|
-
e > 0 &&
|
|
28
|
-
}, [e]), $ =
|
|
29
|
-
e <
|
|
21
|
+
), [g, u] = T(o), a = E(
|
|
22
|
+
() => f ? L(c) : U(c),
|
|
23
|
+
[c, f]
|
|
24
|
+
), h = e === 0, i = e === a.length - 1, r = a[e], m = p(() => {
|
|
25
|
+
u(!1), b(), n == null || n();
|
|
26
|
+
}, [n, b]), x = p(() => {
|
|
27
|
+
e > 0 && l(e - 1);
|
|
28
|
+
}, [e]), $ = p(() => {
|
|
29
|
+
e < a.length - 1 && l(e + 1), i && (d || A(I.INFO_ABOUT_GAME_ACTIVITIES), m());
|
|
30
30
|
}, [
|
|
31
31
|
e,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
m,
|
|
33
|
+
i,
|
|
34
|
+
A,
|
|
35
|
+
d,
|
|
36
|
+
a.length
|
|
37
37
|
]);
|
|
38
38
|
return G(() => {
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
|
|
39
|
+
o ? (u(!0), l(0)) : u(!1);
|
|
40
|
+
}, [o]), !r || !o ? null : g && /* @__PURE__ */ t(
|
|
41
|
+
H,
|
|
42
42
|
{
|
|
43
|
-
onClose:
|
|
43
|
+
onClose: d && o ? m : void 0,
|
|
44
44
|
zIndex: 10,
|
|
45
45
|
contentContainerHeight: "calc(100% - 128px)",
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */ t(W, { $isVideoCircular: r.isVideoCircular, children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ s(w, { children: [
|
|
47
|
+
/* @__PURE__ */ s(z, { children: [
|
|
48
|
+
/* @__PURE__ */ t(W, { $isVideoCircular: r.isVideoCircular, children: /* @__PURE__ */ s(j, { playsInline: !0, autoPlay: !0, loop: !0, muted: !0, children: [
|
|
49
49
|
/* @__PURE__ */ t("source", { src: r.videoUrl, type: "video/mp4" }),
|
|
50
50
|
"Your browser does not support the video tag."
|
|
51
51
|
] }, e) }),
|
|
@@ -62,8 +62,8 @@ const S = y(
|
|
|
62
62
|
/* @__PURE__ */ t(M, { height: 20 }),
|
|
63
63
|
/* @__PURE__ */ t(J, { children: r.footerText && /* @__PURE__ */ t(C, { $renderAs: "ub1", $renderOnMobileAs: "ub2", $color: "WHITE_T_87", $align: "center", children: r.footerText }) })
|
|
64
64
|
] }),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
!
|
|
65
|
+
/* @__PURE__ */ s(K, { $isFirstStep: h, children: [
|
|
66
|
+
!h && /* @__PURE__ */ t(
|
|
67
67
|
O,
|
|
68
68
|
{
|
|
69
69
|
Icon: _,
|
|
@@ -77,18 +77,18 @@ const S = y(
|
|
|
77
77
|
/* @__PURE__ */ t(
|
|
78
78
|
F,
|
|
79
79
|
{
|
|
80
|
-
label:
|
|
80
|
+
label: i ? "Get Started" : "Next",
|
|
81
81
|
onClick: $,
|
|
82
82
|
disabled: !1,
|
|
83
83
|
size: "small",
|
|
84
|
-
analyticsLabel:
|
|
85
|
-
renderAs:
|
|
84
|
+
analyticsLabel: i ? "get-started" : "next-step",
|
|
85
|
+
renderAs: i ? "secondary-dark" : "black-dark"
|
|
86
86
|
}
|
|
87
87
|
)
|
|
88
88
|
] })
|
|
89
89
|
] })
|
|
90
90
|
}
|
|
91
|
-
)
|
|
91
|
+
);
|
|
92
92
|
}
|
|
93
93
|
);
|
|
94
94
|
S.displayName = "AboutGameActivities";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"about-game-activities.js","sources":["../../../../src/features/circle-games/about-game-activities/about-game-activities.tsx"],"sourcesContent":["import { useState, useCallback, memo, useMemo, useEffect, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport BackIcon from '../../../assets/line-icons/icons/back2';\nimport { useGetTrackedViews } from '../../journey/hooks/use-get-tracked-views';\nimport { TRACKING_ID_STUDENT } from '../../journey/tracking-id/tracking-id-student';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport { ArcContainer } from '../comps/arc-container/arc-container';\nimport {\n getAboutGameActivitiesSteps,\n getAboutGameActivitiesStepsForKTo1,\n} from './about-game-activities-constants';\nimport * as Styled from './about-game-activities-styled';\nimport type { IAboutGameActivitiesProps } from './about-game-activities-types';\nimport { EDeviceType } from '../../ui/theme/constants';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\n\nconst AboutGameActivities: FC<IAboutGameActivitiesProps> = memo(\n ({ show = false, isGradeKTo1 = false, onDismiss }) => {\n const { device } = useTheme();\n const isTouchDevice = device <= EDeviceType.TABLET;\n const [currentStep, setCurrentStep] = useState(0);\n const { trackView } = useJourney();\n const trackedViews = useGetTrackedViews();\n const { playButtonSound } = useCircleSounds();\n\n const isInfoAboutGameActivitiesViewed = trackedViews.includes(\n TRACKING_ID_STUDENT.INFO_ABOUT_GAME_ACTIVITIES,\n );\n\n const [showInfo, setShowInfo] = useState(
|
|
1
|
+
{"version":3,"file":"about-game-activities.js","sources":["../../../../src/features/circle-games/about-game-activities/about-game-activities.tsx"],"sourcesContent":["import { useState, useCallback, memo, useMemo, useEffect, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport BackIcon from '../../../assets/line-icons/icons/back2';\nimport { useGetTrackedViews } from '../../journey/hooks/use-get-tracked-views';\nimport { TRACKING_ID_STUDENT } from '../../journey/tracking-id/tracking-id-student';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport { ArcContainer } from '../comps/arc-container/arc-container';\nimport {\n getAboutGameActivitiesSteps,\n getAboutGameActivitiesStepsForKTo1,\n} from './about-game-activities-constants';\nimport * as Styled from './about-game-activities-styled';\nimport type { IAboutGameActivitiesProps } from './about-game-activities-types';\nimport { EDeviceType } from '../../ui/theme/constants';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\n\nconst AboutGameActivities: FC<IAboutGameActivitiesProps> = memo(\n ({ show = false, isGradeKTo1 = false, onDismiss }) => {\n const { device } = useTheme();\n const isTouchDevice = device <= EDeviceType.TABLET;\n const [currentStep, setCurrentStep] = useState(0);\n const { trackView } = useJourney();\n const trackedViews = useGetTrackedViews();\n const { playButtonSound } = useCircleSounds();\n\n const isInfoAboutGameActivitiesViewed = trackedViews.includes(\n TRACKING_ID_STUDENT.INFO_ABOUT_GAME_ACTIVITIES,\n );\n\n const [showInfo, setShowInfo] = useState(show);\n\n const steps = useMemo(\n () =>\n isGradeKTo1\n ? getAboutGameActivitiesStepsForKTo1(isTouchDevice)\n : getAboutGameActivitiesSteps(isTouchDevice),\n [isTouchDevice, isGradeKTo1],\n );\n const isFirstStep = currentStep === 0;\n const isLastStep = currentStep === steps.length - 1;\n\n const currentStepData = steps[currentStep];\n\n const handleClose = useCallback(() => {\n setShowInfo(false);\n playButtonSound();\n onDismiss?.();\n }, [onDismiss, playButtonSound]);\n\n const handlePrevious = useCallback(() => {\n if (currentStep > 0) {\n setCurrentStep(currentStep - 1);\n }\n }, [currentStep]);\n\n const handleNext = useCallback(() => {\n if (currentStep < steps.length - 1) {\n setCurrentStep(currentStep + 1);\n }\n\n if (isLastStep) {\n if (!isInfoAboutGameActivitiesViewed) {\n trackView(TRACKING_ID_STUDENT.INFO_ABOUT_GAME_ACTIVITIES);\n }\n handleClose();\n }\n }, [\n currentStep,\n handleClose,\n isLastStep,\n trackView,\n isInfoAboutGameActivitiesViewed,\n steps.length,\n ]);\n\n useEffect(() => {\n if (show) {\n setShowInfo(true);\n setCurrentStep(0);\n } else {\n setShowInfo(false);\n }\n }, [show]);\n\n if (!currentStepData || !show) {\n return null;\n }\n\n return (\n showInfo && (\n <ArcContainer\n onClose={isInfoAboutGameActivitiesViewed && show ? handleClose : undefined}\n zIndex={10}\n contentContainerHeight={'calc(100% - 128px)'}\n >\n <Styled.Wrapper>\n <Styled.ContentContainer>\n <Styled.VideoContainer $isVideoCircular={currentStepData.isVideoCircular}>\n <Styled.Video key={currentStep} playsInline autoPlay loop muted>\n <source src={currentStepData.videoUrl} type=\"video/mp4\" />\n Your browser does not support the video tag.\n </Styled.Video>\n </Styled.VideoContainer>\n <Styled.Header>\n <Text\n $renderAs=\"ah4-bold\"\n $renderOnMobileAs=\"ab1-black\"\n $color=\"WHITE\"\n $align=\"center\"\n >\n {currentStepData.headerText}\n </Text>\n </Styled.Header>\n <Separator height={20} />\n <Styled.Footer>\n {currentStepData.footerText && (\n <Text $renderAs=\"ub1\" $renderOnMobileAs=\"ub2\" $color=\"WHITE_T_87\" $align=\"center\">\n {currentStepData.footerText}\n </Text>\n )}\n </Styled.Footer>\n </Styled.ContentContainer>\n\n <Styled.NavigationContainer $isFirstStep={isFirstStep}>\n {!isFirstStep && (\n <IconButton\n Icon={BackIcon}\n onClick={handlePrevious}\n disabled={false}\n size=\"small\"\n analyticsLabel=\"previous-step\"\n renderAs=\"black-dark\"\n />\n )}\n <Button\n label={isLastStep ? 'Get Started' : 'Next'}\n onClick={handleNext}\n disabled={false}\n size=\"small\"\n analyticsLabel={isLastStep ? 'get-started' : 'next-step'}\n renderAs={isLastStep ? 'secondary-dark' : 'black-dark'}\n />\n </Styled.NavigationContainer>\n </Styled.Wrapper>\n </ArcContainer>\n )\n );\n },\n);\n\nAboutGameActivities.displayName = 'AboutGameActivities';\n\nexport default AboutGameActivities;\n"],"names":["AboutGameActivities","memo","show","isGradeKTo1","onDismiss","device","useTheme","isTouchDevice","EDeviceType","currentStep","setCurrentStep","useState","trackView","useJourney","trackedViews","useGetTrackedViews","playButtonSound","useCircleSounds","isInfoAboutGameActivitiesViewed","TRACKING_ID_STUDENT","showInfo","setShowInfo","steps","useMemo","getAboutGameActivitiesStepsForKTo1","getAboutGameActivitiesSteps","isFirstStep","isLastStep","currentStepData","handleClose","useCallback","handlePrevious","handleNext","useEffect","jsx","ArcContainer","jsxs","Styled.Wrapper","Styled.ContentContainer","Styled.VideoContainer","Styled.Video","Styled.Header","Text","Separator","Styled.Footer","Styled.NavigationContainer","IconButton","BackIcon","Button","AboutGameActivities$1"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAMA,IAAqDC;AAAA,EACzD,CAAC,EAAE,MAAAC,IAAO,IAAO,aAAAC,IAAc,IAAO,WAAAC,QAAgB;AAC9C,UAAA,EAAE,QAAAC,MAAWC,KACbC,IAAgBF,KAAUG,EAAY,QACtC,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,EAAE,WAAAC,MAAcC,KAChBC,IAAeC,KACf,EAAE,iBAAAC,MAAoBC,KAEtBC,IAAkCJ,EAAa;AAAA,MACnDK,EAAoB;AAAA,IAAA,GAGhB,CAACC,GAAUC,CAAW,IAAIV,EAAST,CAAI,GAEvCoB,IAAQC;AAAA,MACZ,MACEpB,IACIqB,EAAmCjB,CAAa,IAChDkB,EAA4BlB,CAAa;AAAA,MAC/C,CAACA,GAAeJ,CAAW;AAAA,IAAA,GAEvBuB,IAAcjB,MAAgB,GAC9BkB,IAAalB,MAAgBa,EAAM,SAAS,GAE5CM,IAAkBN,EAAMb,CAAW,GAEnCoB,IAAcC,EAAY,MAAM;AACpC,MAAAT,EAAY,EAAK,GACDL,KACJZ,KAAA,QAAAA;AAAA,IAAA,GACX,CAACA,GAAWY,CAAe,CAAC,GAEzBe,IAAiBD,EAAY,MAAM;AACvC,MAAIrB,IAAc,KAChBC,EAAeD,IAAc,CAAC;AAAA,IAChC,GACC,CAACA,CAAW,CAAC,GA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