@cuemath/leap 2.8.36-hg3 → 2.8.36-link.1
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 +2 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lottie/lottie.js +0 -6
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/assets/sounds/sounds.js +7 -0
- package/dist/assets/sounds/sounds.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js +6 -6
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js +73 -29
- 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 +85 -87
- 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/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +15 -25
- 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 +65 -108
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/games/web-view/enums/project-ids-enum.js +14 -0
- package/dist/features/circle-games/games/web-view/enums/project-ids-enum.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 +82 -69
- package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js +16 -17
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js.map +1 -1
- package/dist/features/post-game-stats/clock/clock-styled.js +10 -11
- package/dist/features/post-game-stats/clock/clock-styled.js.map +1 -1
- package/dist/features/post-game-stats/points/points.js +24 -25
- 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 +17 -18
- package/dist/features/post-game-stats/streak/streak-styled.js.map +1 -1
- package/dist/features/talk-meter/helper.js +11 -0
- package/dist/features/talk-meter/helper.js.map +1 -0
- package/dist/features/talk-meter/hooks/use-talk-meter.js +112 -0
- package/dist/features/talk-meter/hooks/use-talk-meter.js.map +1 -0
- package/dist/features/talk-meter/ripple/index.js +62 -0
- package/dist/features/talk-meter/ripple/index.js.map +1 -0
- package/dist/features/talk-meter/talk-meter-styled.js +89 -0
- package/dist/features/talk-meter/talk-meter-styled.js.map +1 -0
- package/dist/features/talk-meter/talk-meter-view/talk-meter-view-styled.js +22 -0
- package/dist/features/talk-meter/talk-meter-view/talk-meter-view-styled.js.map +1 -0
- package/dist/features/talk-meter/talk-meter-view/talk-meter-view.js +101 -0
- package/dist/features/talk-meter/talk-meter-view/talk-meter-view.js.map +1 -0
- package/dist/features/talk-meter/talk-meter.js +73 -0
- package/dist/features/talk-meter/talk-meter.js.map +1 -0
- 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 +141 -78
- package/dist/index.js +201 -194
- package/dist/index.js.map +1 -1
- package/dist/static/female-avatar.b8cd1012.svg +1 -0
- package/dist/static/male-avatar.2febc9eb.svg +1 -0
- package/package.json +2 -3
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js +0 -53
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js +0 -24
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js +0 -7
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js +0 -20
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js +0 -24
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js +0 -54
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star-styled.js +0 -11
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star.js +0 -16
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +0 -161
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +0 -225
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +0 -1
- package/dist/static/advance-mode-segment-lottie.51ff6707.json +0 -1
- package/dist/static/infinite-button-bg.5909225e.json +0 -1
- package/dist/static/infinite-button-symbol.aa31350c.json +0 -1
- package/dist/static/random-mode-segment-lottie.79cf1c07.json +0 -1
- package/dist/static/sequence-mode-segment-lottie.11ac49e9.json +0 -1
- package/dist/static/table-mode-reveal.b44a82c3.json +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"segmented-game-card.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\nimport type {\n IGameCardSegmentContentProps,\n ISegmentedGameCardProps,\n ISegmentedGameCardRefs,\n} from './segmented-game-card-types';\nimport type { AnimationItem } from 'lottie-web';\nimport type { FC, ForwardRefRenderFunction } from 'react';\n\nimport Lottie from 'lottie-web';\nimport {\n forwardRef,\n memo,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport CheckIcon from '../../../../../assets/line-icons/icons/check';\nimport { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport { fetchLottie } from '../../../../ui/lottie-animation/helper';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport { CardContainer } from '../card-container/card-container';\nimport * as Styled from './segmented-game-card-styled';\n\nexport const SegmentContent: FC<IGameCardSegmentContentProps> = ({\n segmentType,\n isCompleted,\n card,\n name,\n onMouseEnter,\n}) => {\n const lottieAnimationRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let animation: AnimationItem | null = null;\n\n const loadLottie = async () => {\n const lottie = await fetchLottie(card);\n\n animation = Lottie.loadAnimation({\n container: lottieAnimationRef.current as Element,\n renderer: 'canvas',\n loop: true,\n autoplay: true,\n animationData: lottie,\n });\n };\n\n loadLottie();\n\n return () => {\n return animation?.destroy();\n };\n }, [card]);\n\n const handleMouseEnter = useCallback(() => onMouseEnter(name), [onMouseEnter, name]);\n\n return (\n <Styled.SegmentContainer>\n <Styled.SegmentContentContainer $segmentType={segmentType} onMouseEnter={handleMouseEnter}>\n <Styled.SegmentAssetContainer ref={lottieAnimationRef} $segmentType={segmentType} />\n {isCompleted && (\n <Styled.SegmentOverlay $segmentType={segmentType}>\n <Styled.IconWrapper>\n <CheckIcon color=\"#fff\" height={40} width={40} />\n </Styled.IconWrapper>\n </Styled.SegmentOverlay>\n )}\n </Styled.SegmentContentContainer>\n </Styled.SegmentContainer>\n );\n};\n\nconst SegmentedGameCardComponent: ForwardRefRenderFunction<\n ISegmentedGameCardRefs,\n ISegmentedGameCardProps\n> = ({ data, label: gameCategoryLabel, initialValue = 0, value, maxValue = 1 }, ref) => {\n const labelRef = useRef<HTMLDivElement>(null);\n const cardWrapperRef = useRef<HTMLDivElement>(null);\n\n const [label, setLabel] = useState<string>(gameCategoryLabel);\n const [isAnimated, setIsAnimated] = useState(false);\n const [animatedColor, setAnimatedColor] = useState<TColorNames>('WHITE_T_87');\n\n const isLabelHighlighted = label !== gameCategoryLabel;\n\n const onMouseEnter = useCallback((gameName: string) => {\n setLabel(gameName);\n }, []);\n\n const onMouseLeave = useCallback(() => {\n setLabel(gameCategoryLabel);\n }, [gameCategoryLabel]);\n\n const onSegmentPress = useCallback(\n (index: number) => {\n data[index]?.onPress?.();\n },\n [data],\n );\n\n const startLabelAnimation = useCallback((color: TColorNames) => {\n setIsAnimated(true);\n setAnimatedColor(color);\n }, []);\n\n useImperativeHandle(ref, () => ({\n labelRef,\n segmentedCardWrapperRef: cardWrapperRef,\n startLabelAnimation,\n }));\n\n const animationSegments: [number, number] | undefined = useMemo(() => {\n if (maxValue <= 0) {\n return;\n }\n\n const totalFrames = 92;\n const framesPerValue = totalFrames / maxValue;\n\n const initialFrameToPlay = Math.min(framesPerValue * initialValue, totalFrames);\n const finalFrameToPlay = Math.min(framesPerValue * value + 1, totalFrames);\n\n return [initialFrameToPlay, finalFrameToPlay];\n }, [initialValue, maxValue, value]);\n\n const levelUpAnimationSettings = useMemo(\n () => ({\n renderer: 'canvas',\n autoplay: true,\n loop: false,\n initialSegment: animationSegments,\n }),\n [animationSegments],\n );\n\n return (\n <CardContainer\n ref={cardWrapperRef}\n labelRef={labelRef}\n label={label}\n isAnimated={isAnimated}\n onMouseLeave={onMouseLeave}\n labelColor={isAnimated ? animatedColor : isLabelHighlighted ? 'WHITE_T_87' : 'WHITE_T_60'}\n >\n <Styled.CircularProgressLottieContainer>\n <LottieAnimation src={LOTTIE.LEVELUP_RINGS} settings={levelUpAnimationSettings} />\n </Styled.CircularProgressLottieContainer>\n {/* left segment */}\n <Styled.SegmentLeft onClick={() => onSegmentPress(0)}>\n <SegmentContent\n segmentType={'left'}\n card={data[0]!.card}\n name={data[0]!.name}\n isCompleted={data[0]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentLeft>\n\n {/* right segment */}\n <Styled.SegmentRight onClick={() => onSegmentPress(1)}>\n <SegmentContent\n segmentType={'right'}\n card={data[1]!.card}\n name={data[1]!.name}\n isCompleted={data[1]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentRight>\n\n {/* bottom segment */}\n <Styled.SegmentBottom onClick={() => onSegmentPress(2)}>\n <SegmentContent\n segmentType={'bottom'}\n card={data[2]!.card}\n name={data[2]!.name}\n isCompleted={data[2]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentBottom>\n </CardContainer>\n );\n};\n\nexport const SegmentedGameCard = memo(forwardRef(SegmentedGameCardComponent));\n"],"names":["SegmentContent","segmentType","isCompleted","card","name","onMouseEnter","lottieAnimationRef","useRef","useEffect","animation","lottie","fetchLottie","Lottie","handleMouseEnter","useCallback","jsx","Styled.SegmentContainer","jsxs","Styled.SegmentContentContainer","Styled.SegmentAssetContainer","Styled.SegmentOverlay","Styled.IconWrapper","CheckIcon","SegmentedGameCardComponent","data","gameCategoryLabel","initialValue","value","maxValue","ref","labelRef","cardWrapperRef","label","setLabel","useState","isAnimated","setIsAnimated","animatedColor","setAnimatedColor","isLabelHighlighted","gameName","onMouseLeave","onSegmentPress","index","_b","_a","startLabelAnimation","color","useImperativeHandle","animationSegments","useMemo","totalFrames","framesPerValue","initialFrameToPlay","finalFrameToPlay","levelUpAnimationSettings","CardContainer","Styled.CircularProgressLottieContainer","LottieAnimation","LOTTIE","Styled.SegmentLeft","Styled.SegmentRight","Styled.SegmentBottom","SegmentedGameCard","memo","forwardRef"],"mappings":";;;;;;;;;AA4BO,MAAMA,IAAmD,CAAC;AAAA,EAC/D,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAAC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AAqB,eAAe;AAAA,MAE7E,UAAA;AAAA,QAAC,gBAAAxB,EAAA0C,GAAA,EACC,UAAC,gBAAA1C,EAAA2C,GAAA,EAAgB,KAAKC,EAAO,eAAe,UAAUJ,EAAA,CAA0B,EAClF,CAAA;AAAA,QAEA,gBAAAxC,EAAC6C,GAAA,EAAmB,SAAS,MAAMlB,EAAe,CAAC,GACjD,UAAA,gBAAA3B;AAAA,UAACf;AAAA,UAAA;AAAA,YACC,aAAa;AAAA,YACb,MAAMwB,EAAK,CAAC,EAAG;AAAA,YACf,MAAMA,EAAK,CAAC,EAAG;AAAA,YACf,aAAaA,EAAK,CAAC,EAAG;AAAA,YACtB,cAAAnB;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,QAGA,gBAAAU,EAAC8C,GAAA,EAAoB,SAAS,MAAMnB,EAAe,CAAC,GAClD,UAAA,gBAAA3B;AAAA,UAACf;AAAA,UAAA;AAAA,YACC,aAAa;AAAA,YACb,MAAMwB,EAAK,CAAC,EAAG;AAAA,YACf,MAAMA,EAAK,CAAC,EAAG;AAAA,YACf,aAAaA,EAAK,CAAC,EAAG;AAAA,YACtB,cAAAnB;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,QAGA,gBAAAU,EAAC+C,GAAA,EAAqB,SAAS,MAAMpB,EAAe,CAAC,GACnD,UAAA,gBAAA3B;AAAA,UAACf;AAAA,UAAA;AAAA,YACC,aAAa;AAAA,YACb,MAAMwB,EAAK,CAAC,EAAG;AAAA,YACf,MAAMA,EAAK,CAAC,EAAG;AAAA,YACf,aAAaA,EAAK,CAAC,EAAG;AAAA,YACtB,cAAAnB;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEa0D,KAAoBC,EAAKC,EAAW1C,CAA0B,CAAC;"}
|
1
|
+
{"version":3,"file":"segmented-game-card.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\nimport type {\n IGameCardSegmentContentProps,\n ISegmentedGameCardProps,\n ISegmentedGameCardRefs,\n} from './segmented-game-card-types';\nimport type { AnimationItem } from 'lottie-web';\nimport type { FC, ForwardRefRenderFunction } from 'react';\n\nimport Lottie from 'lottie-web';\nimport {\n forwardRef,\n memo,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport CheckIcon from '../../../../../assets/line-icons/icons/check';\nimport { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport { fetchLottie } from '../../../../ui/lottie-animation/helper';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport * as Styled from './segmented-game-card-styled';\n\nexport const SegmentContent: FC<IGameCardSegmentContentProps> = ({\n segmentType,\n isCompleted,\n card,\n name,\n onMouseEnter,\n}) => {\n const lottieAnimationRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let animation: AnimationItem | null = null;\n\n const loadLottie = async () => {\n const lottie = await fetchLottie(card);\n\n animation = Lottie.loadAnimation({\n container: lottieAnimationRef.current as Element,\n renderer: 'canvas',\n loop: true,\n autoplay: true,\n animationData: lottie,\n });\n };\n\n loadLottie();\n\n return () => {\n return animation?.destroy();\n };\n }, [card]);\n\n const handleMouseEnter = useCallback(() => onMouseEnter(name), [onMouseEnter, name]);\n\n return (\n <Styled.SegmentContainer>\n <Styled.SegmentContentContainer $segmentType={segmentType} onMouseEnter={handleMouseEnter}>\n <Styled.SegmentAssetContainer ref={lottieAnimationRef} $segmentType={segmentType} />\n {isCompleted && (\n <Styled.SegmentOverlay $segmentType={segmentType}>\n <Styled.IconWrapper>\n <CheckIcon color=\"#fff\" height={40} width={40} />\n </Styled.IconWrapper>\n </Styled.SegmentOverlay>\n )}\n </Styled.SegmentContentContainer>\n </Styled.SegmentContainer>\n );\n};\n\nconst SegmentedGameCardComponent: ForwardRefRenderFunction<\n ISegmentedGameCardRefs,\n ISegmentedGameCardProps\n> = ({ data, label: gameCategoryLabel, initialValue = 0, value, maxValue = 1 }, ref) => {\n const labelRef = useRef<HTMLDivElement>(null);\n const segmentedCardWrapperRef = useRef<HTMLDivElement>(null);\n\n const [label, setLabel] = useState<string>(gameCategoryLabel);\n const [isAnimated, setIsAnimated] = useState(false);\n const [animatedColor, setAnimatedColor] = useState<TColorNames>('WHITE_T_87');\n\n const isLabelHighlighted = label !== gameCategoryLabel;\n\n const onMouseEnter = useCallback((gameName: string) => {\n setLabel(gameName);\n }, []);\n\n const onMouseLeave = useCallback(() => {\n setLabel(gameCategoryLabel);\n }, [gameCategoryLabel]);\n\n const onSegmentPress = (index: number) => {\n data[index]?.onPress?.();\n };\n\n const startLabelAnimation = useCallback((color: TColorNames) => {\n setIsAnimated(true);\n setAnimatedColor(color);\n }, []);\n\n useImperativeHandle(ref, () => ({\n labelRef,\n segmentedCardWrapperRef,\n startLabelAnimation,\n }));\n\n const animationSegments: [number, number] | undefined = useMemo(() => {\n if (maxValue <= 0) {\n return;\n }\n\n const totalFrames = 92;\n const framesPerValue = totalFrames / maxValue;\n\n const initialFrameToPlay = Math.min(framesPerValue * initialValue, totalFrames);\n const finalFrameToPlay = Math.min(framesPerValue * value + 1, totalFrames);\n\n return [initialFrameToPlay, finalFrameToPlay];\n }, [initialValue, maxValue, value]);\n\n const levelUpAnimationSettings = useMemo(\n () => ({\n renderer: 'canvas',\n autoplay: true,\n loop: false,\n initialSegment: animationSegments,\n }),\n [animationSegments],\n );\n\n return (\n <Styled.SegmentedCard>\n <Styled.ExtendedFlexView $position=\"absolute\">\n <Styled.AnimatedLabel\n ref={labelRef}\n $renderAs=\"ac3\"\n $align=\"center\"\n $color={isAnimated ? animatedColor : isLabelHighlighted ? 'WHITE_T_87' : 'WHITE_T_60'}\n isAnimated={isAnimated}\n >\n {label}\n </Styled.AnimatedLabel>\n </Styled.ExtendedFlexView>\n <Styled.SegmentedCardWrapper ref={segmentedCardWrapperRef} onMouseLeave={onMouseLeave}>\n <Styled.CircularProgressLottieContainer>\n <LottieAnimation src={LOTTIE.LEVELUP_RINGS} settings={levelUpAnimationSettings} />\n </Styled.CircularProgressLottieContainer>\n {/* left segment */}\n <Styled.SegmentLeft onClick={() => onSegmentPress(0)}>\n <SegmentContent\n segmentType={'left'}\n card={data[0]!.card}\n name={data[0]!.name}\n isCompleted={data[0]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentLeft>\n\n {/* right segment */}\n <Styled.SegmentRight onClick={() => onSegmentPress(1)}>\n <SegmentContent\n segmentType={'right'}\n card={data[1]!.card}\n name={data[1]!.name}\n isCompleted={data[1]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentRight>\n\n {/* bottom segment */}\n <Styled.SegmentBottom onClick={() => onSegmentPress(2)}>\n <SegmentContent\n segmentType={'bottom'}\n card={data[2]!.card}\n name={data[2]!.name}\n isCompleted={data[2]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentBottom>\n </Styled.SegmentedCardWrapper>\n </Styled.SegmentedCard>\n );\n};\n\nexport const SegmentedGameCard = memo(forwardRef(SegmentedGameCardComponent));\n"],"names":["SegmentContent","segmentType","isCompleted","card","name","onMouseEnter","lottieAnimationRef","useRef","useEffect","animation","lottie","fetchLottie","Lottie","handleMouseEnter","useCallback","jsx","Styled.SegmentContainer","jsxs","Styled.SegmentContentContainer","Styled.SegmentAssetContainer","Styled.SegmentOverlay","Styled.IconWrapper","CheckIcon","SegmentedGameCardComponent","data","gameCategoryLabel","initialValue","value","maxValue","ref","labelRef","segmentedCardWrapperRef","label","setLabel","useState","isAnimated","setIsAnimated","animatedColor","setAnimatedColor","isLabelHighlighted","gameName","onMouseLeave","onSegmentPress","index","_b","_a","startLabelAnimation","color","useImperativeHandle","animationSegments","useMemo","totalFrames","framesPerValue","initialFrameToPlay","finalFrameToPlay","levelUpAnimationSettings","Styled.SegmentedCard","Styled.ExtendedFlexView","Styled.AnimatedLabel","Styled.SegmentedCardWrapper","Styled.CircularProgressLottieContainer","LottieAnimation","LOTTIE","Styled.SegmentLeft","Styled.SegmentRight","Styled.SegmentBottom","SegmentedGameCard","memo","forwardRef"],"mappings":";;;;;;;;AA2BO,MAAMA,IAAmD,CAAC;AAAA,EAC/D,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AACF,MAAM;AACE,QAAAC,IAAqBC,EAAuB,IAAI;AAEtD,EAAAC,EAAU,MAAM;AACd,QAAIC,IAAkC;AAc3B,YAZQ,YAAY;AACvB,YAAAC,IAAS,MAAMC,EAAYR,CAAI;AAErC,MAAAM,IAAYG,EAAO,cAAc;AAAA,QAC/B,WAAWN,EAAmB;AAAA,QAC9B,UAAU;AAAA,QACV,MAAM;AAAA,QACN,UAAU;AAAA,QACV,eAAeI;AAAA,MAAA,CAChB;AAAA,IAAA,MAKI,MACED,KAAA,gBAAAA,EAAW;AAAA,EACpB,GACC,CAACN,CAAI,CAAC;AAEH,QAAAU,IAAmBC,EAAY,MAAMT,EAAaD,CAAI,GAAG,CAACC,GAAcD,CAAI,CAAC;AAGjF,SAAA,gBAAAW,EAACC,GAAA,EACC,UAAA,gBAAAC,EAACC,GAAA,EAA+B,cAAcjB,GAAa,cAAcY,GACvE,UAAA;AAAA,IAAA,gBAAAE,EAACI,GAAA,EAA6B,KAAKb,GAAoB,cAAcL,GAAa;AAAA,IACjFC,uBACEkB,GAAA,EAAsB,cAAcnB,GACnC,4BAACoB,GAAA,EACC,UAAC,gBAAAN,EAAAO,GAAA,EAAU,OAAM,QAAO,QAAQ,IAAI,OAAO,GAAA,CAAI,EACjD,CAAA,GACF;AAAA,EAAA,EAEJ,CAAA,EACF,CAAA;AAEJ,GAEMC,KAGF,CAAC,EAAE,MAAAC,GAAM,OAAOC,GAAmB,cAAAC,IAAe,GAAG,OAAAC,GAAO,UAAAC,IAAW,EAAE,GAAGC,MAAQ;AAChF,QAAAC,IAAWvB,EAAuB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AC,EAAG;AAAA,UACf,MAAMA,EAAK,CAAC,EAAG;AAAA,UACf,aAAaA,EAAK,CAAC,EAAG;AAAA,UACtB,cAAAnB;AAAA,QAAA;AAAA,MAAA,GAEJ;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEa6D,KAAoBC,EAAKC,EAAW7C,EAA0B,CAAC;"}
|
@@ -1,17 +1,17 @@
|
|
1
|
-
import { useState as
|
2
|
-
import { useGetCircleHomeAPI as
|
3
|
-
import { ProjectType as
|
1
|
+
import { useState as E, useCallback as d, useEffect as p } from "react";
|
2
|
+
import { useGetCircleHomeAPI as C } from "../../api/get-content-for-today/get-circle-home-api.js";
|
3
|
+
import { ProjectType as i } from "../../../games/web-view/enums/project-type-enum.js";
|
4
4
|
const O = (r, o, n) => {
|
5
|
-
const [
|
6
|
-
|
5
|
+
const [c, _] = E(null), { data: a, get: m, isProcessed: e, ...l } = C(), R = d(() => {
|
6
|
+
m("", {
|
7
7
|
user_id: r,
|
8
8
|
country_code: o,
|
9
9
|
grade: n
|
10
10
|
});
|
11
|
-
}, [
|
12
|
-
return
|
13
|
-
let
|
14
|
-
|
11
|
+
}, [m, r, o, n]);
|
12
|
+
return p(() => {
|
13
|
+
let s = null;
|
14
|
+
e && a && (s = {
|
15
15
|
points: a.points,
|
16
16
|
streakDays: a.streak_days,
|
17
17
|
streakStatus: a.streak_status,
|
@@ -19,7 +19,7 @@ const O = (r, o, n) => {
|
|
19
19
|
projects: {
|
20
20
|
games: {
|
21
21
|
label: a.projects.games.label,
|
22
|
-
type:
|
22
|
+
type: i.GAME,
|
23
23
|
initialProgressValue: 0,
|
24
24
|
data: a.projects.games.data.map((t) => ({
|
25
25
|
id: t.id,
|
@@ -32,7 +32,7 @@ const O = (r, o, n) => {
|
|
32
32
|
},
|
33
33
|
puzzles: {
|
34
34
|
label: a.projects.puzzles.label,
|
35
|
-
type:
|
35
|
+
type: i.PUZZLE,
|
36
36
|
initialProgressValue: 0,
|
37
37
|
data: a.projects.puzzles.data.map((t) => ({
|
38
38
|
id: t.id,
|
@@ -58,9 +58,9 @@ const O = (r, o, n) => {
|
|
58
58
|
CIRCLE_STREAK_UPDATE_JOURNEY: a.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,
|
59
59
|
CIRCLE_TUTORIAL_JOURNEY: a.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY
|
60
60
|
}
|
61
|
-
}, a.projects.lessons && (
|
61
|
+
}, a.projects.lessons && (s.projects.lessons = {
|
62
62
|
label: a.projects.lessons.label,
|
63
|
-
type:
|
63
|
+
type: i.LESSON,
|
64
64
|
initialProgressValue: 0,
|
65
65
|
data: a.projects.lessons.data.map((t) => ({
|
66
66
|
id: t.id,
|
@@ -73,18 +73,8 @@ const O = (r, o, n) => {
|
|
73
73
|
targetQuestions: t.target_questions,
|
74
74
|
status: t.status
|
75
75
|
}))
|
76
|
-
}),
|
77
|
-
|
78
|
-
type: s.LESSON,
|
79
|
-
data: {
|
80
|
-
infiniteModeHighScore: a.projects.tables.data.infinite_mode_high_score,
|
81
|
-
tableList: a.projects.tables.data.table_wise_details.map((t) => ({
|
82
|
-
tableNumber: t.table_number,
|
83
|
-
stars: t.stars
|
84
|
-
}))
|
85
|
-
}
|
86
|
-
})), l(e);
|
87
|
-
}, [a, i]), { data: m, isProcessed: i, getCircleHomeDetails: d, ..._ };
|
76
|
+
})), _(s);
|
77
|
+
}, [a, e]), { data: c, isProcessed: e, getCircleHomeDetails: R, ...l };
|
88
78
|
};
|
89
79
|
export {
|
90
80
|
O as useGetCircleHomeDetailsDal
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type { ICircleHomeDetails, TStreakStatus } from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useGetCircleHomeAPI } from '../../api/get-content-for-today/get-circle-home-api';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n countryCode: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: () => void;\n} => {\n const [contentForToday, setContentForToday] = useState<ICircleHomeDetails | null>(null);\n const { data, get: getHomeDetails, isProcessed, ...rest } = useGetCircleHomeAPI();\n\n const getCircleHomeDetails = useCallback(() => {\n getHomeDetails('', {\n user_id: userId,\n country_code: countryCode,\n grade: grade,\n });\n }, [getHomeDetails, userId, countryCode, grade]);\n\n useEffect(() => {\n let circleHomeDetails: ICircleHomeDetails | null = null;\n\n if (isProcessed && data) {\n circleHomeDetails = {\n points: data.points,\n streakDays: data.streak_days,\n streakStatus: data.streak_status as TStreakStatus,\n tournamentRank: data.tournament_rank,\n projects: {\n games: {\n label: data.projects.games.label,\n type: ProjectType.GAME,\n initialProgressValue: 0,\n data: data.projects.games.data.map(game => ({\n id: game.id,\n name: game.name,\n cardLottie: game.card,\n tutorial: game.tutorial,\n variant: game.variant,\n isPlayed: game.played,\n })),\n },\n puzzles: {\n label: data.projects.puzzles.label,\n type: ProjectType.PUZZLE,\n initialProgressValue: 0,\n data: data.projects.puzzles.data.map(puzzle => ({\n id: puzzle.id,\n name: puzzle.name,\n cardLottie: puzzle.card,\n tutorial: puzzle.tutorial,\n variant: puzzle.variant,\n question: puzzle.question,\n isHintSeen: puzzle.is_hint_seen,\n solved: puzzle.solved,\n })),\n },\n },\n timestamps: {\n startTimestamp: data.timestamps.start_timestamp,\n endTimestamp: data.timestamps.end_timestamp,\n current: data.timestamps.current,\n },\n coachmarkProgress: {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,\n CIRCLE_LEADERBOARD_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,\n CIRCLE_POINTS_REWARD_JOURNEY: data.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,\n CIRCLE_STREAK_UPDATE_JOURNEY: data.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,\n CIRCLE_TUTORIAL_JOURNEY: data.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY,\n },\n };\n\n if (data.projects.lessons) {\n circleHomeDetails.projects.lessons = {\n label: data.projects.lessons.label,\n type: ProjectType.LESSON,\n initialProgressValue: 0,\n data: data.projects.lessons.data.map(lesson => ({\n id: lesson.id,\n name: lesson.name,\n cardLottie: lesson.card,\n tutorial: lesson.tutorial,\n variant: lesson.variant,\n sessionId: lesson.session_id,\n miniGameIdentifier: lesson.mini_game_identifier,\n targetQuestions: lesson.target_questions,\n status: lesson.status,\n })),\n };\n }\n }\n setContentForToday(circleHomeDetails);\n }, [data, isProcessed]);\n\n return { data: contentForToday, isProcessed, getCircleHomeDetails, ...rest };\n};\n"],"names":["useGetCircleHomeDetailsDal","userId","countryCode","grade","contentForToday","setContentForToday","useState","data","getHomeDetails","isProcessed","rest","useGetCircleHomeAPI","getCircleHomeDetails","useCallback","useEffect","circleHomeDetails","ProjectType","game","puzzle","lesson"],"mappings":";;;AAOO,MAAMA,IAA6B,CACxCC,GACAC,GACAC,MAIG;AACH,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAoC,IAAI,GAChF,EAAE,MAAAC,GAAM,KAAKC,GAAgB,aAAAC,GAAa,GAAGC,EAAA,IAASC,KAEtDC,IAAuBC,EAAY,MAAM;AAC7C,IAAAL,EAAe,IAAI;AAAA,MACjB,SAASP;AAAA,MACT,cAAcC;AAAA,MACd,OAAAC;AAAA,IAAA,CACD;AAAA,KACA,CAACK,GAAgBP,G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AA8BA,EAAK,qBAAqB;AAAA,QACxD,yBAAyBA,EAAK,qBAAqB;AAAA,MACrD;AAAA,IAAA,GAGEA,EAAK,SAAS,YAChBQ,EAAkB,SAAS,UAAU;AAAA,MACnC,OAAOR,EAAK,SAAS,QAAQ;AAAA,MAC7B,MAAMS,EAAY;AAAA,MAClB,sBAAsB;AAAA,MACtB,MAAMT,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWY,OAAA;AAAA,QAC9C,IAAIA,EAAO;AAAA,QACX,MAAMA,EAAO;AAAA,QACb,YAAYA,EAAO;AAAA,QACnB,UAAUA,EAAO;AAAA,QACjB,SAASA,EAAO;AAAA,QAChB,WAAWA,EAAO;AAAA,QAClB,oBAAoBA,EAAO;AAAA,QAC3B,iBAAiBA,EAAO;AAAA,QACxB,QAAQA,EAAO;AAAA,MAAA,EACf;AAAA,IAAA,KAIRd,EAAmBU,CAAiB;AAAA,EAAA,GACnC,CAACR,GAAME,CAAW,CAAC,GAEf,EAAE,MAAML,GAAiB,aAAAK,GAAa,sBAAAG,GAAsB,GAAGF;AACxE;"}
|
@@ -1,59 +1,36 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import { LOTTIE as
|
4
|
-
import { CircularLoader as
|
5
|
-
import
|
6
|
-
import { useCircleSounds as
|
7
|
-
import {
|
8
|
-
import { GAME_LAUNCHER_SIZE as
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import { TablesCard as Z } from "./comps/tables-card/tables-card.js";
|
13
|
-
import { GAME_LAUNCHER_ANALYTICS_EVENTS as x } from "./game-launcher-analytics-events.js";
|
14
|
-
import { useGameLauncherJourney as w } from "./use-game-launcher-journey/use-game-launcher-journey.js";
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
2
|
+
import { memo as h, useState as C, useMemo as a, useEffect as _ } from "react";
|
3
|
+
import { LOTTIE as b } from "../../../assets/lottie/lottie.js";
|
4
|
+
import { CircularLoader as v } from "../../ui/loader/circular-loader/circular-loader.js";
|
5
|
+
import S from "../../ui/lottie-animation/lottie-animation.js";
|
6
|
+
import { useCircleSounds as G } from "../hooks/use-circle-sounds/use-circle-sounds.js";
|
7
|
+
import { Carousel as P } from "./comps/carousel/carousel.js";
|
8
|
+
import { GAME_LAUNCHER_SIZE as R, GAME_LAUNCHER_ASSET_PADDING as M } from "./comps/segmented-game-card/constants.js";
|
9
|
+
import { SegmentedGameCard as n } from "./comps/segmented-game-card/segmented-game-card.js";
|
10
|
+
import { GAME_LAUNCHER_ANALYTICS_EVENTS as y } from "./game-launcher-analytics-events.js";
|
11
|
+
import { useGameLauncherJourney as B } from "./use-game-launcher-journey/use-game-launcher-journey.js";
|
15
12
|
import { ProjectType as m } from "../games/web-view/enums/project-type-enum.js";
|
16
|
-
const
|
17
|
-
({ onSegmentClick:
|
18
|
-
const [
|
19
|
-
gameRefs:
|
20
|
-
lessonRefs:
|
21
|
-
puzzleRefs:
|
22
|
-
startJourney:
|
23
|
-
carouselNextBtnRef:
|
24
|
-
isJourneyInProgress:
|
25
|
-
} =
|
26
|
-
setCarouselIndex:
|
27
|
-
onSegmentClick:
|
28
|
-
onJourneyComplete:
|
29
|
-
}),
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
(l) => {
|
36
|
-
l.status !== "completed" && (o(t.GAME_CARD_CLICK), r(l, m.LESSON));
|
37
|
-
},
|
38
|
-
[r, o]
|
39
|
-
), y = n(
|
40
|
-
(l) => {
|
41
|
-
o(t.GAME_CARD_CLICK), r(l, m.GAME);
|
42
|
-
},
|
43
|
-
[r, o]
|
44
|
-
), I = n(
|
45
|
-
(l) => {
|
46
|
-
o(t.GAME_CARD_CLICK), r(l, m.PUZZLE);
|
47
|
-
},
|
48
|
-
[r, o]
|
49
|
-
), M = h(() => {
|
50
|
-
let l = [];
|
51
|
-
return e && (e.lessons && (l = [
|
52
|
-
...l,
|
53
|
-
/* @__PURE__ */ i(
|
54
|
-
f,
|
13
|
+
const A = R + M, K = h(
|
14
|
+
({ onSegmentClick: l, onJourneyComplete: x, journeyId: i, data: e, isLoading: I, defaultIndex: V = 0 }) => {
|
15
|
+
const [g, z] = C(V), { playSwipSound: t } = G(), {
|
16
|
+
gameRefs: u,
|
17
|
+
lessonRefs: p,
|
18
|
+
puzzleRefs: f,
|
19
|
+
startJourney: c,
|
20
|
+
carouselNextBtnRef: E,
|
21
|
+
isJourneyInProgress: L
|
22
|
+
} = B({
|
23
|
+
setCarouselIndex: z,
|
24
|
+
onSegmentClick: l,
|
25
|
+
onJourneyComplete: x
|
26
|
+
}), N = a(() => {
|
27
|
+
let o = [];
|
28
|
+
return e && (e.lessons && (o = [
|
29
|
+
...o,
|
30
|
+
/* @__PURE__ */ r(
|
31
|
+
n,
|
55
32
|
{
|
56
|
-
ref:
|
33
|
+
ref: p,
|
57
34
|
label: e.lessons.label,
|
58
35
|
value: e.lessons.data.filter((s) => s.status === "completed").length,
|
59
36
|
maxValue: e.lessons.data.length,
|
@@ -62,16 +39,16 @@ const G = J + O, ne = D(
|
|
62
39
|
card: s.cardLottie,
|
63
40
|
name: s.name,
|
64
41
|
isCompleted: s.status === "completed",
|
65
|
-
onPress: () =>
|
42
|
+
onPress: () => s.status === "completed" ? void 0 : l(s, m.LESSON)
|
66
43
|
}))
|
67
44
|
}
|
68
45
|
)
|
69
|
-
]),
|
70
|
-
...
|
71
|
-
/* @__PURE__ */
|
72
|
-
|
46
|
+
]), o = [
|
47
|
+
...o,
|
48
|
+
/* @__PURE__ */ r(
|
49
|
+
n,
|
73
50
|
{
|
74
|
-
ref:
|
51
|
+
ref: u,
|
75
52
|
label: e.games.label,
|
76
53
|
value: e.games.data.filter((s) => s.isPlayed).length,
|
77
54
|
maxValue: e.games.data.length,
|
@@ -80,14 +57,14 @@ const G = J + O, ne = D(
|
|
80
57
|
card: s.cardLottie,
|
81
58
|
name: s.name,
|
82
59
|
isCompleted: !1,
|
83
|
-
onPress: () =>
|
60
|
+
onPress: () => l(s, m.GAME)
|
84
61
|
}))
|
85
62
|
}
|
86
63
|
),
|
87
|
-
/* @__PURE__ */
|
88
|
-
|
64
|
+
/* @__PURE__ */ r(
|
65
|
+
n,
|
89
66
|
{
|
90
|
-
ref:
|
67
|
+
ref: f,
|
91
68
|
label: e.puzzles.label,
|
92
69
|
value: e.puzzles.data.filter((s) => s.solved).length,
|
93
70
|
maxValue: e.puzzles.data.length,
|
@@ -96,66 +73,46 @@ const G = J + O, ne = D(
|
|
96
73
|
card: s.cardLottie,
|
97
74
|
name: s.name,
|
98
75
|
isCompleted: s.solved,
|
99
|
-
onPress: () =>
|
76
|
+
onPress: () => l(s, m.PUZZLE)
|
100
77
|
}))
|
101
78
|
}
|
102
79
|
)
|
103
|
-
],
|
104
|
-
|
105
|
-
/* @__PURE__ */ i(
|
106
|
-
Z,
|
107
|
-
{
|
108
|
-
label: e.tables.label,
|
109
|
-
data: e.tables.data,
|
110
|
-
onPress: _
|
111
|
-
}
|
112
|
-
)
|
113
|
-
])), l;
|
114
|
-
}, [
|
115
|
-
e,
|
116
|
-
a,
|
117
|
-
C,
|
118
|
-
L,
|
119
|
-
P,
|
120
|
-
_,
|
121
|
-
I,
|
122
|
-
y,
|
123
|
-
p
|
124
|
-
]), v = h(
|
80
|
+
]), o;
|
81
|
+
}, [e, u, p, l, f]), T = a(
|
125
82
|
() => [
|
126
|
-
/* @__PURE__ */
|
127
|
-
|
83
|
+
/* @__PURE__ */ r(
|
84
|
+
S,
|
128
85
|
{
|
129
|
-
src:
|
130
|
-
width:
|
131
|
-
height:
|
86
|
+
src: b.SLEEPY_BOI,
|
87
|
+
width: A,
|
88
|
+
height: A
|
132
89
|
}
|
133
90
|
)
|
134
91
|
],
|
135
92
|
[]
|
136
93
|
);
|
137
|
-
return
|
138
|
-
e != null && e.puzzles &&
|
139
|
-
}, [e == null ? void 0 : e.lessons, e == null ? void 0 : e.puzzles,
|
140
|
-
|
94
|
+
return _(() => {
|
95
|
+
e != null && e.puzzles && i && L && c(e == null ? void 0 : e.puzzles, !!(e != null && e.lessons), i);
|
96
|
+
}, [e == null ? void 0 : e.lessons, e == null ? void 0 : e.puzzles, L, i, c]), I ? /* @__PURE__ */ r(v, {}) : e ? /* @__PURE__ */ r(
|
97
|
+
P,
|
141
98
|
{
|
142
|
-
ref:
|
143
|
-
items:
|
144
|
-
defaultIndex:
|
145
|
-
onNext:
|
146
|
-
onPrev:
|
99
|
+
ref: E,
|
100
|
+
items: N,
|
101
|
+
defaultIndex: g,
|
102
|
+
onNext: t,
|
103
|
+
onPrev: t,
|
147
104
|
analyticsNext: {
|
148
|
-
analyticsLabel:
|
105
|
+
analyticsLabel: y.NEXT_ACTIVITY
|
149
106
|
},
|
150
107
|
analyticsPrev: {
|
151
|
-
analyticsLabel:
|
108
|
+
analyticsLabel: y.PREV_ACTIVITY
|
152
109
|
}
|
153
110
|
}
|
154
|
-
) : /* @__PURE__ */
|
155
|
-
|
111
|
+
) : /* @__PURE__ */ r(
|
112
|
+
P,
|
156
113
|
{
|
157
|
-
ref:
|
158
|
-
items:
|
114
|
+
ref: E,
|
115
|
+
items: T,
|
159
116
|
analyticsNext: {
|
160
117
|
analyticsLabel: ""
|
161
118
|
},
|
@@ -167,6 +124,6 @@ const G = J + O, ne = D(
|
|
167
124
|
}
|
168
125
|
);
|
169
126
|
export {
|
170
|
-
|
127
|
+
K as GameLauncher
|
171
128
|
};
|
172
129
|
//# 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 { 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, useState } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\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 './use-game-launcher-journey/use-game-launcher-journey';\n\nconst sleepyBoiDimension = GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING;\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({ onSegmentClick, onJourneyComplete, journeyId, data, isLoading, defaultIndex = 0 }) => {\n const [currentIndex, setCurrentIndex] = useState(defaultIndex);\n const [enableTables] = useState(false);\n\n const { playSwipSound, play } = useCircleSounds();\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney,\n carouselNextBtnRef,\n isJourneyInProgress,\n } = useGameLauncherJourney({\n setCarouselIndex: setCurrentIndex,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const onTableSegmentClick = useCallback(\n (table: ITableDetails) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(table, ProjectType.TABLE);\n },\n [onSegmentClick, play],\n );\n\n const handleLessonSegmentClick = useCallback(\n (lesson: Lesson) => {\n if (lesson.status !== 'completed') {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(lesson, ProjectType.LESSON);\n }\n },\n [onSegmentClick, play],\n );\n\n const handleGameSegmentClick = useCallback(\n (game: Game) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(game, ProjectType.GAME);\n },\n [onSegmentClick, play],\n );\n\n const handlePuzzleSegmentClick = useCallback(\n (puzzle: Puzzle) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(puzzle, ProjectType.PUZZLE);\n },\n [onSegmentClick, play],\n );\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () => handleLessonSegmentClick(lesson),\n }))}\n />,\n ];\n }\n\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => handleGameSegmentClick(game),\n }))}\n />,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => handlePuzzleSegmentClick(puzzle),\n }))}\n />,\n ];\n\n if (data.tables && enableTables) {\n itemTypes = [\n ...itemTypes,\n <TablesCard\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n />,\n ];\n }\n }\n\n return itemTypes;\n }, [\n data,\n gameRefs,\n lessonRefs,\n puzzleRefs,\n handleLessonSegmentClick,\n onTableSegmentClick,\n handlePuzzleSegmentClick,\n handleGameSegmentClick,\n enableTables,\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 when the data for puzzles is available\n useEffect(() => {\n if (data?.puzzles && journeyId && isJourneyInProgress) {\n startJourney(data?.puzzles, !!data?.lessons, journeyId);\n }\n }, [data?.lessons, data?.puzzles, isJourneyInProgress, journeyId, startJourney]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={items}\n defaultIndex={currentIndex}\n onNext={playSwipSound}\n onPrev={playSwipSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoiDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GameLauncher","memo","onSegmentClick","onJourneyComplete","journeyId","data","isLoading","defaultIndex","currentIndex","setCurrentIndex","useState","enableTables","playSwipSound","play","useCircleSounds","gameRefs","lessonRefs","puzzleRefs","startJourney","carouselNextBtnRef","isJourneyInProgress","useGameLauncherJourney","onTableSegmentClick","useCallback","table","CircleSoundKey","ProjectType","handleLessonSegmentClick","lesson","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","items","useMemo","itemTypes","jsx","SegmentedGameCard","TablesCard","sleepyBoiItem","LottieAnimation","LOTTIE","useEffect","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;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AAAA,MAAA;AAAA,QACC,KAAKzB;AAAA,QACL,OAAAc;AAAA,QACA,cAAczB;AAAA,QACd,QAAQI;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgBiC,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA,IAzBA,gBAAAT;AAAA,MAACQ;AAAA,MAAA;AAAA,QACC,KAAKzB;AAAA,QACL,OAAOoB;AAAA,QACP,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA;AAAA,EAoBR;AACF;"}
|
1
|
+
{"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { IGameLauncherProps } from './game-launcher-types';\nimport type { FC, ReactNode } from 'react';\n\nimport { memo, useEffect, useMemo, useState } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\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 { Carousel } from './comps/carousel/carousel';\nimport {\n GAME_LAUNCHER_ASSET_PADDING,\n GAME_LAUNCHER_SIZE,\n} from './comps/segmented-game-card/constants';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport { useGameLauncherJourney } from './use-game-launcher-journey/use-game-launcher-journey';\n\nconst sleepyBoiDimension = GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING;\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({ onSegmentClick, onJourneyComplete, journeyId, data, isLoading, defaultIndex = 0 }) => {\n const [currentIndex, setCurrentIndex] = useState(defaultIndex);\n\n const { playSwipSound } = useCircleSounds();\n\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney,\n carouselNextBtnRef,\n isJourneyInProgress,\n } = useGameLauncherJourney({\n setCarouselIndex: setCurrentIndex,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () =>\n lesson.status === 'completed'\n ? undefined\n : onSegmentClick(lesson, ProjectType.LESSON),\n }))}\n />,\n ];\n }\n\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => onSegmentClick(game, ProjectType.GAME),\n }))}\n />,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => onSegmentClick(puzzle, ProjectType.PUZZLE),\n }))}\n />,\n ];\n }\n\n return itemTypes;\n }, [data, gameRefs, lessonRefs, onSegmentClick, puzzleRefs]);\n\n const sleepyBoiItem = useMemo(\n () => [\n <LottieAnimation\n src={LOTTIE.SLEEPY_BOI}\n width={sleepyBoiDimension}\n height={sleepyBoiDimension}\n />,\n ],\n [],\n );\n\n // Start game launcher journey when the data for puzzles is available\n useEffect(() => {\n if (data?.puzzles && journeyId && isJourneyInProgress) {\n startJourney(data?.puzzles, !!data?.lessons, journeyId);\n }\n }, [data?.lessons, data?.puzzles, isJourneyInProgress, journeyId, startJourney]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={items}\n defaultIndex={currentIndex}\n onNext={playSwipSound}\n onPrev={playSwipSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoiDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GameLauncher","memo","onSegmentClick","onJourneyComplete","journeyId","data","isLoading","defaultIndex","currentIndex","setCurrentIndex","useState","playSwipSound","useCircleSounds","gameRefs","lessonRefs","puzzleRefs","startJourney","carouselNextBtnRef","isJourneyInProgress","useGameLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","lesson","ProjectType","game","puzzle","sleepyBoiItem","LottieAnimation","LOTTIE","useEffect","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;;AAmBA,MAAMA,IAAqBC,IAAqBC,GAEnCC,IAAuCC;AAAA,EAClD,CAAC,EAAE,gBAAAC,GAAgB,mBAAAC,GAAmB,WAAAC,GAAW,MAAAC,GAAM,WAAAC,GAAW,cAAAC,IAAe,QAAQ;AACvF,UAAM,CAACC,GAAcC,CAAe,IAAIC,EAAS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BH,gBAAAkB;AAAA,MAACW;AAAA,MAAA;AAAA,QACC,KAAKjB;AAAA,QACL,OAAAG;AAAA,QACA,cAAcZ;AAAA,QACd,QAAQG;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgBwB,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA,IAzBA,gBAAAZ;AAAA,MAACW;AAAA,MAAA;AAAA,QACC,KAAKjB;AAAA,QACL,OAAOY;AAAA,QACP,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA;AAAA,EAoBR;AACF;"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
var t = /* @__PURE__ */ ((r) => (r.CHESS_MOVES = "chess-moves", r.NO_ATTACK = "no-attack", r.TROMINOS = "trominos", r.NIMS_GAME = "nims-game", r.TRANSFORMATION = "transformation", r.LIGHTS_ON_OR_OFF = "lights-on-or-off", r.LIQUID_WARS = "liquid-wars", r.HACKENBUSH = "hackenbush", r.SQUARE_IT = "square-it", r.CLASH_OF_COLOURS = "clash-of-colours", r.REACH = "reach", r))(t || {}), A = /* @__PURE__ */ ((r) => (r.CUT_THE_STRIP = "cut-the-strip", r.ONE_LINE_WONDER = "one-line-wonder", r.FLIP_IT_UP = "flip-it-up", r.CARS_IN_CHAOS = "cars-in-chaos", r.REFLEKT = "reflekt", r.MATCHSTICKS = "matchsticks", r.NO_CROSS = "no-cross", r.DISSECTION = "dissection", r))(A || {}), E = /* @__PURE__ */ ((r) => (r.SNAKE = "snake", r.BASKETBALL = "basketball", r.REARRANGE = "rearrange", r.CAR_RACE = "car-race", r.DROP_ME = "drop-me", r.WARZONE = "warzone", r.SLOT_MACHINE = "slot-machine", r.SLING_SHOT = "sling-shot", r.CLOCK = "clock", r.MINING = "mining", r.SHADING_AREA = "shading-area", r.MAGIC_HAT = "magic-hat", r.PUZZLE = "puzzle", r.BALANCE = "balance", r))(E || {}), S = /* @__PURE__ */ ((r) => (r.ANGLES = "angles", r.FRACTIONS = "fractions", r.TIME = "time", r.ADDITION_SUBTRACTION = "addition-subtraction", r.MULTIPLICATION_DIVISION = "multiplication-division", r.PERCENTAGES = "percentages", r.INTEGERS = "integers", r.RATIOS = "ratios", r))(S || {});
|
2
|
+
const N = {
|
3
|
+
...t,
|
4
|
+
...A,
|
5
|
+
...S
|
6
|
+
};
|
7
|
+
export {
|
8
|
+
t as GameId,
|
9
|
+
S as LessonId,
|
10
|
+
E as MiniGameId,
|
11
|
+
N as ProjectId,
|
12
|
+
A as PuzzleId
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=project-ids-enum.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"project-ids-enum.js","sources":["../../../../../../src/features/circle-games/games/web-view/enums/project-ids-enum.ts"],"sourcesContent":["// 1v1 game ids\nexport enum GameId {\n CHESS_MOVES = 'chess-moves',\n NO_ATTACK = 'no-attack',\n TROMINOS = 'trominos',\n NIMS_GAME = 'nims-game',\n TRANSFORMATION = 'transformation',\n LIGHTS_ON_OR_OFF = 'lights-on-or-off',\n LIQUID_WARS = 'liquid-wars',\n HACKENBUSH = 'hackenbush',\n SQUARE_IT = 'square-it',\n CLASH_OF_COLOURS = 'clash-of-colours',\n REACH = 'reach',\n}\n\n// puzzle game ids\nexport enum PuzzleId {\n CUT_THE_STRIP = 'cut-the-strip',\n ONE_LINE_WONDER = 'one-line-wonder',\n FLIP_IT_UP = 'flip-it-up',\n CARS_IN_CHAOS = 'cars-in-chaos',\n REFLEKT = 'reflekt',\n MATCHSTICKS = 'matchsticks',\n NO_CROSS = 'no-cross',\n DISSECTION = 'dissection',\n}\n\n// Mini Game ids\nexport enum MiniGameId {\n SNAKE = 'snake',\n BASKETBALL = 'basketball',\n REARRANGE = 'rearrange',\n CAR_RACE = 'car-race',\n DROP_ME = 'drop-me',\n WARZONE = 'warzone',\n SLOT_MACHINE = 'slot-machine',\n SLING_SHOT = 'sling-shot',\n CLOCK = 'clock',\n MINING = 'mining',\n SHADING_AREA = 'shading-area',\n MAGIC_HAT = 'magic-hat',\n PUZZLE = 'puzzle',\n BALANCE = 'balance',\n}\n\n// lesson ids\nexport enum LessonId {\n ANGLES = 'angles',\n FRACTIONS = 'fractions',\n TIME = 'time',\n ADDITION_SUBTRACTION = 'addition-subtraction',\n MULTIPLICATION_DIVISION = 'multiplication-division',\n PERCENTAGES = 'percentages',\n INTEGERS = 'integers',\n RATIOS = 'ratios',\n}\n\n// each category of games is called as Project\nexport const ProjectId = {\n ...GameId,\n ...PuzzleId,\n ...LessonId,\n} as const;\n"],"names":["GameId","PuzzleId","MiniGameId","LessonId","ProjectId"],"mappings":"AACY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,iBAAiB,kBACjBA,EAAA,mBAAmB,oBACnBA,EAAA,cAAc,eACdA,EAAA,aAAa,cACbA,EAAA,YAAY,aACZA,EAAA,mBAAmB,oBACnBA,EAAA,QAAQ,SAXEA,IAAAA,KAAA,CAAA,CAAA,GAeAC,sBAAAA,OACVA,EAAA,gBAAgB,iBAChBA,EAAA,kBAAkB,mBAClBA,EAAA,aAAa,cACbA,EAAA,gBAAgB,iBAChBA,EAAA,UAAU,WACVA,EAAA,cAAc,eACdA,EAAA,WAAW,YACXA,EAAA,aAAa,cARHA,IAAAA,KAAA,CAAA,CAAA,GAYAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,aAAa,cACbA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,eAAe,gBACfA,EAAA,aAAa,cACbA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,eAAe,gBACfA,EAAA,YAAY,aACZA,EAAA,SAAS,UACTA,EAAA,UAAU,WAdAA,IAAAA,KAAA,CAAA,CAAA,GAkBAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,YAAY,aACZA,EAAA,OAAO,QACPA,EAAA,uBAAuB,wBACvBA,EAAA,0BAA0B,2BAC1BA,EAAA,cAAc,eACdA,EAAA,WAAW,YACXA,EAAA,SAAS,UARCA,IAAAA,KAAA,CAAA,CAAA;AAYL,MAAMC,IAAY;AAAA,EACvB,GAAGJ;AAAA,EACH,GAAGC;AAAA,EACH,GAAGE;AACL;"}
|
@@ -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
|
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,UAHCA,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 {\n GameId,\n PuzzleId,\n LessonId,\n MiniGameId,\n WebViewEvent,\n ProjectOutcome,\n ProjectType,\n} from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport type TProject = GameId | PuzzleId | LessonId;\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n}\n\ninterface IBaseWebGameProps<T> {\n projectId: T;\n variant: string;\n projectType: ProjectType;\n joinByRoomId?: string;\n enableSync?: boolean; // applicable for all except multiplayer games\n enablePlayerTurnIndicators?: boolean;\n enableCloseButton?: boolean;\n}\n\nexport interface IMultiplayerWebGameProps extends IBaseWebGameProps<GameId> {}\n\nexport interface IPuzzleWebGameProps extends IBaseWebGameProps<PuzzleId> {\n question: string;\n askHintPermission?: boolean;\n}\n\nexport interface ILessonWebGameProps extends IBaseWebGameProps<LessonId> {\n miniGameIdentifier: MiniGameId;\n sessionId: string;\n targetQuestions: 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 parentDomain: string;\n projectDetails: IMultiplayerWebGameProps | IPuzzleWebGameProps | ILessonWebGameProps;\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":"AAmDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
|