@cuemath/leap 3.0.8 → 3.0.10-hg1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/analytics-events/platform-events-student.js +2 -2
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js +4 -3
- 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 +42 -26
- 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 +39 -39
- 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/table-mode/table-mode.js +12 -10
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js +29 -28
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js +36 -33
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +29 -25
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +121 -122
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/circle-games/leaderboard/comps/banner/banner.js +6 -8
- package/dist/features/circle-games/leaderboard/comps/banner/banner.js.map +1 -1
- package/dist/features/circle-games/leaderboard/leaderboard-styled.js +1 -1
- package/dist/features/circle-games/leaderboard/leaderboard-styled.js.map +1 -1
- package/dist/features/ui/error/error.js +1 -1
- package/dist/features/ui/error/error.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +53 -48
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
@@ -1,74 +1,79 @@
|
|
1
1
|
import { jsx as E } from "react/jsx-runtime";
|
2
2
|
import g from "lottie-web";
|
3
|
-
import { memo as
|
4
|
-
import
|
5
|
-
import { fetchLottie as
|
6
|
-
const
|
3
|
+
import { memo as b, forwardRef as A, useRef as m, useMemo as I, useImperativeHandle as $, useEffect as x } from "react";
|
4
|
+
import O from "../layout/flex-view.js";
|
5
|
+
import { fetchLottie as S } from "./helper.js";
|
6
|
+
const k = A((v, L) => {
|
7
7
|
const {
|
8
8
|
src: l,
|
9
9
|
width: h = "100%",
|
10
10
|
height: w = "100%",
|
11
|
-
settings:
|
12
|
-
eventListener:
|
13
|
-
onRender:
|
11
|
+
settings: i,
|
12
|
+
eventListener: n,
|
13
|
+
onRender: a,
|
14
14
|
animateOnIntersect: s
|
15
|
-
} = v,
|
15
|
+
} = v, c = m(null), r = m(null), u = m(null), y = I(
|
16
16
|
() => ({
|
17
|
-
...
|
18
|
-
renderer: window.ReactNativeWebView ? "svg" : (
|
17
|
+
...i,
|
18
|
+
renderer: window.ReactNativeWebView ? "svg" : (i == null ? void 0 : i.renderer) ?? "svg"
|
19
19
|
}),
|
20
|
-
[
|
20
|
+
[i]
|
21
21
|
);
|
22
|
-
return
|
22
|
+
return $(
|
23
23
|
L,
|
24
24
|
() => ({
|
25
|
-
playSegments: (t,
|
26
|
-
var
|
27
|
-
return (
|
25
|
+
playSegments: (t, o) => {
|
26
|
+
var e;
|
27
|
+
return (e = r.current) == null ? void 0 : e.playSegments(t, o);
|
28
28
|
},
|
29
|
-
addEventListener: (t,
|
30
|
-
var
|
31
|
-
return (
|
29
|
+
addEventListener: (t, o) => {
|
30
|
+
var e;
|
31
|
+
return (e = r.current) == null ? void 0 : e.addEventListener(t, o);
|
32
32
|
},
|
33
|
-
removeEventListener: (t,
|
34
|
-
var
|
35
|
-
return (
|
33
|
+
removeEventListener: (t, o) => {
|
34
|
+
var e;
|
35
|
+
return (e = r.current) == null ? void 0 : e.removeEventListener(t, o);
|
36
36
|
},
|
37
37
|
play: () => {
|
38
38
|
var t;
|
39
|
-
return (t =
|
39
|
+
return (t = r.current) == null ? void 0 : t.play();
|
40
40
|
},
|
41
41
|
stop: () => {
|
42
42
|
var t;
|
43
|
-
return (t =
|
43
|
+
return (t = r.current) == null ? void 0 : t.stop();
|
44
44
|
}
|
45
45
|
}),
|
46
46
|
[]
|
47
|
-
),
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
}),
|
47
|
+
), x(() => {
|
48
|
+
let t = !1;
|
49
|
+
return (async () => {
|
50
|
+
try {
|
51
|
+
const e = await S(l);
|
52
|
+
requestAnimationFrame(() => {
|
53
|
+
!c.current || t || (r.current = g.loadAnimation({
|
54
|
+
container: c.current,
|
55
|
+
animationData: e,
|
56
|
+
loop: !0,
|
57
|
+
autoplay: !0,
|
58
|
+
...y
|
59
|
+
}), s && (u.current = new IntersectionObserver(
|
60
|
+
([d]) => {
|
61
|
+
var f, p;
|
62
|
+
d && d.isIntersecting ? (f = r.current) == null || f.play() : (p = r.current) == null || p.pause();
|
63
|
+
},
|
64
|
+
{ threshold: 0 }
|
65
|
+
), u.current.observe(c.current)), a == null || a(), n && r.current.addEventListener(n.name, n.callback));
|
66
|
+
});
|
67
|
+
} catch (e) {
|
68
|
+
throw Error(`Error loading Lottie animation: ${e}`);
|
69
|
+
}
|
70
|
+
})(), () => {
|
71
|
+
var e;
|
72
|
+
t = !0, r.current && (n && r.current.removeEventListener(n.name, n.callback), s && ((e = u.current) == null || e.disconnect()), r.current.destroy());
|
73
|
+
};
|
74
|
+
}, [l, n, a, s, i]), /* @__PURE__ */ E(O, { ref: c, $width: h, $height: w });
|
75
|
+
}), D = b(k);
|
71
76
|
export {
|
72
|
-
|
77
|
+
D as default
|
73
78
|
};
|
74
79
|
//# sourceMappingURL=lottie-animation.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lottie-animation.js","sources":["../../../../src/features/ui/lottie-animation/lottie-animation.tsx"],"sourcesContent":["import type { ILottieAnimationProps, ILottieAnimationRef } from './types';\nimport type { AnimationEventName, AnimationItem, AnimationSegment, RendererType } from 'lottie-web';\n\nimport lottie from 'lottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport { fetchLottie } from './helper';\n\nconst LottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {\n src,\n width = '100%',\n height = '100%',\n settings,\n eventListener,\n onRender,\n animateOnIntersect,\n } = props;\n\n const container = useRef<HTMLDivElement>(null);\n const animationInstance = useRef<AnimationItem | null>(null);\n const intersectionObserver = useRef<IntersectionObserver | null>(null);\n const newSettings = useMemo(\n () => ({\n ...settings,\n renderer: (window.ReactNativeWebView ? 'svg' : settings?.renderer ?? 'svg') as RendererType,\n }),\n [settings],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n playSegments: (segments: AnimationSegment, forceFlag?: boolean) =>\n animationInstance.current?.playSegments(segments, forceFlag),\n addEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.addEventListener(eventName as AnimationEventName, callback),\n removeEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.removeEventListener(eventName as AnimationEventName, callback),\n play: () => animationInstance.current?.play(),\n stop: () => animationInstance.current?.stop(),\n }),\n [],\n );\n\n useEffect(() => {\n const loadAnimation = async () => {\n try {\n const animationData = await fetchLottie(src);\n\n if (container.current)
|
1
|
+
{"version":3,"file":"lottie-animation.js","sources":["../../../../src/features/ui/lottie-animation/lottie-animation.tsx"],"sourcesContent":["import type { ILottieAnimationProps, ILottieAnimationRef } from './types';\nimport type { AnimationEventName, AnimationItem, AnimationSegment, RendererType } from 'lottie-web';\n\nimport lottie from 'lottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport { fetchLottie } from './helper';\n\nconst LottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {\n src,\n width = '100%',\n height = '100%',\n settings,\n eventListener,\n onRender,\n animateOnIntersect,\n } = props;\n\n const container = useRef<HTMLDivElement>(null);\n const animationInstance = useRef<AnimationItem | null>(null);\n const intersectionObserver = useRef<IntersectionObserver | null>(null);\n\n const newSettings = useMemo(\n () => ({\n ...settings,\n renderer: (window.ReactNativeWebView ? 'svg' : settings?.renderer ?? 'svg') as RendererType,\n }),\n [settings],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n playSegments: (segments: AnimationSegment, forceFlag?: boolean) =>\n animationInstance.current?.playSegments(segments, forceFlag),\n addEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.addEventListener(eventName as AnimationEventName, callback),\n removeEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.removeEventListener(eventName as AnimationEventName, callback),\n play: () => animationInstance.current?.play(),\n stop: () => animationInstance.current?.stop(),\n }),\n [],\n );\n\n useEffect(() => {\n let destroyed = false;\n\n const loadAnimation = async () => {\n try {\n const animationData = await fetchLottie(src);\n\n // Wait for layout\n // NOTE: Do not remove this as this is needed to fix canvas rendering on first layout.\n requestAnimationFrame(() => {\n if (!container.current || destroyed) return;\n\n animationInstance.current = lottie.loadAnimation({\n container: container.current,\n animationData,\n loop: true,\n autoplay: true,\n ...newSettings,\n });\n\n if (animateOnIntersect) {\n intersectionObserver.current = new IntersectionObserver(\n ([entry]) => {\n if (entry && entry.isIntersecting) {\n animationInstance.current?.play();\n } else {\n animationInstance.current?.pause();\n }\n },\n { threshold: 0 },\n );\n\n intersectionObserver.current.observe(container.current);\n }\n\n onRender?.();\n if (eventListener) {\n animationInstance.current.addEventListener(eventListener.name, eventListener.callback);\n }\n });\n } catch (error) {\n throw Error(`Error loading Lottie animation: ${error}`);\n }\n };\n\n loadAnimation();\n\n return () => {\n destroyed = true;\n if (animationInstance.current) {\n if (eventListener) {\n animationInstance.current.removeEventListener(eventListener.name, eventListener.callback);\n }\n\n if (animateOnIntersect) {\n intersectionObserver.current?.disconnect();\n }\n animationInstance.current.destroy();\n }\n };\n }, [src, eventListener, onRender, animateOnIntersect, settings]);\n\n return <FlexView ref={container} $width={width} $height={height} />;\n});\n\nexport default memo(LottieAnimation);\n"],"names":["LottieAnimation","forwardRef","props","ref","src","width","height","settings","eventListener","onRender","animateOnIntersect","container","useRef","animationInstance","intersectionObserver","newSettings","useMemo","useImperativeHandle","segments","forceFlag","_a","eventName","callback","useEffect","destroyed","animationData","fetchLottie","lottie","entry","_b","error","FlexView","LottieAnimation$1","memo"],"mappings":";;;;;AASA,MAAMA,IAAkBC,EAAuD,CAACC,GAAOC,MAAQ;AACvF,QAAA;AAAA,IACJ,KAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC;AAAA,EACE,IAAAR,GAEES,IAAYC,EAAuB,IAAI,GACvCC,IAAoBD,EAA6B,IAAI,GACrDE,IAAuBF,EAAoC,IAAI,GAE/DG,IAAcC;AAAA,IAClB,OAAO;AAAA,MACL,GAAGT;AAAA,MACH,UAAW,OAAO,qBAAqB,SAAQA,KAAA,gBAAAA,EAAU,aAAY;AAAA,IAAA;AAAA,IAEvE,CAACA,CAAQ;AAAA,EAAA;AAGX,SAAAU;AAAA,IACEd;AAAA,IACA,OAAO;AAAA,MACL,cAAc,CAACe,G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,eACMsB,GAAO;AACR,cAAA,MAAM,mCAAmCA,CAAK,EAAE;AAAA,MACxD;AAAA,IAAA,MAKK,MAAM;;AACC,MAAAN,IAAA,IACRX,EAAkB,YAChBL,KACFK,EAAkB,QAAQ,oBAAoBL,EAAc,MAAMA,EAAc,QAAQ,GAGtFE,OACFU,IAAAN,EAAqB,YAArB,QAAAM,EAA8B,eAEhCP,EAAkB,QAAQ;IAC5B;AAAA,EACF,GACC,CAACT,GAAKI,GAAeC,GAAUC,GAAoBH,CAAQ,CAAC,qBAEvDwB,GAAS,EAAA,KAAKpB,GAAW,QAAQN,GAAO,SAASC,EAAQ,CAAA;AACnE,CAAC,GAEc0B,IAAAC,EAAKjC,CAAe;"}
|
package/dist/index.d.ts
CHANGED
@@ -3979,6 +3979,7 @@ export declare enum PLATFORM_EVENTS_STUDENT {
|
|
3979
3979
|
PAGE_VIEWED = "page_viewed",
|
3980
3980
|
CUSTOM_TEST_SUBMITTED = "custom_test_submitted",
|
3981
3981
|
HOMEWORK_COMPLETED = "homework_completed",
|
3982
|
+
ERROR_VIA_AUTO_LOGIN_FROM_CUEMATH_APP = "error_via_auto_login_from_cuemath_app",
|
3982
3983
|
ACTIVITY_STARTED = "activity_started",
|
3983
3984
|
ACTIVITY_TUTORIAL_SEEN = "activity_tutorial_seen",
|
3984
3985
|
STREAK_ICON_CLICKED = "streak_icon_clicked",
|