@cuemath/leap 2.8.36-link.3 → 2.8.36-rj-0
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/illustrations/illustrations.js +0 -2
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/carat-left.js +26 -0
- package/dist/assets/line-icons/icons/carat-left.js.map +1 -0
- package/dist/assets/line-icons/icons/carat-right.js +26 -0
- package/dist/assets/line-icons/icons/carat-right.js.map +1 -0
- package/dist/assets/lottie/lottie.js +6 -0
- package/dist/assets/lottie/lottie.js.map +1 -1
- 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 +33 -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/carousel/carousel.js +53 -47
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
- 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 +87 -85
- 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 +54 -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/table-star/table-star-styled.js +11 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star.js +16 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star.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 +245 -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.js +118 -65
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js +8 -0
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +217 -0
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js +6 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js +13 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +197 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -0
- 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 +69 -82
- package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.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.js +25 -24
- package/dist/features/post-game-stats/points/points.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 +80 -150
- package/dist/index.js +194 -201
- package/dist/index.js.map +1 -1
- package/dist/static/advance-mode-segment-lottie.51ff6707.json +1 -0
- package/dist/static/infinite-button-bg.5909225e.json +1 -0
- package/dist/static/infinite-button-symbol.aa31350c.json +1 -0
- package/dist/static/random-mode-segment-lottie.79cf1c07.json +1 -0
- package/dist/static/sequence-mode-segment-lottie.11ac49e9.json +1 -0
- package/dist/static/table-mode-reveal.b44a82c3.json +1 -0
- package/package.json +3 -2
- package/dist/assets/sounds/sounds.js +0 -7
- package/dist/assets/sounds/sounds.js.map +0 -1
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js +0 -7
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js +0 -213
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js.map +0 -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
- package/dist/features/talk-meter/helper.js +0 -11
- package/dist/features/talk-meter/helper.js.map +0 -1
- package/dist/features/talk-meter/hooks/use-talk-meter.js +0 -112
- package/dist/features/talk-meter/hooks/use-talk-meter.js.map +0 -1
- package/dist/features/talk-meter/ripple/index.js +0 -62
- package/dist/features/talk-meter/ripple/index.js.map +0 -1
- package/dist/features/talk-meter/talk-meter-styled.js +0 -89
- package/dist/features/talk-meter/talk-meter-styled.js.map +0 -1
- package/dist/features/talk-meter/talk-meter-view/talk-meter-view-styled.js +0 -22
- package/dist/features/talk-meter/talk-meter-view/talk-meter-view-styled.js.map +0 -1
- package/dist/features/talk-meter/talk-meter-view/talk-meter-view.js +0 -101
- package/dist/features/talk-meter/talk-meter-view/talk-meter-view.js.map +0 -1
- package/dist/features/talk-meter/talk-meter.js +0 -73
- package/dist/features/talk-meter/talk-meter.js.map +0 -1
- package/dist/static/female-avatar.b8cd1012.svg +0 -1
- package/dist/static/male-avatar.2febc9eb.svg +0 -1
@@ -0,0 +1,197 @@
|
|
1
|
+
import { jsx as r, Fragment as L } from "react/jsx-runtime";
|
2
|
+
import { useRef as R, useCallback as T } from "react";
|
3
|
+
import X from "../../../../../assets/line-icons/icons/carat-right.js";
|
4
|
+
import { JOURNEY_ID_STUDENT as w } from "../../../../journey/journey-id/journey-id-student.js";
|
5
|
+
import { IndicatorType as d } from "../../../../journey/use-journey/constants.js";
|
6
|
+
import { useJourney as B } from "../../../../journey/use-journey/use-journey.js";
|
7
|
+
import x from "../../../../ui/buttons/icon-button/icon-button.js";
|
8
|
+
import A from "../../../../ui/layout/flex-view.js";
|
9
|
+
import u from "../../../../ui/text/text.js";
|
10
|
+
import { useCircleSounds as U } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
|
11
|
+
import { TablesCard as v } from "../../comps/tables-card/tables-card.js";
|
12
|
+
import { TABLE_CARD_INDEX as $, PUZZLE_CARD_INDEX as J } from "./constants.js";
|
13
|
+
import { Indicator as G } from "./use-table-launcher-journey-styled.js";
|
14
|
+
const ne = ({
|
15
|
+
carouselRefs: s,
|
16
|
+
onTableSegmentClick: I,
|
17
|
+
onJourneyComplete: y
|
18
|
+
}) => {
|
19
|
+
const e = w.CIRCLE_TABLES_INTRO_JOURNEY, t = R(null), p = R(null), O = R(!1), { playButtonSound: P } = U(), { nextCoachmark: i, setJourney: k, addCoachmark: c } = B(), C = T(
|
20
|
+
(o) => {
|
21
|
+
var l, a;
|
22
|
+
o && I(o), (l = t == null ? void 0 : t.current) == null || l.setLabelVisiblity(!0), (a = t == null ? void 0 : t.current) == null || a.stopLabelAnimation(), y(e), i(e, !1);
|
23
|
+
},
|
24
|
+
[e, i, y, I]
|
25
|
+
), H = T(
|
26
|
+
(o, l) => {
|
27
|
+
var g, m, h;
|
28
|
+
if (!((g = t.current) != null && g.segmentedCardWrapperRef.current) || !((m = t.current) != null && m.labelRef.current))
|
29
|
+
return;
|
30
|
+
const a = t.current.labelRef.current.getBoundingClientRect(), n = (h = t.current) == null ? void 0 : h.segmentedCardWrapperRef.current.getBoundingClientRect();
|
31
|
+
c(e, {
|
32
|
+
originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
|
33
|
+
isActive: !1,
|
34
|
+
type: d.TOOLTIP,
|
35
|
+
elementToHighlight: /* @__PURE__ */ r(
|
36
|
+
v,
|
37
|
+
{
|
38
|
+
ref: p,
|
39
|
+
defaultTable: l,
|
40
|
+
label: o.label,
|
41
|
+
data: o.data,
|
42
|
+
onPress: C,
|
43
|
+
onGoBackFromTableLevel: C
|
44
|
+
}
|
45
|
+
),
|
46
|
+
indicator: {
|
47
|
+
position: "left",
|
48
|
+
backgroundColor: "YELLOW_4",
|
49
|
+
width: 236,
|
50
|
+
tooltipItem: /* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(u, { $renderAs: "ab2-bold", children: "Each table has 3 levels—clear them and earn 3 stars!" }) }),
|
51
|
+
tooltipXCoOrdinates: 0,
|
52
|
+
tooltipYCoOrdinates: a.height * 0.35
|
53
|
+
}
|
54
|
+
}), c(e, {
|
55
|
+
originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
|
56
|
+
isActive: !1,
|
57
|
+
type: d.NUDGE,
|
58
|
+
indicator: {
|
59
|
+
nudge: "click",
|
60
|
+
content: /* @__PURE__ */ r(u, { $renderAs: "ab1", $color: "WHITE", children: "Pick a level" }),
|
61
|
+
nudgePointerX: n.width / 2 + 50,
|
62
|
+
nudgePointerY: n.height * 0.4
|
63
|
+
},
|
64
|
+
elementToHighlight: /* @__PURE__ */ r(L, {})
|
65
|
+
}), i(e, !1, 100), i(e, !0, 2e3);
|
66
|
+
const b = setTimeout(() => {
|
67
|
+
var f;
|
68
|
+
clearTimeout(b), (f = p.current) == null || f.startLabelAnimation("YELLOW_4");
|
69
|
+
}, 3e3);
|
70
|
+
},
|
71
|
+
[c, C, e, i]
|
72
|
+
), E = T(() => {
|
73
|
+
var a;
|
74
|
+
P(), (a = s.current) == null || a.goToIndex($), i(e, !1, 1e3);
|
75
|
+
const o = setTimeout(() => {
|
76
|
+
var n;
|
77
|
+
clearTimeout(o), (n = t.current) == null || n.setLabelVisiblity(!1), i(e, !0);
|
78
|
+
}, 3e3), l = setTimeout(() => {
|
79
|
+
var n;
|
80
|
+
clearTimeout(l), (n = p.current) == null || n.startLabelAnimation("YELLOW_4");
|
81
|
+
}, 3100);
|
82
|
+
}, [s, e, i, P]), D = T(
|
83
|
+
(o) => {
|
84
|
+
var m, h, f, W, Y, _;
|
85
|
+
if (O.current)
|
86
|
+
return;
|
87
|
+
const l = (m = s.current) == null ? void 0 : m.indicatorRefs, a = (h = s.current) == null ? void 0 : h.nextBtnRef, n = l == null ? void 0 : l[$];
|
88
|
+
if (!((f = t.current) != null && f.segmentedCardWrapperRef.current) || !((W = t.current) != null && W.labelRef.current) || !l || !(a != null && a.current) || !n || !n.current)
|
89
|
+
return;
|
90
|
+
O.current = !0;
|
91
|
+
const b = t.current.labelRef.current.getBoundingClientRect(), g = (Y = t.current) == null ? void 0 : Y.segmentedCardWrapperRef.current.getBoundingClientRect();
|
92
|
+
k(e, []), s.current.currentIndex === J ? (c(e, {
|
93
|
+
originalElementToHighlightRef: (_ = s.current) == null ? void 0 : _.nextBtnRef,
|
94
|
+
isActive: !1,
|
95
|
+
type: d.NUDGE,
|
96
|
+
indicator: {
|
97
|
+
nudge: "click",
|
98
|
+
content: /* @__PURE__ */ r(u, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
|
99
|
+
nudgePointerX: 0,
|
100
|
+
nudgePointerY: 0
|
101
|
+
},
|
102
|
+
elementToHighlight: /* @__PURE__ */ r(
|
103
|
+
x,
|
104
|
+
{
|
105
|
+
renderAs: "secondary",
|
106
|
+
Icon: X,
|
107
|
+
onClick: E,
|
108
|
+
analyticsLabel: "FIXXXX"
|
109
|
+
}
|
110
|
+
)
|
111
|
+
}), i(e, !1, 500)) : (c(e, {
|
112
|
+
originalElementToHighlightRef: n,
|
113
|
+
isActive: !1,
|
114
|
+
type: d.TOOLTIP,
|
115
|
+
elementToHighlight: /* @__PURE__ */ r(G, { $isActive: !1 }),
|
116
|
+
indicator: {
|
117
|
+
position: "bottom",
|
118
|
+
backgroundColor: "YELLOW_4",
|
119
|
+
width: 52,
|
120
|
+
tooltipItem: /* @__PURE__ */ r(
|
121
|
+
A,
|
122
|
+
{
|
123
|
+
$position: "absolute",
|
124
|
+
$flexDirection: "row",
|
125
|
+
style: { top: 6, left: 8, cursor: "pointer" },
|
126
|
+
onClick: E,
|
127
|
+
children: /* @__PURE__ */ r(u, { $renderAs: "ab2-bold", children: "NEW" })
|
128
|
+
}
|
129
|
+
),
|
130
|
+
tooltipYCoOrdinates: 14
|
131
|
+
// Need some offset in Y direction from top
|
132
|
+
}
|
133
|
+
}), c(e, {
|
134
|
+
originalElementToHighlightRef: n,
|
135
|
+
isActive: !1,
|
136
|
+
type: d.NUDGE,
|
137
|
+
indicator: {
|
138
|
+
nudge: "click",
|
139
|
+
content: "",
|
140
|
+
nudgePointerY: 20
|
141
|
+
},
|
142
|
+
elementToHighlight: /* @__PURE__ */ r(L, {})
|
143
|
+
}), i(e, !1, 500), i(e, !0, 1500)), c(e, {
|
144
|
+
originalElementToHighlightRef: t.current.labelRef,
|
145
|
+
isActive: !1,
|
146
|
+
type: d.TOOLTIP,
|
147
|
+
elementToHighlight: /* @__PURE__ */ r(L, {}),
|
148
|
+
indicator: {
|
149
|
+
position: "right",
|
150
|
+
backgroundColor: "YELLOW_4",
|
151
|
+
width: 236,
|
152
|
+
tooltipItem: /* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(u, { $renderAs: "ab2-bold", children: "Get faster & stay ahead in school. Practice 3 new skills everyday." }) }),
|
153
|
+
tooltipXCoOrdinates: b.width + 50,
|
154
|
+
tooltipYCoOrdinates: b.height / 2
|
155
|
+
}
|
156
|
+
}), c(e, {
|
157
|
+
originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
|
158
|
+
isActive: !1,
|
159
|
+
type: d.NUDGE,
|
160
|
+
indicator: {
|
161
|
+
nudge: "click",
|
162
|
+
content: /* @__PURE__ */ r(u, { $renderAs: "ab1", $color: "WHITE", children: "Pick a table to start" }),
|
163
|
+
nudgePointerX: g.width / 2 + 50,
|
164
|
+
nudgePointerY: g.height / 2
|
165
|
+
},
|
166
|
+
elementToHighlight: /* @__PURE__ */ r(
|
167
|
+
v,
|
168
|
+
{
|
169
|
+
ref: p,
|
170
|
+
label: o.label,
|
171
|
+
data: o.data,
|
172
|
+
onPress: () => {
|
173
|
+
},
|
174
|
+
onPressTableSegment: (N) => H(o, N)
|
175
|
+
}
|
176
|
+
)
|
177
|
+
});
|
178
|
+
},
|
179
|
+
[
|
180
|
+
c,
|
181
|
+
s,
|
182
|
+
E,
|
183
|
+
H,
|
184
|
+
e,
|
185
|
+
i,
|
186
|
+
k
|
187
|
+
]
|
188
|
+
);
|
189
|
+
return {
|
190
|
+
tableRef: t,
|
191
|
+
startJourney: D
|
192
|
+
};
|
193
|
+
};
|
194
|
+
export {
|
195
|
+
ne as useTableLauncherJourney
|
196
|
+
};
|
197
|
+
//# sourceMappingURL=use-table-launcher-journey.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-table-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { ITableCardRef, ITableDetails } from '../../comps/tables-card/tables-card-types';\nimport type {\n ITableInfo,\n ITables,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseTableJourneyProps } from './use-table-launcher-journey-types';\n\nimport { useCallback, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { TablesCard } from '../../comps/tables-card/tables-card';\nimport { PUZZLE_CARD_INDEX, TABLE_CARD_INDEX } from './constants';\nimport * as S from './use-table-launcher-journey-styled';\n\nexport const useTableLauncherJourney = ({\n carouselRefs,\n onTableSegmentClick,\n onJourneyComplete,\n}: IUseTableJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY;\n const originalTableRef = useRef<ITableCardRef>(null);\n const highlightedTableRef = useRef<ITableCardRef>(null);\n const isJourneyInProgress = useRef(false);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, addCoachmark } = useJourney();\n\n const endJourney = useCallback(\n (tableDetails?: ITableDetails) => {\n // Only when User clicked on play\n if (tableDetails) {\n onTableSegmentClick(tableDetails);\n }\n // Reset original table card ref label\n originalTableRef?.current?.setLabelVisiblity(true);\n originalTableRef?.current?.stopLabelAnimation();\n onJourneyComplete(journeyId);\n nextCoachmark(journeyId, false);\n },\n [journeyId, nextCoachmark, onJourneyComplete, onTableSegmentClick],\n );\n\n const handleTableSegmentClick = useCallback(\n (launcherData: ITables, tableData: ITableInfo) => {\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current\n ) {\n return;\n }\n\n const segmentedCardDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n defaultTable={tableData}\n label={launcherData.label}\n data={launcherData.data}\n onPress={endJourney}\n onGoBackFromTableLevel={endJourney}\n />\n ),\n indicator: {\n position: 'left',\n backgroundColor: 'YELLOW_4',\n width: 236,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">Each table has 3 levels—clear them and earn 3 stars!</Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: segmentedCardDims.height * 0.35,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Pick a level\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height * 0.4,\n } as INudgeProps,\n elementToHighlight: <></>,\n });\n\n nextCoachmark(journeyId, false, 100); // Show coachmark => Each table has 3... and Hide the previous two\n nextCoachmark(journeyId, true, 2000); // Show nudge => Pick a level\n\n const startAnimationOnLabelAgain = setTimeout(() => {\n clearTimeout(startAnimationOnLabelAgain);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, 3000);\n },\n [addCoachmark, endJourney, journeyId, nextCoachmark],\n );\n\n const goToTableLauncher = useCallback(() => {\n playButtonSound();\n carouselRefs.current?.goToIndex(TABLE_CARD_INDEX);\n nextCoachmark(journeyId, false, 1000);\n\n const showNudge = setTimeout(() => {\n clearTimeout(showNudge);\n originalTableRef.current?.setLabelVisiblity(false);\n nextCoachmark(journeyId, true);\n }, 3000);\n\n const animateLabel = setTimeout(() => {\n clearTimeout(animateLabel);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, 3100);\n }, [carouselRefs, journeyId, nextCoachmark, playButtonSound]);\n\n const startJourney = useCallback(\n (tablesData: ITables) => {\n if (isJourneyInProgress.current) {\n return;\n }\n\n const paginationList = carouselRefs.current?.indicatorRefs;\n const carouselNextBtnRef = carouselRefs.current?.nextBtnRef;\n const tablePaginationRef = paginationList?.[TABLE_CARD_INDEX];\n\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current ||\n !paginationList ||\n !carouselNextBtnRef?.current ||\n !tablePaginationRef ||\n !tablePaginationRef.current\n ) {\n return;\n }\n\n isJourneyInProgress.current = true;\n\n const labelDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n setJourney(journeyId, []);\n\n // TAKE THE USER TO THE TABLE CARD\n if (carouselRefs.current.currentIndex === PUZZLE_CARD_INDEX) {\n addCoachmark(journeyId, {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={goToTableLauncher}\n analyticsLabel={'FIXXXX'}\n />\n ),\n });\n nextCoachmark(journeyId, false, 500); // Show nudge => Click to proceed\n } else {\n addCoachmark(journeyId, {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <S.Indicator $isActive={false} />,\n indicator: {\n position: 'bottom',\n backgroundColor: 'YELLOW_4',\n width: 52,\n tooltipItem: (\n <FlexView\n $position=\"absolute\"\n $flexDirection=\"row\"\n style={{ top: 6, left: 8, cursor: 'pointer' }}\n onClick={goToTableLauncher}\n >\n <Text $renderAs=\"ab2-bold\">NEW</Text>\n </FlexView>\n ),\n tooltipYCoOrdinates: 14, // Need some offset in Y direction from top\n } as IArrowTooltipProps,\n });\n addCoachmark(journeyId, {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: '',\n nudgePointerY: 20,\n } as INudgeProps,\n elementToHighlight: <></>,\n });\n nextCoachmark(journeyId, false, 500); // Show Coachmark => NEW\n nextCoachmark(journeyId, true, 1500); // Show Nudge over Coachmark\n }\n\n // SHOW THE USER SELECT A TABLE\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'YELLOW_4',\n width: 236,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: labelDims.width + 50,\n tooltipYCoOrdinates: labelDims.height / 2,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n {'Pick a table to start'}\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height / 2,\n } as INudgeProps,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n label={tablesData.label}\n data={tablesData.data}\n onPress={() => {}}\n onPressTableSegment={tableInfo => handleTableSegmentClick(tablesData, tableInfo)}\n />\n ),\n });\n },\n [\n addCoachmark,\n carouselRefs,\n goToTableLauncher,\n handleTableSegmentClick,\n journeyId,\n nextCoachmark,\n setJourney,\n ],\n );\n\n return {\n tableRef: originalTableRef,\n startJourney,\n };\n};\n"],"names":["useTableLauncherJourney","carouselRefs","onTableSegmentClick","onJourneyComplete","journeyId","JOURNEY_ID_STUDENT","originalTableRef","useRef","highlightedTableRef","isJourneyInProgress","playButtonSound","useCircleSounds","nextCoachmark","setJourney","addCoachmark","useJourney","endJourney","useCallback","tableDetails","_a","_b","handleTableSegmentClick","launcherData","tableData","segmentedCardDims","tableCardDims","_c","IndicatorType","jsx","TablesCard","FlexView","Text","Fragment","startAnimationOnLabelAgain","goToTableLauncher","TABLE_CARD_INDEX","showNudge","animateLabel","startJourney","tablesData","paginationList","carouselNextBtnRef","tablePaginationRef","_d","labelDims","_e","PUZZLE_CARD_INDEX","_f","IconButton","CaratRightIcon","S.Indicator","tableInfo"],"mappings":";;;;;;;;;;;;;AAwBO,MAAMA,KAA0B,CAAC;AAAA,EACtC,cAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAYC,EAAmB,6BAC/BC,IAAmBC,EAAsB,IAAI,GAC7CC,IAAsBD,EAAsB,IAAI,GAChDE,IAAsBF,EAAO,EAAK,GAElC,EAAE,iBAAAG,MAAoBC,KACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,cAAAC,MAAiBC,EAAW,GAEzDC,IAAaC;AAAA,IACjB,CAACC,MAAiC;;AAEhC,MAAIA,KACFhB,EAAoBgB,CAAY,IAGhBC,IAAAb,KAAA,gBAAAA,EAAA,YAAA,QAAAa,EAAS,kBAAkB,MAC7CC,IAAAd,KAAA,gBAAAA,EAAkB,YAAlB,QAAAc,EAA2B,sBAC3BjB,EAAkBC,CAAS,GAC3BQ,EAAcR,GAAW,EAAK;AAAA,IAChC;AAAA,IACA,CAACA,GAAWQ,GAAeT,GAAmBD,CAAmB;AAAA,EAAA,GAG7DmB,IAA0BJ;AAAA,IAC9B,CAACK,GAAuBC,MAA0B;;AAE9C,UAAA,GAACJ,IAAAb,EAAiB,YAAjB,QAAAa,EAA0B,wBAAwB,YACnD,GAACC,IAAAd,EAAiB,YAAjB,QAAAc,EAA0B,SAAS;AAEpC;AAGF,YAAMI,IAAoBlB,EAAiB,QAAQ,SAAS,QAAQ,yBAC9DmB,KACJC,IAAApB,EAAiB,YAAjB,gBAAAoB,EAA0B,wBAAwB,QAAQ;AAE5D,MAAAZ,EAAaV,GAAW;AAAA,QACtB,+BAA+BE,EAAiB,QAAQ;AAAA,QACxD,UAAU;AAAA,QACV,MAAMqB,EAAc;AAAA,QACpB,oBACE,gBAAAC;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,KA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KAAK,WAAU,YAAW,gFAE3B,EACF,CAAA;AAAA,UAEF,qBAAqBa,EAAU,QAAQ;AAAA,UACvC,qBAAqBA,EAAU,SAAS;AAAA,QAC1C;AAAA,MAAA,CACD,GAED9B,EAAaV,GAAW;AAAA,QACtB,+BAA+BE,EAAiB,QAAQ;AAAA,QACxD,UAAU;AAAA,QACV,MAAMqB,EAAc;AAAA,QACpB,WAAW;AAAA,UACT,OAAO;AAAA,UACP,SACG,gBAAAC,EAAAG,GAAA,EAAK,WAAU,OAAM,QAAO,SAC1B,UACH,yBAAA;AAAA,UAEF,eAAeN,EAAc,QAAQ,IAAI;AAAA,UACzC,eAAeA,EAAc,SAAS;AAAA,QACxC;AAAA,QACA,oBACE,gBAAAG;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,KAAKrB;AAAA,YACL,OAAO+B,EAAW;AAAA,YAClB,MAAMA,EAAW;AAAA,YACjB,SAAS,MAAM;AAAA,YAAC;AAAA,YAChB,qBAAqB,CAAAY,MAAa9B,EAAwBkB,GAAYY,CAAS;AAAA,UAAA;AAAA,QACjF;AAAA,MAAA,CAEH;AAAA,IACH;AAAA,IACA;AAAA,MACErC;AAAA,MACAb;AAAA,MACAiC;AAAA,MACAb;AAAA,MACAjB;AAAA,MACAQ;AAAA,MACAC;AAAA,IACF;AAAA,EAAA;AAGK,SAAA;AAAA,IACL,UAAUP;AAAA,IACV,cAAAgC;AAAA,EAAA;AAEJ;"}
|
@@ -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 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":"AAkDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,115 +1,102 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { forwardRef as
|
3
|
-
import { useUIContext as
|
1
|
+
import { jsx as P } from "react/jsx-runtime";
|
2
|
+
import { forwardRef as G, useRef as W, useMemo as _, useCallback as T, useImperativeHandle as V, useEffect as $ } from "react";
|
3
|
+
import { useUIContext as B } from "../../../ui/context/context.js";
|
4
4
|
import { ALLOWED_ORIGIN as N } from "./constants.js";
|
5
|
-
import { ProjectType as
|
6
|
-
import { WebViewEvent as
|
7
|
-
const
|
5
|
+
import { ProjectType as s } from "./enums/project-type-enum.js";
|
6
|
+
import { WebViewEvent as o } from "./enums/web-view-events-enum.js";
|
7
|
+
const F = G((C, I) => {
|
8
8
|
const {
|
9
|
-
baseUrl:
|
10
|
-
projectDetails:
|
11
|
-
playerDetails:
|
9
|
+
baseUrl: L,
|
10
|
+
projectDetails: y,
|
11
|
+
playerDetails: v,
|
12
12
|
onGameLoad: a,
|
13
|
-
onGamePlayFinish:
|
14
|
-
handleInfoMessage:
|
15
|
-
onBack:
|
16
|
-
parentDomain:
|
17
|
-
...
|
18
|
-
} = C, l = W(null),
|
19
|
-
let
|
20
|
-
const { onEvent:
|
21
|
-
|
22
|
-
const m =
|
23
|
-
const {
|
24
|
-
enableCloseButton: r = !0,
|
25
|
-
enablePlayerTurnIndicators: s = !1,
|
26
|
-
enableSync: t = !1,
|
27
|
-
joinByRoomId: E = ""
|
28
|
-
} = o;
|
13
|
+
onGamePlayFinish: p,
|
14
|
+
handleInfoMessage: c,
|
15
|
+
onBack: f,
|
16
|
+
parentDomain: w,
|
17
|
+
...R
|
18
|
+
} = C, l = W(null), D = _(() => v, [v]), t = _(() => y, [y]);
|
19
|
+
let A = "";
|
20
|
+
const { onEvent: O } = B();
|
21
|
+
t.projectType === s.LESSON && (A = t.miniGameIdentifier);
|
22
|
+
const m = T(() => {
|
23
|
+
const { enableCloseButton: n = !0 } = t;
|
29
24
|
let e = {
|
30
|
-
|
31
|
-
enableCloseButton: r,
|
32
|
-
enablePlayerTurnIndicators: s,
|
33
|
-
enableSync: t
|
25
|
+
enableCloseButton: n
|
34
26
|
};
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
e
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
return e;
|
53
|
-
}, [o]), d = A(() => {
|
54
|
-
var s, t;
|
55
|
-
const r = m();
|
56
|
-
(t = (s = l.current) == null ? void 0 : s.contentWindow) == null || t.postMessage(
|
27
|
+
return t.projectType === s.GAME && (e = {
|
28
|
+
...e,
|
29
|
+
...t
|
30
|
+
}), t.projectType === s.PUZZLE && (e = {
|
31
|
+
...e,
|
32
|
+
...t
|
33
|
+
}), t.projectType === s.LESSON && (e = {
|
34
|
+
...e,
|
35
|
+
...t
|
36
|
+
}), t.projectType === s.TABLE && (e = {
|
37
|
+
...e,
|
38
|
+
...t
|
39
|
+
}), e;
|
40
|
+
}, [t]), E = T(() => {
|
41
|
+
var e, r;
|
42
|
+
const n = m();
|
43
|
+
(r = (e = l.current) == null ? void 0 : e.contentWindow) == null || r.postMessage(
|
57
44
|
JSON.stringify({
|
58
|
-
event:
|
59
|
-
payload:
|
45
|
+
event: o.GAME_DATA,
|
46
|
+
payload: n
|
60
47
|
}),
|
61
48
|
N
|
62
49
|
);
|
63
|
-
}, [m]),
|
64
|
-
var
|
65
|
-
const
|
66
|
-
(
|
50
|
+
}, [m]), g = T(() => {
|
51
|
+
var e, r;
|
52
|
+
const n = m();
|
53
|
+
(r = (e = l.current) == null ? void 0 : e.contentWindow) == null || r.postMessage(
|
67
54
|
JSON.stringify({
|
68
|
-
event:
|
55
|
+
event: o.SET_CONFIG,
|
69
56
|
payload: {
|
70
|
-
user:
|
71
|
-
projectConfig:
|
72
|
-
parentDomain:
|
57
|
+
user: D,
|
58
|
+
projectConfig: n,
|
59
|
+
parentDomain: w
|
73
60
|
}
|
74
61
|
}),
|
75
62
|
N
|
76
63
|
);
|
77
|
-
}, [
|
78
|
-
return
|
79
|
-
const
|
80
|
-
var
|
81
|
-
const
|
82
|
-
if (
|
83
|
-
const { pattern:
|
84
|
-
(
|
64
|
+
}, [D, m, w]);
|
65
|
+
return V(I, () => l.current, []), $(() => {
|
66
|
+
const n = (e) => {
|
67
|
+
var j, S;
|
68
|
+
const r = e.data, b = typeof r == "string" ? JSON.parse(r) : r, { event: i, payload: d = null } = b;
|
69
|
+
if (i === o.VIBRATE) {
|
70
|
+
const { pattern: u } = d;
|
71
|
+
(S = (j = window.navigator).vibrate) == null || S.call(j, u);
|
85
72
|
}
|
86
|
-
if (
|
87
|
-
const { eventName:
|
88
|
-
|
73
|
+
if (i === o.GAME_BACK && (f == null || f()), i === o.HIDE_LOADER && (a == null || a()), i === o.LOAD_DATA_FROM_APP && (E == null || E()), i === o.GET_CONFIG && g(), i === o.UPDATE_STATS && (p == null || p(d)), i === o.SHOW_SNACKBAR && (c == null || c(d)), i === o.TRACK_EVENT) {
|
74
|
+
const { eventName: u, properties: M } = d;
|
75
|
+
O(u, M);
|
89
76
|
}
|
90
77
|
};
|
91
|
-
return window.addEventListener("message",
|
92
|
-
window.removeEventListener("message",
|
78
|
+
return window.addEventListener("message", n), () => {
|
79
|
+
window.removeEventListener("message", n);
|
93
80
|
};
|
94
81
|
}, [
|
82
|
+
c,
|
95
83
|
f,
|
96
84
|
p,
|
97
|
-
c,
|
98
85
|
a,
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
]), /* @__PURE__ */
|
86
|
+
g,
|
87
|
+
E,
|
88
|
+
O
|
89
|
+
]), /* @__PURE__ */ P(
|
103
90
|
"iframe",
|
104
91
|
{
|
105
|
-
...
|
92
|
+
...R,
|
106
93
|
ref: l,
|
107
|
-
src: `${
|
94
|
+
src: `${L}/play-game/${t.projectId}/${t.variant}${A ? `/${A}` : ""}?version=2`,
|
108
95
|
allow: "autoplay"
|
109
96
|
}
|
110
97
|
);
|
111
98
|
});
|
112
99
|
export {
|
113
|
-
|
100
|
+
F as WebView
|
114
101
|
};
|
115
102
|
//# 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":["import type {\n IInfoMessage,\n ILessonWebGameProps,\n IMessageProps,\n IMultiplayerWebGameProps,\n IPlayerStats,\n IPuzzleWebGameProps,\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 {
|
1
|
+
{"version":3,"file":"web-view.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view.tsx"],"sourcesContent":["import 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 window.navigator.vibrate?.(pattern);\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 return (\n <iframe\n {...rest}\n ref={webViewRef}\n src={`${baseUrl}/play-game/${memoizedProjectDetails.projectId}/${\n memoizedProjectDetails.variant\n }${miniGameIdentifier ? `/${miniGameIdentifier}` : ''}?version=2`}\n allow=\"autoplay\"\n />\n );\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","jsx"],"mappings":";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EAAWqB,GAAWC,CAAU;AAAA,MAClC;AAAA,IAAA;AAGK,kBAAA,iBAAiB,WAAWN,CAAa,GAEzC,MAAM;AACJ,aAAA,oBAAoB,WAAWA,CAAa;AAAA,IAAA;AAAA,EACrD,GACC;AAAA,IACD1B;AAAA,IACAC;AAAA,IACAF;AAAA,IACAD;AAAA,IACAwB;AAAA,IACAL;AAAA,IACAP;AAAA,EAAA,CACD,GAGC,gBAAAuB;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG9B;AAAA,MACJ,KAAKC;AAAA,MACL,KAAK,GAAGT,CAAO,cAAca,EAAuB,SAAS,IAC3DA,EAAuB,OACzB,GAAGC,IAAqB,IAAIA,CAAkB,KAAK,EAAE;AAAA,MACrD,OAAM;AAAA,IAAA;AAAA,EAAA;AAGZ,CAAC;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var E = /* @__PURE__ */ ((R) => (R.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", R.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", R.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", R.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", R.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", R))(E || {});
|
1
|
+
var E = /* @__PURE__ */ ((R) => (R.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", R.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", R.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", R.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", R.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", R.CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY", R))(E || {});
|
2
2
|
export {
|
3
3
|
E as JOURNEY_ID_STUDENT
|
4
4
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,
|
1
|
+
{"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n CIRCLE_TABLES_INTRO_JOURNEY = 'CIRCLE_TABLES_INTRO_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,2BAC1BA,EAAA,8BAA8B,+BANpBA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,20 +1,21 @@
|
|
1
|
-
import o, { keyframes as
|
2
|
-
import { GAME_LAUNCHER_SIZE as t
|
3
|
-
|
1
|
+
import o, { keyframes as r, css as s } from "styled-components";
|
2
|
+
import { GAME_LAUNCHER_SIZE as t } from "../../circle-games/game-launcher/comps/card-container/constants.js";
|
3
|
+
import { GAME_LAUNCHER_ASSET_PADDING as a } from "../../circle-games/game-launcher/comps/segmented-game-card/constants.js";
|
4
|
+
const p = 50 * 84 / 100, c = r`
|
4
5
|
0%{
|
5
6
|
opacity: 0;
|
6
7
|
}
|
7
8
|
100%{
|
8
9
|
opacity: 1;
|
9
10
|
}
|
10
|
-
`, d =
|
11
|
+
`, d = r`
|
11
12
|
0%{
|
12
13
|
opacity: 1;
|
13
14
|
}
|
14
15
|
100%{
|
15
16
|
opacity: 0;
|
16
17
|
}
|
17
|
-
`,
|
18
|
+
`, m = o.div`
|
18
19
|
height: ${t}px;
|
19
20
|
width: ${t}px;
|
20
21
|
background: transparent;
|
@@ -28,40 +29,40 @@ const p = 50 * 84 / 100, c = s`
|
|
28
29
|
position: absolute;
|
29
30
|
flex: 1;
|
30
31
|
z-index: 1;
|
31
|
-
`,
|
32
|
+
`, y = o.div`
|
32
33
|
height: ${t + a}px;
|
33
34
|
width: ${t + a}px;
|
34
35
|
position: absolute;
|
35
36
|
z-index: 2;
|
36
37
|
transform: ${({ $translateX: e = 0, $translateY: i = 0, $rotate: n = 0 }) => `translateX(${e}px) translateY(${i}px) rotate(${n}deg)`};
|
37
|
-
`,
|
38
|
+
`, A = o.div`
|
38
39
|
height: 100%;
|
39
40
|
width: 100%;
|
40
|
-
`,
|
41
|
+
`, h = o.div`
|
41
42
|
z-index: 2;
|
42
43
|
opacity: 0;
|
43
44
|
position: absolute;
|
44
|
-
animation: ${({ $animationType: e, $duration: i, $delay: n }) =>
|
45
|
+
animation: ${({ $animationType: e, $duration: i, $delay: n }) => s`
|
45
46
|
${e === "fadein" ? c : d} ${i}ms ${n}ms ease forwards
|
46
47
|
`};
|
47
48
|
transform: translateY(${(t + p) * 84 / 200 + 25}px);
|
48
|
-
`,
|
49
|
+
`, u = o.div`
|
49
50
|
position: absolute;
|
50
51
|
z-index: 20;
|
51
52
|
display: flex;
|
52
53
|
flex-direction: row;
|
53
54
|
align-items: flex-end;
|
54
55
|
|
55
|
-
${({ $animationType: e, $duration: i }) => e && i &&
|
56
|
+
${({ $animationType: e, $duration: i }) => e && i && s`
|
56
57
|
animation: ${e === "fadein" ? c : d} ${i}ms linear forwards;
|
57
58
|
`}
|
58
59
|
`;
|
59
60
|
export {
|
60
|
-
|
61
|
+
m as Accuracy,
|
61
62
|
$ as AccuracyMeterLottie,
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
63
|
+
A as AccuracyNeedleLottie,
|
64
|
+
y as AnimatedAccuracyNeedleContainer,
|
65
|
+
u as PercentTextWrapper,
|
66
|
+
h as TextWrapper
|
66
67
|
};
|
67
68
|
//# sourceMappingURL=accuracy-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"accuracy-styled.js","sources":["../../../../src/features/post-game-stats/accuracy/accuracy-styled.tsx"],"sourcesContent":["import styled, { keyframes, css } from 'styled-components';\n\nimport {
|
1
|
+
{"version":3,"file":"accuracy-styled.js","sources":["../../../../src/features/post-game-stats/accuracy/accuracy-styled.tsx"],"sourcesContent":["import styled, { keyframes, css } from 'styled-components';\n\nimport { GAME_LAUNCHER_SIZE } from '../../circle-games/game-launcher/comps/card-container/constants';\nimport { GAME_LAUNCHER_ASSET_PADDING } from '../../circle-games/game-launcher/comps/segmented-game-card/constants';\n\nconst MASK_PADDING = (50 * 84) / 100;\n\nconst fadeIn = keyframes`\n 0%{\n opacity: 0;\n }\n 100%{\n opacity: 1;\n }\n`;\n\nconst fadeOut = keyframes`\n 0%{\n opacity: 1;\n }\n 100%{\n opacity: 0;\n }\n`;\n\nexport const Accuracy = styled.div`\n height: ${GAME_LAUNCHER_SIZE}px;\n width: ${GAME_LAUNCHER_SIZE}px;\n background: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n`;\n\nexport const AccuracyMeterLottie = styled.div`\n height: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n width: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n position: absolute;\n flex: 1;\n z-index: 1;\n`;\n\nexport const AnimatedAccuracyNeedleContainer = styled.div<{\n $translateX?: number;\n $translateY?: number;\n $rotate?: number;\n}>`\n height: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n width: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n position: absolute;\n z-index: 2;\n transform: ${({ $translateX = 0, $translateY = 0, $rotate = 0 }) =>\n `translateX(${$translateX}px) translateY(${$translateY}px) rotate(${$rotate}deg)`};\n`;\n\nexport const AccuracyNeedleLottie = styled.div`\n height: 100%;\n width: 100%;\n`;\n\nexport const TextWrapper = styled.div<{\n $duration: number;\n $delay: number;\n $animationType: 'fadein' | 'fadeout';\n}>`\n z-index: 2;\n opacity: 0;\n position: absolute;\n animation: ${({ $animationType, $duration, $delay }) => css`\n ${$animationType === 'fadein' ? fadeIn : fadeOut} ${$duration}ms ${$delay}ms ease forwards\n `};\n transform: translateY(${((GAME_LAUNCHER_SIZE + MASK_PADDING) * 84) / 200 + 25}px);\n`;\n\nexport const PercentTextWrapper = styled.div<{\n $animationType?: 'fadein' | 'fadeout';\n $duration?: number;\n}>`\n position: absolute;\n z-index: 20;\n display: flex;\n flex-direction: row;\n align-items: flex-end;\n\n ${({ $animationType, $duration }) =>\n $animationType &&\n $duration &&\n css`\n animation: ${$animationType === 'fadein' ? fadeIn : fadeOut} ${$duration}ms linear forwards;\n `}\n`;\n"],"names":["MASK_PADDING","fadeIn","keyframes","fadeOut","Accuracy","styled","GAME_LAUNCHER_SIZE","AccuracyMeterLottie","GAME_LAUNCHER_ASSET_PADDING","AnimatedAccuracyNeedleContainer","$translateX","$translateY","$rotate","AccuracyNeedleLottie","TextWrapper","$animationType","$duration","$delay","css","PercentTextWrapper"],"mappings":";;;AAKA,MAAMA,IAAgB,KAAK,KAAM,KAE3BC,IAASC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASTC,IAAUD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASHE,IAAWC,EAAO;AAAA,YACnBC,CAAkB;AAAA,WACnBA,CAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQhBC,IAAsBF,EAAO;AAAA,YAC9BC,IAAqBE,CAA2B;AAAA,WACjDF,IAAqBE,CAA2B;AAAA;AAAA;AAAA;AAAA,GAM9CC,IAAkCJ,EAAO;AAAA,YAK1CC,IAAqBE,CAA2B;AAAA,WACjDF,IAAqBE,CAA2B;AAAA;AAAA;AAAA,eAG5C,CAAC,EAAE,aAAAE,IAAc,GAAG,aAAAC,IAAc,GAAG,SAAAC,IAAU,EAAE,MAC5D,cAAcF,CAAW,kBAAkBC,CAAW,cAAcC,CAAO,MAAM;AAAA,GAGxEC,IAAuBR,EAAO;AAAA;AAAA;AAAA,GAK9BS,IAAcT,EAAO;AAAA;AAAA;AAAA;AAAA,eAQnB,CAAC,EAAE,gBAAAU,GAAgB,WAAAC,GAAW,QAAAC,QAAaC;AAAA,MACpDH,MAAmB,WAAWd,IAASE,CAAO,IAAIa,CAAS,MAAMC,CAAM;AAAA,GAC1E;AAAA,2BACyBX,IAAqBN,KAAgB,KAAM,MAAM,EAAE;AAAA,GAGlEmB,IAAqBd,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUrC,CAAC,EAAE,gBAAAU,GAAgB,WAAAC,EAAU,MAC7BD,KACAC,KACAE;AAAA,mBACeH,MAAmB,WAAWd,IAASE,CAAO,IAAIa,CAAS;AAAA,KACzE;AAAA;"}
|