@cuemath/leap 2.8.62-rj-release-XX → 2.8.62
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/game-launcher/game-launcher.js +55 -57
- package/dist/features/circle-games/game-launcher/game-launcher.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 +47 -53
- package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
@@ -1,50 +1,49 @@
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
2
|
-
import { memo as
|
3
|
-
import { LOTTIE as
|
2
|
+
import { memo as g, useRef as x, useCallback as m, useMemo as z, useEffect as D } from "react";
|
3
|
+
import { LOTTIE as U } from "../../../assets/lottie/lottie.js";
|
4
4
|
import { JOURNEY_ID_STUDENT as G } from "../../journey/journey-id/journey-id-student.js";
|
5
|
-
import { useJourney as
|
6
|
-
import { CircularLoader as
|
7
|
-
import
|
8
|
-
import { useCircleSounds as
|
9
|
-
import { CircleSoundKey as
|
10
|
-
import { GAME_LAUNCHER_SIZE as
|
5
|
+
import { useJourney as Y } from "../../journey/use-journey/use-journey.js";
|
6
|
+
import { CircularLoader as B } from "../../ui/loader/circular-loader/circular-loader.js";
|
7
|
+
import K from "../../ui/lottie-animation/lottie-animation.js";
|
8
|
+
import { useCircleSounds as H } from "../hooks/use-circle-sounds/use-circle-sounds.js";
|
9
|
+
import { CircleSoundKey as t } from "../hooks/use-circle-sounds/use-circle-sounds-enums.js";
|
10
|
+
import { GAME_LAUNCHER_SIZE as Z } from "./comps/card-container/constants.js";
|
11
11
|
import { Carousel as V } from "./comps/carousel/carousel.js";
|
12
|
-
import { GAME_LAUNCHER_ASSET_PADDING as
|
13
|
-
import { SegmentedGameCard as
|
14
|
-
import { TablesCard as
|
12
|
+
import { GAME_LAUNCHER_ASSET_PADDING as w } from "./comps/segmented-game-card/constants.js";
|
13
|
+
import { SegmentedGameCard as E } from "./comps/segmented-game-card/segmented-game-card.js";
|
14
|
+
import { TablesCard as X } from "./comps/tables-card/tables-card.js";
|
15
15
|
import { GAME_LAUNCHER_ANALYTICS_EVENTS as S } from "./game-launcher-analytics-events.js";
|
16
|
-
import { useGameLauncherJourney as
|
17
|
-
import { useTableLauncherJourney as
|
18
|
-
import { ProjectType as
|
19
|
-
const M =
|
16
|
+
import { useGameLauncherJourney as j } from "./hooks/use-game-launcher-journey/use-game-launcher-journey.js";
|
17
|
+
import { useTableLauncherJourney as q } from "./hooks/use-table-launcher-journey/use-table-launcher-journey.js";
|
18
|
+
import { ProjectType as n } from "../games/web-view/enums/project-type-enum.js";
|
19
|
+
const M = Z + w, ce = g(
|
20
20
|
({
|
21
21
|
onSegmentClick: r,
|
22
|
-
journeyId:
|
22
|
+
journeyId: u,
|
23
23
|
data: e,
|
24
|
-
isLoading:
|
25
|
-
isTutorialOnboardingDone:
|
24
|
+
isLoading: f,
|
25
|
+
isTutorialOnboardingDone: a,
|
26
26
|
defaultIndex: J = 0,
|
27
|
-
showError: v,
|
28
27
|
onJourneyComplete: C
|
29
28
|
}) => {
|
30
|
-
const
|
29
|
+
const p = x(null), { isJourneyActive: L } = Y(), { playSwipSound: _, play: o } = H(), c = m(
|
31
30
|
(l) => {
|
32
|
-
o(
|
31
|
+
o(t.GAME_CARD_CLICK), r(l, n.TABLE);
|
33
32
|
},
|
34
33
|
[r, o]
|
35
|
-
), A =
|
34
|
+
), A = m(
|
36
35
|
(l) => {
|
37
|
-
l.status !== "completed" && (o(
|
36
|
+
l.status !== "completed" && (o(t.GAME_CARD_CLICK), r(l, n.LESSON));
|
38
37
|
},
|
39
38
|
[r, o]
|
40
|
-
), b =
|
39
|
+
), b = m(
|
41
40
|
(l) => {
|
42
|
-
o(
|
41
|
+
o(t.GAME_CARD_CLICK), r(l, n.GAME);
|
43
42
|
},
|
44
43
|
[r, o]
|
45
|
-
), T =
|
44
|
+
), T = m(
|
46
45
|
(l) => {
|
47
|
-
o(
|
46
|
+
o(t.GAME_CARD_CLICK), r(l, n.PUZZLE);
|
48
47
|
},
|
49
48
|
[r, o]
|
50
49
|
), {
|
@@ -52,20 +51,20 @@ const M = w + X, ae = x(
|
|
52
51
|
lessonRefs: R,
|
53
52
|
puzzleRefs: I,
|
54
53
|
startJourney: P
|
55
|
-
} =
|
56
|
-
carouselRefs:
|
54
|
+
} = j({
|
55
|
+
carouselRefs: p,
|
57
56
|
onSegmentClick: r,
|
58
57
|
onJourneyComplete: C
|
59
|
-
}), { startJourney: N, tableRef: h } =
|
60
|
-
carouselRefs:
|
58
|
+
}), { startJourney: N, tableRef: h } = q({
|
59
|
+
carouselRefs: p,
|
61
60
|
onTableSegmentClick: c,
|
62
61
|
onJourneyComplete: C
|
63
|
-
}),
|
62
|
+
}), v = z(() => {
|
64
63
|
let l = [];
|
65
64
|
return e && (e.lessons && (l = [
|
66
65
|
...l,
|
67
66
|
/* @__PURE__ */ i(
|
68
|
-
|
67
|
+
E,
|
69
68
|
{
|
70
69
|
ref: R,
|
71
70
|
label: e.lessons.label,
|
@@ -83,7 +82,7 @@ const M = w + X, ae = x(
|
|
83
82
|
]), l = [
|
84
83
|
...l,
|
85
84
|
/* @__PURE__ */ i(
|
86
|
-
|
85
|
+
E,
|
87
86
|
{
|
88
87
|
ref: y,
|
89
88
|
label: e.games.label,
|
@@ -99,7 +98,7 @@ const M = w + X, ae = x(
|
|
99
98
|
}
|
100
99
|
),
|
101
100
|
/* @__PURE__ */ i(
|
102
|
-
|
101
|
+
E,
|
103
102
|
{
|
104
103
|
ref: I,
|
105
104
|
label: e.puzzles.label,
|
@@ -117,7 +116,7 @@ const M = w + X, ae = x(
|
|
117
116
|
], e.tables && (l = [
|
118
117
|
...l,
|
119
118
|
/* @__PURE__ */ i(
|
120
|
-
|
119
|
+
X,
|
121
120
|
{
|
122
121
|
ref: h,
|
123
122
|
label: e.tables.label,
|
@@ -137,12 +136,12 @@ const M = w + X, ae = x(
|
|
137
136
|
T,
|
138
137
|
h,
|
139
138
|
c
|
140
|
-
]),
|
139
|
+
]), O = z(
|
141
140
|
() => [
|
142
141
|
/* @__PURE__ */ i(
|
143
|
-
|
142
|
+
K,
|
144
143
|
{
|
145
|
-
src:
|
144
|
+
src: U.SLEEPY_BOI,
|
146
145
|
width: M,
|
147
146
|
height: M
|
148
147
|
}
|
@@ -150,53 +149,52 @@ const M = w + X, ae = x(
|
|
150
149
|
],
|
151
150
|
[]
|
152
151
|
);
|
153
|
-
return
|
154
|
-
if (!(
|
155
|
-
if (e != null && e.puzzles &&
|
152
|
+
return D(() => {
|
153
|
+
if (!(f || !e || L)) {
|
154
|
+
if (e != null && e.puzzles && u === G.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {
|
156
155
|
P(e == null ? void 0 : e.puzzles, !!(e != null && e.lessons));
|
157
156
|
return;
|
158
157
|
}
|
159
|
-
e != null && e.tables &&
|
158
|
+
e != null && e.tables && u === G.CIRCLE_TABLES_INTRO_JOURNEY && N(e == null ? void 0 : e.tables, a);
|
160
159
|
}
|
161
160
|
}, [
|
162
161
|
e,
|
163
162
|
L,
|
164
|
-
p,
|
165
|
-
E,
|
166
163
|
f,
|
164
|
+
a,
|
165
|
+
u,
|
167
166
|
P,
|
168
167
|
N
|
169
|
-
]),
|
168
|
+
]), f ? /* @__PURE__ */ i(B, {}) : e ? /* @__PURE__ */ i(
|
170
169
|
V,
|
171
170
|
{
|
172
|
-
ref:
|
173
|
-
items:
|
171
|
+
ref: p,
|
172
|
+
items: v,
|
173
|
+
defaultIndex: J,
|
174
|
+
onNext: _,
|
175
|
+
onPrev: _,
|
174
176
|
analyticsNext: {
|
175
|
-
analyticsLabel:
|
177
|
+
analyticsLabel: S.NEXT_ACTIVITY
|
176
178
|
},
|
177
179
|
analyticsPrev: {
|
178
|
-
analyticsLabel:
|
180
|
+
analyticsLabel: S.PREV_ACTIVITY
|
179
181
|
}
|
180
182
|
}
|
181
183
|
) : /* @__PURE__ */ i(
|
182
184
|
V,
|
183
185
|
{
|
184
|
-
ref: m,
|
185
186
|
items: O,
|
186
|
-
defaultIndex: J,
|
187
|
-
onNext: _,
|
188
|
-
onPrev: _,
|
189
187
|
analyticsNext: {
|
190
|
-
analyticsLabel:
|
188
|
+
analyticsLabel: ""
|
191
189
|
},
|
192
190
|
analyticsPrev: {
|
193
|
-
analyticsLabel:
|
191
|
+
analyticsLabel: ""
|
194
192
|
}
|
195
193
|
}
|
196
194
|
);
|
197
195
|
}
|
198
196
|
);
|
199
197
|
export {
|
200
|
-
|
198
|
+
ce as GameLauncher
|
201
199
|
};
|
202
200
|
//# 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 { ICarouselRefs } from './comps/carousel/carousel-types';\nimport 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 { FC, ReactNode } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { JOURNEY_ID_STUDENT } from '../../journey/journey-id/journey-id-student';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\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 { GAME_LAUNCHER_SIZE } from './comps/card-container/constants';\nimport { Carousel } from './comps/carousel/carousel';\nimport { GAME_LAUNCHER_ASSET_PADDING } from './comps/segmented-game-card/constants';\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 { useGameLauncherJourney } from './hooks/use-game-launcher-journey/use-game-launcher-journey';\nimport { useTableLauncherJourney } from './hooks/use-table-launcher-journey/use-table-launcher-journey';\n\nconst sleepyBoiDimension = GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING;\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({\n onSegmentClick,\n journeyId,\n data,\n isLoading,\n isTutorialOnboardingDone,\n defaultIndex = 0,\n showError,\n onJourneyComplete,\n }) => {\n const carouselRefs = useRef<ICarouselRefs>(null);\n\n const { isJourneyActive } = useJourney();\n\n const { playSwipSound, play } = useCircleSounds();\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 {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney: startLessonPuzzleGamesJourney,\n } = useGameLauncherJourney({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const { startJourney: startTablesJourney, tableRef } = useTableLauncherJourney({\n carouselRefs,\n onTableSegmentClick,\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: () => 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 ref={tableRef}\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n openModesOfTable={data.tables.openModesOfTable}\n />,\n ];\n }\n }\n\n return itemTypes;\n }, [\n data,\n gameRefs,\n puzzleRefs,\n lessonRefs,\n handleLessonSegmentClick,\n handleGameSegmentClick,\n handlePuzzleSegmentClick,\n tableRef,\n onTableSegmentClick,\n ]);\n\n const sleepyBoiItem = useMemo(\n () => [\n <LottieAnimation\n src={LOTTIE.SLEEPY_BOI}\n width={sleepyBoiDimension}\n height={sleepyBoiDimension}\n />,\n ],\n [],\n );\n\n // Start game launcher journey only when isLoading has become false and data is available\n useEffect(() => {\n if (isLoading || !data || isJourneyActive) {\n return;\n }\n\n if (data?.puzzles && journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {\n startLessonPuzzleGamesJourney(data?.puzzles, !!data?.lessons);\n\n return; // CIRCLE_ACTIVITIES_INTRO_JOURNEY has higher priority\n }\n\n if (data?.tables && journeyId === JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY) {\n startTablesJourney(data?.tables, isTutorialOnboardingDone);\n }\n }, [\n data,\n isJourneyActive,\n isLoading,\n isTutorialOnboardingDone,\n journeyId,\n startLessonPuzzleGamesJourney,\n startTablesJourney,\n ]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (showError) {\n return (\n <Carousel\n ref={carouselRefs}\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselRefs}\n items={items}\n defaultIndex={defaultIndex}\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":["sleepyBoiDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GameLauncher","memo","onSegmentClick","journeyId","data","isLoading","isTutorialOnboardingDone","defaultIndex","showError","onJourneyComplete","carouselRefs","useRef","isJourneyActive","useJourney","playSwipSound","play","useCircleSounds","onTableSegmentClick","useCallback","table","CircleSoundKey","ProjectType","handleLessonSegmentClick","lesson","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","gameRefs","lessonRefs","puzzleRefs","startLessonPuzzleGamesJourney","useGameLauncherJourney","startTablesJourney","tableRef","useTableLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","TablesCard","sleepyBoiItem","LottieAnimation","LOTTIE","useEffect","JOURNEY_ID_STUDENT","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAMA,IAAqBC,IAAqBC,GAEnCC,KAAuCC;AAAA,EAClD,CAAC;AAAA,IACC,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,WAAAC;AAAA,IACA,mBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAeC,EAAsB,IAAI,GAEzC,EAAE,iBAAAC,MAAoBC,KAEtB,EAAE,eAAAC,GAAe,MAAAC,EAAK,IAAIC,EAAgB,GAE1CC,IAAsBC;AAAA,MAC1B,CAACC,MAAyB;AACxB,QAAAJ,EAAKK,EAAe,eAAe,GACpBlB,EAAAiB,GAAOE,EAAY,KAAK;AAAA,MACzC;AAAA,MACA,CAACnB,GAAgBa,CAAI;AAAA,IAAA,GAGjBO,IAA2BJ;AAAA,MAC/B,CAACK,MAAmB;AACd,QAAAA,EAAO,WAAW,gBACpBR,EAAKK,EAAe,eAAe,GACpBlB,EAAAqB,GAAQF,EAAY,MAAM;AAAA,MAE7C;AAAA,MACA,CAACnB,GAAgBa,CAAI;AAAA,IAAA,GAGjBS,IAAyBN;AAAA,MAC7B,CAACO,MAAe;AACd,QAAAV,EAAKK,EAAe,eAAe,GACpBlB,EAAAuB,GAAMJ,EAAY,IAAI;AAAA,MACvC;AAAA,MACA,CAACnB,GAAgBa,CAAI;AAAA,IAAA,GAGjBW,IAA2BR;AAAA,MAC/B,CAACS,MAAmB;AAClB,QAAAZ,EAAKK,EAAe,eAAe,GACpBlB,EAAAyB,GAAQN,EAAY,MAAM;AAAA,MAC3C;AAAA,MACA,CAACnB,GAAgBa,CAAI;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A,MACF;AAAA,MACA,CAAC;AAAA,IAAA;AA4BH,WAxBAgD,EAAU,MAAM;AACV,UAAA,EAAAxC,KAAa,CAACD,KAAQQ,IAI1B;AAAA,YAAIR,KAAA,QAAAA,EAAM,WAAWD,MAAc2C,EAAmB,iCAAiC;AACrF,UAAAf,EAA8B3B,KAAA,gBAAAA,EAAM,SAAS,CAAC,EAACA,KAAA,QAAAA,EAAM,QAAO;AAE5D;AAAA,QACF;AAEA,QAAIA,KAAA,QAAAA,EAAM,UAAUD,MAAc2C,EAAmB,+BAChCb,EAAA7B,KAAA,gBAAAA,EAAM,QAAQE,CAAwB;AAAA;AAAA,IAC3D,GACC;AAAA,MACDF;AAAA,MACAQ;AAAA,MACAP;AAAA,MACAC;AAAA,MACAH;AAAA,MACA4B;AAAA,MACAE;AAAA,IAAA,CACD,GAEG5B,sBACM0C,GAAe,CAAA,CAAA,IAGrBvC,IAEA,gBAAA+B;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,KAAKtC;AAAA,QACL,OAAOgC;AAAA,QACP,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA,IAMJ,gBAAAH;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,KAAKtC;AAAA,QACL,OAAA0B;AAAA,QACA,cAAA7B;AAAA,QACA,QAAQO;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;AAAA,EAGN;AACF;"}
|
1
|
+
{"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { ICarouselRefs } from './comps/carousel/carousel-types';\nimport 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 { FC, ReactNode } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { JOURNEY_ID_STUDENT } from '../../journey/journey-id/journey-id-student';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\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 { GAME_LAUNCHER_SIZE } from './comps/card-container/constants';\nimport { Carousel } from './comps/carousel/carousel';\nimport { GAME_LAUNCHER_ASSET_PADDING } from './comps/segmented-game-card/constants';\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 { useGameLauncherJourney } from './hooks/use-game-launcher-journey/use-game-launcher-journey';\nimport { useTableLauncherJourney } from './hooks/use-table-launcher-journey/use-table-launcher-journey';\n\nconst sleepyBoiDimension = GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING;\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({\n onSegmentClick,\n journeyId,\n data,\n isLoading,\n isTutorialOnboardingDone,\n defaultIndex = 0,\n onJourneyComplete,\n }) => {\n const carouselRefs = useRef<ICarouselRefs>(null);\n\n const { isJourneyActive } = useJourney();\n\n const { playSwipSound, play } = useCircleSounds();\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 {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney: startLessonPuzzleGamesJourney,\n } = useGameLauncherJourney({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const { startJourney: startTablesJourney, tableRef } = useTableLauncherJourney({\n carouselRefs,\n onTableSegmentClick,\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: () => 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 ref={tableRef}\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n openModesOfTable={data.tables.openModesOfTable}\n />,\n ];\n }\n }\n\n return itemTypes;\n }, [\n data,\n gameRefs,\n puzzleRefs,\n lessonRefs,\n handleLessonSegmentClick,\n handleGameSegmentClick,\n handlePuzzleSegmentClick,\n tableRef,\n onTableSegmentClick,\n ]);\n\n const sleepyBoiItem = useMemo(\n () => [\n <LottieAnimation\n src={LOTTIE.SLEEPY_BOI}\n width={sleepyBoiDimension}\n height={sleepyBoiDimension}\n />,\n ],\n [],\n );\n\n // Start game launcher journey only when isLoading has become false and data is available\n useEffect(() => {\n if (isLoading || !data || isJourneyActive) {\n return;\n }\n\n if (data?.puzzles && journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {\n startLessonPuzzleGamesJourney(data?.puzzles, !!data?.lessons);\n\n return; // CIRCLE_ACTIVITIES_INTRO_JOURNEY has higher priority\n }\n\n if (data?.tables && journeyId === JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY) {\n startTablesJourney(data?.tables, isTutorialOnboardingDone);\n }\n }, [\n data,\n isJourneyActive,\n isLoading,\n isTutorialOnboardingDone,\n journeyId,\n startLessonPuzzleGamesJourney,\n startTablesJourney,\n ]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselRefs}\n items={items}\n defaultIndex={defaultIndex}\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":["sleepyBoiDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GameLauncher","memo","onSegmentClick","journeyId","data","isLoading","isTutorialOnboardingDone","defaultIndex","onJourneyComplete","carouselRefs","useRef","isJourneyActive","useJourney","playSwipSound","play","useCircleSounds","onTableSegmentClick","useCallback","table","CircleSoundKey","ProjectType","handleLessonSegmentClick","lesson","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","gameRefs","lessonRefs","puzzleRefs","startLessonPuzzleGamesJourney","useGameLauncherJourney","startTablesJourney","tableRef","useTableLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","TablesCard","sleepyBoiItem","LottieAnimation","LOTTIE","useEffect","JOURNEY_ID_STUDENT","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAMA,IAAqBC,IAAqBC,GAEnCC,KAAuCC;AAAA,EAClD,CAAC;AAAA,IACC,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,mBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAeC,EAAsB,IAAI,GAEzC,EAAE,iBAAAC,MAAoBC,KAEtB,EAAE,eAAAC,GAAe,MAAAC,EAAK,IAAIC,EAAgB,GAE1CC,IAAsBC;AAAA,MAC1B,CAACC,MAAyB;AACxB,QAAAJ,EAAKK,EAAe,eAAe,GACpBjB,EAAAgB,GAAOE,EAAY,KAAK;AAAA,MACzC;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M;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,IAxBA,gBAAAV;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,OAAON;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":"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 countryCode: string;\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 starEligibleTime?: number;\n starEligibleAccuracy?: number;\n starRewarded?: boolean;\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 parentDomain: string;\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":"
|
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 countryCode: string;\n isAdmin?: boolean;\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 starEligibleTime?: number;\n starEligibleAccuracy?: number;\n starRewarded?: boolean;\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 parentDomain: string;\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":"AAoDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,28 +1,28 @@
|
|
1
1
|
import { jsx as P } from "react/jsx-runtime";
|
2
|
-
import { forwardRef as
|
3
|
-
import { useUIContext as
|
4
|
-
import { ALLOWED_ORIGIN as
|
2
|
+
import { forwardRef as V, useRef as G, useMemo as R, useCallback as v, useImperativeHandle as $, useEffect as B } from "react";
|
3
|
+
import { useUIContext as J } from "../../../ui/context/context.js";
|
4
|
+
import { ALLOWED_ORIGIN as C } from "./constants.js";
|
5
5
|
import { ProjectType as s } from "./enums/project-type-enum.js";
|
6
6
|
import { WebViewEvent as o } from "./enums/web-view-events-enum.js";
|
7
|
-
const
|
7
|
+
const Z = V((I, b) => {
|
8
8
|
const {
|
9
|
-
baseUrl:
|
10
|
-
projectDetails:
|
11
|
-
playerDetails:
|
9
|
+
baseUrl: y,
|
10
|
+
projectDetails: T,
|
11
|
+
playerDetails: w,
|
12
12
|
onGameLoad: a,
|
13
|
-
onGamePlayFinish:
|
14
|
-
handleInfoMessage:
|
13
|
+
onGamePlayFinish: c,
|
14
|
+
handleInfoMessage: p,
|
15
15
|
onBack: f,
|
16
|
-
parentDomain:
|
17
|
-
...
|
18
|
-
} =
|
16
|
+
parentDomain: g,
|
17
|
+
...L
|
18
|
+
} = I, l = G(null), N = R(() => w, [w]), t = R(() => T, [T]);
|
19
19
|
let A = "";
|
20
|
-
const { onEvent: O } =
|
20
|
+
const { onEvent: O } = J();
|
21
21
|
t.projectType === s.LESSON && (A = t.miniGameIdentifier);
|
22
|
-
const m =
|
23
|
-
const { enableCloseButton:
|
22
|
+
const m = v(() => {
|
23
|
+
const { enableCloseButton: i = !0 } = t;
|
24
24
|
let e = {
|
25
|
-
enableCloseButton:
|
25
|
+
enableCloseButton: i
|
26
26
|
};
|
27
27
|
return t.projectType === s.GAME && (e = {
|
28
28
|
...e,
|
@@ -37,66 +37,60 @@ const F = G((C, I) => {
|
|
37
37
|
...e,
|
38
38
|
...t
|
39
39
|
}), e;
|
40
|
-
}, [t]),
|
40
|
+
}, [t]), d = v(() => {
|
41
41
|
var e, r;
|
42
|
-
const
|
42
|
+
const i = m();
|
43
43
|
(r = (e = l.current) == null ? void 0 : e.contentWindow) == null || r.postMessage(
|
44
44
|
JSON.stringify({
|
45
45
|
event: o.GAME_DATA,
|
46
|
-
payload:
|
46
|
+
payload: i
|
47
47
|
}),
|
48
|
-
|
48
|
+
C
|
49
49
|
);
|
50
|
-
}, [m]),
|
50
|
+
}, [m]), D = v(() => {
|
51
51
|
var e, r;
|
52
|
-
const
|
52
|
+
const i = m();
|
53
53
|
(r = (e = l.current) == null ? void 0 : e.contentWindow) == null || r.postMessage(
|
54
54
|
JSON.stringify({
|
55
55
|
event: o.SET_CONFIG,
|
56
56
|
payload: {
|
57
|
-
user:
|
58
|
-
projectConfig:
|
59
|
-
parentDomain:
|
57
|
+
user: N,
|
58
|
+
projectConfig: i,
|
59
|
+
parentDomain: g
|
60
60
|
}
|
61
61
|
}),
|
62
|
-
|
62
|
+
C
|
63
63
|
);
|
64
|
-
}, [
|
65
|
-
|
66
|
-
const
|
67
|
-
var j,
|
68
|
-
const r = e.data,
|
69
|
-
if (
|
70
|
-
const { pattern: u } =
|
71
|
-
(S = (j = window.navigator).vibrate) == null ||
|
64
|
+
}, [N, m, g]);
|
65
|
+
$(b, () => l.current, []), B(() => {
|
66
|
+
const i = (e) => {
|
67
|
+
var j, _;
|
68
|
+
const r = e.data, S = typeof r == "string" ? JSON.parse(r) : r, { event: n, payload: E = null } = S;
|
69
|
+
if (n === o.VIBRATE) {
|
70
|
+
const { pattern: u } = E;
|
71
|
+
window.ReactNativeWebView ? window.ReactNativeWebView.postMessage(JSON.stringify(S)) : (_ = (j = window.navigator).vibrate) == null || _.call(j, u);
|
72
72
|
}
|
73
|
-
if (
|
74
|
-
const { eventName: u, properties:
|
75
|
-
O(u,
|
73
|
+
if (n === o.GAME_BACK && (f == null || f()), n === o.HIDE_LOADER && (a == null || a()), n === o.LOAD_DATA_FROM_APP && (d == null || d()), n === o.GET_CONFIG && D(), n === o.UPDATE_STATS && (c == null || c(E)), n === o.SHOW_SNACKBAR && (p == null || p(E)), n === o.TRACK_EVENT) {
|
74
|
+
const { eventName: u, properties: W } = E;
|
75
|
+
O(u, W);
|
76
76
|
}
|
77
77
|
};
|
78
|
-
return window.addEventListener("message",
|
79
|
-
window.removeEventListener("message",
|
78
|
+
return window.addEventListener("message", i), () => {
|
79
|
+
window.removeEventListener("message", i);
|
80
80
|
};
|
81
81
|
}, [
|
82
|
-
c,
|
83
|
-
f,
|
84
82
|
p,
|
83
|
+
f,
|
84
|
+
c,
|
85
85
|
a,
|
86
|
-
|
87
|
-
|
86
|
+
D,
|
87
|
+
d,
|
88
88
|
O
|
89
|
-
])
|
90
|
-
|
91
|
-
|
92
|
-
...R,
|
93
|
-
ref: l,
|
94
|
-
src: `${L}/play-game/${t.projectId}/${t.variant}${A ? `/${A}` : ""}?version=2`,
|
95
|
-
allow: "autoplay"
|
96
|
-
}
|
97
|
-
);
|
89
|
+
]);
|
90
|
+
const M = w.isAdmin ? y : `${y}/play-game/${t.projectId}/${t.variant}${A ? `/${A}` : ""}`;
|
91
|
+
return /* @__PURE__ */ P("iframe", { ...L, ref: l, src: `${M}?version=2`, allow: "autoplay" });
|
98
92
|
});
|
99
93
|
export {
|
100
|
-
|
94
|
+
Z as WebView
|
101
95
|
};
|
102
96
|
//# sourceMappingURL=web-view.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"web-view.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view.tsx"],"sourcesContent":["
|
1
|
+
{"version":3,"file":"web-view.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view.tsx"],"sourcesContent":["declare global {\n interface IReactNativeWebview {\n postMessage: (data: string) => void;\n }\n\n interface Window {\n ReactNativeWebView?: IReactNativeWebview;\n }\n}\n\nimport type {\n IInfoMessage,\n ILessonWebGameProps,\n IMessageProps,\n IMultiplayerWebGameProps,\n IPlayerStats,\n IPuzzleWebGameProps,\n ITableWebGameProps,\n IVibrationPattern,\n IWebViewProps,\n} from './web-view-types';\nimport type { ForwardedRef } from 'react';\n\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport { useUIContext } from '../../../ui/context/context';\nimport { ALLOWED_ORIGIN } from './constants';\nimport { ProjectType, WebViewEvent } from './enums';\n\nexport const WebView = forwardRef((props: IWebViewProps, ref: ForwardedRef<HTMLIFrameElement>) => {\n const {\n baseUrl,\n projectDetails,\n playerDetails,\n onGameLoad,\n onGamePlayFinish,\n handleInfoMessage,\n onBack,\n parentDomain,\n ...rest\n } = props;\n const webViewRef = useRef<HTMLIFrameElement>(null);\n const memoizedPlayerDetails = useMemo(() => playerDetails, [playerDetails]);\n const memoizedProjectDetails = useMemo(() => projectDetails, [projectDetails]);\n\n let miniGameIdentifier = '';\n const { onEvent: trackEvent } = useUIContext();\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n miniGameIdentifier = (memoizedProjectDetails as ILessonWebGameProps).miniGameIdentifier;\n }\n\n const getProjectDetails = useCallback(() => {\n const { enableCloseButton = true } = memoizedProjectDetails;\n\n let payload = {\n enableCloseButton,\n } as IMultiplayerWebGameProps | IPuzzleWebGameProps | ILessonWebGameProps;\n\n if (memoizedProjectDetails.projectType === ProjectType.GAME) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as IMultiplayerWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.PUZZLE) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as IPuzzleWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as ILessonWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.TABLE) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as ITableWebGameProps;\n }\n\n return payload;\n }, [memoizedProjectDetails]);\n\n const sendGamesData = useCallback(() => {\n const payload = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.GAME_DATA,\n payload,\n }),\n ALLOWED_ORIGIN,\n );\n }, [getProjectDetails]);\n\n const setConfig = useCallback(() => {\n const projectConfig = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.SET_CONFIG,\n payload: {\n user: memoizedPlayerDetails,\n projectConfig,\n parentDomain,\n },\n }),\n ALLOWED_ORIGIN,\n );\n }, [memoizedPlayerDetails, getProjectDetails, parentDomain]);\n\n useImperativeHandle(ref, () => webViewRef.current as HTMLIFrameElement, []);\n\n useEffect(() => {\n const handleMessage = (e: MessageEvent) => {\n const data: string = e.data;\n const parsedData = typeof data === 'string' ? JSON.parse(data) : (data as IMessageProps);\n\n const { event, payload = null } = parsedData;\n\n if (event === WebViewEvent.VIBRATE) {\n const { pattern } = payload as IVibrationPattern;\n\n if (window.ReactNativeWebView) {\n window.ReactNativeWebView.postMessage(JSON.stringify(parsedData));\n } else {\n window.navigator.vibrate?.(pattern);\n }\n }\n\n if (event === WebViewEvent.GAME_BACK) {\n onBack?.();\n }\n\n if (event === WebViewEvent.HIDE_LOADER) {\n onGameLoad?.();\n }\n\n if (event === WebViewEvent.LOAD_DATA_FROM_APP) {\n sendGamesData?.();\n }\n\n if (event === WebViewEvent.GET_CONFIG) {\n setConfig();\n }\n\n if (event === WebViewEvent.UPDATE_STATS) {\n onGamePlayFinish?.(payload as IPlayerStats);\n }\n\n if (event === WebViewEvent.SHOW_SNACKBAR) {\n handleInfoMessage?.(payload as IInfoMessage);\n }\n\n if (event === WebViewEvent.TRACK_EVENT) {\n const { eventName, properties } = payload;\n\n trackEvent(eventName, properties);\n }\n };\n\n window.addEventListener('message', handleMessage);\n\n return () => {\n window.removeEventListener('message', handleMessage);\n };\n }, [\n handleInfoMessage,\n onBack,\n onGamePlayFinish,\n onGameLoad,\n setConfig,\n sendGamesData,\n trackEvent,\n ]);\n\n const url = playerDetails.isAdmin\n ? baseUrl\n : `${baseUrl}/play-game/${memoizedProjectDetails.projectId}/${memoizedProjectDetails.variant}${\n miniGameIdentifier ? `/${miniGameIdentifier}` : ''\n }`;\n\n return <iframe {...rest} ref={webViewRef} src={`${url}?version=2`} allow=\"autoplay\" />;\n});\n"],"names":["WebView","forwardRef","props","ref","baseUrl","projectDetails","playerDetails","onGameLoad","onGamePlayFinish","handleInfoMessage","onBack","parentDomain","rest","webViewRef","useRef","memoizedPlayerDetails","useMemo","memoizedProjectDetails","miniGameIdentifier","trackEvent","useUIContext","ProjectType","getProjectDetails","useCallback","enableCloseButton","payload","sendGamesData","_b","_a","WebViewEvent","ALLOWED_ORIGIN","setConfig","projectConfig","useImperativeHandle","useEffect","handleMessage","data","parsedData","event","pattern","eventName","properties","url","jsx"],"mappings":";;;;;;AA6BO,MAAMA,IAAUC,EAAW,CAACC,GAAsBC,MAAyC;AAC1F,QAAA;AAAA,IACJ,SAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAV,GACEW,IAAaC,EAA0B,IAAI,GAC3CC,IAAwBC,EAAQ,MAAMV,GAAe,CAACA,CAAa,CAAC,GACpEW,IAAyBD,EAAQ,MAAMX,GAAgB,CAACA,CAAc,CAAC;AAE7E,MAAIa,IAAqB;AACzB,QAAM,EAAE,SAASC,EAAW,IAAIC,EAAa;AAEzC,EAAAH,EAAuB,gBAAgBI,EAAY,WACrDH,IAAsBD,EAA+C;AAGjE,QAAAK,IAAoBC,EAAY,MAAM;AACpC,UAAA,EAAE,mBAAAC,IAAoB,GAAS,IAAAP;AAErC,QA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HANGED
@@ -1111,7 +1111,6 @@ declare interface IGameLauncherProps {
|
|
1111
1111
|
defaultIndex?: number;
|
1112
1112
|
journeyId?: TJourneyId;
|
1113
1113
|
isTutorialOnboardingDone?: boolean;
|
1114
|
-
showError?: boolean;
|
1115
1114
|
onJourneyComplete: (journeyId: TJourneyId) => void;
|
1116
1115
|
}
|
1117
1116
|
|
@@ -2122,6 +2121,7 @@ export declare interface IPlayer {
|
|
2122
2121
|
avatar?: IAvatarLayer[] | null;
|
2123
2122
|
playerType: TUserTypes;
|
2124
2123
|
countryCode: string;
|
2124
|
+
isAdmin?: boolean;
|
2125
2125
|
}
|
2126
2126
|
|
2127
2127
|
export declare interface IPlayerStats {
|