@cuemath/leap 2.8.23 → 2.8.24-hg1
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/lotties/circle/tables/advance-mode-segment-lottie.json.js +4370 -0
- package/dist/assets/lotties/circle/tables/advance-mode-segment-lottie.json.js.map +1 -0
- package/dist/assets/lotties/circle/tables/infinite-button-bg.json.js +1552 -0
- package/dist/assets/lotties/circle/tables/infinite-button-bg.json.js.map +1 -0
- package/dist/assets/lotties/circle/tables/infinite-button-symbol.json.js +1795 -0
- package/dist/assets/lotties/circle/tables/infinite-button-symbol.json.js.map +1 -0
- package/dist/assets/lotties/circle/tables/random-mode-segment-lottie.json.js +9661 -0
- package/dist/assets/lotties/circle/tables/random-mode-segment-lottie.json.js.map +1 -0
- package/dist/assets/lotties/circle/tables/sequence-mode-segment-lottie.json.js +8630 -0
- package/dist/assets/lotties/circle/tables/sequence-mode-segment-lottie.json.js.map +1 -0
- package/dist/assets/lotties/circle/tables/table-mode-reveal.json.js +9076 -0
- package/dist/assets/lotties/circle/tables/table-mode-reveal.json.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js +53 -0
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js +24 -0
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js +7 -0
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js +6 -6
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js +29 -73
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js +83 -81
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js +20 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js +24 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js +83 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +161 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +223 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -0
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +25 -15
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher-styled.js +6 -5
- package/dist/features/circle-games/game-launcher/game-launcher-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +123 -82
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/games/web-view/enums/project-type-enum.js +1 -1
- package/dist/features/circle-games/games/web-view/enums/project-type-enum.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view.js +70 -83
- package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js +17 -16
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js.map +1 -1
- package/dist/features/post-game-stats/clock/clock-styled.js +11 -10
- package/dist/features/post-game-stats/clock/clock-styled.js.map +1 -1
- package/dist/features/post-game-stats/points/points-styled.js +7 -6
- package/dist/features/post-game-stats/points/points-styled.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats-styled.js +1 -1
- package/dist/features/post-game-stats/post-game-stats-styled.js.map +1 -1
- package/dist/features/post-game-stats/streak/streak-styled.js +18 -17
- package/dist/features/post-game-stats/streak/streak-styled.js.map +1 -1
- package/dist/features/trial-session/comps/trial-circle-game/constants.js.map +1 -1
- package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js.map +1 -1
- package/dist/index.d.ts +72 -109
- package/dist/index.js +203 -208
- package/package.json +1 -1
- package/dist/features/circle-games/games/web-view/enums/project-ids-enum.js +0 -14
- package/dist/features/circle-games/games/web-view/enums/project-ids-enum.js.map +0 -1
@@ -1,17 +1,17 @@
|
|
1
|
-
import { useState as
|
2
|
-
import { useGetCircleHomeAPI as
|
3
|
-
import { ProjectType as
|
1
|
+
import { useState as p, useCallback as E, useEffect as R } from "react";
|
2
|
+
import { useGetCircleHomeAPI as u } from "../../api/get-content-for-today/get-circle-home-api.js";
|
3
|
+
import { ProjectType as s } from "../../../games/web-view/enums/project-type-enum.js";
|
4
4
|
const O = (r, o, n) => {
|
5
|
-
const [
|
6
|
-
|
5
|
+
const [m, l] = p(null), { data: a, get: c, isProcessed: i, ..._ } = u(), d = E(() => {
|
6
|
+
c("", {
|
7
7
|
user_id: r,
|
8
8
|
country_code: o,
|
9
9
|
grade: n
|
10
10
|
});
|
11
|
-
}, [
|
12
|
-
return
|
13
|
-
let
|
14
|
-
|
11
|
+
}, [c, r, o, n]);
|
12
|
+
return R(() => {
|
13
|
+
let e = null;
|
14
|
+
i && a && (e = {
|
15
15
|
points: a.points,
|
16
16
|
streakDays: a.streak_days,
|
17
17
|
streakStatus: a.streak_status,
|
@@ -19,7 +19,7 @@ const O = (r, o, n) => {
|
|
19
19
|
projects: {
|
20
20
|
games: {
|
21
21
|
label: a.projects.games.label,
|
22
|
-
type:
|
22
|
+
type: s.GAME,
|
23
23
|
initialProgressValue: 0,
|
24
24
|
data: a.projects.games.data.map((t) => ({
|
25
25
|
id: t.id,
|
@@ -32,7 +32,7 @@ const O = (r, o, n) => {
|
|
32
32
|
},
|
33
33
|
puzzles: {
|
34
34
|
label: a.projects.puzzles.label,
|
35
|
-
type:
|
35
|
+
type: s.PUZZLE,
|
36
36
|
initialProgressValue: 0,
|
37
37
|
data: a.projects.puzzles.data.map((t) => ({
|
38
38
|
id: t.id,
|
@@ -58,9 +58,9 @@ const O = (r, o, n) => {
|
|
58
58
|
CIRCLE_STREAK_UPDATE_JOURNEY: a.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,
|
59
59
|
CIRCLE_TUTORIAL_JOURNEY: a.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY
|
60
60
|
}
|
61
|
-
}, a.projects.lessons && (
|
61
|
+
}, a.projects.lessons && (e.projects.lessons = {
|
62
62
|
label: a.projects.lessons.label,
|
63
|
-
type:
|
63
|
+
type: s.LESSON,
|
64
64
|
initialProgressValue: 0,
|
65
65
|
data: a.projects.lessons.data.map((t) => ({
|
66
66
|
id: t.id,
|
@@ -73,8 +73,18 @@ const O = (r, o, n) => {
|
|
73
73
|
targetQuestions: t.target_questions,
|
74
74
|
status: t.status
|
75
75
|
}))
|
76
|
-
})
|
77
|
-
|
76
|
+
}), a.projects.tables && (e.projects.tables = {
|
77
|
+
label: a.projects.tables.label,
|
78
|
+
type: s.LESSON,
|
79
|
+
data: {
|
80
|
+
infiniteModeHighScore: a.projects.tables.data.infinite_mode_high_score,
|
81
|
+
tableList: a.projects.tables.data.table_wise_details.map((t) => ({
|
82
|
+
tableNumber: t.table_number,
|
83
|
+
stars: t.stars
|
84
|
+
}))
|
85
|
+
}
|
86
|
+
})), l(e);
|
87
|
+
}, [a, i]), { data: m, isProcessed: i, getCircleHomeDetails: d, ..._ };
|
78
88
|
};
|
79
89
|
export {
|
80
90
|
O as useGetCircleHomeDetailsDal
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type {\n ICircleHomeDetails,\n TStreakStatus,\n TTableMode,\n} from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useGetCircleHomeAPI } from '../../api/get-content-for-today/get-circle-home-api';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n countryCode: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: () => void;\n} => {\n const [contentForToday, setContentForToday] = useState<ICircleHomeDetails | null>(null);\n const { data, get: getHomeDetails, isProcessed, ...rest } = useGetCircleHomeAPI();\n\n const getCircleHomeDetails = useCallback(() => {\n getHomeDetails('', {\n user_id: userId,\n country_code: countryCode,\n grade: grade,\n });\n }, [getHomeDetails, userId, countryCode, grade]);\n\n useEffect(() => {\n let circleHomeDetails: ICircleHomeDetails | null = null;\n\n if (isProcessed && data) {\n circleHomeDetails = {\n points: data.points,\n streakDays: data.streak_days,\n streakStatus: data.streak_status as TStreakStatus,\n tournamentRank: data.tournament_rank,\n projects: {\n games: {\n label: data.projects.games.label,\n type: ProjectType.GAME,\n initialProgressValue: 0,\n data: data.projects.games.data.map(game => ({\n id: game.id,\n name: game.name,\n cardLottie: game.card,\n tutorial: game.tutorial,\n variant: game.variant,\n isPlayed: game.played,\n })),\n },\n puzzles: {\n label: data.projects.puzzles.label,\n type: ProjectType.PUZZLE,\n initialProgressValue: 0,\n data: data.projects.puzzles.data.map(puzzle => ({\n id: puzzle.id,\n name: puzzle.name,\n cardLottie: puzzle.card,\n tutorial: puzzle.tutorial,\n variant: puzzle.variant,\n question: puzzle.question,\n isHintSeen: puzzle.is_hint_seen,\n solved: puzzle.solved,\n })),\n },\n },\n timestamps: {\n startTimestamp: data.timestamps.start_timestamp,\n endTimestamp: data.timestamps.end_timestamp,\n current: data.timestamps.current,\n },\n coachmarkProgress: {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,\n CIRCLE_LEADERBOARD_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,\n CIRCLE_POINTS_REWARD_JOURNEY: data.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,\n CIRCLE_STREAK_UPDATE_JOURNEY: data.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,\n CIRCLE_TUTORIAL_JOURNEY: data.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY,\n },\n };\n\n if (data.projects.lessons) {\n circleHomeDetails.projects.lessons = {\n label: data.projects.lessons.label,\n type: ProjectType.LESSON,\n initialProgressValue: 0,\n data: data.projects.lessons.data.map(lesson => ({\n id: lesson.id,\n name: lesson.name,\n cardLottie: lesson.card,\n tutorial: lesson.tutorial,\n variant: lesson.variant,\n sessionId: lesson.session_id,\n miniGameIdentifier: lesson.mini_game_identifier,\n targetQuestions: lesson.target_questions,\n status: lesson.status,\n })),\n };\n }\n\n if (data.projects.tables) {\n circleHomeDetails.projects.tables = {\n label: data.projects.tables.label,\n type: ProjectType.LESSON,\n data: {\n infiniteModeHighScore: data.projects.tables.data.infinite_mode_high_score,\n tableList: data.projects.tables.data.table_wise_details.map(table => ({\n tableNumber: table.table_number,\n stars: table.stars as TTableMode[],\n })),\n },\n };\n }\n }\n setContentForToday(circleHomeDetails);\n }, [data, isProcessed]);\n\n return { data: contentForToday, isProcessed, getCircleHomeDetails, ...rest };\n};\n"],"names":["useGetCircleHomeDetailsDal","userId","countryCode","grade","contentForToday","setContentForToday","useState","data","getHomeDetails","isProcessed","rest","useGetCircleHomeAPI","getCircleHomeDetails","useCallback","useEffect","circleHomeDetails","ProjectType","game","puzzle","lesson","table"],"mappings":";;;AAWO,MAAMA,IAA6B,CACxCC,GACAC,GACAC,MAIG;AACH,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAoC,IAAI,GAChF,EAAE,MAAAC,GAAM,KAAKC,GAAgB,aAAAC,GAAa,GAAGC,EAAA,IAASC,KAEtDC,IAAuBC,EAAY,MAAM;AAC7C,IAAAL,EAAe,IAAI;AAAA,MACjB,SAASP;AAAA,MACT,cAAcC;AAAA,MACd,OAAAC;AAAA,IAAA,CACD;AAAA,KACA,CAACK,GAAgBP,GAAQC,GAAaC,CAAK,CAAC;AAE/C,SAAAW,EAAU,MAAM;AACd,QAAIC,IAA+C;AAEnD,IAAIN,KAAeF,MACGQ,IAAA;AAAA,MAClB,QAAQR,EAAK;AAAA,MACb,YAAYA,EAAK;AAAA,MACjB,cAAcA,EAAK;AAAA,MACnB,gBAAgBA,EAAK;AAAA,MACrB,UAAU;AAAA,QACR,OAAO;AAAA,UACL,OAAOA,EAAK,SAAS,MAAM;AAAA,UAC3B,MAAMS,EAAY;AAAA,UAClB,sBAAsB;AAAA,UACtB,MAAMT,EAAK,SAAS,MAAM,KAAK,IAAI,CAASU,OAAA;AAAA,YAC1C,IAAIA,EAAK;AAAA,YACT,MAAMA,EAAK;AAAA,YACX,YAAYA,EAAK;AAAA,YACjB,UAAUA,EAAK;AAAA,YACf,SAASA,EAAK;AAAA,YACd,UAAUA,EAAK;AAAA,UAAA,EACf;AAAA,QACJ;AAAA,QACA,SAAS;AAAA,UACP,OAAOV,EAAK,SAAS,QAAQ;AAAA,UAC7B,MAAMS,EAAY;AAAA,UAClB,sBAAsB;AAAA,UACtB,MAAMT,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWW,OAAA;AAAA,YAC9C,IAAIA,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O,KAAK,mBAAmB,IAAI,CAAUa,OAAA;AAAA,UACpE,aAAaA,EAAM;AAAA,UACnB,OAAOA,EAAM;AAAA,QAAA,EACb;AAAA,MACJ;AAAA,IAAA,KAINf,EAAmBU,CAAiB;AAAA,EAAA,GACnC,CAACR,GAAME,CAAW,CAAC,GAEf,EAAE,MAAML,GAAiB,aAAAK,GAAa,sBAAAG,GAAsB,GAAGF;AACxE;"}
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import i from "styled-components";
|
2
|
-
import { GAME_LAUNCHER_SIZE as
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
import { GAME_LAUNCHER_SIZE as o } from "./comps/card-container/constants.js";
|
3
|
+
import { GAME_LAUNCHER_ASSET_PADDING as t } from "./comps/segmented-game-card/constants.js";
|
4
|
+
const m = i.div`
|
5
|
+
height: ${o + t}px;
|
6
|
+
width: ${o + t}px;
|
6
7
|
`;
|
7
8
|
export {
|
8
|
-
|
9
|
+
m as SleepyBoiLottyContainer
|
9
10
|
};
|
10
11
|
//# sourceMappingURL=game-launcher-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"game-launcher-styled.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport {
|
1
|
+
{"version":3,"file":"game-launcher-styled.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { GAME_LAUNCHER_SIZE } from './comps/card-container/constants';\nimport { GAME_LAUNCHER_ASSET_PADDING } from './comps/segmented-game-card/constants';\n\nexport const SleepyBoiLottyContainer = styled.div`\n height: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n width: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n`;\n"],"names":["SleepyBoiLottyContainer","styled","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING"],"mappings":";;;AAKO,MAAMA,IAA0BC,EAAO;AAAA,YAClCC,IAAqBC,CAA2B;AAAA,WACjDD,IAAqBC,CAA2B;AAAA;"}
|
@@ -1,122 +1,163 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import
|
3
|
-
import { memo as
|
4
|
-
import { CircularLoader as
|
5
|
-
import { useCircleSounds as
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
2
|
+
import B from "lottie-web";
|
3
|
+
import { memo as D, useState as K, useRef as J, useCallback as t, useMemo as I, useEffect as V } from "react";
|
4
|
+
import { CircularLoader as Y } from "../../ui/loader/circular-loader/circular-loader.js";
|
5
|
+
import { useCircleSounds as w } from "../hooks/use-circle-sounds/use-circle-sounds.js";
|
6
|
+
import { CircleSoundKey as i } from "../hooks/use-circle-sounds/use-circle-sounds-enums.js";
|
7
|
+
import { Carousel as _ } from "./comps/carousel/carousel.js";
|
8
|
+
import { SegmentedGameCard as a } from "./comps/segmented-game-card/segmented-game-card.js";
|
9
|
+
import { TablesCard as U } from "./comps/tables-card/tables-card.js";
|
10
|
+
import { GAME_LAUNCHER_ANALYTICS_EVENTS as R } from "./game-launcher-analytics-events.js";
|
11
|
+
import { SleepyBoiLottyContainer as Z } from "./game-launcher-styled.js";
|
12
|
+
import { useGameLauncherJourney as H } from "./use-game-launcher-journey/use-game-launcher-journey.js";
|
13
|
+
import { ProjectType as m } from "../games/web-view/enums/project-type-enum.js";
|
14
|
+
const O = () => import("../../../assets/lotties/circle/sleepy-boi-lottie.json.js"), ne = D(
|
15
|
+
({ onSegmentClick: r, onJourneyComplete: T, journeyId: u, data: e, isLoading: g, defaultIndex: h = 0 }) => {
|
16
|
+
const [G, v] = K(h), c = J(null), { playSwipSound: f, play: o } = w(), {
|
17
|
+
gameRefs: p,
|
18
|
+
lessonRefs: C,
|
19
|
+
puzzleRefs: y,
|
20
|
+
startJourney: L,
|
21
|
+
carouselNextBtnRef: A,
|
22
|
+
isJourneyInProgress: b
|
23
|
+
} = H({
|
24
|
+
setCarouselIndex: v,
|
25
|
+
onSegmentClick: r,
|
26
|
+
onJourneyComplete: T
|
27
|
+
}), P = t(
|
28
|
+
(s) => {
|
29
|
+
o(i.GAME_CARD_CLICK), r(s, m.TABLE);
|
30
|
+
},
|
31
|
+
[r, o]
|
32
|
+
), E = t(
|
33
|
+
(s) => {
|
34
|
+
s.status !== "completed" && (o(i.GAME_CARD_CLICK), r(s, m.LESSON));
|
35
|
+
},
|
36
|
+
[r, o]
|
37
|
+
), z = t(
|
38
|
+
(s) => {
|
39
|
+
o(i.GAME_CARD_CLICK), r(s, m.GAME);
|
40
|
+
},
|
41
|
+
[r, o]
|
42
|
+
), x = t(
|
43
|
+
(s) => {
|
44
|
+
o(i.GAME_CARD_CLICK), r(s, m.PUZZLE);
|
45
|
+
},
|
46
|
+
[r, o]
|
47
|
+
), M = I(() => {
|
48
|
+
let s = [];
|
49
|
+
return e && (e.lessons && (s = [
|
50
|
+
...s,
|
51
|
+
/* @__PURE__ */ n(
|
52
|
+
a,
|
31
53
|
{
|
32
|
-
ref:
|
54
|
+
ref: C,
|
33
55
|
label: e.lessons.label,
|
34
|
-
value: e.lessons.data.filter((
|
56
|
+
value: e.lessons.data.filter((l) => l.status === "completed").length,
|
35
57
|
maxValue: e.lessons.data.length,
|
36
58
|
initialValue: e.lessons.initialProgressValue,
|
37
|
-
data: e == null ? void 0 : e.lessons.data.map((
|
38
|
-
card:
|
39
|
-
name:
|
40
|
-
isCompleted:
|
41
|
-
onPress: () =>
|
59
|
+
data: e == null ? void 0 : e.lessons.data.map((l) => ({
|
60
|
+
card: l.cardLottie,
|
61
|
+
name: l.name,
|
62
|
+
isCompleted: l.status === "completed",
|
63
|
+
onPress: () => E(l)
|
42
64
|
}))
|
43
65
|
}
|
44
66
|
)
|
45
|
-
]),
|
46
|
-
...
|
47
|
-
/* @__PURE__ */
|
48
|
-
|
67
|
+
]), s = [
|
68
|
+
...s,
|
69
|
+
/* @__PURE__ */ n(
|
70
|
+
a,
|
49
71
|
{
|
50
|
-
ref:
|
72
|
+
ref: p,
|
51
73
|
label: e.games.label,
|
52
|
-
value: e.games.data.filter((
|
74
|
+
value: e.games.data.filter((l) => l.isPlayed).length,
|
53
75
|
maxValue: e.games.data.length,
|
54
76
|
initialValue: e.games.initialProgressValue,
|
55
|
-
data: e.games.data.map((
|
56
|
-
card:
|
57
|
-
name:
|
77
|
+
data: e.games.data.map((l) => ({
|
78
|
+
card: l.cardLottie,
|
79
|
+
name: l.name,
|
58
80
|
isCompleted: !1,
|
59
|
-
onPress: () =>
|
81
|
+
onPress: () => z(l)
|
60
82
|
}))
|
61
83
|
}
|
62
84
|
),
|
63
|
-
/* @__PURE__ */
|
64
|
-
|
85
|
+
/* @__PURE__ */ n(
|
86
|
+
a,
|
65
87
|
{
|
66
|
-
ref:
|
88
|
+
ref: y,
|
67
89
|
label: e.puzzles.label,
|
68
|
-
value: e.puzzles.data.filter((
|
90
|
+
value: e.puzzles.data.filter((l) => l.solved).length,
|
69
91
|
maxValue: e.puzzles.data.length,
|
70
92
|
initialValue: e.puzzles.initialProgressValue,
|
71
|
-
data: e.puzzles.data.map((
|
72
|
-
card:
|
73
|
-
name:
|
74
|
-
isCompleted:
|
75
|
-
onPress: () =>
|
93
|
+
data: e.puzzles.data.map((l) => ({
|
94
|
+
card: l.cardLottie,
|
95
|
+
name: l.name,
|
96
|
+
isCompleted: l.solved,
|
97
|
+
onPress: () => x(l)
|
76
98
|
}))
|
77
99
|
}
|
78
100
|
)
|
79
|
-
]
|
80
|
-
|
81
|
-
|
101
|
+
], e.tables && (s = [
|
102
|
+
...s,
|
103
|
+
/* @__PURE__ */ n(
|
104
|
+
U,
|
105
|
+
{
|
106
|
+
label: e.tables.label,
|
107
|
+
data: e.tables.data,
|
108
|
+
onPress: P
|
109
|
+
}
|
110
|
+
)
|
111
|
+
])), s;
|
112
|
+
}, [
|
113
|
+
e,
|
114
|
+
p,
|
115
|
+
C,
|
116
|
+
y,
|
117
|
+
E,
|
118
|
+
P,
|
119
|
+
x,
|
120
|
+
z
|
121
|
+
]), N = I(
|
122
|
+
() => [/* @__PURE__ */ n(Z, { ref: c })],
|
82
123
|
[]
|
83
124
|
);
|
84
|
-
return
|
85
|
-
let
|
125
|
+
return V(() => {
|
126
|
+
let s = null;
|
86
127
|
return (async () => {
|
87
|
-
const
|
88
|
-
|
89
|
-
container:
|
90
|
-
animationData:
|
128
|
+
const S = (await O()).default;
|
129
|
+
s = B.loadAnimation({
|
130
|
+
container: c.current,
|
131
|
+
animationData: S,
|
91
132
|
autoplay: !0,
|
92
133
|
loop: !0,
|
93
134
|
renderer: "canvas"
|
94
135
|
});
|
95
136
|
})(), () => {
|
96
|
-
|
137
|
+
s == null || s.destroy();
|
97
138
|
};
|
98
|
-
}, []),
|
99
|
-
e != null && e.puzzles &&
|
100
|
-
}, [e == null ? void 0 : e.lessons, e == null ? void 0 : e.puzzles,
|
101
|
-
|
139
|
+
}, []), V(() => {
|
140
|
+
e != null && e.puzzles && u && b && L(e == null ? void 0 : e.puzzles, !!(e != null && e.lessons), u);
|
141
|
+
}, [e == null ? void 0 : e.lessons, e == null ? void 0 : e.puzzles, b, u, L]), g ? /* @__PURE__ */ n(Y, {}) : e ? /* @__PURE__ */ n(
|
142
|
+
_,
|
102
143
|
{
|
103
|
-
ref:
|
104
|
-
items:
|
105
|
-
defaultIndex:
|
106
|
-
onNext:
|
107
|
-
onPrev:
|
144
|
+
ref: A,
|
145
|
+
items: M,
|
146
|
+
defaultIndex: G,
|
147
|
+
onNext: f,
|
148
|
+
onPrev: f,
|
108
149
|
analyticsNext: {
|
109
|
-
analyticsLabel:
|
150
|
+
analyticsLabel: R.NEXT_ACTIVITY
|
110
151
|
},
|
111
152
|
analyticsPrev: {
|
112
|
-
analyticsLabel:
|
153
|
+
analyticsLabel: R.PREV_ACTIVITY
|
113
154
|
}
|
114
155
|
}
|
115
|
-
) : /* @__PURE__ */
|
116
|
-
|
156
|
+
) : /* @__PURE__ */ n(
|
157
|
+
_,
|
117
158
|
{
|
118
|
-
ref:
|
119
|
-
items:
|
159
|
+
ref: A,
|
160
|
+
items: N,
|
120
161
|
analyticsNext: {
|
121
162
|
analyticsLabel: ""
|
122
163
|
},
|
@@ -128,6 +169,6 @@ const J = () => import("../../../assets/lotties/circle/sleepy-boi-lottie.json.js
|
|
128
169
|
}
|
129
170
|
);
|
130
171
|
export {
|
131
|
-
|
172
|
+
ne as GameLauncher
|
132
173
|
};
|
133
174
|
//# sourceMappingURL=game-launcher.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { IGameLauncherProps } from './game-launcher-types';\nimport type { AnimationItem } from 'lottie-web';\nimport type { FC, ReactNode } from 'react';\n\nimport Lottie from 'lottie-web';\nimport { memo, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { Carousel } from './comps/carousel/carousel';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport * as Styled from './game-launcher-styled';\nimport { useGameLauncherJourney } from './use-game-launcher-journey/use-game-launcher-journey';\n\nconst sleepyBoi = () => import('../../../assets/lotties/circle/sleepy-boi-lottie.json');\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({ onSegmentClick, onJourneyComplete, journeyId, data, isLoading, defaultIndex = 0 }) => {\n const [currentIndex, setCurrentIndex] = useState(defaultIndex);\n\n const lottieContainerRef = useRef<HTMLDivElement>(null);\n const { playSwipSound } = useCircleSounds();\n\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney,\n carouselNextBtnRef,\n isJourneyInProgress,\n } = useGameLauncherJourney({\n setCarouselIndex: setCurrentIndex,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () =>\n lesson.status === 'completed'\n ? undefined\n : onSegmentClick(lesson, ProjectType.LESSON),\n }))}\n />,\n ];\n }\n\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => onSegmentClick(game, ProjectType.GAME),\n }))}\n />,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => onSegmentClick(puzzle, ProjectType.PUZZLE),\n }))}\n />,\n ];\n }\n\n return itemTypes;\n }, [data, gameRefs, lessonRefs, onSegmentClick, puzzleRefs]);\n\n const sleepyBoiItem = useMemo(\n () => [<Styled.SleepyBoiLottyContainer ref={lottieContainerRef} />],\n [],\n );\n\n useEffect(() => {\n let animation: AnimationItem | null = null;\n const loadAnimation = async () => {\n const animationModule = await sleepyBoi();\n\n const animationData = animationModule.default;\n\n animation = Lottie.loadAnimation({\n container: lottieContainerRef.current as Element,\n animationData: animationData,\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n });\n };\n\n loadAnimation();\n\n return () => {\n animation?.destroy();\n };\n }, []);\n\n // Start game launcher journey when the data for puzzles is available\n useEffect(() => {\n if (data?.puzzles && journeyId && isJourneyInProgress) {\n startJourney(data?.puzzles, !!data?.lessons, journeyId);\n }\n }, [data?.lessons, data?.puzzles, isJourneyInProgress, journeyId, startJourney]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={items}\n defaultIndex={currentIndex}\n onNext={playSwipSound}\n onPrev={playSwipSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoi","GameLauncher","memo","onSegmentClick","onJourneyComplete","journeyId","data","isLoading","defaultIndex","currentIndex","setCurrentIndex","useState","lottieContainerRef","useRef","playSwipSound","useCircleSounds","gameRefs","lessonRefs","puzzleRefs","startJourney","carouselNextBtnRef","isJourneyInProgress","useGameLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","lesson","ProjectType","game","puzzle","sleepyBoiItem","Styled.SleepyBoiLottyContainer","useEffect","animation","animationData","Lottie","CircularLoader","Carousel","GAME_LAUNCHER_AN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AEtC,QAAAmC,IAAYE,EAAO,cAAc;AAAA,UAC/B,WAAWzB,EAAmB;AAAA,UAC9B,eAAAwB;AAAA,UACA,UAAU;AAAA,UACV,MAAM;AAAA,UACN,UAAU;AAAA,QAAA,CACX;AAAA,MAAA,MAKI,MAAM;AACX,QAAAD,KAAA,QAAAA,EAAW;AAAA,MAAQ;AAAA,IAEvB,GAAG,CAAE,CAAA,GAGLD,EAAU,MAAM;AACV,MAAA5B,KAAA,QAAAA,EAAM,WAAWD,KAAagB,KAChCF,EAAab,KAAA,gBAAAA,EAAM,SAAS,CAAC,EAACA,KAAA,QAAAA,EAAM,UAASD,CAAS;AAAA,IACxD,GACC,CAACC,KAAA,gBAAAA,EAAM,SAASA,KAAA,gBAAAA,EAAM,SAASe,GAAqBhB,GAAWc,CAAY,CAAC,GAE3EZ,sBACM+B,GAAe,CAAA,CAAA,IAGpBhC,IAgBH,gBAAAoB;AAAA,MAACa;AAAA,MAAA;AAAA,QACC,KAAKnB;AAAA,QACL,OAAAG;AAAA,QACA,cAAcd;AAAA,QACd,QAAQK;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgB0B,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA,IAzBA,gBAAAd;AAAA,MAACa;AAAA,MAAA;AAAA,QACC,KAAKnB;AAAA,QACL,OAAOY;AAAA,QACP,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA;AAAA,EAoBR;AACF;"}
|
1
|
+
{"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { ITableDetails } from './comps/tables-card/tables-card-types';\nimport type {\n Game,\n Lesson,\n Puzzle,\n} from './dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IGameLauncherProps } from './game-launcher-types';\nimport type { AnimationItem } from 'lottie-web';\nimport type { FC, ReactNode } from 'react';\n\nimport Lottie from 'lottie-web';\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../hooks/use-circle-sounds/use-circle-sounds-enums';\nimport { Carousel } from './comps/carousel/carousel';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { TablesCard } from './comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport * as Styled from './game-launcher-styled';\nimport { useGameLauncherJourney } from './use-game-launcher-journey/use-game-launcher-journey';\n\nconst sleepyBoi = () => import('../../../assets/lotties/circle/sleepy-boi-lottie.json');\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({ onSegmentClick, onJourneyComplete, journeyId, data, isLoading, defaultIndex = 0 }) => {\n const [currentIndex, setCurrentIndex] = useState(defaultIndex);\n\n const lottieContainerRef = useRef<HTMLDivElement>(null);\n const { playSwipSound, play } = useCircleSounds();\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney,\n carouselNextBtnRef,\n isJourneyInProgress,\n } = useGameLauncherJourney({\n setCarouselIndex: setCurrentIndex,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const onTableSegmentClick = useCallback(\n (table: ITableDetails) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(table, ProjectType.TABLE);\n },\n [onSegmentClick, play],\n );\n\n const handleLessonSegmentClick = useCallback(\n (lesson: Lesson) => {\n if (lesson.status !== 'completed') {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(lesson, ProjectType.LESSON);\n }\n },\n [onSegmentClick, play],\n );\n\n const handleGameSegmentClick = useCallback(\n (game: Game) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(game, ProjectType.GAME);\n },\n [onSegmentClick, play],\n );\n\n const handlePuzzleSegmentClick = useCallback(\n (puzzle: Puzzle) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(puzzle, ProjectType.PUZZLE);\n },\n [onSegmentClick, play],\n );\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () => handleLessonSegmentClick(lesson),\n }))}\n />,\n ];\n }\n\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => handleGameSegmentClick(game),\n }))}\n />,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => handlePuzzleSegmentClick(puzzle),\n }))}\n />,\n ];\n\n if (data.tables) {\n itemTypes = [\n ...itemTypes,\n <TablesCard\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n />,\n ];\n }\n }\n\n return itemTypes;\n }, [\n data,\n gameRefs,\n lessonRefs,\n puzzleRefs,\n handleLessonSegmentClick,\n onTableSegmentClick,\n handlePuzzleSegmentClick,\n handleGameSegmentClick,\n ]);\n\n const sleepyBoiItem = useMemo(\n () => [<Styled.SleepyBoiLottyContainer ref={lottieContainerRef} />],\n [],\n );\n\n useEffect(() => {\n let animation: AnimationItem | null = null;\n const loadAnimation = async () => {\n const animationModule = await sleepyBoi();\n\n const animationData = animationModule.default;\n\n animation = Lottie.loadAnimation({\n container: lottieContainerRef.current as Element,\n animationData: animationData,\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n });\n };\n\n loadAnimation();\n\n return () => {\n animation?.destroy();\n };\n }, []);\n\n // Start game launcher journey when the data for puzzles is available\n useEffect(() => {\n if (data?.puzzles && journeyId && isJourneyInProgress) {\n startJourney(data?.puzzles, !!data?.lessons, journeyId);\n }\n }, [data?.lessons, data?.puzzles, isJourneyInProgress, journeyId, startJourney]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={items}\n defaultIndex={currentIndex}\n onNext={playSwipSound}\n onPrev={playSwipSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoi","GameLauncher","memo","onSegmentClick","onJourneyComplete","journeyId","data","isLoading","defaultIndex","currentIndex","setCurrentIndex","useState","lottieContainerRef","useRef","playSwipSound","play","useCircleSounds","gameRefs","lessonRefs","puzzleRefs","startJourney","carouselNextBtnRef","isJourneyInProgress","useGameLauncherJourney","onTableSegmentClick","useCallback","table","CircleSoundKey","ProjectType","handleLessonSegmentClick","lesson","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","items","useMemo","itemTypes","jsx","SegmentedGameCard","TablesCard","sleepyBoiItem","Styled.SleepyBoiLottyContainer","useEffect","animation","animationData","Lottie","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;;;AAwBA,MAAMA,IAAY,MAAM,OAAO,0DAAuD,GAEzEC,KAAuCC;AAAA,EAClD,CAAC,EAAE,gBAAAC,GAAgB,mBAAAC,GAAmB,WAAAC,GAAW,MAAAC,GAAM,WAAAC,GAAW,cAAAC,IAAe,QAAQ;AACvF,UAAM,CAACC,GAAcC,CAAe,IAAIC,EAASH,CAAY,GAEvDI,IAAqBC,EAAuB,IAAI,GAChD,EAAE,eAAAC,GAAe,MAAAC,EAAK,IAAIC,EAAgB,GAC1C;AAAA,MACJ,UAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,qBAAAC;AAAA,QACEC,EAAuB;AAAA,MACzB,kBAAkBb;AAAA,MAClB,gBAAAP;AAAA,MACA,mBAAAC;AAAA,IAAA,CACD,GAEKoB,IAAsBC;AAAA,MAC1B,CAACC,MAAyB;AACxB,QAAAX,EAAKY,EAAe,eAAe,GACpBxB,EAAAuB,GAAOE,EAAY,KAAK;AAAA,MACzC;AAAA,MACA,CAACzB,GAAgBY,CAAI;AAAA,IAAA,GAGjBc,IAA2BJ;AAAA,MAC/B,CAACK,MAAmB;AACd,QAAAA,EAAO,WAAW,gBACpBf,EAAKY,EAAe,eAAe,GACpBxB,EAAA2B,GAAQF,EAAY,MAAM;AAAA,MAE7C;AAAA,MACA,CAACzB,GAAgBY,CAAI;AAAA,IAAA,GAGjBgB,IAAyBN;AAAA,MAC7B,CAACO,MAAe;AACd,QAAAjB,EAAKY,EAAe,eAAe,GACpBxB,EAAA6B,GAAMJ,EAAY,IAAI;AAAA,MACvC;AAAA,MACA,CAACzB,GAAgBY,CAAI;A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AA,QAAA,CACX;AAAA,MAAA,MAKI,MAAM;AACX,QAAAD,KAAA,QAAAA,EAAW;AAAA,MAAQ;AAAA,IAEvB,GAAG,CAAE,CAAA,GAGLD,EAAU,MAAM;AACV,MAAArC,KAAA,QAAAA,EAAM,WAAWD,KAAaiB,KAChCF,EAAad,KAAA,gBAAAA,EAAM,SAAS,CAAC,EAACA,KAAA,QAAAA,EAAM,UAASD,CAAS;AAAA,IACxD,GACC,CAACC,KAAA,gBAAAA,EAAM,SAASA,KAAA,gBAAAA,EAAM,SAASgB,GAAqBjB,GAAWe,CAAY,CAAC,GAE3Eb,sBACMwC,GAAe,CAAA,CAAA,IAGpBzC,IAgBH,gBAAAgC;AAAA,MAACU;AAAA,MAAA;AAAA,QACC,KAAK3B;AAAA,QACL,OAAAc;AAAA,QACA,cAAc1B;AAAA,QACd,QAAQK;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgBmC,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA,IAzBA,gBAAAX;AAAA,MAACU;AAAA,MAAA;AAAA,QACC,KAAK3B;AAAA,QACL,OAAOoB;AAAA,QACP,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA;AAAA,EAoBR;AACF;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"project-type-enum.js","sources":["../../../../../../src/features/circle-games/games/web-view/enums/project-type-enum.ts"],"sourcesContent":["export enum ProjectType {\n GAME = 'game',\n PUZZLE = 'puzzle',\n LESSON = 'lesson',\n}\n"],"names":["ProjectType"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,SAAS,
|
1
|
+
{"version":3,"file":"project-type-enum.js","sources":["../../../../../../src/features/circle-games/games/web-view/enums/project-type-enum.ts"],"sourcesContent":["export enum ProjectType {\n GAME = 'game',\n PUZZLE = 'puzzle',\n LESSON = 'lesson',\n TABLE = 'table',\n}\n"],"names":["ProjectType"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAJEA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type {
|
1
|
+
{"version":3,"file":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type { WebViewEvent, ProjectOutcome, ProjectType } from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n}\n\ninterface ISyncableWebGameProps {\n joinByRoomId?: string;\n enableSync?: boolean; // applicable for all except multiplayer games and tables\n}\n\ninterface IBaseWebGameProps {\n projectId: string;\n variant: string;\n projectType: ProjectType;\n enableCloseButton?: boolean;\n}\n\nexport interface IMultiplayerWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n enablePlayerTurnIndicators?: boolean;\n}\n\nexport interface IPuzzleWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n question: string;\n askHintPermission?: boolean;\n}\n\nexport interface ILessonWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n miniGameIdentifier: string;\n sessionId: string;\n targetQuestions: number;\n}\n\nexport interface ITableWebGameProps extends IBaseWebGameProps {\n tableNumber: number;\n infiniteModeHighScore?: number;\n}\n\nexport interface IVibrationPattern {\n pattern: number[] | number;\n}\n\nexport enum IStatsToAwardErrorCode {\n DEFAULT = 'default',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport interface IPlayerStats {\n points: number;\n accuracy: number;\n timeSpent: number;\n streakDays: number;\n streakStatusToday: 'pending' | 'completed';\n errorCode: IStatsToAwardErrorCode;\n outcome: ProjectOutcome;\n value: string;\n}\n\nexport interface IInfoMessage {\n message: string;\n position: 'top' | 'bottom';\n}\n\nexport interface ITrackEvent {\n eventName: typeof WEBVIEW_ANALYTICS_EVENTS;\n properties: Record<string, unknown>;\n}\n\nexport interface IWebViewProps extends IframeHTMLAttributes<HTMLIFrameElement> {\n baseUrl: string;\n projectDetails:\n | IMultiplayerWebGameProps\n | IPuzzleWebGameProps\n | ILessonWebGameProps\n | ITableWebGameProps;\n playerDetails: IPlayer;\n onBack?: () => void;\n onGameLoad?: () => void;\n onGamePlayFinish?: (playerStats: IPlayerStats) => void;\n handleInfoMessage?: (infoMessage: IInfoMessage) => void;\n}\n\nexport interface IMessageProps {\n event: `${WebViewEvent}`;\n payload: IVibrationPattern | IPlayerStats | IInfoMessage | null;\n}\n"],"names":["IStatsToAwardErrorCode"],"mappings":"AAkDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
|